v1

latestOpenAPI 3.0.0Proprietary2026-07-1313647393.0 KB
Subscriptions

Create a subscription

Subscribe a customer to a plan. Returns a short_url that the customer MUST open to authorize the payment mandate (UPI Autopay, NACH, or card-on-file). The subscription will not charge until the mandate is authorized. Set notify_info to send the auth link via SMS/email automatically. Requires Subscriptions feature enabled on your Razorpay account.

post/subscriptions

Request body

plan_idstring required

Plan ID (plan_*) to subscribe the customer to.

total_countinteger required

Total number of billing cycles. Use 0 for indefinite (no fixed end).

quantityinteger

Number of plan units billed per cycle.

customer_notify0 | 1

1 to have Razorpay notify customer via SMS/email on each charge event.

start_atinteger

Unix timestamp for the first charge. Defaults to subscription creation time.

expire_byinteger

Unix timestamp deadline for the customer to authorize the mandate.

offer_idstring

Offer/coupon ID to apply to the subscription.

notesNotes

Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.

Response

Subscription created. Send short_url to the customer for mandate authorization.

idstring

Subscription ID. Prefix: sub_

entity'subscription'
plan_idstring

Associated plan ID (plan_*).

status'created' | 'authenticated' | 'active' | 'pending' | 'halted' | 'cancelled' | 'completed' | 'expired' | 'paused'

Subscription lifecycle status. created→authenticated (mandate authorized)→active→completed/cancelled/expired. pending=charge retry scheduled; halted=multiple failures; paused=temporarily stopped.

current_startinteger

Unix timestamp of current billing cycle start.

current_endinteger

Unix timestamp of current billing cycle end.

ended_atinteger

Unix timestamp when subscription ended (cancelled/completed/expired).

quantityinteger

Number of plan units billed per cycle.

notesNotes

Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.

charge_atinteger

Unix timestamp of next scheduled charge attempt.

start_atinteger

Unix timestamp of first charge. Defaults to subscription creation time.

end_atinteger

Unix timestamp after which no more charges will be attempted.

auth_attemptsinteger

Number of mandate authorization attempts.

total_countinteger

Total billing cycles. 0 = indefinite.

paid_countinteger

Number of billing cycles successfully charged.

remaining_countinteger

Remaining billing cycles.

customer_notify0 | 1

1 = Razorpay sends SMS/email notifications to customer on each charge.

short_urlstring

Mandate authorization URL. Must be sent to the customer to activate the subscription.

has_scheduled_changesboolean

True if a plan/quantity change is scheduled for the next cycle.

change_scheduled_at'now' | 'cycle_end'

When scheduled changes take effect.

sourcestring

Source that created the subscription (e.g., api, dashboard).

offer_idstring

Offer/coupon applied to the subscription.

expire_byinteger

Unix timestamp by which the customer must authorize the mandate.

created_atinteger