Choose a bank
Use the six-digit bank BIN (e.g. MBBank: 970422), not a SWIFT code or short bank name.
Embed a bank transfer QR code using a single <img> tag. No JavaScript QR library or Base64 output required.
https://vietnam-bank.com/qr/v1/image.pngReplace the demo BIN and account with verified details. The BIN must exist in the Go service’s local supported directory.
Use the six-digit bank BIN (e.g. MBBank: 970422), not a SWIFT code or short bank name.
Only bank and account are required. Optionally provide amount, purpose and size as query parameters.
Put the URL in an img src attribute. The browser loads the PNG via CDN, Nginx and the Go QR Service.
The playground sends a request only when you click Generate image. The HTML, URL and curl snippets will update automatically.
These example details are for testing only. Do not send real money.
The image loads only after you click Generate image.
Generated URL
https://vietnam-bank.com/qr/v1/image.png?bank=970422&account=00123456789&amount=150000&purpose=TEST&size=320Use an img tag for websites, or curl to test the HTTP response. In HTML markup, write & as & within attributes.
No script tag or CORS is needed to display an image with img. Use URLSearchParams or encodeURIComponent when building queries from JavaScript.
The endpoint is GET /qr/v1/image.png. Unknown parameters and duplicate names are rejected.
| Parameter | Required | Example | Validation rules |
|---|---|---|---|
bank | Yes | 970422 | Exactly six digits; must exist in the Go Service’s local bank BIN registry. |
account | Yes | 00123456789 | 1–19 ASCII letters/digits without spaces; normalized to uppercase. |
amount | No | 150000 | Positive integer VND (1–13 digits). 1.234.567 grouping is accepted; commas and decimals are not. |
purpose | No | THANH TOAN DH123 | Up to 25 characters after accent removal and whitespace collapsing; non-ASCII-untranslatable characters are rejected. |
size | No | 320 | Integer from 128 to 1024; defaults to 320 if omitted. |
v1 has no account holder/name or QR logo parameter. An incorrect BIN may generate a PNG but still lead to an unusable payment code.
Success returns image/png; errors are JSON objects with error, message and sometimes field.
PNG response body with Content-Type: image/png. HEAD returns the same headers without a body.
Missing bank/account, invalid values, duplicate fields or unsupported bank BIN.
A route other than /image.png (or a public route that was not configured).
Only GET and HEAD are supported; others return Allow: GET, HEAD.
Payload exceeds capacity or the requested image is too small for the QR density.
Concurrency/queue limit reached; response may include Retry-After: 1.
The URI exceeds the service’s limit; shorten the query.
The server-side Go image API behaves differently from our browser-only JavaScript QR generator.
bank, account, amount and purpose are included in the URL and sent to the CDN/server. They may appear in shared URLs or third-party logs/analytics. Use the API only for details you intend to expose. Never include passwords, verification codes or sensitive information in purpose. The CDN must vary its cache key by the complete query string to prevent mismatched QR images. The Go origin and Nginx do not cache images.
A QR image does not verify account ownership or confirm a completed transfer. Check the recipient and amount in your banking app before paying.
No. An img tag and a valid URL are enough to display the PNG. This API version does not require an API key.
No for standard img rendering. CORS can matter if you read image pixels through canvas or call fetch from a different domain.
The BIN must also exist in the Go Service’s local registry. Verify the bank and its VietQR receiving capability before publishing.
Yes. Only bank and account are required; without amount, the QR does not fix the transfer amount.
Yes. The image API runs on the server for use in img tags; the existing JavaScript generator runs in the browser and is a better choice when account/amount data must stay on-device.
Use the JavaScript VietQR generator instead; it does not submit your account or amount to our QR Image API.