Naafi Pay

Dynamic QR Codes

Dynamic QR codes provide a fast way to request a specific amount in person. Each QR encodes a checkout URL, the amount, and a unique reference, so a customer scans, pays through the business's selected method, and the related status can trigger a webhook. Unlike static QR codes printed on a poster, dynamic codes let you bind a payment to a specific order — no manual reconciliation, no customer typing the wrong amount, no guessing which order a payment belongs to.

Generate a QR code

Every checkout response includes a qr_url field that points to a PNG of the scannable code. You can display it on a kiosk, print it on a printed invoice, or send it over WhatsApp. The QR encodes the same checkout URL, so any device that scans it lands on the hosted checkout for that exact invoice.

Generate QR
1curl -X POST https://naafipay.com/api/public/v1/payments \
2 -H "Authorization: Bearer pg_live_xxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "full_name": "Walk-in customer",
6 "email": "kiosk@yourstore.com",
7 "amount": 250,
8 "currency": "BDT",
9 "metadata": { "kiosk_id": "K-04", "order_id": "ORD-7700" },
10 "success_url": "https://yourstore.com/kiosk/done",
11 "cancel_url": "https://yourstore.com/kiosk/cancel"
12 }'

The JSON response includes checkout_url, qr_url, and invoice_id. Render the qr_url image at no smaller than 200x200 pixels for reliable scanning on a phone camera.

TipIn-person POS pattern
Build a small kiosk web page that creates a checkout the moment the cashier rings up the order, then displays the QR. Subscribe to the payment.completed webhook to flip the page to a “Paid” state automatically — your cashier never touches a confirmation button.

QR expiry and one-time use

Each QR is single-use and expires 30 minutes after creation by default. You can extend the window up to 24 hours by passing expires_in_minutes in the checkout request. Once a QR is paid or expires, scanning it shows the customer a friendly “This invoice has already been paid or has expired” page rather than letting them double-pay.

Use cases

  • Retail point-of-sale: print a receipt with a QR tied to the payment record
  • Restaurant table billing: one QR per table, replaces handing the card machine around
  • Field sales and home delivery: courier shows QR on their phone, customer scans without touching the device
  • Event ticketing: kiosk prints ticket the moment payment is confirmed
WarningDo not print one QR and reuse it
Static QR codes (one QR for any amount, reused across customers) require manual amount entry by the customer and manual reconciliation by you. Always generate a fresh dynamic QR per transaction.
Updated at: May 30, 2026