Dark Mode

Payment Charge API


The following endpoint charges the payment for all payment methods

/payments/charge

Run in Postman

Basic Attributes

type

String
Mandatory

type of payment, possible values - "VA", "EWALLET", "CARD", "RETAILSTORE", "ONLINE_BANKING", "QRIS", "BNPL"

request

json object
Mandatory

The payload object depending on the payment type

Virtual Account (VA) or Bank Transfer

Request Payload Attributes

type

String
Mandatory

"VA"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

bank_codeMandatory

string

Bank codes for the relevant bank. Available banks: BCA, BNI, BRI, MANDIRI, PERMATA, CIMB, BTPN, SAHABAT_SAMPOERNA, SINARMAS, MAYBANK, SYARIAH, DANAMON, OTHERS

nameMandatory

string

Name that should appear in ATM

amountMandatory

string

Payment amount

payment_ref_idOptional

string

Reference ID for merchant

Example - VA
# for VA
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "type": "VA",
    "request": {
        "order_id": "ord_WkJWY1ysZ57194",
        "bank_code": "MANDIRI",
        "name": "Name Appear in ATM",
        "amount": "20000",
        "payment_ref_id":"pay_ref_123",
    }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
 {
    "data": {
        "type": "VA",
        "response": {
            "payment_id": "pay_bfmIT8sczc2277",
            "order_id": "ord_WkJWY1ysZ57194",
            "account_number": "7001400009085556",
            "payment_ref_id":"pay_ref_123",
            "expiration_time": "2022-06-24T05:30:20.24670162Z",
            "paid_amount": "104000.00",
            "payment_instruction": {
                "en": {
                    "atm": {
                        "heading": "ATM Mandiri",
                        "instruction_text": "<ol><li>Insert your ATM card and select ENGLISH</li><li>Enter PIN, then select ENTER</li><li>Enter Virtual Account Number, then press CORRECT</li><li>Enter the amount to transfer, then press CORRECT</li><li>Customer details will be displayed. Choose number 1 according to the amount billed and then press YES</li><li>Payment confirmation will be displayed. Select YES to proceed</li><li>Keep your receipt as a formal proof of payment from Mandiri Bank</li><li>Your transaction is successful</li></ol>"
                    },
                    "mobile_app": {
                        "heading": "Mandiri Online",
                        "appstore_url": "http://onelink.to/dvs8pn",
                        "playstore_url": "http://onelink.to/dvs8pn",
                        "instruction_text": "<ol><li>Login to Livin' by Mandiri application</li><li>Select "Payment"</li><li>Select "E-commerce"</li><li>Select Transferpay "70014"</li><li>Enter virtual account number</li><li>Select "Continue"</li><li>Check transaction amount and source of fund</li><li>Select "Continue"</li><li>Check details on payment confirmation page</li><li>Select "Continue Payment"</li><li>Input "PIN" and the transaction will be completed</li></ol>"
                    },
                    "internet_banking": {
                        "heading": "Internet Banking",
                        "instruction_text": "<ol><li>Go to Mandiri Internet Banking website: https://ibank.bankmandiri.co.id/retail3/</li><li>Login with your USER ID and PIN</li><li>Select Payment</li><li>Select Multi Payment</li><li>Select My Account Number</li><li>Select Virtual Account Number</li><li>Enter your virtual account number</li><li>Go to confirmation page 1</li><li>Click on TOTAL if all details are correct and then click on CONTINUE</li><li>Go to confirmation page 2</li><li>Enter Challenge Code from your Internet Banking Token, then click on Send</li><li>You will be directed to the confirmation page once your payment has</li></ol>"
                    }
                },
                "id": {
                    "atm": {
                        "heading": "ATM Mandiri",
                        "instruction_text": "<ol><li>Masukkan kartu ATM dan pilih Bahasa Indonesia</li><li>Ketik nomor PIN dan tekan BENAR</li><li>Pilih menu “BAYAR/BELI”</li><li>Masukkan nomor Virtual Account</li><li>Isi NOMINAL, kemudian tekan BENAR</li><li>Muncul konfirmasi data customer. Pilih Nomor 1 sesuai tagihan yang akan dibayar, kemudian tekan YA</li><li>Muncul konfirmasi pembayaran. Tekan YA untuk melakukan pembayaran</li><li>Bukti pembayaran dalam bentuk struk agar disimpan sebagai bukti pembayaran yang sah dari Bank Mandiri</li><li>Transaksi Anda sudah selesai</li></ol>"
                    },
                    "mobile_app": {
                        "heading": "Mandiri Online",
                        "appstore_url": "http://onelink.to/dvs8pn",
                        "playstore_url": "http://onelink.to/dvs8pn",
                        "instruction_text": "<ol><li>Login ke aplikasi Livin` by Mandiri</li><li>Pilih menu "Bayar"</li><li>Pilih "E-commerce"</li><li>Pilih Penyedia Jasa Transferpay "70014"</li><li>Masukkan no virtual account pada kolom kode bayar</li><li>Tekan "Lanjutkan"</li><li>Cek nominal yang akan dibayarkan dan rekening sumber</li><li>Tekan "Lanjutkan"</li><li>Cek detail di tampilan konfirmasi pembayaran</li><li>Tekan "Lanjut Bayar"</li><li>Masukkan "PIN" dan transaksi anda selesai</li></ol>"
                    },
                    "internet_banking": {
                        "heading": "Internet Banking",
                        "instruction_text": "<ol><li>Kunjungi website Mandiri Internet Banking: https://ibank.bankmandiri.co.id/retail3/</li><li>Login dengan memasukkan USER ID dan PIN</li><li>Pilih Pembayaran</li><li>Pilih Multi Payment</li><li>Pilih No Rekening Anda</li><li>Pilih Penyedia Jasa Xendit 88908</li><li>Pilih No Virtual Account</li><li>Masukkan nomor Virtual Account anda</li><li>Masuk ke halaman konfirmasi 1</li><li>Apabila benar/sesuai, klik tombol tagihan TOTAL, kemudian klik Lanjutkan</li><li>Masuk ke halaman konfirmasi 2</li><li>Masukkan Challenge Code yang dikirimkan ke Token Internet Banking Anda, kemudian klik Kirim</li><li>Anda akan masuk ke halaman konfirmasi jika pembayaran telah selesai</li></ol>"
                    }
                }
            },
            "metadata": {}
        }
    }
  }
}

E-Wallet

Request Payload Attributes

type

String
Mandatory

"EWALLET"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

mobileMandatory

string

Mobile number linked to the wallet

amountMandatory

string

Payment amount

wallet_typeMandatory

string

Wallet type. Available wallet types : LINKAJA, OVO, GOPAY, DANA, SHOPEEPAY

account_idConditional

string

The unique identifier assigned to a specific customer's linked e-wallet account, which is obtained after the account binding process. This parameter is required in the request for tokenized and preauthorization payment.

expiry_durationOptional

integer

The length of time, in minutes, that a preauthorization payment will be valid before it expires. Example: 60

is_preauthOptional

bool

Flag indicating whether the payment is a preauthorization payment or a normal payment. Default Value: false

redirect_urlConditional

string

Redirect the user to the specified URL after pin challenge. Required for preauth payment

Example - E-Wallet
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
  "type": "EWALLET",
  "request": {
      "order_id": "ord_mJH2hKOSYb3514",
      "amount": "20000.00",
      "mobile": "08123456789",
      "wallet_type": "DANA"
  }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "type": "EWALLET",
  "response": {
    "payment_id": "pay_dAM0lqkVuk0074",
    "order_id": "ord_TVZ6EYuBJ85268",
    "mobile": "08123123123",
    "status": "processing",
    "expiration_time": "2021-04-02T15:08:57.800297779Z",
    "checkout_url": "https://link.to/ewallet-checkout-url",
    "paid_amount": "1000.00",
    "metadata": {}
  }
}

Retail Store

Request Payload Attributes

type

String
Mandatory

"RETAILSTORE"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

bank_codeMandatory

string

Available values: ALFAMART, INDOMARET

nameMandatory

string

Name that should appear in ATM

amountMandatory

string

Payment amount

payment_ref_idOptional

string

Reference ID for merchant

Example - Retail Store
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "type": "RETAILSTORE",
    "request": {
        "order_id": "ord_mJH2hKOSYb3514",
        "bank_code": "ALFAMART",
        "name": "Name Appear in ATM",
        "amount": "20000.00",
        "payment_ref_id":"pay_ref_123"
    }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
{
  "type": "RETAILSTORE",
  "response": {
    "payment_id": "pay_XUwAkgIoru9966",
    "order_id": "ord_Zwcd3aNiZR5608",
    "account_number": "889089999561424",
    "payment_ref_id": "pay_ref_123",
    "expiration_time": "2021-05-01T15:12:14.437734082Z",
    "paid_amount": "1000.00",
    "metadata": {}
  }
}

ONLINE BANKING

Request Payload Attributes

type

String
Mandatory

"ONLINE_BANKING"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

typeMandatory

string

Available values: JENIUSPAY

nameMandatory

string

Name

mobileMandatory

string

Mobile

amountMandatory

string

Payment amount

customer_infoOptional

string

Customer info

Note: web_url is the redirect url which merchant should open to move on to the Jenius pay payment confirmation page.

Example - Online Banking
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "type": "ONLINE_BANKING",
    "request": {
        "order_id": "ord_mJH2hKOSYb3514",
        "type": "JENIUSPAY",
        "name": "Name Appear in ATM",
        "amount": "20000.00",
    "customer_info": {
      "email": "jude_kasper@koss.in",
      "given_name": "Jude Kasper",
      "id": "cus_aGn5UD0m7F0994"
    },
    "mobile": "+6285722173217"
    }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "type": "ONLINE_BANKING",
  "response": {
    "expiration_time": "2021-08-25T04:54:02.512309995Z",
    "metadata": {},
    "mobile": "+6285722173217",
    "order_id": "ord_QKglAxhyXs7798",
    "paid_amount": "925002.00",
    "payment_id": "pay_LbsD6MZmbn0052",
    "status": "processing",
    "unique_id": "JENIUSPAY",
    "web_url": "https://test-url.com"
  }
}

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
{
  "type": "VA",
  "response": {
      "account_number": "1900800000003154",
      "expiration_time": "2021-08-25T04:47:03.258854515Z",
      "metadata": {},
      "order_id": "ord_PDZ1PzH5Iv3914",
      "paid_amount": "925002.00"
  }
}

QRIS

Request Payload Attributes

type

String
Mandatory

"QRIS"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

nameMandatory

string

Name

amountMandatory

string

Payment amount

Example Request for QRIS

Example - QRIS
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "type": "QRIS",
    "request": {
        "amount": "80001.00",
        "order_id": "ord_ZSHipeBgUd4740",
        "name": "Name Appear in ATM"
    }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "type": "QRIS",
  "response": {
    "payment_id": "pay_s2sSBlDSWv4167",
    "order_id": "ord_QETgbs2UGL3100",
    "status": "processing",
    "expiration_time": "2021-09-15T15:44:37Z",
    "creation_time": "2021-09-12T15:44:37ZZ",
    "qr_string": "data:image/png;base64, long_qr_string",
    "unique_id": "QRIS",
    "metadata":{
      "merchant_name": "Durianpay",
      "merchant_id" : "sample_national_merchant_id"
    },
    "amount": "80001.00",
    "qr_code": "00020101021226590013ID.CO.BNI.WWW011893600009150002286002092107061320303UME51470015ID.OR.GPNQR.WWW0217ID2107271315771960303UME520454995303360540880001.005802ID5905Ajesh6013JAKARTA PUSAT6105101406214011038291492856304E1F"
  }
 }

CARD

Request Payload Attributes

type

String
Mandatory

"CARD"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

amountOptional

string

Payment amount

customer_infoOptional

string

Customer info

payment_ref_idOptional

string

Reference ID for merchant

Example - Card
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "type": "CARD",
    "request": {
        "order_id": "ord_1EcWGI2xSs7216",
        "amount": "10000.00",
        "payment_ref_id": "pay_ref_123",
        "customer_info": {
            "id": "cus_aGn5UD0m7F0994",
            "email": "jude_kasper@koss.in",
            "given_name": "Jude Kasper"
        }
    }
}'

Response Attributes

payment_id

String

Unique id for payment object

order_id

String

The id returned from create order api

payment_ref_id

String

The reference id used by the merchant

paid_amount

String

Payment amount

status

String

Payment status

checkout_url

String

Redirect url which merchant should open to move on to the payment page

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "type": "CARD",
  "response": {
      "payment_id": "pay_1Ylb1r122v1860",
      "order_id": "ord_sipQEaBnkX0407",
      "payment_ref_id": "pay_ref_123",
      "token_id": "",
      "status": "processing",
      "paid_amount": "10000.00",
      "metadata": {},
      "checkout_url": "https://link.to/card-checkout-url"
  }
}

Buy Now Pay Later (BNPL)

Request Payload Attributes

type

String
Mandatory

"BNPL"

request

json object
Mandatory

The payload object depending on the payment type

Hide request object

FieldTypeDescription

order_idMandatory

string

The id returned from create order api

payment_method_unique_idMandatory

string

AKULAKU, INDODANA

amountMandatory

string

Payment amount

customer_infoOptional

string

Customer info

payment_ref_idOptional

string

Reference ID for merchant

Example - BNPL
curl -X POST \
  https://api.durianpay.id/v1/payments/charge \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "type": "BNPL",
    "request": {
        "order_id": "ord_1EcWGI2xSs7216",
        "amount": "10000.00",
        "payment_ref_id": "pay_ref_123",
        "payment_method_unique_id" : "AKULAKU"
        "customer_info": {
            "id": "cus_aGn5UD0m7F0994",
            "email": "jude_kasper@koss.in",
            "given_name": "Jude Kasper"
        }
    }
}'

Response Attributes

payment_id

String

Unique id for payment object

order_id

String

The id returned from create order api

payment_ref_id

String

The reference id used by the merchant

redirect_url

String

Redirect url which merchant should open to move on to the payment page

paid_amount

String

Payment amount

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
{
  "type": "BNPL",
  "response": {
    "payment_id": "pay_s2sSBlDSWv4167",
    "order_id": "ord_ZSHipeBgUd4740",
    "payment_ref_id": "pay_ref_123",
    "redirect_url": "https://redirect-url.com/"
    "paid_amount": "80001.00",
    "metadata":{},
  }
 }

Sandbox Mode

To simulate the charge API flow in sandbox mode, merchants can use dp_test_XXXXXXXXX key. By default we will simulate the success scenario. If you want to simulate the failure scenario, you should use the sandbox_options json field in the request. This contains force_fail and delay_ms fields.

force_fail

Boolean
Optional

Make this field as true in the request if you want to simulate failure scenario.

delay_ms

Integer
Optional

If you want to simulate a delay in making the payment as success or failed, give a value in milliseconds in this field in the request.

Note: Currently sandbox_options is supported for VA, E-Wallet, RetailStore and BNPL.

Example - Sandbox Mode
curl
-X POST https://api.durianpay.id/v1/payments/charge \
-H "content-type: application/json" \
-H "authorization: [Base64({Your_Server_Key}:)]" \
-d '{
    "type": "VA",
    "request": {
        "order_id": "ord_aiFBiqVWwk8596",
        "amount": "925002.00",
        "bank_code": "BCA",
        "name": "Bauch Leannon and Donnelly Jude Casper",
        "save_preferences": true,
        "address_id": 4028,
        "customer_info": {
            "id": "cus_lqbboIkqI80314",
            "given_name": "Jude Casper",
            "email": "jude.casper@testmail.com",
            "mobile": "+6285722173250"
        }
    },
    "sandbox_options": {
        "force_fail": true,
        "delay_ms": 10000
    }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
{
    "data": {
        "type": "VA",
        "response": {
            "payment_id": "pay_lZqgqy5mQz0234",
            "order_id": "ord_aiFBiqVWwk8596",
            "account_number": "1111111111",
            "expiration_time": "2022-01-11T09:01:18.083714Z",
            "paid_amount": ""
        }
    }
}