Virtual Account APIs

There are two methods available related to Virtual Account generation:

  1. Open VA
  2. Close VA
Minimum AmountMaximum Amount
IDR 10.000IDR 500.000.000

The VA generation is available for these banks:

Bank NameBank ShortcodeMaximum AmountClosed VAOpen VASettlement
Bank MandiriMANDIRIIDR 500.000.000AvailableAvailableT+1 Working Day
Bank Rakyat IndonesiaBRIIDR 500.000.000AvailableAvailableT+1 Working Day
Bank CIMB NiagaCIMB_NIAGAIDR 500.000.000AvailableAvailableT+1 Working Day
Bank DanamonDANAMONIDR 25.000.000AvailableAvailableT+1 Working Day
Bank PermataPERMATAIDR 500.000.000-AvailableT+1 Working Day
Bank HanaHANAIDR 50.000.000AvailableAvailableT+1 Working Day
Bank Sahabat SampoernaSAHABAT_SAMPOERNAIDR 10.000.000-AvailableInstant

There are two methods available related to Virtual Account generation:

A. Open VA

Use this method when a payment method with no pre-defined amount is needed to be linked for your end-user. Brick will send you callback notifications to your designated callback URL when we detect payments made through the open VA.

These are typically used when you want to create a specific payment channel that will be tightened to each of your users (example: as a top-up channel to your users' e-wallet or balance).

1. Generating an Open VA

To start generating an open VA, you can use Open VA API with these details:

curl --location --request POST 'https://sandbox.onebrick.io/v2/payments/gs/va/open' \
--header 'publicAccessToken: Bearer {{public-access-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "bankShortCode": "MANDIRI",
    "referenceId": "Brick12345",
    "displayName": "BRICK"
}'

2. You will get the responses like below when successful:

{
  "status": 200,
  "data": {
    "message": "We have successfully generated the open VA",
    "id": "OP_b123123123asdas1231231123",
    "referenceId": "Brick12345",
    "bankShortCode": "MANDIRI",
    "accountNo": "1304300000003243",
    "displayName": "IKN-BRICK"
  },
  "metaData": {
    "source": "API",
    "entity": "Payment"
  },
  "error": null
}

3. Virtual account Callback Notification

Brick notifies you when the user has already made the payment via callbacks (you will be able to set up the Virtual account callback in the Brick Dashboard )

The callback will be sent twice:

  1. When the payment is made (status: "paid")
  2. When the fund settlement is done in each Bank (status: "completed")
{
  "data": {
    "id": "OP_123456i12i1i123u123",
    "referenceId": "Dodo123456",
    "amount": "10000.0",
    "status": "paid",
    "createdAt": "2023-03-28T10:29:48.000+07:00",
		"paymentId": "PAY_b123b123b123b123b123b123bb1",
		"bankShortCode": "MANDIRI",
    "accountNo": "8804995730945965",
    "displayName": "BRICK"
  }
}
{
  "data": {
    "id": "OP_123456i12i1i123u123",
    "referenceId": "Dodo123456",
    "amount": "10000.0",
    "status": "completed",
    "createdAt": "2023-03-28T10:29:48.000+07:00",
		"paymentId": "PAY_b123b123b123b123b123b123bb1",
		"bankShortCode": "MANDIRI",
    "accountNo": "8804995730945965",
    "displayName": "BRICK"
  }
}

B. Closed VA

Use this method when a static payment method with a pre-defined amount is needed to be linked for your end-user. Brick will send you callback notifications to your designated callback URL when we detect payments made through the close VA.

These are typically used when you want to create a specific payment channel that will be tightened to each of the transactions/bills of your users where the payment window is limited.

1. Generating a Close VA

To start generating a close VA, you can use Close VA API with these details:

curl --location --request POST 'https://sandbox.onebrick.io/v2/payments/gs/va/close' \
--header 'publicAccessToken: Bearer {{public-access-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 15000,
    "referenceId": "brick12345",
    "expiredAt": "60",
    "description": "Test Initial VA Close",
    "bankShortCode": "MANDIRI",
    "displayName": "BRICK"
}'

2. You will get the responses like below when successful:

{
  "status": 200,
  "data": {
    "message": "We have successfully generated the close VA",
    "id": "CL_asd123asd2322313asss2223321",
    "referenceId": "brick12345",
    "description": "Test Initial VA Close",
    "amount": "15000",
    "status": "pending",
    "createdAt": "2023-04-10T13:33:03.000+07:00",
    "expiredAt": "2023-04-10T14:34:03.000+07:00",
    "bankShortCode": "MANDIRI",
    "accountNo": "23096000000108142",
    "displayName": "BRICK"
  },
  "metaData": {
    "source": "API",
    "entity": "Payment"
  },
  "error": null
}

3. Virtual Account Callback Notification

Brick notifies you when the user has already made the payment via callbacks (you will be able to set up the Virtual Account callback in the Brick Dashboard )

The callback will be sent twice:

  1. When the payment is made (status: "paid")
  2. When the fund settlement is done in each Bank (status: "completed")
{
  "data": {
    "id": "CL_asd123asd2322313asss2223321",
    "referenceId": "brick12345",
    "description": "Test Initial VA Close",
    "amount": "15000",
    "status": "paid",
    "createdAt": "2023-04-10T13:33:03.000+07:00",
    "expiredAt": "2023-04-10T14:34:03.000+07:00",
    "paymentId": "PAY_zxc123azx123zxc123zxc123",
    "bankShortCode": "MANDIRI",
    "accountNo": "23096000000108142",
    "displayName": "BRICK"
  }
}
{
  "data": {
    "id": "CL_asd123asd2322313asss2223321",
    "referenceId": "brick12345",
    "description": "Test Initial VA Close",
    "amount": "15000",
    "status": "paid",
    "createdAt": "2023-04-10T13:33:03.000+07:00",
    "expiredAt": "2023-04-10T14:34:03.000+07:00",
    "paymentId": "PAY_zxc123azx123zxc123zxc123",
    "bankShortCode": "MANDIRI",
    "accountNo": "23096000000108142",
    "displayName": "BRICK"
  }
}

What’s Next

The details of the APIs can be found here: