Virtual Account
This feature is used to create new temporary or permanent virtual accounts.
Method | Path | Format | Authentication |
---|---|---|---|
POST | /api/v1.0/virtual-accounts/{account_id} | json | OAuth 2.0 with Access Token |
Field | Value | Type | Mandatory | Length | Description | Example |
---|---|---|---|---|---|---|
X-PARTNER-ID | api_key | Alphanumeric | Mandatory | API key obtained from the merchant dashboard. | b3ed7d4b-a96c-6c08-b3c7-12c3124242d9 | |
Accept | application/json | Alphabetic | Mandatory | Specifies JSON as the expected response format. | application/json | |
Authorization | Bearer {bearerToken} | Alphanumeric | Mandatory | Bearer token obtained from the get access token endpoint. | Bearer eyJ0eXAiOiJKV1{…} |
Field | Type | Mandatory | Length | Description | Example |
---|---|---|---|---|---|
amount | Numeric | Yes | - | Amount of transaction | 99000 |
bank_code | Alphanumeric | Yes | - | Bank code like BRI, BNI, BCA | BRI |
currency | Alphanumeric | No | - | - | - |
kind | Enum | Yes | - | temporary or permanent | temporary |
expired_at | Timestamp | Yes | - | Expired at in Unix timestamp millisecond format | 1714122693 |
{
"amount": 99000,
"bank_code": "BRI",
"currency": null,
"kind": "temporary",
"expired_at": 1714122693
}
Field | Type | Mandatory | Length | Description | Example |
---|---|---|---|---|---|
status | Numeric | Mandatory | 3 | HTTP Status Code | 200 |
success | Boolean | Mandatory | 1 | Indicates whether the request was successful (2xx is true, 4xx-500 is false) | true |
data | Array Object | Conditional | - | Contains details about the virtual account | - |
> id | Numeric | Mandatory | - | Virtual account ID | 23643 |
> amount | Object | Mandatory | - | Contains balance amount and currency | - |
>> value | Numeric | Mandatory | - | Balance amount; if kind is “permanent”, value will be 0 | 99000 |
>> currency | Alphabetic | Mandatory | 3 | Currency code | IDR |
> kind | Enum | Mandatory | - | Indicates whether the account is temporary or permanent | temporary |
> bank_code | Alphanumeric | Mandatory | - | Bank code like BRI, BCA, BNI | BRI |
> number | Numeric | Mandatory | 16 | Virtual account number with a length of 16 digits | 6343654354 |
> status | Alphabetic | Mandatory | - | Status of the virtual account (values are “active” or “expired”) | active |
> created_at | Timestamp | Mandatory | - | Date created in Unix millisecond timestamp | 1714616095080 |
Success: Here’s an example of a successful response.
{
"status": 200,
"success": true,
"data": {
"id": "2374354",
"amount": {
"value": "11000.00",
"currency": "IDR"
},
"kind": "temporary",
"status": "expired",
"bank_code": "BRI",
"number": "465436543564546",
"created_at": "1714616095080"
}
}
Error: This is an example of an unsuccessful request.
{
"status": 401,
"success": false,
"error": {
"code": 401,
"message": "Unauthorized partner, please sign in"
}
}