Dark Mode

Virtual Accounts 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/:id

Path parameters

id

Integer
Mandatory

Unique identifier of the Virtual Account to be retrieved

Request parameters

expiry_minutes

Integer
Optional

Number of minutes left till expiry from now. Set to 0 to expire VA Example: 10000

min_amount

Integer
Optional

Modify minimum amount which can be paid to an open VA. Example: 10000

max_amount

Integer
Optional

Modify maximum amount which can be paid to an open VA. Example: 10000

amount

Integer
Optional

Modify maximum amount which can be paid to a closed VA. Example: 10000

is_disabled

Boolean
Optional

Modify enabling/disabling payments to a VA while still reserving it. Example: true

va_ref_id

String
Optional

Modify a reference ID which the merchant wants to use for a specific VA. Example: "VA_XYZ_1234"

Error Codes

CodeDescription
DPAY_CANNOT_PATCH_PAID_VAcannot patch paid va
DPAY_PATCHING_VA_NOT_SUPPORTEDpatching va not supported
DPAY_INTERNAL_ERRORan unclassified error
DPAY_INVALID_REQUESTan error in form fields
DPAY_UNAUTHORIZED_ACCESSan unauthorized access error
Example
curl --location --request PATCH 'https://api.durianpay.id/v1/payments/va/va_sample_EwCm3LrPqE5184' \
--header 'Authorization: [Base64({Your_Server_Key}:)]' \
--header 'Content-Type: application/json' \
--data-raw '{
    "expiry_minutes": 1440,
    "min_amount": 11000,
    "max_amount": 13000,
    "amount": 123456,
    "is_disabled": true,
    "va_ref_id": "1234412"
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
    "data": {
        "virtual_account": {
            "id": "va_sample_EwCm3LrPqE5184",
            "bank_code": "PERMATA",
            "account_number": "88565004532522",
            "name": "Ardi Hanan Durian",
            "is_closed": true,
            "amount": 123456,
            "currency": "IDR",
            "customer_id": "cus_akA2FwrR5B2217",
            "is_sandbox": true,
            "created_at": "2022-06-27T02:52:30.236901Z",
            "expiry_at": "2022-06-29T05:40:59.795448Z",
            "metadata": {},
            "is_disabled": true,
            "is_paid": false,
            "is_reusable": true,
            "min_amount": 50000,
            "max_amount": null,
            "va_ref_id": "1234412",
            "auto_disable_after_payment": false
        },
        "virtual_account_status": "VirtualAccountSuccess",
        "customer": {
            "id": "cus_akA2FwrR5B2217",
            "customer_ref_id": "",
            "given_name": "",
            "middle_name": "",
            "sur_name": "",
            "email": "p.ardi.h@gmail.com",
            "mobile": "+628978678578"
        }
    }
}

499 - Invalid Request

401 - Unauthorized Access

404 - Not Found