Paytm Dynamic QR code helps enterprises accept contactless and error-free in-store payments from customers using Paytm app or any UPI app. The Static Paytm QR code, that can be seen across different merchants, is something that identifies the merchant. Unlike Dynamic QR Code, customers are needed to enter the amount while paying through Paytm/UPI app. Paytm Dynamic QR offers a solution where the merchant is in control of the amount paid through QR code.
A merchant can generate the dynamic QR code from their Billing POS/System for a specific order/bill and must pass the order-specific information such as Order ID, Order Amount, etc. while generating the code. The customer can scan this QR to make a payment and the merchant can check the transaction status with Paytm using the Order ID and accordingly close the order/bill.
Note: A Customer-Facing Display (CFD) is required for Billing POS integration. In case, you don’t have a CFD, please Get in Touch for the same.
The section describes the integration steps required to integrate Paytm's Dynamic QR code with billing POS to accept contactless payment from your customer using the Paytm app or any UPI app.
STEP 1: Get your authentication keys
Paytm Dynamic QR is only available to the select enterprise customers with high transaction volumes and established businesses.
Get in touch to request access to Paytm Dynamic QR code payment flow.
- MID: A unique merchant identifier issued by Paytm for your account.
- Merchant Key: A unique secret key used to secure encryption of every request. This needs to be kept on server-side and should not be shared with anyone.
Note: Never share your secret Merchant Key with anyone.
STEP 2: Create Dynamic QR Code
To create a dynamic QR code for an order, refer to the Create QR Code API.
Rendering QR Code Image
After you send a create QR code request, you need to render a QR code image. Paytm returns the QR Code Data/UPI QR Data in Create QR Code API that needs to be converted into the QR image. This QR image can be displayed on a customer-facing screen or printed on a bill for the user to scan and complete payment. There are open libraries available online which can be used to convert the QR Code ID/UPI QR Data string into the QR image.
You need to take care of the following points while generating and displaying/printing QR image:
- qrData param’s value should be used for generating QR
- The QR image must be displayed on white background
- The size of the UPI QR image must be at least 1.5"x1.5" for faster scan
- Leave a white space of 0.5" width around the QR image
STEP 3: Customer scans Dynamic QR code
When the QR code is generated for an specific order, the customer scans that QR code and pays using the Paytm/UPI app from their prefered payment method. The customer is notified about the payment status on their Paytm/UPI app after the successful completion of payment.
Note: Customers cannot change the order amount in their app on scanning the particular order QR code.
STEP 4: Confirm the Transaction Status
Once the payment is completed by a customer, the merchant can confirm the transaction status by using S2S Webhook or the Transaction Status API.
The merchant can get the transaction status using the following ways:
- Webhook - Paytm sends a server to server (S2S) response in a key value pair on the configured URL. The S2S response is sent only when the transaction has reached a terminal state (success/fail). To configure the URL, please connect with Paytm.
- Polling - Setup a polling process after regular intervals using the Transaction Status API. To get the best results out of a status query, you should check the status 8 times/minute by following the schedule given here.
Henceforth, there should be a check status tender on the POS to help the cashier check the transaction status if the payment has been completed post 1 minute of QR generation.
STEP 5: Manage Refunds
If you need to cancel or refund a successful transaction, send the Refund API request and ensure success using the Refund Status API.
REFID - It is necessary to send the REFID parameter as a unique ID in every refund request sent to Paytm. The refund request may fail due to insufficient funds in MPA (Merchant Payable Account) and for Failure refund status, the merchant can retry refunds. However, for Pending refund status, the merchant should not retry refunds.
Integration Checklist
Post completion of integration in your staging environment, it is mandatory to test the integration before moving into the live environment with production account details (received from Paytm team). Paytm will provide the test account credentials for testing the flow on our staging environment. You can view the staging transaction details in the “Test Data” mode on your dashboard. Below points should be taken care of during the integration of the flow:
- The transaction status should be verified through the Transaction Status API in the payment flow and should be used to code the bill/order.
- The order ID passed to Paytm should be unique for your MID across all POS IDs.
- The amount must not contain more than 2 decimal points, comma, or any special characters.
- POS ID parameter is mandatory for creating QR.
- Paytm Transaction ID must be recorded against your Order ID for reconciliation.
- Make sure Create QR, Refund & Transaction/Refund Status are implemented & tested for positive & negative scenarios.
- API timeouts should be configured as per your business needs & architecture (e.g. if you have multiple hops before the transaction reaches Paytm Servers, API timeouts should be higher).
- Integration should handle scenarios where the status of a transaction can not be captured due to intermittent issues. E.g. If debit has happened but the bill has been marked with Unknown status, then you can refund the transaction through Paytm Dashboard or Refund API.
- For any local errors implemented in POS, user-friendly messages should be displayed to the cashier.
- The error codes and logs should be maintained to help in debugging issues during integration and post making it live.
For any issues regarding Dynamic QR Code integration, please Get in touch.
Key attributes for Dynamic QR Code Integration
S.No. |
Attributes |
Description |
1 |
Order_ID |
A unique reference ID for a transaction passed in the transaction request. Order ID should be passed to check the actual status of the transaction.
Example: OREDRID98765. |
2 |
Transaction Amount |
Its an object and should contain the value of transaction i.e. amount and currency type.
Example: { "value" : "1303.00", "currency" : "INR" } |
3 |
POS_ID |
There should be a unique, alphanumeric values for each POS. The format of POS ID should be as: “Store ID_POS ID”.
Example: “S12_123” |
4 |
Paytm Transaction ID |
Its string length should capable of storing 64 digits. |
5 |
Transport Layer Security (TLS) 1.2 |
Paytm receives all the API requests with TLS 1.2 version. |