API Reference

API Reference for Payment Links

New API Version:
We are introducing a new version of APIs for Payment Links. This will be available from 01 Sep 2020.


Old API URL:
The Legacy API Contract will be deprecated on 31st March 2021 15th August 2021. Raise a request with our support team to enable the new version of the app on your account. We will be enabling the new version for you post July end.
https://api.razorpay.com/v1/invoices


New API URL: https://api.razorpay.com/v1/payment_links

Some of the existing request and response parameters have changed and new ones have been added.

Pass this information to your developers and ask them to change your integration accordingly.



Payment Links help you to receive payments from customers by sending them links via email, SMS, chatbots and more. You can easily set up and use Payment Links with these APIs:

Ensure you have read the product document before you proceed with the API integration.

Amount must be in Currency Subunits:
Ensure that the Payment Link amount is in currency subunits. That is, if you are choosing INR as the currency, you must enter the amount in paise. For example, if you want to receive a payment of ₹299.95, you must enter 29995.

API Gateway URL🔗

The Razorpay API Gateway URL is https://api.razorpay.com/v1.

You need to include this before each API endpoint to make API calls.

API Authentication🔗

All Razorpay APIs are authenticated using Basic Auth. Basic auth requires the following:

  • [YOUR_KEY_ID]
  • [YOUR_KEY_SECRET]

Basic auth expects an Authorization header for each request in the Basic base64token format. Here, base64token is a base64 encoded string of YOUR_KEY_ID:YOUR_KEY_SECRET.

Watch Out
The Authorization header value should strictly adhere to the format mentioned above. Invalid formats will result in authentication failures. Few examples of invalid headers are:

  • BASIC base64token
  • basic base64token
  • Basic "base64token"
  • Basic $base64token

Generate API Keys🔗

  1. Log into your Dashboard with appropriate credentials.
  2. Select the mode (Test or Live) for which you want to generate the API key. You have to generate separate API Keys for the test and live modes. No real money is used in test mode.
  3. Navigate to SettingsAPI KeysGenerate Key to generate key for the selected mode.

The Key Id and Key Secret appear in a pop-out window as shown below:

Generate API Keys

Watch Out!

  • After generating the keys from the Dashboard, download and save them securely. If you do not remember your API Keys, you need to re-generate it from the Dashboard and replace it wherever required.
  • Do not share your API Key secret with anyone or on any public platforms. This can pose security threats for your Razorpay account.

Entity Structure🔗

Following JSON represents a sample Payment Link entity.

Note:
Payment Link is a solution on our existing Invoices system. Hence, few of the attributes in the response are not applicable for Payment Links.


Partial List of Attributes🔗

The following table details some of the attributes related to Payment Links:

id

string Unique identifier of the Payment Link.

entity

string Payment Link uses the Invoices entity.

receipt

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

customer_id

string You can pass the customer_id in this field, if you are using Customers API. If not, you can pass the customer object described in the below fields.

customer

Customer details

name
string The customer's name. The maximum character limit supported is 50.
email
string The email address of the customer.
contact
string The contact number of the customer.
status

string Displays the current state of the Payment Link. Learn more about the Payment Link Life Cycle.

expire_by

integer Timestamp, in Unix, when the payment link will expire.

issued_at

integer Timestamp, in Unix, at which the Payment Link was issued to the customer.

paid_at

integer Timestamp, in Unix, at which the Payment Link was paid by the customer.

cancelled_at

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

expired_at

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

sms_status

string Indicates whether the SMS notification for the Payment Link was sent to the customer. Possible values:

  • pending
  • sent
email_status

string Indicates whether the email notification for the Payment Link was sent to the customer. Possible values:

  • pending
  • sent
partial_payment

boolean Indicates if partial payments is enabled for the Payment Link. Possible values:

  • 0 - not enabled (default)
  • 1 - enabled
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 ₹299.95, you must enter the value 29995.

amount_paid

integer Amount paid using the Payment Link.

amount_due

integer Remaining amount to be paid using the Payment Link.

currency

string Defaults to INR. We accept payments in international currencies.

description

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

notes

object User-entered notes for internal reference. This is a key-value pair. You can enter a maximum of 15 key-value pairs.

short_url

string The unique short URL generated for the Payment Link.

type

string. Here it will be link.

created_at

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


×