Recurring Payments API
Integrate Recurring Payments using Razorpay APIs.
You can use Razorpay
APIs to create subsequent payments for your customers at intervals you can define and control.For most of the Razorpay APIs, the Gateway URL is https://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.
Use the URL https://api.razorpay.com/v1/payments
to access payment resources.
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"
and Basic $base64token
.
Follow these steps to generate API keys:
- Log in to your Dashboard with the appropriate credentials.
- 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.
- Navigate to Account & Settings → API Keys (under Website and app settings) → Generate Key to generate key for the selected mode.
The Key Id
and Key Secret
appear on a pop-up page.
The integration flow varies depending on how you choose to create the authorisation transaction.
Was this page helpful?