Pay Invoice API
The following endpoint creates a payment for Invoices:
/invoices/pay
Request Attributes
Following are the parameters to be sent in the request body:
bank_code
String
Mandatory
The code of the bank for which the VA needs to be created. Supported Bank Codes are: BCA
, BRI
, MANDIRI
, PERMATA
, CIMB
.
invoices
List of Objects
Mandatory
json object
Contains details of Invoices to be paid.
Hide invoices object
Field | Type | Description |
---|---|---|
idMandatory | string | Unique identifier of the Invoice to be paid. |
transaction_amountMandatory | string | Amount to be paid for the Invoice. |
customer_id
String
Mandatory
The customer_id of customer for which the invoice is being paid
Example
curl -X POST \
https://api.durianpay.id/v1/invoices/pay \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H 'content-type: application/json' \
-d '{
"bank_code": "BCA",
"invoices": [
{
"id": "inv_0dIWbudjjf84078",
"transaction_amount": "10000.34"
},
{
"id": "inv_h73BiiJVS42949",
"transaction_amount": "12002.00"
}
],
"customer_id": "cus_8OZPaCrlfV6309"
}'
Response Code
200 - Success
1 2 3 4 5 6 7 8 9 10
{ "message": "Payment for invoice has been created successfully", "data": { "va_number": "4041600154000000", "amount": "250002", "bank_code": "BCA", "invoice_transaction_id": "inv_txn_Fp7St3HycX8335" }, "response_code": "0000" }
400 - Invalid Request
401 - Unauthorized Access
404 - Not Found
422 - Unprocessable Entity
500 - Internal Server Error