Airwallex logo
Airwallex logo

Desktop/Mobile Website Browser

Accept Indonesian bank transfer payments on your website by redirecting shopper to payment instruction page. See checkout process below:

  1. The shopper chooses to check out with Bank Transfer
  2. The shopper selects preferred bank on the checkout page and proceed payment
  3. The shopper is redirected to a page where a Payment Code is generated and displayed, along with the payment instructions
  4. The shopper completes the payment via a bank transfer on internet banking or at an ATM
  5. The shopper is redirected back to the merchant’s page where the payment result is displayed

Step 1. Initialize a Payment Intent

Create a PaymentIntent object with a request_id, amount, currency and a merchant_order_id from your backend server.

Shell
1curl -X POST \
2 https://api.airwallex.com/api/v1/pa/payment_intents/create \
3 -H 'Content-Type: application/json' \
4 -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhNDc...' \
5 -d '{
6 "request_id": "ed11e38a-7234-11ea-aa94-7fd44ffd1b89",
7 "amount": 10000,
8 "currency": "IDR",
9 "merchant_order_id": "85d7b0e0-7235-11ea-862e-9f6aa1adfca6"
10 "return_url": "https://www.airwallex.com"
11 }'

Step 2. Get available banks

Indonesian Bank Transfer requires bank_name when confirming the Payment Intent, you can call this API endpoint /api/v1/pa/config/banks with payment_method_type, country_code and lang to get available bank names based on the payment method selected.

Request:

1/api/v1/pa/config/banks?payment_method_type=bank_transfer&country_code=ID&lang=en

Response:

Shell
1{
2 "has_more": false,
3 "items": [
4 {
5 "bank_name": "mandiri",
6 "display_name": "Bank Mandiri",
7 "resources": {
8 "logo_url": "https://checkout.airwallex.com/static/media/mandiri.c9e8f88f.svg"
9 }
10 },
11 {
12 "bank_name": "bni",
13 "display_name": "Bank Negara Indonesia",
14 "resources": {
15 "logo_url": "https://checkout.airwallex.com/static/media/bni.232321.svg"
16 }
17 },
18 {
19 "bank_name": "bri",
20 "display_name": "Bank Rakyat Indonesia",
21 "resources": {
22 "logo_url": "https://checkout.airwallex.com/static/media/bri.564.svg"
23 }
24 },
25 {
26 "bank_name": "cimb_niaga",
27 "display_name": "CIMB Niaga",
28 "resources": {
29 "logo_url": "https://checkout.airwallex.com/static/media/cimb_niaga.f4ee926a.svg"
30 }
31 },
32 {
33 "bank_name": "permata",
34 "display_name": "Permata Bank",
35 "resources": {
36 "logo_url": "https://checkout.airwallex.com/static/media/permata.23dadd15.svg"
37 }
38 }
39 ]
40}

Note for available banks:

Alternatively, you can maintain a list of available banks locally on your server for payment methods that require bank_name if you do not want to use this API endpoint. However, we highly recommend you get the banks dynamically from this API to avoid any trouble when bank information or availability gets updated.

Supported banks:

bank_nameDisplay Name
mandiriBank Mandiri
danamonBank Danamon
cimb_niagaCIMB Niaga
permataPermata Bank
maybankMayBank
briBank Rakyat Indonesia
indomaretIndomaret
bniBank Negara Indonesia

Step 3. Redirect to Indonesian Bank Transfer payment page to complete payment

When a shopper selects to pay with Indonesian Bank Transfer on their desktop/mobile browser, call the following API endpoints to get the URL which you can use to redirect the shopper to payment code and instruction page to complete the payment.

  1. Obtain URL from Airwallex and redirect shopper to payment code and instruction page

Request:

Shell
1curl -X POST \
2 https://api.airwallex.com/api/v1/pa/payment_intents/{id}/confirm \
3 -H 'Content-Type: application/json' \
4 -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhNDc...' \
5 -d '{
6 "request_id": "ed11e38a-7234-11ea-aa94-7fd44ffd1b89",
7 "payment_method":
8 {
9 "type": "bank_transfer",
10 "bank_transfer": {
11 "shopper_name": "xxxxxx",
12 "shopper_email": "[email protected]"
13 "bank_name": "mandiri" // specify which bank to use
14 "country_code": "ID"
15 }
16 }
17 }'

Response: Render the value of url to redirect shoppers to payment code and instruction page.

Shell
1{
2 "next_action": {
3 "type": "redirect",
4 "method": "GET",
5 "url": "https://r2.girogate.de/doku/T1138/I?tx=948883081&rs=yY4QjVwxlu805HRX6Bp4nO1cDzx4Y7JG&cs=6a6cf3a6eb18b6e26844a940bdced3428f6e58b151130b34d2f9336ca32bfc77"
6 }
7}
  1. Wait for notification from Airwallex

Airwallex will notify you on the payment result asynchronously via the webhook API. Please refer to webhook documentation to set up your webhook accordingly. Although subscribing to different events is optional, it is recommended to at least subscribe to the payment_intent.succeeded which indicates that the shopper has successfully paid for the order via Indonesian Bank Transfer.

  1. Query the PaymentIntent status

You may also query the status of a payment anytime via the PaymentIntents API

Shell
1 GET /payment_intents/{id}
Was this page helpful?