Dynamic TANQR
The Dynamic TANQR API enables merchants to generate a unique QR code for every payment transaction. Customers can scan the QR code using any participating banking or mobile banking application that supports the Tanzania National QR (TANQR) standard. Unlike Static QR codes, Dynamic QR codes are generated per transaction and include the payment amount and transaction reference.Dynamic QR Payments
Generate a unique QR code for every payment and receive real-time payment notifications through webhooks.
Endpoint
Base URL
- Sandbox
- Production
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| reference | string | Yes | Unique merchant reference |
| buyer_name | string | Yes | Customer full name |
| buyer_email | string | Yes | Customer email address |
| buyer_phone | string | Yes | Customer phone number |
| amount | number | Yes | Payment amount |
| currency | string | Yes | Currency (TZS) |
| billing_firstname | string | Yes | Billing first name |
| billing_lastname | string | Yes | Billing last name |
| billing_address | string | Yes | Billing address |
| billing_city | string | Yes | Billing city |
| billing_state | string | Yes | Billing state |
| billing_postcode | string | Yes | Billing postcode |
| billing_country | string | Yes | ISO Country Code |
| billing_phone | string | Yes | Billing phone number |
Example Request
Successful Response
QR Code
Theqr field contains the generated QR code as a Base64-encoded PNG image.
To display the QR code in a web browser, prepend the following prefix:
Payment Status
| Status | Description |
|---|---|
| pending | Waiting for customer to scan and pay |
| processing | Payment is being processed |
| success | Payment completed successfully |
| failed | Payment failed |
| cancelled | Payment cancelled |
| expired | QR code expired before payment |
Webhook Payload
Error Responses
Invalid Request
Authentication Failed
Duplicate Request
Best Practices
Display the QR immediately
Render the Base64 image returned in the
qr field to allow the customer to scan and pay.Verify Payment Status
If a webhook is delayed, retrieve the latest transaction status using the Payment Status endpoint.
Next Steps
Payment Status
Retrieve the latest status of a QR payment.
Webhooks
Receive real-time payment notifications.
