Create Virtual Account
Berikut adalah endpoint untuk membuat virtual account.
Endpoint
| Key | Detail |
|---|---|
| URL | https://sconnect-api.alnairpay.id/client/va_billing/create-virtual-account |
| Method | POST |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | String | Yes | Content type request. Gunakan application/json. |
Authorization | String | Yes | Bearer token hasil dari Generate Access Token. Format: Bearer [token]. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
id_koneksi | String | Yes | ID koneksi channel pembayaran yang akan digunakan untuk membuat VA. Didapatkan dari endpoint Channel Pembayaran. |
customer | Object | Yes | Objek data pelanggan. |
customer.name | String | Yes | Nama pelanggan. |
customer.email | String | Yes | Email pelanggan. |
bill | Object | Yes | Objek detail tagihan. |
bill.amount | Number | Yes | Nominal tagihan. Contoh: 250000. |
bill.expired_at | String | Yes | Waktu kedaluwarsa VA. Format: YYYY-MM-DD HH:mm. Contoh: 2026-12-12 10:22. |
bill.currency | String | Yes | Mata uang tagihan. Contoh: IDR. |
bill.va_type | String | Yes | Tipe Virtual Account. Contoh: CLOSED. |
bill.description | String | Yes | Deskripsi / keterangan tagihan. |
Request Body Example
{
"id_koneksi": "ID-KONEKSI",
"customer": {
"name": "Azhari Subroto",
"email": "subroto.azhari@gmail.com"
},
"bill": {
"amount": 250000,
"expired_at": "2026-12-12 10:22",
"currency": "IDR",
"va_type": "CLOSED",
"description": "Pembayaran SPP bulan September 2025"
}
}
CURL Example
curl --location 'https://sconnect-api.alnairpay.id/client/va_billing/create-virtual-account' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [long-token-goes-here]' \
--data-raw '{
"id_koneksi": "ID-KONEKSI",
"customer": {
"name": "Azhari Subroto",
"email": "subroto.azhari@gmail.com"
},
"bill": {
"amount": 250000,
"currency": "IDR",
"expired_at": "2026-12-12 10:22",
"va_type": "CLOSED",
"description": "Pembayaran SPP bulan September 2025"
}
}'
Response Example (Success)
{
"succes": true,
"status": 200,
"code": "SUCCESS",
"message": "Virtual account created successfuly",
"virtual_account": {
"va_number": "2245246874750723",
"amount": 250000,
"currency": "IDR",
"customer_name": "Azhari Subroto",
"customer_email": "subroto.azhari@gmail.com",
"channel_pembayaran": "Virtual Account",
"bank": "BANK MUAMALAT",
"expired_at": "2026-12-1210:22:00"
}
}
Response Example (Failed)
{
"success": false,
"status": 422,
"code": "INVALID_ID_KONEKSI",
"message": "id_koneksi tidak valid"
}