API Test keys

API Test keys

Create a UPI Payment Link

POST
/v1/payment_links

Click to copy

Use this endpoint to create a UPI Payment Link using basic details such as amount, expiry date, reference id, description, customer details and so on.

  • Basic Payment Links These are regular Payment Links, which are not customised.

  • Customised Payment Links You can

    as per your business requirements.

Handy Tips

As per Razorpay's updated security policy, even if the customer's email address and phone number are provided while creating the Payment Link, these details are not auto-populated on the Checkout section of the Payment Link hosted page. The customer will have to enter these details manually while making the payment.

  • After successful completion of the payment, customers can be redirected to a specific URL using the callback_url and callback_method parameters. Know more about how to use

    .

  • Verify the razorpay_signature parameter to validate that it is authentic and sent from Razorpay servers. Know more about how to

    .

Is this page helpful?

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
2
-X POST https://api.razorpay.com/v1/payment_links/ \
3
-H 'Content-type: application/json' \
4
-d '{
5
"upi_link": "true",
6
"amount": 1000,
7
"currency": "INR",
8
"accept_partial": false,
9
"first_min_partial_amount": 100,
10
"expire_by": 1691097057,
11
"reference_id": "TS1989",
12
"description": "Payment for policy no #23456",
13
"customer": {
14
"name": "Gaurav Kumar",
15
"contact": "+919000090000",
16
"email": "gaurav.kumar@example.com"
17
},
18
"notify": {
19
"sms": true,
20
"email": true
21
},
22
"reminder_enable": true,
23
"notes": {
24
"policy_name": "Jeevan Bima"
25
},
26
"callback_url": "https://example-callback-url.com/",
27
"callback_method": "get"
28
}'

Success

Failure

1
{
2
"accept_partial": false,
3
"amount": 1000,
4
"amount_paid": 0,
5
"cancelled_at": 0,
6
"created_at": 1584524459,
7
"currency": "INR",
8
"customer": {
9
"contact": "9912650835",
10
"email": "gaurav.kumar@razorpay.com",
11
"name": "Gaurav Kumar"
12
},
13
"description": "Payment for policy no #23456",
14
"expire_by": 0,
15
"expired_at": 0,
16
"first_min_partial_amount": 0,
17
"id": "plink_ETbyWrRHW2oXVt",
18
"upi_link": "true",
19
"notes": {
20
"policy_name": "Jeevan Bima"
21
},
22
"payments": null,
23
"reference_id": "#456",
24
"reminder_enable": true,
25
"reminders": [],
26
"short_url": "https://rzp.io/i/AiGGmnh",
27
"status": "created",
28
"updated_at": null,
29
"user_id": "API"
30
}
Request Parameters
amount

*

integer

Amount to be paid using the Payment Link. Must be in the smallest unit of the currency. For example, if you want to receive a payment of ₹300.00, you must enter the value 30000.

currency
string

A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. Refer to the list of

.

accept_partial
boolean

Indicates whether customers can make

using the Payment Link. Possible values:
  • true: Customer can make partial payments.
  • false: (default): Customer cannot make partial payments.

first_min_partial_amount
integer

Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. Default value is 100. Default currency is INR. For example, if an amount of ₹700.00 is to be received from the customer in two installments of #1 - ₹500.00, #2 - ₹200.00, then you can set this value as 500000. Must be passed along with accept_partial parameter.

upi_link
boolean

Must be set to true for creating UPI Payment Link. If the upi_link parameter is not passed or passed with value as false, a Standard Payment Link will be created.

description
string

A brief description of the Payment Link. The maximum character limit supported is 2048.

reference_id
string

Reference number tagged to a Payment Link. Must be a unique number for each Payment Link. The maximum character limit supported is 40.

customer
string

Customer details

Show child parameters (3)

expire_by
integer

Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. Please note that the expire by date cannot exceed more than six months from the date of creation.

notify
array

Defines who handles Payment Link notification.

Show child parameters (2)

notes
json object

Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Payment Link for Groceries.”.

callback_url
string

If specified, adds a redirect URL to the Payment Link. Once customers completes the payment, they are redirected to the specified URL.

Handy Tips
If the callback_url is passed, it should be passed in the correct format. That is, it should contain a URL.

callback_method
string

If callback_url parameter is passed, callback_method must be passed with the value get.

reminder_enable
boolean

Used to send

for the Payment Link. Possible values:
  • true: To send reminders.
  • false: To disable reminders.

Response Parameters
accept_partial
boolean

Indicates whether customers can make

using the Payment Link. Possible values:
  • true: Customer can make partial payments.
  • false: (default): Customer cannot make partial payments.

amount
integer

Amount to be paid using the Payment Link. Must be in the smallest unit of the currency. For example, if you want to receive a payment of ₹300.00, you must enter the value 30000.

amount_paid
integer

Amount paid by the customer.

callback_url
string

If specified, adds a redirect URL to the Payment Link. Once the customer completes the payment, they are redirected to the specified URL.

callback_method
string

If callback_url parameter is passed, callback_method must be passed with the value get.

cancelled_at
integer

Timestamp, in Unix, at which the Payment Link was cancelled by you.

created_at
integer

Timestamp, in Unix, indicating when the Payment Link was created.

currency
string

Defaults to INR. We accept payments in

customer
string

Customer details.

Show child parameters (3)

description
string

A brief description of the Payment Link.

expire_by
integer

Timestamp, in Unix, when the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. Please note that the expire by date cannot exceed more than six months from the date of creation.

expired_at
integer

Timestamp, in Unix, at which the Payment Link expired.

first_min_partial_amount
integer

Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of ₹700.00 is to be received from the customer in two installments of #1 - ₹500.00, #2 - ₹200.00, then you can set this value as 500000.

id
string

Unique identifier of the Payment Link. For example, plink_ERgihyaAAC0VNW.

upi_link
boolean

Indicates whether the Payment Link is a UPI Payment Link.

  • true: A UPI Payment Link has been created.
  • false: It is a Standard Payment Link.

notes
object

Set of key-value pairs that you can use to store additional information. You (Businesses) can enter a maximum of 15 key-value pairs, with each value having a maximum limit of 256 characters.

notify
array

Defines who handles Payment Link notification.

Show child parameters (2)

payments
array

Payment details such as amount, payment id, Payment Link id and more. This array is populated only after a payment is made by the customer or if the payment fails. Until then, the value is null.

Show child parameters (7)

reference_id
string

Reference number tagged to a Payment Link. Must be a unique number for each Payment Link. The maximum character limit supported is 40.

short_url
string

The unique short URL generated for the Payment Link.

status
string

Displays the current state of the Payment Link. Possible values:

  • created
  • partially_paid
  • expired
  • cancelled
  • paid

updated_at
integer

Timestamp, in Unix, indicating when the Payment Link was updated.

reminder_enable
boolean

Used to send

for the Payment Link. Possible values:
  • true: To send reminders.
  • false: To disable reminders.

user_id
string

A unique identifier for the user role through which the Payment Link was created. For example, HD1JAKCCPGDfRx.

Errors

The {input field} is required

Error Status: 4xx

A mandatory field is empty.

Solution

wrong input fields sent.

Error Status: 400

When wrong input fields are sent during Payment Link creation.

Solution

payment link creation with reference ID already attempted

Error Status: 400

An existing reference id has been passed.

Solution

UPI Payment Links is not supported in Test Mode. Please experience the product in Live Mode.

Error Status: 400

The UPI link parameter has been passed with the Test API keys.

Solution

upi is currently supported only in indian currency

Error Status: 400

Occurs when you try to create a UPI Payment Link using an international currency.

Solution

partial payment not supported in upi link

Error Status: 400

Occurs when you try to create a UPI Payment Link with partial payments enabled.

Solution

timestamp must be atleast 15 minutes in future

Error Status: 400

The epoch time passed is less than 15 minutes from the current time.

Solution

Invalid access: Cannot create a payment link in live mode, as live mode is disabled for merchant.

Error Status: 400

Occurs when you try to create a Payment Link in Live mode, but live mode is disabled for you

Solution

Invalid access: Cannot create a payment link, as Merchant is Suspended.

Error Status: 400

Occurs when you try to create a Payment Link when you have been been suspended.

Solution

value: the length must not be greater than 255.

Error Status: 400

When the notes length is greater than 255 characters during Payment Link creation.

Solution

Create a UPI Payment Link

POST
/v1/payment_links

Click to copy

Use this endpoint to create a UPI Payment Link using basic details such as amount, expiry date, reference id, description, customer details and so on.

  • Basic Payment Links These are regular Payment Links, which are not customised.

  • Customised Payment Links You can

    as per your business requirements.

Handy Tips

As per Razorpay's updated security policy, even if the customer's email address and phone number are provided while creating the Payment Link, these details are not auto-populated on the Checkout section of the Payment Link hosted page. The customer will have to enter these details manually while making the payment.

  • After successful completion of the payment, customers can be redirected to a specific URL using the callback_url and callback_method parameters. Know more about how to use

    .

  • Verify the razorpay_signature parameter to validate that it is authentic and sent from Razorpay servers. Know more about how to

    .

Is this page helpful?

Request Parameters
amount

*

integer

Amount to be paid using the Payment Link. Must be in the smallest unit of the currency. For example, if you want to receive a payment of ₹300.00, you must enter the value 30000.

currency
string

A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. Refer to the list of

.

accept_partial
boolean

Indicates whether customers can make

using the Payment Link. Possible values:
  • true: Customer can make partial payments.
  • false: (default): Customer cannot make partial payments.

first_min_partial_amount
integer

Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. Default value is 100. Default currency is INR. For example, if an amount of ₹700.00 is to be received from the customer in two installments of #1 - ₹500.00, #2 - ₹200.00, then you can set this value as 500000. Must be passed along with accept_partial parameter.

upi_link
boolean

Must be set to true for creating UPI Payment Link. If the upi_link parameter is not passed or passed with value as false, a Standard Payment Link will be created.

description
string

A brief description of the Payment Link. The maximum character limit supported is 2048.

reference_id
string

Reference number tagged to a Payment Link. Must be a unique number for each Payment Link. The maximum character limit supported is 40.

customer
string

Customer details

Show child parameters (3)

expire_by
integer

Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. Please note that the expire by date cannot exceed more than six months from the date of creation.

notify
array

Defines who handles Payment Link notification.

Show child parameters (2)

notes
json object

Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Payment Link for Groceries.”.

callback_url
string

If specified, adds a redirect URL to the Payment Link. Once customers completes the payment, they are redirected to the specified URL.

Handy Tips
If the callback_url is passed, it should be passed in the correct format. That is, it should contain a URL.

callback_method
string

If callback_url parameter is passed, callback_method must be passed with the value get.

reminder_enable
boolean

Used to send

for the Payment Link. Possible values:
  • true: To send reminders.
  • false: To disable reminders.

Response Parameters
accept_partial
boolean

Indicates whether customers can make

using the Payment Link. Possible values:
  • true: Customer can make partial payments.
  • false: (default): Customer cannot make partial payments.

amount
integer

Amount to be paid using the Payment Link. Must be in the smallest unit of the currency. For example, if you want to receive a payment of ₹300.00, you must enter the value 30000.

amount_paid
integer

Amount paid by the customer.

callback_url
string

If specified, adds a redirect URL to the Payment Link. Once the customer completes the payment, they are redirected to the specified URL.

callback_method
string

If callback_url parameter is passed, callback_method must be passed with the value get.

cancelled_at
integer

Timestamp, in Unix, at which the Payment Link was cancelled by you.

created_at
integer

Timestamp, in Unix, indicating when the Payment Link was created.

currency
string

Defaults to INR. We accept payments in

customer
string

Customer details.

Show child parameters (3)

description
string

A brief description of the Payment Link.

expire_by
integer

Timestamp, in Unix, when the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. Please note that the expire by date cannot exceed more than six months from the date of creation.

expired_at
integer

Timestamp, in Unix, at which the Payment Link expired.

first_min_partial_amount
integer

Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of ₹700.00 is to be received from the customer in two installments of #1 - ₹500.00, #2 - ₹200.00, then you can set this value as 500000.

id
string

Unique identifier of the Payment Link. For example, plink_ERgihyaAAC0VNW.

upi_link
boolean

Indicates whether the Payment Link is a UPI Payment Link.

  • true: A UPI Payment Link has been created.
  • false: It is a Standard Payment Link.

notes
object

Set of key-value pairs that you can use to store additional information. You (Businesses) can enter a maximum of 15 key-value pairs, with each value having a maximum limit of 256 characters.

notify
array

Defines who handles Payment Link notification.

Show child parameters (2)

payments
array

Payment details such as amount, payment id, Payment Link id and more. This array is populated only after a payment is made by the customer or if the payment fails. Until then, the value is null.

Show child parameters (7)

reference_id
string

Reference number tagged to a Payment Link. Must be a unique number for each Payment Link. The maximum character limit supported is 40.

short_url
string

The unique short URL generated for the Payment Link.

status
string

Displays the current state of the Payment Link. Possible values:

  • created
  • partially_paid
  • expired
  • cancelled
  • paid

updated_at
integer

Timestamp, in Unix, indicating when the Payment Link was updated.

reminder_enable
boolean

Used to send

for the Payment Link. Possible values:
  • true: To send reminders.
  • false: To disable reminders.

user_id
string

A unique identifier for the user role through which the Payment Link was created. For example, HD1JAKCCPGDfRx.

Errors

The {input field} is required

Error Status: 4xx

A mandatory field is empty.

Solution

wrong input fields sent.

Error Status: 400

When wrong input fields are sent during Payment Link creation.

Solution

payment link creation with reference ID already attempted

Error Status: 400

An existing reference id has been passed.

Solution

UPI Payment Links is not supported in Test Mode. Please experience the product in Live Mode.

Error Status: 400

The UPI link parameter has been passed with the Test API keys.

Solution

upi is currently supported only in indian currency

Error Status: 400

Occurs when you try to create a UPI Payment Link using an international currency.

Solution

partial payment not supported in upi link

Error Status: 400

Occurs when you try to create a UPI Payment Link with partial payments enabled.

Solution

timestamp must be atleast 15 minutes in future

Error Status: 400

The epoch time passed is less than 15 minutes from the current time.

Solution

Invalid access: Cannot create a payment link in live mode, as live mode is disabled for merchant.

Error Status: 400

Occurs when you try to create a Payment Link in Live mode, but live mode is disabled for you

Solution

Invalid access: Cannot create a payment link, as Merchant is Suspended.

Error Status: 400

Occurs when you try to create a Payment Link when you have been been suspended.

Solution

value: the length must not be greater than 255.

Error Status: 400

When the notes length is greater than 255 characters during Payment Link creation.

Solution

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
2
-X POST https://api.razorpay.com/v1/payment_links/ \
3
-H 'Content-type: application/json' \
4
-d '{
5
"upi_link": "true",
6
"amount": 1000,
7
"currency": "INR",
8
"accept_partial": false,
9
"first_min_partial_amount": 100,
10
"expire_by": 1691097057,
11
"reference_id": "TS1989",
12
"description": "Payment for policy no #23456",
13
"customer": {
14
"name": "Gaurav Kumar",
15
"contact": "+919000090000",
16
"email": "gaurav.kumar@example.com"
17
},
18
"notify": {
19
"sms": true,
20
"email": true
21
},
22
"reminder_enable": true,
23
"notes": {
24
"policy_name": "Jeevan Bima"
25
},
26
"callback_url": "https://example-callback-url.com/",
27
"callback_method": "get"
28
}'

Success

Failure

1
{
2
"accept_partial": false,
3
"amount": 1000,
4
"amount_paid": 0,
5
"cancelled_at": 0,
6
"created_at": 1584524459,
7
"currency": "INR",
8
"customer": {
9
"contact": "9912650835",
10
"email": "gaurav.kumar@razorpay.com",
11
"name": "Gaurav Kumar"
12
},
13
"description": "Payment for policy no #23456",
14
"expire_by": 0,
15
"expired_at": 0,
16
"first_min_partial_amount": 0,
17
"id": "plink_ETbyWrRHW2oXVt",
18
"upi_link": "true",
19
"notes": {
20
"policy_name": "Jeevan Bima"
21
},
22
"payments": null,
23
"reference_id": "#456",
24
"reminder_enable": true,
25
"reminders": [],
26
"short_url": "https://rzp.io/i/AiGGmnh",
27
"status": "created",
28
"updated_at": null,
29
"user_id": "API"
30
}