VietQR
Basic information
The customer scans the payment QR code with a supported banking app and authorizes the transfer.
- Integration path: Direct API
- Transaction type: One-time payment
lpmsInfo.lpmsType:VIET_QR
| Customer country/region | Order currency |
|---|---|
| 🇻🇳 VN | VND |
The customer country/region is the billingInformation.country value in the payment request.
This guide applies to enabled merchants and applications.
Before you begin
Complete Setup and confirm VietQR enablement, VND orders, transaction limits, payment expiry, and testing arrangements with Onerway. The customer needs a banking app that supports VietQR; see NAPAS VietQR for the service description.
Prepare actual customer and product information according to the Direct API requirements, including the customer’s email, billing country VN, and required shipping details. Submit billingInformation, shippingInformation, lpmsInfo, and txnOrderMsg as JSON strings. Configure notification and return URLs, and map your order to the Onerway payment identifiers. Follow Currency and amount validation for VND amounts.
Create the payment and display the QR code
- On your server, call Create Direct Transaction with
productType=LPMS,subProductType=DIRECT,txnType=SALE,paymentMode=WEB, andorderCurrency=VND. SetlpmsType=VIET_QRinlpmsInfo. Include theApiKeyheader as described in Request authentication. - Select the request example “VietQR request (illustrative)”. Replace the order, customer, product, application, and notification details, follow the current field requirements, and send the
ApiKeyheader. The example illustrates the request structure; its amount is not a transaction limit. - Select the response example “VietQR response (illustrative)”. Store
paymentIdandtransactionId. Whenstatus=RandactionType=QrCode, select a supported entry fromcodeForm.codeDetails: forcodeValueType=QRCODEanddisplayType=TEXT, generate a QR code fromcodeValue; fordisplayType=IMAGE, display the image at the returnedcodeValueURL.codeFormis already a JSON object; do not parse it as a JSON string. The number and order of entries are not fixed. - When the response also includes
redirectUrl, you can send the customer to that Onerway-hosted QR display page. The action remainsQrCode. IfcodeForm.expireTimeis returned, use it to handle code expiry; do not assume a fixed lifetime.
The API Reference linked above contains the fields and examples. See Direct API integration for shared request authentication and response handling.
Customer actions and final result
The customer scans the QR code with a supported banking app, checks the recipient, amount, and VND currency, and authorizes the transfer. Plan how customers will access the QR code with the devices they use, and test that flow before launch. Your application does not collect banking passwords or verification codes.
Displaying a code, completing an action in the banking app, or returning to your website does not replace a server-confirmed payment result. Process the signature-verified Payment Result notification on your server. If it is missing or you need to check the result, call Query payments with the saved paymentId. Fulfil the order after confirming payment success. See Webhooks for verification, acknowledgement, idempotency, and query fallback.
If the customer cancels, leaves payment incomplete, or the code expires, check the existing payment before creating a replacement to avoid duplicate collection.
Refunds and disputes
Confirm your account’s refund capabilities, partial-refund support, request deadlines, and dispute process with Onerway. If refunds are enabled, follow Refunds and track the refund result separately.
Testing and go-live
Follow Sandbox testing using the environment and banking procedure agreed with Onerway.
- Create a VND order and check
VIET_QR, customer details, and theApiKeyheader. Verify the returned identifiers andQrCodeaction. - Test each code representation your application supports, the returned hosted display link, and expiry when provided. Scan the code, check the amount, and complete the agreed bank authorization.
- Retain the notification and acknowledgement for the same order, then query the payment and compare the results. Test incomplete payment, cancellation, expiry, duplicate notifications, and early returns.
- Before launch, confirm production enablement, VND amount rules, notification and return URLs, limits, and expiry. Test refunds separately if enabled.