Skip to main content
These endpoints act on Razorpay subscription objects directly using Razorpay subscription ids (sub_XXXX). They are always registered, even when subscription.enabled is false, because they operate on raw Razorpay resources rather than the plugin-managed local subscription lifecycle.

Get subscription

GET /api/auth/razorpay/subscription/get Retrieves a single Razorpay subscription by its id. Server API name: fetchSubscription
Client method: authClient.razorpay.subscription.get({ query: { subscriptionId } })
string
required
Razorpay subscription id, for example sub_XXXX.
POST /api/auth/razorpay/subscription-link Creates a Razorpay subscription and returns a hosted authorization shortUrl. Use this when you want Razorpay to handle the checkout flow for a subscription. Server API name: createSubscriptionLink
Client method: authClient.razorpay.subscriptionLink(...)
string
required
Razorpay plan id, for example plan_XXXX.
integer
required
Total number of billing cycles for the subscription.
integer
default:"1"
Number of subscriptions for the selected plan.
integer
Unix timestamp when the subscription should start.
integer
Unix timestamp before which the authorization link must be used.
boolean
default:"true"
Whether Razorpay should notify the customer.
array
Add-ons to include with the subscription. Each item is an object with an item field and optional quantity. The item can be either { id: "item_XXXX" } or a new item { name, amount, currency, description }.
string
Razorpay offer id to apply to the subscription.
object
Key-value pairs stored with the subscription.
object
Customer contact details for notifications. Contains notifyPhone and notifyEmail.
string
Razorpay subscription id.
string
Hosted authorization link the customer can use to complete the subscription.
object
Full Razorpay subscription object.
Errors: SUBSCRIPTION_LINK_CREATE_FAILED.

Fetch pending update

GET /api/auth/razorpay/subscription/pending-update Retrieves the pending update details for a subscription that has a scheduled change. Server API name: fetchPendingUpdate
Client method: authClient.razorpay.subscription.pendingUpdate({ query: { subscriptionId } })
string
required
Razorpay subscription id.
Errors: PENDING_UPDATE_NOT_FOUND.

Cancel pending update

POST /api/auth/razorpay/subscription/cancel-update Cancels a pending update on a subscription so the scheduled change does not take effect. Server API name: cancelPendingUpdate
Client method: authClient.razorpay.subscription.cancelUpdate(...)
string
required
Razorpay subscription id.
Errors: PENDING_UPDATE_CANCEL_FAILED.

Fetch invoices

GET /api/auth/razorpay/subscription/invoices Retrieves all invoices generated for a given Razorpay subscription. Server API name: fetchInvoices
Client method: authClient.razorpay.subscription.invoices({ query: { subscriptionId } })
string
required
Razorpay subscription id.
Errors: SUBSCRIPTION_INVOICE_FETCH_FAILED.
POST /api/auth/razorpay/subscription/link-offer Links an existing Razorpay offer to a subscription. Server API name: linkOffer
Client method: authClient.razorpay.subscription.linkOffer(...)
string
required
Razorpay subscription id.
string
required
Razorpay offer id, for example offer_XXXX.
Errors: OFFER_LINK_FAILED.

Delete offer

POST /api/auth/razorpay/subscription/delete-offer Removes a linked offer from a subscription. Server API name: deleteOffer
Client method: authClient.razorpay.subscription.deleteOffer(...)
string
required
Razorpay subscription id.
string
required
Razorpay offer id to remove.
Errors: OFFER_DELETE_FAILED.

Create subscription addon

POST /api/auth/razorpay/subscription/addon Adds an addon to an existing Razorpay subscription. The addon is billed immediately and included in subsequent invoices. Server API name: createSubscriptionAddon
Client method: authClient.razorpay.subscription.addon(...)
string
required
Razorpay subscription id.
object
required
The addon item. Either reference an existing item with { id: "item_XXXX" } or create a new item inline with { name, amount, currency, description }.
integer
default:"1"
Quantity of the addon.
Errors: ADDON_CREATE_FAILED.