The Order VAs API is Production only: test directly on Live with a BIDV enterprise, Sacombank personal/household business, or Vietcombank enterprise/household business account linked to your SePay company.
Create unique VA numbers per order. Customers transfer to the VA, SePay auto-matches and sends a webhook.
Supported Banks
| BIDV | Sacombank | Vietcombank | |
|---|---|---|---|
| Account type | Enterprise | Personal / Household | Enterprise / Household |
VA prefix (va_prefix) | Not needed | Required | Not needed |
Terminal ID (tid) | Not needed | Not needed | Required |
Amount (amount) | Optional | Required | Required |
order_code max | 50 chars | 50 chars | 15 chars |
| Partial payment | Yes | No (exact amount only) | No (exact amount only) |
Sacombank and Vietcombank do not support partial payment. Orders only transition from Pending to Paid or Cancelled.
Every Vietcombank order must be tied to a specific terminal via the tid parameter. If you don't have a terminal yet, see how to add a terminal for a Vietcombank enterprise/household business account. Call List Terminals to fetch a valid tid before creating an order. tid must be the raw Vietcombank-issued Terminal ID (e.g. 20933557), not the SePay xid UUID.
Statuses
Endpoints
https://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/ordershttps://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/ordershttps://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/orders/{order_xid}https://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/orders/{order_xid}https://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/orders/{order_xid}/vahttps://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/orders/{order_xid}/va/{va_number}https://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/prefixeshttps://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/prefixes/{va_prefix}https://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/terminalsPayment Flow via VA
Integration Steps
Prerequisites
- Create an API Token
- A bank account linked on SePay:
- BIDV: enterprise account
- Sacombank: personal or business account, merchant activated
- Vietcombank: enterprise or household business account with at least one terminal (see how to add a terminal, or fetch the list via List Terminals)
- Get the account UUID from Bank Accounts API
Fetch VA Prefixes (Sacombank) or Terminals (Vietcombank)
Create Order
curl -X POST "https://userapi.sepay.vn/v2/bank-accounts/{ba_uuid}/orders" \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_TOKEN" \-d '{"amount": 500000, "order_code": "DH20250001", "with_qrcode": "1"}'
{"status": "success","message": "Order created successfully","data": {"id": "b2c3d4e5-f6a7-8901-bcde-f12345678902","order_code": "DH20250001","va_number": "963NQDORD1234567890AB","va_holder_name": "CONG TY CP TECH VINA","amount": 500000,"status": "Pending","bank_name": "BIDV","account_holder_name": "CONG TY CP TECH VINA","account_number": "1234567890","expired_at": null,"qr_code": "data:image/png;base64,...","qr_code_url": "https://qr.sepay.vn/img?acc=963NQDORD1234567890AB&bank=BIDV&amount=500000&template=compact"}}
Display to Customer
From the response, show the customer:
- Account number:
va_number(VA number to transfer to) - Amount:
amount - QR code:
qr_codeorqr_code_url - Expiry:
expired_at(if set)
Receive Payment Notification
When the customer transfers successfully, SePay sends a webhook to your configured URL. The transaction will contain a code field matching the order's order_code.
See webhook configuration for details.
Check Order Status
curl -X GET "https://userapi.sepay.vn/v2/bank-accounts/{ba_uuid}/orders/{order_uuid}" \-H "Authorization: Bearer YOUR_API_TOKEN"
Order statuses:
Pending: awaiting paymentPaid: fully paidPartially: partially paid (BIDV only)Cancelled: cancelled
Key Parameters
| Parameter | Required | Description |
|---|---|---|
va_prefix | Yes (Sacombank) | VA prefix. Not used for BIDV or Vietcombank. |
tid | Yes (Vietcombank) | Raw Vietcombank-issued Terminal ID. Not used for BIDV or Sacombank. |
order_code | No | Order code (6-50 chars, Vietcombank max 15). Auto-generated if omitted. |
amount | Yes (Sacombank, Vietcombank) | Amount (VND). Only BIDV allows it to be optional. |
Multiple Payments (BIDV only)
BIDV supports adding VAs to orders in Pending or Partially status. When the cumulative paid amount reaches the order's amount, the order becomes Paid; in between it stays in Partially. Sacombank and Vietcombank do not support Partially: their orders move directly from Pending to Paid on payment.
Cancel Order or VA
Only Pending orders and Unpaid VAs can be cancelled. Response: 204 No Content.