Handy Tips
Create a QR Code API
Given below is the sample code for Create a QR Code API. Pass theaccount_id of the sub-merchant using X-Razorpay-Account in the header. Refer to the QR Codes API documentation.
payments/qr_codes
Curl
Request Parameters
type mandatory
: string The type of QR code. Possible values:
upi_qr: Create a QR code that accepts only UPI payments.bharat_qr: Create a QR code that accepts UPI and card payments. This is an on-demand feature. Know more about Bharat QR.
name optional
: string Label entered to identify the QR code. For example, Store Front Display.
usage mandatory
: string Indicates if the QR code should be allowed to accept single payment or multiple payments. Possible values:
single_use: QR code will accept only one payment and then close automatically.multiple_use(default): QR code will accept multiple payments.
fixed_amount optional
: boolean Indicates if the QR should accept payments of specific amounts or any amount. Possible values:
true: QR code accepts only a specific amount.false(default): QR code will accept any amount.
payment_amountmandatory if fixed_amount=true
: integer The amount allowed for a transaction. If this is specified, then any transaction of amount less than or more than this value will not be allowed. For example, if this amount is set as 500000, the customer cannot pay an amount less than or more than ₹5000.
description optional
: string A brief description about the QR code.
notes optional
: object Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty".
customer_id optional
: string Unique identifier of the customer the QR code is linked with. Know more about the Customers API.
close_by optional
: integer UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 2 minutes after the current time. The date range can be set to 2147483647 in UNIX timestamp format (equivalent to Tuesday, January 19, 2038 8:44:07 AM GMT+05:30).
Response Parameters
Descriptions for the response parameters are present in the QR Codes Entity parameters table.Error Response Parameters
Error codes and descriptions are present in the Error Response Parameters table.Fetch all QR Codes API
Given below is the sample code for Fetch all QR Codes API. Pass theaccount_id of the sub-merchant using X-Razorpay-Account in the header.
payments/qr_codes
Curl