Request
Curl
Response
Success
Parameters
id mandatory
: string The unique identifier linked to a Subscription. For example, sub_00000000000001.
Parameters
plan_idoptional
: string The unique identifier of the new plan that should be linked to the Subscription. For example, plan_00000000000001.
offer_id optional
: string The unique identifier of the offer that should be linked to the Subscription. You can obtain this from the Dashboard. For example, offer_JHD834hjbxzhd38d.
quantityoptional
: integer The number of times the plan should be linked to the Subscription. For example, if the plan is 100/user/month and the customer has 5 users, you should pass 5 as the quantity to have the customer charged 500 (5 x 100) monthly. By default, this value is set to 1.
remaining_countoptional
: integer This parameter is used to update the total_count for a Subscription. For example, let us consider a monthly Subscription with 12 billing cycles. The Subscription has been charged successfully 4 times and 3 more invoices have been issued, but have not been charged. The remaining count in such cases is 5. However, you can overwrite this value using this parameter.
start_atoptional
: integer Unix timestamp. The new start date for the Subscription.
schedule_change_atoptional
: string Represents when the Subscription should be updated.
now(default): Updates the Subscription immediately.cycle_end: Updates the Subscription at the end of the current billing cycle.
customer_notifyoptional
: boolean Represents who sends notifications to the customer. Possible values:
true(default): Notifications sent by Razorpay.false: Notifications sent by you.
Parameters
id
: string The unique identifier of the subscription created. For example, sub_00000000000001.
entity
: string The entity being created. Here, it will be subscription.
plan_id
: string The unique identifier for a plan that is linked to the created subscription. For example, plan_00000000000001.
customer_id
: string The unique identifier of the customer linked to the subscription. This is populated automatically once the customer completes the authorisation transaction. For example, cust_00000000000001.
status
: string Status of the subscription. Refer to the life cycle section for more details. Possible values:
createdauthenticatedactivependinghaltedcancelledcompletedexpired
current_start
: integer Unix timestamp. The start time of the current billing cycle of the subscription. For example, 1581013800.
current_end
: integer Unix timestamp. The end time of the current billing cycle of the subscription. For example, 1581013800.
ended_at
: integer The timestamp, in Unix format, when the subscription was completed or was cancelled. For example, 1581013800.
quantity
: integer The number of times the plan should be linked to the subscription. For example, if the plan is 100/user/month and the customer has 5 users, you should pass 5 as the quantity to have the customer charged 500 (5 x 100) monthly. By default, this value is set to 1.
notes
: 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": "Beam me up Scotty”.
charge_at
: integer Unix timestamp. This indicates when the next charge on the subscription should be made. For example, 1581013800.
offer_id
: string The unique identifier of the offer that should be linked to the subscription. For example, offer_JHD834hjbxzhd38d.
start_at
: integer The timestamp, in Unix format, when the subscription should start. If not passed, the subscription starts immediately after the authorisation payment. For example, 1581013800.
end_at
: integer The timestamp, in Unix format, when the subscription should end. For example, 1581013800.
auth_attempts
: integer The number of times that the charge for the current billing cycle has been attempted on the card. For example, 2.
total_count
: integer The number of billing cycles for which the customer should be charged. For example, 2. We support subscriptions for a maximum duration of 100 years. The number of billing cycles depends if the subscription is daily, weekly, monthly or yearly.
paid_count
: integer This indicates the number of billing cycles for which the customer has already been charged. For example, 2.
customer_notify
: boolean Indicates whether the communication to the customer would be handled by businesses or Razorpay.
true: Communication handled by Razorpay. Defaults totrue.false: Communication handled by businesses.
created_at
: integer The timestamp, in Unix format, when the subscription was created. For example, 1581013800.
expire_by
: integer The timestamp, in Unix format, till when the customer can make the authorisation payment. For example, 1581013800.
short_url
: string URL that can be used to make the authorisation payment. For example, https://rzp.io/i/PWtAiEo.
has_scheduled_changes
: boolean Indicates if the subscription has any scheduled changes. Possible values:
true: Subscription has scheduled changes.false: Subscription does not have scheduled changes.
schedule_change_at
: 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.
remaining_count
: integer This indicates the number of billing cycles remaining on the subscription. For example, 2.
Errors
Subscriptions cannot be updated when payment mode is UPI- code: 400
- description: This error occurs when you are trying to update a Subscription authorised via UPI.
- solution: You cannot update a Subscription authorised via UPI mode or Emandate.
- code: 400
- description: This error occurs when you are trying to update a Subscription in the created state.
- solution: Ensure that the Subscription status is either in the authenticated or active state.