Static VA Payment Simulate API
The following endpoint to simulate a payment to a virtual account
This endpoint only works in sandbox mode using API Key which starts with
dp_test
Request parameters
Following are the parameters to be sent in the request body:
Field | is required? | Description | Example |
---|---|---|---|
account_number | mandatory | string the account number to which money should be sent | 1236170055 |
amount | mandatory | string amount in IDR to be sent to account | 12345.55 |
Sample Request
Example
curl -X POST \
https://api.durianpay.id/v1/payments/va/static/simulate \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H "content-type: application/json" \
-d '{
"account_number": "1236170055",
"amount": "12345.55"
}'
Sample Response
The status code
returned would be 200
.
{
"data": {
"status": "Payment Successful"
}
}
Sample Error
Form Errors
Form errors are those which occur during form validation
& contain an errors array
and are thrown with status code 400
.
{
"error_code": "DPAY_INVALID_REQUEST",
"request_id": "dp_JSN8xJULZ39583",
"errors": [
{
"field": "account_number",
"message": "can't be blank"
},
{
"field": "amount",
"message": "can't be blank"
}
]
}
Authorization Errors
Authorization errors are errors that occur during authorization
. The status code returned is usually 401
{
"error": "invalid Authorization header in request",
"error_code": "DPAY_UNAUTHORIZED_ACCESS"
}
Other Errors
Other errors are failures
which occur after form validation
. The status codes codes are usually 422
.
{
"data": {
"status": "Payment Unsuccessful",
"reason": "VA Not found"
}
}