API Reference

Razorpay APIs lets you create, fetch, fetch all payments made from BharatQR.


Learn how to create a BQR payment and perform other operations using Razorpay APIs. To understand the basic concepts of our API usage, refer our

We have a Postman collection to make the integration quicker and easier. You can try out our APIs on the Razorpay Postman Public Workspace.

Each BharatQR is mapped to a virtual account. In order to generate a BharatQR, a virtual account must be created with the appropriate receiver type. The receiver defines the method of payment collection. In the case of BharatQR, the receiver type is QR Code which allows you to accept payments made via UPI or Cards.

POST
/virtual_accounts
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/virtual_accounts \
-H "Content-Type: application/json" \
-d '{
"receivers": {
"types": [
"qr_code"
]
},
"description": "First Payment by BharatQR",
"customer_id": "cust_805c8oBQdBGPwS",
"notes": {
"reference_key": "reference_value"
}
}'

receivers

mandatory

array consisting of configured receivers types.

types

mandatory

array The receiver type. Here, it will be qr_code.

description

optional

string A brief description of the payment.

customer_id

optional

string Unique identifier of customer for whom BharatQR is being created. Refer

notes

optional

object consisting of key value pairs as notes. Refer

for more details.

amount_expected

optional

integer The maximum amount you expect to receive in this virtual account. Pass 69999 for ₹699.99.

id

string The unique identifier of the generated QR code. A sample id for a QR code will look like this: qr_4lsdkfldlteskf.

entity

string The name of the response entity. Here, it is qr_code.

reference

string A 14-digit reference number or a receipt for the payment. It will be the same as the value of id without the prefix qr_. A sample reference value will look like this: 4lsdkfldlteskf.

short_url

The URL of the QR code. A sample short URL looks like this http://rzp.io/l6MS. Clicking on the link will download the code. This will be useful for offline merchants.

status

The status of the payment. It can have two values, active and closed.

The following endpoint retrieves details of a specific payment.

GET
/virtual_accounts/:id
curl -u <YOUR_KEY>:<YOUR_KEY_SECRET> \
-X GET \
https://api.razorpay.com/v1/virtual_accounts/va_4xbQrmEoA5WJ0G

The following endpoint retrieves details of all the payments.

GET
/virtual_accounts
curl -u <YOUR_KEY>:<YOUR_SECRET> \
-X GET \
https://api.razorpay.com/v1/virtual_accounts

POST
/virtual_accounts/:id/close

id

mandatory

stringThe unique identifier of the virtual account that is to be closed.

curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/virtual_accounts/va_FaulaIlvXeGqfV/close\

Was this page helpful?