Skip to main content
The Subscriptions API handles recurring billing. You first create a Plan that defines the billing amount and frequency, then create a Subscription that links a customer to that plan. Razorpay automatically charges the customer on each billing cycle.

Create a plan

POST /v1/plans
string
required
Billing frequency. One of daily, weekly, monthly, or yearly.
integer
required
Multiplier for the period. For example, interval: 3 with period: monthly creates a quarterly billing cycle.
object
required
Pricing details for this plan.

Create a subscription

POST /v1/subscriptions
string
required
The ID of the plan to subscribe the customer to.
integer
required
Total number of billing cycles. For example, 12 for a one-year monthly subscription.
integer
Set to 1 to send Razorpay’s built-in email and SMS notifications to the customer. Set to 0 to manage notifications yourself.
integer
Unix timestamp for when the first billing cycle should begin. Defaults to immediately.

Fetch a subscription

GET /v1/subscriptions/:id

Cancel a subscription

POST /v1/subscriptions/:id/cancel
integer
Controls when the cancellation takes effect. Set to 0 to cancel immediately, or 1 to cancel at the end of the current billing cycle.
Cancelling immediately (cancel_at_cycle_end: 0) stops the subscription at once. The customer will not be charged for any remaining cycles. Cancelling at cycle end (cancel_at_cycle_end: 1) allows the current period to complete before stopping.