Generate QR API
Method: POST
Path: https://amazonpay.amazon.in/v2/pay/token
Description: This API will be used by merchants to request for QR code for a particular transaction at Amazon Pay end.In return, merchants will receive “200 OK” status code with UPI QR code in string and/or image format that needs to be further displayed over their Billing POS/EDC device.
Request Parameters
Parameter | Type | Description | Allowed values | Nullable |
---|---|---|---|---|
merchantId | String | Merchant ID provided by Amazon | - | No |
expiryTimeStamp | String | Timestamp by when QR has to expire, beyond this no payment will be go through | UTC Timestamp value in yyyy-mm-dd hh:mm:ss format. A min value of 60 secs and a max value of 600 secs is allowed. |
No |
amount | String | Floating point numeric with minimum value of 0.01 | - | No |
currency | String | Currency code of the transaction | 'INR' | No |
orderId | String | Unique identifier required to close loop the transaction | Max 35 characters - alphanumeric | No |
clientId | String | Dependent on the DQR generation use case | 04 | No |
qrMedium | String | This indicates source channel or creation point of the UPI string | Medium as specified by NPCI: 01 - PICK FROM GALLERY, 02 - APP, 03 – POS, 04 – PHYSICAL/Share Intent mode, 05 – ATM, 06 – WEB |
No |
distributionType | Set |
The way in which DQR UPI is requested | 1.'QR_STRING' (for String) 2.'QR_IMAGE' (for Base64 Image) 3.PAY_LINK(for SMS) |
No |
storeId | String | Merchant Store Id for which DQR needs to be generated. | Standard merchant storeId value | No |
storeIdType | String | Type of storeId being passed | AMAZON_STORE_ID, MERCHANT_STORE_ID, PARTNER_STORE_ID | No |
terminalId | String | TerminalId on which the VPA is associated (For DQR generation) | Standard AmazonPay TerminalID | If VPA is mapped against store, then terminalId is optional. However, if VPA is mapped against a terminal under a store, terminalId is mandatory. |
Sample Request
{
"merchantId" : "AMZONMID0Z",
"storeIdType" : "MERCHANT_STORE_ID",
"storeId": "test01",
"terminalId":"12341234",
"currency": "INR",
"clientId": "01",
"distributionType": ["QR_STRING"],
"expiryTimestamp": "2024-08-08 12:00:00",
"amount": "100.00",
"orderId": "AMD00000000000000000000123456789123",
"qrMedium": "03"
}
Response Parameters
Parameter | Type | Description | Possible values |
---|---|---|---|
tokenId | String | This value is the same as TID, which will be generated at Amazon's end. This is the same as orderId passed in the QR generation request |
Max 35 Characters - alphanumeric |
qrPayload | QrPayload |
Determined by the distributionType passed in the request | - |
QrPayload
structure -
Parameter | Type | Description | Possible values |
---|---|---|---|
qrString | String | UPI QR String that can be converted to a QR Code to be displayed on POS device | - |
qrImage | String | Base64 image string of the UPI QR code | - |
Sample Response
-
Success – distributionType – QR_STRING
Http status: 200 OK
-
Success – distributionType – QR_IMAGE
Http status: 200 OK
-
Success – distributionType – QR_IMAGE, QR_STRING
Http status: 200 OK
- Error
Http status: 400 InvalidArguments
Common Errors
Status Code | Message | Description |
---|---|---|
200 | OK | Success |
400 | Missing parameter <> | A mandatory parameter is missing |
400 | Invalid Input Exception | A request is made with an unsupported parameter |
401 | Authn/Authz Failure | Request authentication/authorization failure |
404 | StoreId/TerminalId not found | Request made with an invalid terminalId or storeId |
409 | OrderID already exists | Duplicate QR generation request made for the same order |
500 | Internal Server Error | Amazon Pay server issue |