Available in🇮🇳 India
You can create an authorisation transaction using the Razorpay APIs or Registration Link.
1.1 Using Razorpay APIs
You can create an authorisation transaction with the UPI Collect payment method using the following APIs:1.1 Create a Customer
1.1 Create a Customer
Razorpay links recurring tokens to customers using a unique identifier generated through the Customer API.You can create customers with basic information such as
email and contact and use them for various Razorpay offerings. The following endpoint creates a customer.POST /customersSample Code
Sample Code
Request Parameters
Request Parameters
The request throws an exception by default if a customer with the exact details already exists. You can pass an additional parameter
fail_existing to get the existing customer’s details in the response. Possible values:1(default): If a customer with the same details already exists, throws an error.0: If a customer with the same details already exists, fetches details of the existing customer.
1.2. Create an Order
1.2. Create an Order
Use the Orders API to create a unique Razorpay
order_id that is associated with the authorisation transaction. The following endpoint creates an order.POST /ordersSample Code
Sample Code
Request Parameters
Request Parameters
Unique identifier for the order entered by you. For example,
Receipt No. 1. This parameter should be mapped to the order_id sent by Razorpay.A description of the mandate that will be displayed to the customer in their UPI app. This helps the customer understand what they are subscribing to. Keep it under 50 characters and avoid special characters. For example,
Monthly Pro subscription.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": "Beam me up Scotty”.The maximum amount that can be debited in a single charge.
For other categories and MCCs, the minimum value is
100 (₹1) and maximum value is 9999900 (₹99,999).Best PracticesSet the
max_amount as close to the actual debit amount as possible. For example, if the expected debit amount is ₹99-₹299, setting the max_amount to ₹5,000 may cause the customer to drop off due to trust issues. A realistic max_amount builds customer trust while allowing flexibility for variable debits.The Unix timestamp that indicates when the authorisation transaction must expire. The default value is 10 years and the maximum value allowed is 30 years.
The frequency at which you can charge your customer. Possible values:
dailyweeklyfortnightlybimonthlymonthlyquarterlyhalf_yearlyyearlyas_presented
1.2. Using a Registration Link
Registration Links are an alternate way of creating an authorisation transaction. If you create a registration link, you need not create a customer or an order. When you create a registration link, an invoice is automatically issued to the customer. The customer can use the invoice to make the Authorisation Payment. Know how to create Registration Links using the Dashboard.Handy TipsYou can use webhooks to get notifications about successful payments against a registration link. Know more about Webhooks.
₹1.
1.2.1. Create a Registration Link
The following endpoint creates a registration link.POST /subscription_registration/auth_links
Request Parameters
Use to set the maximum amount (in paise) per debit request.
For other categories and MCCs, the minimum value is
100 (₹1) and maximum value is 9999900 (₹99,999).The Unix timestamp till when you can use the token to charge the customer subsequent payments. The default value is 10 years and the maximum value allowed is 30 years.
The frequency at which you can charge your customer. Possible values:
dailyweeklyfortnightlybimonthlymonthlyquarterlyhalf_yearlyyearlyas_presented
Indicates if SMS notifications are to be sent by Razorpay. Possible values:
true(default): Notifications are sent by Razorpay .false: Notifications are not sent by Razorpay.
Indicates if email notifications are to be sent by Razorpay. Possible values:
true(default): Notifications are sent by Razorpay .false: Notifications are not sent by Razorpay.
A unique identifier entered by you for the order. For example,
Receipt No. 1. You should map this parameter to the order_id sent by Razorpay.This is a key-value pair that is used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example,
"note_key": "Beam me up Scotty”.1.2.2. Send/Resend Notifications
The following endpoint sends/resends notifications with the short URL to the customer:POST /invoices/:id/notify_by/:medium
Sample Code
Sample Code
Response
Path Parameters
The unique identifier of the invoice linked to the registration link for which you want to send the notification. For example,
inv_1Aa00000000001.Determines through which medium you want to resend the notification. Possible values:
smsemail
1.2.3. Cancel a Registration Link
The following endpoint cancels a registration link.POST /invoices/:id/cancel
Handy TipsYou can only cancel registration link in the
issued state.Sample Code
Sample Code
Response