Static VA Payment Simulate API


The following endpoint to simulate a payment to a virtual account

/payments/va/static/simulate

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:

Fieldis required?DescriptionExample
account_numbermandatorystring the account number to which money should be sent1236170055
amountmandatorystring amount in IDR to be sent to account12345.55

Sample Request

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"
    }
}