Static VA Fetch API
Query parameters
Following are the parameters to be sent in the request body:
Field | is required? | Description |
---|---|---|
from | optional | string Timestamp (in YYYY-MM-DD format) from when the virtual accounts should be fetched |
to | optional | string Timestamp (in YYYY-MM-DD format) up till when virtual accounts are to be fetched |
skip | optional | integer The number of virtual accounts to be skipped. The default value is 0. This can be used for pagination, in combination with count |
limit | optional | integer Number of virtual accounts to be fetched. Default value is 25. This can be used for pagination, in combination with the skip parameter |
Sample Request
Example
curl -X GET \
https://api.durianpay.id/v1/payments/va/static?limit=50&skip=10 \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H "content-type: application/json"'
Sample Response
{
"data": {
"virtual_accounts": [
{
"id": "va_iz2tvf9UiH4986",
"bank_code": "BRI",
"account_number": "1236170050000007",
"name": "Hello Virtual Account",
"is_closed": true,
"amount": 12346,
"currency": "IDR",
"customer_id": "cus_vS2R7NX08l7424",
"is_sandbox": false,
"created_at": "2022-03-01T07:37:35.313679Z",
"expiry_at": "2024-01-24T12:47:35.385003Z",
"metadata": {}
},
{
"id": "va_njZ2xTwr4s8660",
"bank_code": "BRI",
"account_number": "123617005423324590",
"name": "Hello Virtual Account",
"is_closed": true,
"amount": 12346,
"currency": "IDR",
"customer_id": "cus_vS2R7NX08l7424",
"is_sandbox": false,
"created_at": "2022-03-01T07:23:59.889904Z",
"expiry_at": "2024-01-24T12:33:59.952814Z",
"metadata": {}
}
],
"total": 2
}
}
Sample Error
Form/Params Errors
The possible error status codes are: 400
{
"error": "invalid skip and limit parameter"
}
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
The possible error status codes are: 500
{
"error": "failed to connect to database",
"error_code": "DPAY_INTERNAL_ERROR",
"request_id": "dp_d3HX9S5W0r4989"
}