EMV Payment QR (PromptPay, KHQR, PayNow…) API
Decode any EMVCo merchant QR (VietQR, PromptPay, KHQR, Lao QR, QRIS, DuitNow, PayNow, QR Ph, Pix) with CRC check, or create PromptPay, PayNow, KHQR.
action=decode with a payload (the text inside the QR; decode an image first with /v1/qr-decode) splits the EMVCo merchant-presented TLV tree, checks the CRC-16 of field 63 and the mandatory fields, and detects the scheme from the identifier in fields 26–51: VietQR / NAPAS 247, PromptPay (Thailand), KHQR / Bakong (Cambodia), Lao QR (LAPNet), QRIS (Indonesia), DuitNow (Malaysia), PayNow / SGQR (Singapore), QR Ph, FPS (Hong Kong), Pix and UPI. It returns the merchant name and city, category code, amount, currency (ISO 4217), tip / fee settings, additional data (bill number, reference, terminal…), the language template and scheme details such as the PromptPay proxy, the PayNow UEN or the Bakong account. payable_from_vietnam says whether Vietnamese bank apps can pay the code through the NAPAS cross-border QR links (Thailand, Cambodia, Laos, China).
action=create builds a payload with the right CRC: scheme=promptpay (proxy = Thai mobile, 13-digit ID or e-wallet ID), paynow (mobile or UEN, editable, expiry), khqr (bakong_account_id, merchant_name, KHR or USD, creation / expiry timestamps), vietqr (bank, account) or generic with any tags in fields. Add amount, merchant_name, merchant_city, bill_number, reference… Add format=png, svg or json_image to get the QR image from the qr engine (size, colour, margin parameters).
Scheme identifiers come from the central bank / scheme documents; Lao QR and QR Ph are detected from observed codes (marked confidence: observed). action=schemes lists them.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
action | body|query | string | no | decode (default when payload is given), create or schemes. Also as a path: /v1/emv-qr/decode. | |
payload | body|query | string | no | EMVCo QR text to decode (also accepts upi:// links). | |
scheme | body|query | string | no | For create: promptpay, paynow, khqr, vietqr or generic. | |
proxy | body|query | string | no | PromptPay mobile / ID / e-wallet ID, PayNow mobile or UEN. | |
bakong_account_id | body|query | string | no | KHQR Bakong account, e.g. john_smith@aclb. | |
bank | body|query | string | no | VietQR: bank code, name or BIN (with account). | |
amount | body|query | number | no | Amount (makes a dynamic QR). | |
currency | body|query | string | no | KHQR only: KHR (default) or USD. | |
merchant_name | body|query | string | no | Merchant name (ASCII, max 25). | |
merchant_city | body|query | string | no | Merchant city (max 15). | |
bill_number | body|query | string | no | Additional data: bill number; also reference, store_label, terminal_label, mobile_number, purpose. | |
fields | body | object | no | Generic create: EMV tags, templates as nested objects, e.g. {"26": {"00": "SG.PAYNOW", …}, "52": "0000"}. | |
format | body|query | string | no | Create: png, svg or json_image to also render the QR (default JSON payload only). |
Example
curl -X POST "https://apibox.io.vn/v1/emv-qr" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"decode","payload":"00020101021229370016A0000006770101110113006681234567853037645402505802TH5913Coffee Corner6007Bangkok63040854"}'const res = await fetch('https://apibox.io.vn/v1/emv-qr', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"action": "decode",
"payload": "00020101021229370016A0000006770101110113006681234567853037645402505802TH5913Coffee Corner6007Bangkok63040854"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/emv-qr",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"action": "decode", "payload": "00020101021229370016A0000006770101110113006681234567853037645402505802TH5913Coffee Corner6007Bangkok63040854"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/emv-qr');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"action":"decode","payload":"00020101021229370016A0000006770101110113006681234567853037645402505802TH5913Coffee Corner6007Bangkok63040854"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"format": "emv_mpm",
"valid": true,
"emv_complete": false,
"crc": {
"present": true,
"value": "0854",
"expected": "0854",
"valid": true
},
"payload_format_indicator": "01",
"initiation": "dynamic",
"scheme": {
"id": "promptpay",
"name": "PromptPay / Thai QR Payment",
"country": "TH",
"operator": "NITMX / Bank of Thailand",
"confidence": "documented"
},
"merchant_accounts": [
{
"tag": "29",
"guid": "A000000677010111",
"scheme": {
"id": "promptpay",
"name": "PromptPay / Thai QR Payment",
"country": "TH",
"operator": "NITMX / Bank of Thailand",
"confidence": "documented"
},
"details": {
"type": "mobile",
"proxy": "0066812345678",
"mobile": "0812345678"
},
"sub": [
{
"id": "00",
"value": "A000000677010111"
},
{
"id": "01",
"value": "0066812345678"
}
]
}
],
"merchant": {
"name": "Coffee Corner",
"city": "Bangkok",
"country": "TH"
},
"amount": 50,
"currency": {
"numeric": "764",
"code": "THB"
},
"tip": null,
"additional_data": null,
"language_template": null,
"payable_from_vietnam": {
"domestic": false,
"napas_link": "Thailand (PromptPay) - live since 2024",
"note": "Payable from Vietnamese bank apps that joined the NAPAS cross-border QR programme; the amount is converted by your bank."
},
"warnings": [
"Mandatory field 52 (merchant_category_code) is missing"
],
"fields": [
{
"id": "00",
"name": "payload_format_indicator",
"length": 2,
"value": "01"
},
{
"id": "01",
"name": "point_of_initiation",
"length": 2,
"value": "12"
},
"…"
]
}
Use cases
- Check that a QR sticker at a shop really pays the expected merchant (anti-swap)
- Accept tourists’ PromptPay, KHQR and Lao QR codes in a Vietnamese POS or app
- Generate PromptPay or PayNow QR codes for invoices and receipts
- Debug CRC and field errors in QR codes produced by your own system
FAQ
Can it read a QR image?
This endpoint works on the payload text. Decode the image first with /v1/qr-decode, then send the text here.
Which foreign codes can Vietnamese banking apps pay?
Through NAPAS links: Thai PromptPay, Cambodian KHQR, Lao QR and UnionPay QR from China (with participating banks). The response flags this in payable_from_vietnam.
Is the payment executed?
No. The API only reads and builds QR payloads; nothing is sent to any bank.
Related APIs
JSON Validator
Check JSON syntax with exact line and column of errors, and validate data against a JSON Schema (draft 4, 7, 2019-09 or 2020-12).
{ }JSON Formatter
Pretty print JSON with 0-8 spaces or tabs, minify it, or sort object keys recursively. Syntax errors are reported with line and column.
CSVCSV to JSON
Convert CSV into an array of JSON objects using the header row, with delimiter auto-detection, number and boolean typing, and row-level errors.