Subscriptions
Fetch All Subscriptions
Fetch all Subscriptions using the Razorpay API.
GET
Use this endpoint to fetch all the created Subscriptions.
Query Parameters
string
The unique identifier of the plan for which you want to retrieve all the Subscriptions.
integer
The Unix timestamp from when Subscriptions are to be fetched.
integer
The Unix timestamp till when Subscriptions are to be fetched.
integer
The number of Subscriptions to be fetched. Default value is
10. Maximum value is 100. This can be used for pagination, in combination with skip.integer
The number of Subscriptions to be skipped. Default value is
0. This can be used for pagination, in combination with count.Response Parameters
string
The unique identifier linked to a Subscription.
string
The entity being created. Here, it is
subscription.string
The unique identifier of a plan that should be linked to the Subscription. For example,
plan_00000000000001.string
The unique identifier of the customer who is subscribing to a plan. This is populated automatically after the customer completes the authorisation transaction.
integer
The number of billing cycles for which the customer should be charged. For example, if a customer is buying a 1-year subscription billed on a bi-monthly basis, this value should be
6.boolean
Indicates whether the communication to the customer would be handled by businesses or Razorpay. Possible values:
true(default): Communication handled by Razorpay.false: Communication handled by businesses.
integer
The Unix timestamp, indicates from when the Subscription should start. If not passed, the Subscription starts immediately after the authorisation payment. For example,
1581013800. For Subscriptions with a future start_date, frequency is considered as_presented.integer
The number of times the customer should be charged the plan amount per invoice. For example, a customer subscribes to use software. The charges are ₹100/month/license. The customer wants 5 licenses. You should pass 5 as the quantity. The customer is charged ₹500 (5 x ₹100) monthly. By default, this value is set to
1.object
Object consisting of key value pairs as notes.
string
Status of the Subscription. Possible values:
createdauthenticatedactivependinghaltedcancelledcompletedexpired
integer
Indicates the number of billing cycles the customer has already been charged.
integer
Indicates the start time of the current billing cycle of a Subscription.
integer
Indicates the end time of the current billing cycle of a Subscription.
integer
The Unix timestamp of when the Subscription has completed its period or has been cancelled midway.
integer
The Unix timestamp of when the next charge on the Subscription should be made.
integer
The number of times the charge for the current billing cycle has been attempted on the card.
integer
The Unix timestamp that indicates till when the customer can make the authorisation payment. For example,
1581013800. The default value is 30 years. Do not pass any value if you do not want to set an expiry date.array of objects
Array that contains details of any upfront amount you want to collect as part of the authorisation transaction.
array
Details of the upfront amount you want to charge your customer.
string
A name for the upfront amount you want to charge the customer. For example,
Delivery Fee.integer
The upfront amount in the currency subunit you want to charge the customer. For example ,
30000.string
The currency in which you want to charge the customer. This has to match the plan currency. For example,
INR.string
The unique identifier of the offer that is linked to the Subscription. You can obtain this from the Dashboard. For example,
offer_JHD834hjbxzhd38d.object
Notes you can enter for the contact for future reference. This is a key-value pair. You can enter a maximum of 15 key-value pairs. For example,
"note_key": "Gym Membership Plan.string
URL that can be used to make the authorisation payment. For example,
https://rzp.io/i/PWtAiEo.boolean
Indicates if the Subscription has any scheduled changes. Possible values:
true: Subscription has scheduled changes.false: Subscription does not have scheduled changes.
string
Represents when the Subscription should be updated. Possible values:
now(default): Updates the Subscription immediately.cycle_end: Updates the Subscription at the end of the current billing cycle.
integer
Indicates the number of billing cycles remaining on the Subscription. For example,
2.string
The customer’s phone number associated with the subscription.
string
The customer’s email address associated with the subscription.
string
The payment method used for the subscription, such as card, emandate, or UPI.
integer
Timestamp, in Unix format, when a scheduled update on this subscription is set to take effect.
null when no update is pending.integer
Timestamp, in Unix format, when the subscription ended.
integer
Timestamp, in Unix format, when the subscription was created. For example,
1778024127.string
The origin of the subscription. One of
api (created via API), dashboard, or links.Errors
The API key/secret provided is invalid.
The API key/secret provided is invalid.
Code:
4xxThis error occurs due to a mismatch between the API credentials passed in the API call and those generated on the Dashboard.Solution: Ensure that the API keys are active and correctly entered, with no whitespaces before or after the keys.count must be an integer between 1 and 100.
count must be an integer between 1 and 100.
Code:
400An invalid value was passed for the count query parameter. The API returns The count must be at least 1. (for count=0 or negative), The count may not be greater than 100. (for values above 100), or The count must be an integer. (for non-integer values).Solution: Pass count as a positive integer between 1 and 100.{any extra field} is/are not required and should not be sent.
{any extra field} is/are not required and should not be sent.
Code:
400A query parameter that is not part of the fetch-subscriptions schema was passed.Solution: Only pass documented query parameters: plan_id, from, to, count, skip.from and to must be UNIX-epoch integers.
from and to must be UNIX-epoch integers.
Code:
400A non-integer value (for example a human-readable date like 2024-01-01) was passed for from or to. The API returns The from must be an integer. or The to must be an integer. respectively.Solution: Pass from and to as UNIX-epoch integers in seconds.