VietQR Generator API
Create VietQR / NAPAS 247 bank transfer QR codes with bank, account, amount and transfer note as PNG, SVG or JSON payload. Decode existing VietQR codes.
The VietQR API builds the standard EMVCo / NAPAS payload that every Vietnamese banking app scans: pick the bank (bank=VCB, TCB, MB, a bank name or its 6-digit NAPAS BIN), the account number, an optional amount in VND and a transfer note. You get a PNG image by default, an SVG with format=svg, or with format=json the raw payload string, the bank details and both images in one response. Size, colours, margin and error correction work like the QR Code API.
The payload is a dynamic QR (01=12) when an amount is set and a static one otherwise. Field 63 carries the CRC-16/CCITT checksum required by the specification. Vietnamese accents in the note are converted to plain ASCII (banks do not carry them reliably) and the original text is returned so you can see the change; keep notes under 25 characters, as some banks cut the rest.
GET /v1/vietqr/banks returns the supported banks and e-wallets with their codes and BINs. action=decode&payload=… parses an existing VietQR string: bank, account, amount, note and whether the checksum is valid – handy to check what a printed code really contains.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
bank | body|query | string | yes | Bank code (VCB, ICB, BIDV, MB, TCB…), name (Vietcombank) or 6-digit NAPAS BIN. See /v1/vietqr/banks. | |
account | body|query | string | yes | Account number (or card number with service=card), up to 19 letters/digits. | |
amount | body|query | number | no | Amount in VND (whole number). Makes the QR dynamic. | |
content | body|query | string | no | Transfer note, max 50 characters (accents removed). Aliases: message, description. | |
service | body|query | string | no | account | account (QRIBFTTA) or card (QRIBFTTC). |
account_name | body|query | string | no | Account holder, only echoed in JSON output (not part of the QR). | |
format | body|query | string | no | png | png, svg or json. |
size | body|query | number | no | 300 | Image size in pixels (64–2000). color, background, margin, ecc work as in /v1/qr. |
action | body|query | string | no | decode to parse the VietQR string given in payload. |
Example
curl "https://apibox.io.vn/v1/vietqr?bank=VCB&account=0123456789&amount=150000&content=Thanh%20toan%20don%20ABX1234&format=json" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/vietqr?bank=VCB&account=0123456789&amount=150000&content=Thanh%20toan%20don%20ABX1234&format=json', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/vietqr?bank=VCB&account=0123456789&amount=150000&content=Thanh%20toan%20don%20ABX1234&format=json",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vietqr?bank=VCB&account=0123456789&amount=150000&content=Thanh%20toan%20don%20ABX1234&format=json');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"bank": {
"code": "VCB",
"bin": "970436",
"short_name": "Vietcombank",
"name": "Ngân hàng TMCP Ngoại thương Việt Nam"
},
"account": "0123456789",
"account_name": null,
"service": "account",
"amount": 150000,
"currency": "VND",
"content": "Thanh toan don ABX1234",
"data": "00020101021238540010A00000072701240006970436011001234567890208QRIBFTTA530370454061500005802VN62260822Thanh toan don ABX12346304FFCC",
"version": 5,
"modules": 37,
"ecc": "M",
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 45\" …</svg>",
"png_base64": "data:image/png;base64,iVBORw0KGgo…"
}
Use cases
- Show a payment QR with the exact amount and order code on checkout pages and invoices
- Match incoming transfers automatically by putting the order number in the note
- Print donation or shop QR codes for a bank account
- Verify the content of a VietQR code before publishing it
FAQ
Does this move money or need a bank contract?
No. The API only builds the QR code that the payer’s banking app reads. The transfer itself happens between the banks through NAPAS 247; to be notified of incoming payments you need your bank’s API or a service such as SePay or Casso.
Which banks are supported?
All banks of the NAPAS 247 network. /v1/vietqr/banks lists about 50 banks and e-wallets with their codes; if a bank is missing you can pass its 6-digit BIN directly in bank.
Why was my Vietnamese transfer note changed?
Bank transfer notes are reliably carried as ASCII only, so accents are removed (“Thanh toán đơn” becomes “Thanh toan don”) and symbols are replaced by spaces. The response shows both the original and the encoded note.
Related APIs
QR Code Generator
Generate QR codes as PNG or SVG with one GET request: URLs, text, WiFi logins, vCards, e-mail, SMS, phone and geo links. Custom colours, size and ECC.
|||Barcode Generator
Create Code 128 barcodes for labels, SKUs and shipping with a single request. SVG with human-readable text or PNG, custom height, width and colours.
▭Placeholder Image
Get placeholder images of any size for mockups and tests: /v1/placeholder/600x400.png. SVG with custom text and colours, or a solid-colour PNG.