Submit Disbursement API
Path parameters
Field | is required? | Description | Default Value |
---|---|---|---|
force_disburse | optional | bool If this parameter is true then the batch will be validated and disbursed. In this case, approve API doesn't need to be called. | false |
skip_validation | optional | bool If this parameter is true then the bank validation will be skipped and items will be disbursed directly. | false |
Request parameters
Following are the parameters to be sent in the request body:
Field | is required? | Description |
---|---|---|
name | mandatory | string |
description | mandatory | string The description for the disbursement batch. |
account_owner_name | mandatory | string The name of the bank account holder. |
bank_code | mandatory | string The bank code of the account. |
amount | mandatory | string The amount of money to be disbursed. |
account_number | mandatory | string The account number of the recipient. |
email_recipient | mandatory | string The email of the recipient. |
phone_number | mandatory | string The phone number of the recipient. |
notes | optional | string The notes for the disbursement if any. |
Following are the parameters to be sent in the request header:
Field | is required? | Description |
---|---|---|
idempotency_key | mandatory | string The idempotency key used to submit the disbursement. It will be used to prevent accidentally creating the same disbursement more than once. |
Example
curl -u [Base64({Your_Server_Key}:)] \
-X POST https://api.durianpay.id/v1/disbursements/submit \
-H "content-type: application/json" \
-H "idempotency_key: <YOUR_IDEMPOTENCY_KEY>" \
-d '{
"name": "sample disbursement",
"description": "this is a sample disbursement",
"items": [{
"account_owner_name": "Jane Doe",
"bank_code": "bca",
"amount": "10000",
"account_number": "8422647",
"email_recipient": "jane_doe@nomail.com",
"phone_number": "85722173217",
"notes": "salary"
},
{
"account_owner_name": "Jack",
"bank_code": "bca",
"amount": "10000",
"account_number": "235464",
"email_recipient": "jack@nomail.com",
"phone_number": "85609873209",
"notes": "salary"
}]
}'
Response Code : 200
Here is an example of success response
{
"data": {
"id": "dis_LjxhDKq8Am3427",
"name": "test disb",
"total_amount": "20000.00",
"total_disbursements": 2,
"description": "description"
}
}
Error Response Code : 400
Here is an example error response for invalid request
{
"error": "required fields missing",
"errors": [
{
"field": "amount=\"amount invalid\"\n",
"message": "Please provide valid disbursement data"
}
]
}
Error Response Code : 401
Here is an example error response for unauthorized access
{
"error": "invalid Authorization header in request",
"error_code": "DPAY_UNAUTHORIZED_ACCESS"
}
Error Response Code : 403
Here is an example error response for invalid request
{
"error": "disbursement already exist with given idempotency key",
"error_code": "DISBURSEMENT_ALREADY_EXIST_WITH_GIVEN_IDEMPOTENCY_KEY",
"request_id": "dp_do7KAjuYGi5960"
}
Error Response Code : 500
Here is an example error response or invalid request
{
"error": "error submitting disbursement",
"error_code": "DPAY_INTERNAL ERROR"
}