Feature RequestThis is an on-demand feature. Please raise a request with our Support team to get this feature activated on your Razorpay account.to get this feature activated on your account.
How It Works
- Authorise: Customer authorises their payment method.
- Tokenise: Payment method is securely tokenised after first successful payment.
- Charge: You initiate charges as needed using the token.
When to Use Recurring Payments
Recurring Payments are ideal when you need:- Flexible billing cycles: Charge customers based on usage, milestones or variable schedules.
- Manual control: You decide when to charge each payment.
Integration Flow
The integration flow varies depending on how you choose to create the authorisation transaction.Using Razorpay APIs
This is possible only via APIs. The integration flow to collect recurring payments using Razorpay APIs is:- Create a customer. This returns a
customer_id. - Create an order. This returns an
order_id. The order amount for:- Emandate is ₹0.
- Cards is a minimum of ₹1.
- Paper NACH is ₹0.
- UPI is ₹1.
- Pass the
customer_id,order_idand a few additional parameters in your Checkout to create the authorisation payment. The customer completes the authorisation payment, which generates atoken. This payment can be authorised using one of the following instruments:- Emandate.
- Card.
- Paper NACH. The following additional steps have to be completed for NACH:
- The customer either downloads a pre-filled NACH form or you can send it to the customer.
- The customer signs the pre-filled NACH form.
- The customer either uploads the signed form or sends it to you to upload for processing.
- UPI.
- Retrieve and check the status of the token. Once the token status changes to
confirmed, you can create and charge subsequent payments. - Create and charge subsequent payments. To do this, you have to manually:
- Create a new order.
- Create a recurring payment.
Using a Registration Link
You can create registration links from the Dashboard or using APIs. Following is the integration flow to collect recurring payments using a registration link:- Create a registration link and send it to your customer
token. This payment can be authorised using one of the following instruments:
- Emandate
- Card
- Paper NACH. The following additional steps have to be completed for NACH:
- The customer either downloads a pre-filled NACH form or you can send it to the customer.
- The customer signs the pre-filled NACH form.
- The customer either uploads the signed form or sends it to you to upload for processing. Know more about uploading Paper Nach Form.
- UPI
No Need to Create a Customer and Order SeparatelyIf you use a registration link to create the authorisation transaction, Razorpay automatically creates a customer and the order on your behalf.
- Retrieve and check the token status
confirmed, you can create and charge subsequent payments.
3. Create and charge subsequent paymentsTo do this, you have to manually:- Create a new order.
- Create a recurring payment.
API Gateway URL
For most of the Razorpay APIs, the Gateway URL ishttps://api.razorpay.com/v1. You need to include this before each API endpoint to make API calls. However, certain APIs are on V2. Hence, the gateway URL may differ for certain APIs.
Example
-
Use the URL
https://api.razorpay.com/v1/paymentsto access payment resources. -
Use the URL
https://api.razorpay.com/v2/accountsto access Route (Linked Account)-related resources.
API Authentication
All Razorpay APIs are authenticated usingBasic Auth. Basic auth requires the following:
[YOUR_KEY_ID][YOUR_KEY_SECRET]
Authorization header for each request in the Basic base64token format. Here, base64token is a base64 encoded string of YOUR_KEY_ID:YOUR_KEY_SECRET.
Generate API Key
Follow these steps to generate API keys: Watch this video to see how to generate API keys in the Test mode. Watch this video to see how to generate API keys in the Live mode.1
Step 1
Log in to your Dashboard with the appropriate credentials.
2
Step 2
Select the mode (Test or Live) for which you want to generate the API key.
- Test Mode: The test mode is a simulation mode that you can use to test your integration flow. Your customers will not be able to make payments in this mode.
- Live Mode: When your integration is complete, switch to live mode and generate live mode API keys. In the integration, replace test mode keys with live mode keys to accept customer payments.
3
Step 3
Navigate to Account & Settings → API Keys (under Website and app settings) → Generate Key to generate key for the selected mode.
List of APIs as per Supported Payment Methods
Step 1: Create Authorisation Payment
Set up the authorisation payment using:- APIs for Cards
- APIs for UPI Autopay: Collect and Intent
- APIs for UPI OTM: Collect and Intent
- APIs for UPI TPV
- APIs for Emandate
- APIs for Paper NACH
Step 2: Fetch Token Details
Fetch the customer’s token detail to proceed with the authorisation payment using:- APIs for Cards
- APIs for UPI Autopay: Collect and Intent
- APIs for UPI OTM: Collect and Intent
- APIs for UPI TPV
- APIs for Emandate
- APIs for Paper NACH
Step 3: Charge Subsequent Payments
Use the token to charge customers as needed using:- APIs for Cards
- APIs for UPI Autopay: Collect and Intent
- APIs for UPI OTM: Collect and Intent
- APIs for UPI TPV
- APIs for Emandate
- APIs for Paper NACH