Static VA Patch By ID API


The following endpoint is used to override Expiry Time of a single Virtual Account. It can either expire a VA(set expiry_minutes to 0) or override the expiry time.

/payments/va/static/:id

Path parameters

Fieldis required?Description
idmandatoryinteger Unique identifier of the Virtual Account to be retrieved
expiry_minutesoptionalinteger Number of minutes left till expiry from now (default 1440), set to 0 to expire VA

Sample Request

curl -X PATCH \
https://api.durianpay.id/v1/payments/va/static/va_yiCTj9JRaP9307 \
-H 'authorization: [Base64({Your_Server_Key}:)]' \
-H "content-type: application/json" \
-d '{
    "expiry_minutes": 100
}'

Sample Response

{
    "data": {
        "virtual_account": {
            "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": "2022-03-01T04:12:14.129524Z",
            "metadata": {}
        },
        "virtual_account_status": "VirtualAccountSuccess",
        "customer": {
            "id": "cus_vS2R7NX08l7424",
            "customer_ref_id": "27aa09d7-dd63-4053-94a4-d3ebb0e1e68b",
            "given_name": "Paul",
            "middle_name": "K",
            "sur_name": "Rudd",
            "email": "paulrudd@gmail.com",
            "mobile": "999999999"
        }
    }
}

Sample Error

Form Errors

The possible error status codes are: 400

{
    "error_code": "DPAY_INVALID_REQUEST",
    "request_id": "dp_Dzc8hMzkQU4826",
    "errors": [
        {
            "field": "expiry_minutes",
            "message": "can't be less than 0"
        }
    ]
}

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: 404, 500

{
    "error": "sql: no rows in result set",
    "error_code": "DPAY_VA_NOT_FOUND",
    "request_id": "dp_d3HX9S5W0r4989"
}