QR Codes


Razorpay QR Codes enables you to create QR Codes and share them with customers to accept digital payments.

Handy Tips
Before you begin integrating with the APIs for QR Codes, refer to the:

You can try out our APIs on the Razorpay Postman Public Workspace.

Run in Postman

QR Code EntityπŸ”—

The QR Code entity has the following fields:

id

string The unique identifier of the QR Code. For example, qr_HMsVL8HOpbMcjU

entity

string Indicates the type of entity. Here, it is qr_code.

created_at

integer Unix timestamp at which the QR Code is created.

name

string Label entered to identify the QR Code. For example, Store Front Display.

usage

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.
type

string The type of the 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. Know more about Bharat QR. Watch Out!
    This is an on-demand feature.
image_url

string The URL of the QR Code. For example, http://rzp.io/l6MS. Click the link to download the code.

payment_amount if fixed_amount=true

integer The amount allowed for a transaction. If this is specified, then any transaction of an amount less than or more than this value is not allowed. For example, if this amount is set as 500000, the customer cannot pay an amount less than or more than β‚Ή5000.

status

string Indicates the status of the QR Code. Possible values:

  • active: Indicates that the QR Code has been created and is ready to accept payments.
  • closed: Indicates that the QR Code has been closed.
description

string A brief description about the QR Code.

fixed_amount

boolean Indicates if the QR Code should accept payments of specific amounts or any amount. Possible values:

  • true: QR Code accepts only a specific amount.
  • false (default): QR code accepts any amount.
payments_amount_received

integer The total amount received on the QR Code. Only captured payments are considered.

payments_count_received

integer The total number of payments received on the QR Code. All captured payments are considered.

notes

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

string The unique identifier of the customer the QR Code is linked with. Know more about the Customers API.

close_by

integer Unix timestamp at which the QR Code is scheduled to be automatically closed. The time must be at least 15 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).

Watch Out
Any request beyond 2147483647 Unix timestamp will fail.

closed_at

integer Unix timestamp at which the QR Code is automatically closed.

close_reason

string The reason for the closure of the QR Code. Possible values:

  • on_demand: When you close the QR Code using the APIs or the Razorpay Dashboard.
  • paid: If the QR Code is created with the usage=single_payment parameter, the QR Code closes automatically once the customer makes the payment, with the reason marked as paid.
  • null: The QR Code has not been closed yet.

You can create and manage QR Codes using APIs or from the Razorpay Dashboard.

Create a QR CodeπŸ”—

The following endpoint creates a QR Code:

/payments/qr_codes

Handy Tips

  • You can share the short URL with customers to accept payments.
  • You can print and download it.
  • You can create QR Codes for single or multiple use and for specific or all customers.

Request ParametersπŸ”—

type mandatory

string The type of the 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. Know more about Bharat QR. Watch Out!
    This is an on-demand feature.
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 accepts any amount.
payment_amount _ mandatory if fixed_amount=true_

integer The amount allowed for a transaction. If this is specified, then any transaction of an amount less than or more than this value is not allowed. For example, if this amount is set as 500000, the customer cannot pay an amount less than or more than β‚Ή5000.

descriptionoptional

string A brief description about the QR Code.

customer_id optional

string The unique identifier of the customer the QR Code is linked with. Know more about to 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).

Watch Out
Any request beyond 2147483647 Unix timestamp will fail.

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”.

Response ParametersπŸ”—

Descriptions for the response parameters are present in the QR Codes Entity parameters table.

Close a QR CodeπŸ”—

The following endpoint closes a QR Code.

/payments/qr_codes/:qr_id/close

Path ParameterπŸ”—

id mandatory
string The unique identifier of the QR Code that is to be closed.

Response ParametersπŸ”—

Descriptions for the response parameters are present in the QR Codes Entity parameters table.

Fetch Multiple QR CodesπŸ”—

The following endpoint retrieves multiple QR Codes.

/payments/qr_codes?count=2

Query ParametersπŸ”—

from optional
integer Unix timestamp, in seconds, from when QR Codes are to be retrieved.
to optional
integer Unix timestamp, in seconds, till when QR Codes are to be retrieved.
count optional
integer Number of QR Codes to be retrieved.
  • Default value: 10
  • Maximum value: 100
  • This can be used for pagination, in combination with skip.
skip optional
integer Number of records to be skipped while fetching the QR Codes. This can be used for pagination, in combination with count.

Response ParametersπŸ”—

Descriptions for the response parameters are present in the QR Codes Entity parameters table.

Fetch a QR CodeπŸ”—

The following endpoint retrieves all the details of a QR Code.

/payments/qr_codes/:qr_id

Path ParameterπŸ”—

id mandatory
string The unique identifier of the QR Code whose details are to be fetched.

Response ParametersπŸ”—

Descriptions for the response parameters are present in the QR Codes Entity parameters table.

Fetch QR Codes for a Customer IDπŸ”—

The following endpoint fetches QR Codes for a specific Customer ID.

/payments/qr_codes?customer_id={customer_id}

Query ParameterπŸ”—

id mandatory
string The unique identifier of the customer. For example, cust_HKsR5se84c5LTO.

Response ParametersπŸ”—

Descriptions for the response parameters are present in the QR Codes Entity parameters table.

Fetch QR Codes for a Payment IDπŸ”—

The following endpoint fetches QR Codes for a specific Payment ID.

/payments/qr_codes?payment_id={payment_id}

Query ParameterπŸ”—

id mandatory
string The unique identifier of the payment.

Response ParametersπŸ”—

Descriptions for the response parameters are present in the QR Codes Entity parameters table.

Fetch Payments for a QR CodeπŸ”—

The following endpoint fetches payments made on a particular QR Code:

/payments/qr_codes/:qr_id/payments?count=2

Path ParameterπŸ”—

id mandatory
string The unique identifier of the QR Code whose payment details are to be fetched.

Query ParametersπŸ”—

from optional
integer Unix timestamp, in seconds, from when payments are to be retrieved.
to optional
integer Unix timestamp, in seconds, till when payments are to be fetched.
count optional
integer Number of payments to be fetched.
  • Default value: 10
  • Maximum value: 100
  • This can be used for pagination, in combination with skip.
skip
integer Number of records to be skipped while fetching the payments. This can be used for pagination, in combination with count.

Response ParametersπŸ”—

The response parameters are the same as those mentioned in the Fetch a Payment API. Descriptions for the response parameters are present in the Payments Entity parameters table.

Refund a PaymentπŸ”—

The following endpoint refunds a payment made on a QR Code:

/payments/:id/refund

Path ParameterπŸ”—

id mandatory
string The unique identifier of the payment to be refunded.

Request ParametersπŸ”—

amount optional
integer Amount to be refunded. If no value is passed, a full refund is issued.
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”.

Response ParametersπŸ”—

id
string Unique identifier of the refund.
entity
string Indicates the type of entity. Here, it is refund.
amount
integer The amount to be refunded (in the smallest unit of currency).
For example, refund in INR, a value of 100 means 100 paise (equivalent to β‚Ή1).
currency
string The currency of the amount for which refund is initiated.
payment_id
string Unique identifier of the payment for which the refund is initiated.
created_at
integer Unix timestamp when the refund was created.
batch_id
string This parameter is populated if the refund was created as part of a batch upload. For example, batch_00000000000001
notes
json object Key-value store for storing your reference data. A maximum of 15 key-value pairs can be included.
receipt
string A unique identifier provided by you for your internal reference.
acquirer_data
array A dynamic array consisting of a unique reference number (either RRN, ARN or UTR) that is provided by the banking partner when a refund is processed. This reference number can be used by the customer to track the status of the refund with the bank.
status
string Indicates the state of the refund. Possible values:
  • pending: This state indicates that Razorpay is attempting to process the refund.
  • processed: This is the final status of the refund, indicating that the refund is paid.
  • failed: A refund can attain the failed state in the following scenarios:
    • Normal refund is not possible for a payment which is more than 6 months old.
    • Instant Refund can sometimes fail because of customer's account or bank-related issues.
speed_requested
string The processing mode of the refund seen in the refund response.
This attribute is seen in the refund response only if the speed parameter is set in the refund request.
Possible values:
  • normal: Indicates that the refund will be processed via the normal speed. That is, the refund will take 5-7 working days. Know more about normal refunds.
  • optimum: Indicates that the refund will be processed at an optimal speed based on Razorpay's internal fund transfer logic. That is:
    • If the refund can be processed instantly, Razorpay will do so, irrespective of the payment method used to make the payment.
    • If an instant refund is not possible, Razorpay will initiate a refund that is processed at the normal speed. Know more about instant refunds.
speed_processed
string This is a parameter in the response which describes the mode used to process a refund.
This attribute is seen in the refund response only if the speed parameter is set in the refund request. Possible values:
  • instant: This means that the refund has been processed instantly via fund transfer.
  • normal: This means that the refund has been processed by the payment processing partner. That is, the refund takes 5-7 working days to be processed.

Know more about Refunds API to perform other refund-related operations.

  • Fetch a particular refund or a list of refunds for a payment ID.
  • Update a refund to modify the Notes field.

Response ParametersπŸ”—

The response parameters are the same as those mentioned in the Create a Normal Refund API. Descriptions for the response parameters are present in the Refunds Entity parameters table.

Γ—