API ReferenceIntegrationsKnowledge Base

Recurring Payments - API

Feature Request:
This feature is available only on request. It is not available by default. Raise a request on our Support Portal to get this feature enabled on your Dashboard.

Integration Flow#

The integration flow varies depending on how you choose to create the authorization transaction.

Using Razorpay Standard Checkout#

This is possible only via APIs. The integration flow to collect recurring payments using the Razorpay Standard Checkout is:

  1. Create a customer. This returns a customer_id.
  2. Create an order. This returns an order_id. The order amount for:
    • For Emandate is ₹0.
    • Cards is a minimum of ₹1.
    • Paper NACH is ₹0.
    • UPI is ₹1.
  3. Pass the customer_id, order_id and a few additional parameters in your Checkout to create the authorization payment. The customer completes the authorization payment, which generates a token. This payment can be authorized using one of the following instruments:
    • Emandate.
    • Card.
    • Paper NACH. The following additional steps have to be completed for NACH:
      1. The customer either downloads a pre-filled NACH form or you can send it to the customer.
      2. The customer signs the pre-filled NACH form.
      3. The customer either uploads the signed form or sends it to you to upload for processing.
    • UPI.
  4. Retrieve and check the status of the token. Once the token status changes to confirmed, you can create and charge subsequent payments.
  5. Create and charge subsequent payments. To do this, you have to manually:
    1. Create a new order.
    2. Create a recurring payment.

Using a Registration Link#

You can create registration links either using API or from the Dashboard. The integration flow to collect recurring payments using a registration link is:

  1. Create a registration link and send it to your customer. The customer completes the authorization payment, which generates a token. This payment can be authorized using one of the following instruments:
    • Emandate.
    • Card.
    • Paper NACH. The following additional steps have to be completed for NACH:
      1. The customer either downloads a pre-filled NACH form or you can send it to the customer.
      2. The customer signs the pre-filled NACH form.
      3. The customer either uploads the signed form or sends it to you to upload for processing.
    • UPI No need to create a customer and order separately:
      If you use a registration link to create the authorization transaction, Razorpay automatically creates a customer and the order on your behalf.
  2. Retrieve and check the token status. Once the token status changes to confirmed, you can create and charge subsequent payments.
  3. Create and charge subsequent payments. To do this, you have to manually:
    1. Create a new order.
    2. Create a recurring payment.

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 Authorization#

All Razorpay APIs are authorized using Basic Authorization. Basic authorization requires the following:

  • <YOUR_KEY_ID>
  • <YOUR_KEY_SECRET>

Generate API Key#

  1. Log into your Dashboard with appropriate credentials.
  2. Select the mode (Test or Live) for which you want to generate the API key. Note:
    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:

Note:
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.

×