Payment
Direct API - Direct Debit Allobank SNAP Payment
Direct API - Direct Debit CIMB SNAP Payment
Direct Debit Payment
To initiate Payment, you must hit these API with your backend
API Request
Type | Value | Description |
---|---|---|
HTTP Method | POST | |
API endpoint (Sandbox) | https://api-sandbox.doku.com/direct-debit/[acquirer-name]/v1.0/debit/payment-host-to-host | Possible Values for [acquirer-name] : ovo, cimb, allobank, bri |
API endpoint (Production) | https://api.doku.com/direct-debit/[acquirer-name]/v1.0/debit/payment-host-to-host | Possible Values for [acquirer-name] : ovo, cimb, allobank, bri |
Here is the sample of request header to perform Account Binding:
X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh
Request Header Explanation
Parameter | Description |
---|---|
X-PARTNER-ID | Unique ID for a partner (DOKU'S Client ID) |
X-EXTERNAL-ID | Numeric String. Reference number that should be unique in the same day (request-id) |
X-TIMESTAMP | Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format |
X-IP-ADDRESS | IP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer |
X-SIGNATURE | algoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +โ:โ+ EndpointUrl +":"+ AccessToken +":โ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ + TimeStamp |
Here is the sample of request body for Payment Process :
1. OVO
Request Body
{
"partnerReferenceNo": "INV_20221221_0002",
"bankCardToken": "00007100010926",
"amount": {
"value": "12345678.00",
"currency": "IDR"
},
"feeType": "SHA|1000",
"payOptionDetails": [
{
"payMethod": "CASH",
"transAmount": {
"value": "12345678.00",
"currency": "IDR"
},
"feeAmount": {
"value": "12345678.00",
"currency": "IDR"
},
}
],
"additionalInfo": {
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
},
{
"name": "aqua",
"price": "5000.00",
"quantity": 1
}
],
"successPaymentUrl": "https://dribbble.com/shots/14575431-Payment-method-success/attachments/6265573?mode=media",
"failedPaymentUrl": "https://dribbble.com/shots/4756331-Failed-Transaction"
}
}
BCA VA Notification Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
partnerReferenceNo | string (64) | Mandatory | Transaction identifier on service consumer system, will be used as invoice number. For CIMB, Max length : 12 |
bankCardToken | string (128) | Mandatory | Customer's Token obtained from get B2B2C token the same with to tokenId in unbinding API |
amount | object | Mandatory | |
amount.value | string (16) | Mandatory | Total amount ends in decimal .00 if currency is IDR |
amount.currency | string (3) | Mandatory | |
feeType | string (25) | Conditional | Possible Value : OUR : Fee charged to sender (default), BEN : Fee charged to recipient, SHA |
payOptionDetails | object | Mandatory | |
payOptionDetails.payMethod | string | Mandatory | Source of funds. Notes : - Allobank : Balance/Point/Paylater - OVO : Cash/points |
payOptionDetails.transAmount | object | Mandatory | Transaction amount that will be paid using this paymentmethod If its IDR then value includes 2 decimal digits. e.g. IDR 10.000,- will be placed with 10000.00 |
payOptionDetails.transAmount.value | String (16) | Mandatory | ends in decimal .00 if currency is IDR |
payOptionDetails.transAmount.currency | string (3) | Mandatory | IDR |
payOptionDetails.feeAmount | object | Optional | Fee amount that will be paid using this payment method If its IDR then value includes 2 decimal digits. e.g. IDR 10.000,- will be placed with 10000.00. Must be filled if the feeAmount data exist. Optional only to OVO |
payOptionDetails.feeAmount.value | string (16) | Optional | Total amount ends in decimal .00 if currency is IDR |
payOptionDetails.feeAmount.currency | string(3) | Optional | IDR |
additionalInfo | object | Mandatory | |
additionalInfo.lineItems | object | Conditional | line of items. Mandatory for Allobank |
additionalInfo.lineItems.name | string | Conditional | Name of the product item. Mandatory for Allobank |
additionalInfo.lineItems.price | string(16) | Conditional | Price of the product item. Total price and quantity must match with the amount.value, ends in decimal .00 if currency is IDR |
additionalInfo.lineItems.quantity | numeric( 16) | Conditional | Quantity of the product item |
additionalInfo.successPaymentUrl | string(255) | Mandatory | redirect URL in case of binding request was a success |
additionalInfo.failedPaymentUrl | string(255) | Mandatory | redirect URL in case of binding request was a failure |
Response Body
{
"responseCode": "20054000",
"responseMessage": "Request has been processed successfully",
"webRedirectUrl": "https://pjsp.com/universal?bizNo=REF9",
"referenceNo": "1234"
}
BCA VA Notification Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
responseCode | string (7) | Mandatory | Response code as defined in SNAP Regulation |
responseMessage | string (128) | Mandatory | Response message as defined in SNAP Regulation |
referenceNo | string (64) | Optional | account binding unique identifier on acquirer's side |
webRedirectUrl.value | string (2048) | Optional | URL to redirect user to Acquirer's webview to let customer finish OTP |
2. Allo Bank
Request Body
{
"partnerReferenceNo": "INV_20221221_0002",
"bankCardToken": "00007100010926",
"amount": {
"value": "12345678.00",
"currency": "IDR"
},
"feeType": "SHA|1000",
"payOptionDetails": [
{
"payMethod": "CASH",
"transAmount": {
"value": "12345678.00",
"currency": "IDR"
},
"feeAmount": {
"value": "12345678.00",
"currency": "IDR"
},
}
],
"additionalInfo": {
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
},
{
"name": "aqua",
"price": "5000.00",
"quantity": 1
}
],
"successPaymentUrl": "https://dribbble.com/shots/14575431-Payment-method-success/attachments/6265573?mode=media",
"failedPaymentUrl": "https://dribbble.com/shots/4756331-Failed-Transaction"
}
}
BCA VA Notification Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
partnerReferenceNo | string (64) | Mandatory | Transaction identifier on service consumer system, will be used as invoice number. For CIMB, Max length : 12 |
bankCardToken | string (128) | Mandatory | Customer's Token obtained from get B2B2C token the same with to tokenId in unbinding API |
amount | object | Mandatory | |
amount.value | string (16) | Mandatory | Total amount ends in decimal .00 if currency is IDR |
amount.currency | string (3) | Mandatory | |
feeType | string (25) | Conditional | Possible Value : OUR : Fee charged to sender (default), BEN : Fee charged to recipient, SHA |
payOptionDetails | object | Mandatory | |
payOptionDetails.payMethod | string | Mandatory | Source of funds. Notes : - Allobank : Balance/Point/Paylater - OVO : Cash/points |
payOptionDetails.transAmount | object | Mandatory | Transaction amount that will be paid using this paymentmethod If its IDR then value includes 2 decimal digits. e.g. IDR 10.000,- will be placed with 10000.00 |
payOptionDetails.transAmount.value | String (16) | Mandatory | ends in decimal .00 if currency is IDR |
payOptionDetails.transAmount.currency | string (3) | Mandatory | IDR |
payOptionDetails.feeAmount | object | Optional | Fee amount that will be paid using this payment method If its IDR then value includes 2 decimal digits. e.g. IDR 10.000,- will be placed with 10000.00. Must be filled if the feeAmount data exist. Optional only to OVO |
payOptionDetails.feeAmount.value | string (16) | Optional | Total amount ends in decimal .00 if currency is IDR |
payOptionDetails.feeAmount.currency | string(3) | Optional | IDR |
additionalInfo | object | Mandatory | |
additionalInfo.lineItems | object | Conditional | line of items. Mandatory for Allobank |
additionalInfo.lineItems.name | string | Conditional | Name of the product item. Mandatory for Allobank |
additionalInfo.lineItems.price | string(16) | Conditional | Price of the product item. Total price and quantity must match with the amount.value, ends in decimal .00 if currency is IDR |
additionalInfo.lineItems.quantity | numeric( 16) | Conditional | Quantity of the product item |
additionalInfo.successPaymentUrl | string(255) | Mandatory | redirect URL in case of binding request was a success |
additionalInfo.failedPaymentUrl | string(255) | Mandatory | redirect URL in case of binding request was a failure |
Response Body
{
"responseCode": "20054000",
"responseMessage": "Request has been processed successfully",
"webRedirectUrl": "https://pjsp.com/universal?bizNo=REF9",
"referenceNo": "1234"
}
BCA VA Notification Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
responseCode | string (7) | Mandatory | Response code as defined in SNAP Regulation |
responseMessage | string (128) | Mandatory | Response message as defined in SNAP Regulation |
referenceNo | string (64) | Optional | account binding unique identifier on acquirer's side |
webRedirectUrl.value | string (2048) | Optional | URL to redirect user to Acquirer's webview to let customer finish OTP |
3. CIMB
Request Body
{
"partnerReferenceNo": "L20230718003",
"bankCardToken": "f8bd1847580da224476b2981adfb54ec",
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
},
{
"name": "aqua",
"price": "5000.00",
"quantity": 1
}
],
"remarks": "hadiah",
"successPaymentUrl": "https://dribbble.com/shots/14575431-Payment-method-success/attachments/6265573?mode=media",
"failedPaymentUrl": "https://dribbble.com/shots/4756331-Failed-Transaction"
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
partnerReferenceNo | string (12) | Mandatory | Transaction identifier on service consumer system, will be used as invoice number. For CIMB, Max length : 12 |
bankCardToken | string (128) | Mandatory | Customer's Token obtained from get B2B2C token the same with to tokenId in unbinding API |
amount | object | Mandatory | |
amount.value | string (16) | Mandatory | Total amount ends in decimal .00 if currency is IDR |
amount.currency | string (3) | Mandatory | |
additionalInfo | object | Mandatory | |
additionalInfo.lineItems | object | Optional | line of items. Mandatory for Allobank |
additionalInfo.lineItems.name | string (32) | Optional | Name of the product item. Mandatory for Allobank |
additionalInfo.lineItems.price | string(16) | Optional | Price of the product item. Total price and quantity must match with the amount.value, ends in decimal .00 if currency is IDR |
additionalInfo.lineItems.quantity | numeric(16) | Optional | Quantity of the product item |
remarks | string(40) | Optional | Payment's remarks |
successPaymentUrl | string(255) | Mandatory | redirect URL in case of binding request was a success |
failedPaymentUrl | string(255) | Mandatory | redirect URL in case of binding request was a failure |
Response Body
{
"responseCode": "4035413",
"responseMessage": "OTP Sent To Cardholer",
"partnerReferenceNo": "INV_20221221_0002"
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
responseCode | string (7) | Mandatory | Response code as defined in SNAP Regulation |
responseMessage | string (128) | Mandatory | Response message as defined in SNAP Regulation |
partnerReferenceNo | string (64) | Optional | account binding unique identifier on acquirer's side |