Implement Disbursement
Pre-Requisite
Sandbox Access
You can start by testing in sandbox environment with steps mentioned previously.
Step 1: Validate Account Number
API to validate if your disbursement destination is correct. It is splitted into two type: Bank and E-wallet.
The numbers stated above is a guideline only, you can adjust it accordingly based on your system implementation
Please take notes in rare cases, it can take longer to get the final status of a transaction.
Bank Account Validation
Bank Account validation API is used to verify whether a disbursement destination account is valid/ invalid. If the account is valid, it will give information of the destination name according to the the bank/provider.
curl --location 'https://api.durianpay.id/v1.0/account-inquiry-external' \
--header 'X-TIMESTAMP: 2024-05-14T18:54:57+07:00' \
--header 'X-SIGNATURE: pCA+q832pxHnTPm1Kdbfu1am37J9XFeGH13JGYqHv7Ww4Tb3Hrc5xRew+4y2tN4wiAPnHmvXcJ1Tyf94jK5gHQ==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: random_external_id' \
--header 'CHANNEL-ID: channel_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTM3NTYsImlhdCI' \
--data '{
"beneficiaryAccountNo": "087783146495",
"beneficiaryBankCode": "002",
"partnerReferenceNo": "202010290000000000000",
"additionalInfo": {
"deviceId": "12345679237",
"channel": "mobilephone"
}
}'
{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237"
},
"beneficiaryAccountName": "",
"beneficiaryAccountNo": "087783146495",
"beneficiaryBankCode": "002",
"beneficiaryBankName": "",
"currency": "IDR",
"partnerReferenceNo": "202010290000000000000",
"responseCode": "2021600",
"responseMessage": "Request In Progress"
}
E-Wallet Account Validation
Validation for e-wallet account, the general flow is the same except URL used and the bank code.
- Instead of beneficiaryAccountNo, e-wallet has parameter called customerNumber
- Instead of beneficiaryBankCode, you need to put e-wallet code inside additionalInfo as platformCode. See here for more information.
curl --location 'https://api.durianpay.id/v1.0/emoney/account-inquiry' \
--header 'X-TIMESTAMP: 2024-05-14T18:54:57+07:00' \
--header 'X-SIGNATURE: pCA+q832pxHnTPm1Kdbfu1am37J9XFeGH13JGYqHv7Ww4Tb3Hrc5xRew+4y2tN4wiAPnHmvXcJ1Tyf94jK5gHQ==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: random_external_id' \
--header 'CHANNEL-ID: channel_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTM3NTYsImlhdCI' \
--data '{
"customerNumber": "087783146495",
"partnerReferenceNo": "202010290000000000000",
"additionalInfo": {
"deviceId": "12345679237",
"channel": "mobilephone",
"platformCode": "gopay"
}
}'
{
"additionalInfo": {
"deviceId": "12345679237",
"channel": "mobilephone",
"platformCode": "gopay"
},
"customerNumber": "087783146495",
"currency": "IDR",
"customerName": "Jane Doe",
"partnerReferenceNo": "202010290000000000000",
"responseCode": "2021600",
"responseMessage": "Request In Progress"
}
Step 2: Submitting Disbursement
Submit Disbursement API is used to Create Disbursement in Durianpay, like account validation, it's splitted into Bank Account Transfer API and E-Wallet Account Transfer API. This API is only used to trigger the disbursement and the response will be reflecting that disbursement is accepted and will be processed by Durianpay. To get final status of disbursement, please implement step 3
- See this table to see which bank supported and its respective bank code
- In case of time out or internal server error, merchant can try to submit disbursement with the same partnerReferenceNo to see if previous disbursement was submitted or not.
Bank Account Transfer
Submit a disbursement batch or basically create a disbursement batch. The disbursement needs to be submitted via submit disbursement API.
The numbers stated above is a guideline only, you can adjust it accordingly based on your system implementation
Please take notes in rare cases, it can take longer to get the final status of a transaction.
Use following endpoint to submit a disbursement:
curl --location 'https://api.durianpay.id/v1.0/transfer-interbank' \
--header 'X-TIMESTAMP: 2024-05-14T18:54:57+07:00' \
--header 'X-SIGNATURE: pCA+q832pxHnTPm1Kdbfu1am37J9XFeGH13JGYqHv7Ww4Tb3Hrc5xRew+4y2tN4wiAPnHmvXcJ1Tyf94jK5gHQ==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: random_external_id' \
--header 'CHANNEL-ID: 95221' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTM3NTYsImlhdCI' \
--data '{
"partnerReferenceNo": "111111111",
"amount": {
"value": "20000.00",
"currency": "IDR"
},
"beneficiaryAccountName": "Dummy Name",
"beneficiaryAccountNo": "888801000003301",
"beneficiaryAddress": "Palembang",
"beneficiaryBankCode": "002",
"beneficiaryBankName": "Bank BRI",
"beneficiaryEmail": "yories.yolanda@work.bri.co.id",
"currency": "IDR",
"customerReference": "10052019",
"transactionDate": "2019-07-03T12:08:56-07:00",
"additionalInfo": {
"deviceId": "12345679237",
"channel": "mobilephone"
}
}'
Example of response
// Sample response
{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237"
},
"amount": {
"currency": "IDR",
"value": "20000.00",
},
"beneficiaryAccountNo": "888801000003301",
"beneficiaryBankCode": "002",
"partnerReferenceNo": "111111111",
"referenceNo": "dis_item_zqMYiSqsPO",
"responseCode": "2021800",
"responseMessage": "Request In Progress",
"sourceAccountNo": "mer_MsCtIPhqRc8045"
}
E-wallet Account Transfer
- For e-wallet, instead of beneficiaryBankCode, you will need to put platformCode inside additionalInfo containing e-wallet code
- See this table to see which e-wallet supported and its respective platform code
curl --location 'https://api.durianpay.id/v1.0/emoney/topup' \
--header 'X-TIMESTAMP: 2024-05-14T18:54:57+07:00' \
--header 'X-SIGNATURE: pCA+q832pxHnTPm1Kdbfu1am37J9XFeGH13JGYqHv7Ww4Tb3Hrc5xRew+4y2tN4wiAPnHmvXcJ1Tyf94jK5gHQ==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: random_external_id' \
--header 'CHANNEL-ID: channel_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTM3NTYsImlhdCI' \
--data '{
"partnerReferenceNo": "111111111",
"amount": {
"value": "20000.00",
"currency": "IDR"
},
"customerName": "Dummy Name",
"customerNumber": "888801000003301",
"currency": "IDR",
"customerReference": "10052019",
"transactionDate": "2019-07-03T12:08:56-07:00",
"additionalInfo": {
"platformCode": "gopay",
"deviceId": "12345679237",
"channel": "mobilephone"
}
}'
// Sample response
{
statusCode: 202,
message: 'Accepted',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237",
"platformCode" : "gopay"
},
"customerName": "Dummy Name",
"customerNumber": "087783146495",
"referenceNo": "dis_item_123",
"currency": "IDR",
"partnerReferenceNo": "202010290000000000000",
"responseCode": "2021600",
"responseMessage": "Request In Progress"
}
Step 3: Getting Final Status
There are two ways to get final status of a disbursement: By doing disbursement status inquiry, and implement disbursement status notify (soon)
Disbursement Status Inquiry
The numbers stated above is a guideline only, you can adjust it accordingly based on your system implementation
Please take notes in rare cases, it can take longer to get the final status of a transaction.
Bank Account Transfer Inquiry
curl --location 'https://api.durianpay.id/v1.0/transfer/status' \
--header 'X-TIMESTAMP: 2024-05-14T18:54:57+07:00' \
--header 'X-SIGNATURE: pCA+q832pxHnTPm1Kdbfu1am37J9XFeGH13JGYqHv7Ww4Tb3Hrc5xRew+4y2tN4wiAPnHmvXcJ1Tyf94jK5gHQ==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: random_external_id' \
--header 'CHANNEL-ID: 95221' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTM3NTYsImlhdCI' \
--data '{
"originalPartnerReferenceNo": "111111111",
"originalReferenceNo": "dis_item_vhLkXOtB0s6619",
"originalExternalId": "30443786930722726463280097920912",
"serviceCode": "18",
"transactionDate": "2019-07-03T12:08:56-07:00",
"amount": {
"value": "20000.00",
"currency": "IDR"
},
"additionalInfo": {
"deviceId": "12345679237",
"channel": "mobilephone"
}
}'
Success will have transaction status "00"
Processing will have transaction status "03"
Failed will have transaction status "06"
If the transaction is success, the response will be
// Sample Response if transfer is success
{
statusCode: 200,
message: 'Success',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237"
},
"amount": {
"currency": "IDR",
"value": "12345678"
},
"beneficiaryAccountNo": "123123123",
"beneficiaryBankCode": "002",
"currency": "IDR",
"latestTransactionStatus": "00",
"originalExternalId": "30443786930722726463280097920912",
"originalPartnerReferenceNo": "111111111",
"originalReferenceNo": "dis_item_vhLkXOtB0s6619",
"previousResponseCode": "2021800",
"referenceNumber": "123123",
"responseCode": "2003600",
"responseMessage": "Successful",
"serviceCode": "18",
"sourceAccountNo": "123123",
"transactionDate": "2019-07-03T12:08:56-07:00",
"transactionId": "123123",
"transactionStatusDesc": "success"
}
}
If the transaction was still in progress, the response will be
// Sample Response if transfer is still processing
{
statusCode: 200,
message: 'Success',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237"
},
"amount": {
"currency": "IDR",
"value": "20000.00",
},
"beneficiaryAccountNo": "123123123",
"beneficiaryBankCode": "002",
"currency": "IDR",
"latestTransactionStatus": "03",
"originalExternalId": "30443786930722726463280097920912",
"originalPartnerReferenceNo": "111111111",
"originalReferenceNo": "dis_item_vhLkXOtB0s6619",
"previousResponseCode": "2021800",
"referenceNumber": "123123",
"responseCode": "2003600",
"responseMessage": "OK",
"serviceCode": "18",
"sourceAccountNo": "123123",
"transactionDate": "2019-07-03T12:08:56-07:00",
"transactionId": "123123",
"transactionStatusDesc": "processing"
}
}
If the transaction was failed, the response will be
// Sample Response if transfer is failed
{
statusCode: 200,
message: 'Success',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237"
},
"amount": {
"currency": "IDR",
"value": "20000.00",
},
"beneficiaryAccountNo": "123123123",
"beneficiaryBankCode": "002",
"currency": "IDR",
"latestTransactionStatus": "06",
"originalExternalId": "30443786930722726463280097920912",
"originalPartnerReferenceNo": "111111111",
"originalReferenceNo": "dis_item_vhLkXOtB0s6619",
"previousResponseCode": "2021800",
"referenceNumber": "123123",
"responseCode": "2003600",
"responseMessage": "OK",
"serviceCode": "18",
"sourceAccountNo": "123123",
"transactionDate": "2019-07-03T12:08:56-07:00",
"transactionId": "123123",
"transactionStatusDesc": "failed"
}
}
E-wallet Transfer Inquiry Status
curl --location 'https://api.durianpay.id/v1.0/transfer/status' \
--header 'X-TIMESTAMP: 2024-05-14T18:54:57+07:00' \
--header 'X-SIGNATURE: pCA+q832pxHnTPm1Kdbfu1am37J9XFeGH13JGYqHv7Ww4Tb3Hrc5xRew+4y2tN4wiAPnHmvXcJ1Tyf94jK5gHQ==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: random_external_id' \
--header 'CHANNEL-ID: 95221' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTM3NTYsImlhdCI' \
--data '{
"originalPartnerReferenceNo": "111111111",
"originalReferenceNo": "dis_item_vhLkXOtB0s6619",
"originalExternalId": "30443786930722726463280097920912",
"serviceCode": "18",
"transactionDate": "2019-07-03T12:08:56-07:00",
"amount": {
"value": "20000.00",
"currency": "IDR"
},
"additionalInfo": {
"deviceId": "12345679237",
"channel": "mobilephone"
}
}'
Similar with bank transfer, e-wallet transfer status inquiry will have two states: Processing and Success
If the transaction is success, the response will be
// Sample Response if transfer is still in progresss
{
statusCode: 200,
message: 'Success',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237",
"platformCode": "gopay"
},
"customerNumber": "087783146495",
"currency": "IDR",
"partnerReferenceNo": "202010290000000000000",
"responseCode": "2021600",
"responseMessage": "Request In Progress"
}
}
If the transaction was still in progress, the response will be
// Sample Response if transfer is already success
{
statusCode: 202,
message: 'Accepted',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237",
"platformCode": "gopay"
},
"customerNumber": "087783146495",
"currency": "IDR",
"partnerReferenceNo": "202010290000000000000",
"responseCode": "2021600",
"responseMessage": "Request In Progress"
}
}
Disbursement Notify (Callback) Handling
Balance Inquiry
API to check merchant's current balance.
curl --location 'https://api.durianpay.id/v1.0/balance-inquiry' \
--header 'X-TIMESTAMP: 2023-07-31T10:55:00+07:00' \
--header 'X-SIGNATURE: SlCb5OKordx8WVhAE5bkg4M8U1vbI7hyHb07G/ydStvTIBmNgEzHj8PdLVbp2iWY1k2e/jgwWmKsrIj/AvH9rw==' \
--header 'X-PARTNER-ID: client_8045' \
--header 'X-EXTERNAL-ID: 202001' \
--header 'CHANNEL-ID: 95521' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1Nzk0MjYsImlhdCI6MTcxNTU3ODUyNiwibWVyY2hhbnRfaWQiOiJtZXJfTXNDdElQaHFSYzgwNDUiLCJncmFudF90eXBlIjoiQVVUSE9SSVpBVElPTl9DT0RFIiwiY2xpZW50X2tleSI6ImNsaWVudF84MDQ1In0.H2IMBY0MiGNvjHwVwXoYekajhPocBxflmodiHxbm0XA' \
--data '{
"partnerReferenceNo": "2020102900000000000001",
"accountNo": "7382382957893840",
"bankCardToken": "12312312",
"additionalInfo": {
"deviceId": "123456",
"channel": "phone"
}
}'
// Sample Response
{
statusCode: 200,
message: 'Success',
codeBlock: `{
"additionalInfo": {
"channel": "mobilephone",
"deviceId": "12345679237"
},
"beneficiaryAccountName": "Dummy Name",
"beneficiaryAccountNo": "087783146495",
"beneficiaryBankCode": "002",
"beneficiaryBankName": "Bank Rakyat Indonesia",
"currency": "IDR",
"partnerReferenceNo": "202010290000000000000",
"responseCode": "2001600",
"responseMessage": "Successful"
}
Other useful non-SNAP API
There are several APIs that might be useful which do not implement SNAP, for example disbursement list API and balance topup API
Please refer to disbursement or api docs for more info.