Update a schedule ​
Updates an existing subscription schedule.
Returns ​
Returns an updated subscription schedule object if the call succeeded.
Parameters ​
default_settings(object, optional) Object representing the subscription schedule’s default settings.default_settings.application_fee_percent(float, optional) A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees documentation.default_settings.automatic_tax(object, optional) Default settings for automatic tax computation.default_settings.automatic_tax.enabled(boolean, required) Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.default_settings.automatic_tax.liability(object, optional) The account that’s liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.default_settings.automatic_tax.liability.type(enum, required) Type of the account referenced in the request. Possible enum values:accountIndicates that the account being referenced is a connected account which is different from the account making the API request but related to it.selfIndicates that the account being referenced is the account making the API request.
default_settings.automatic_tax.liability.account(string, required only if type is account) The connected account being referenced whentypeisaccount.
default_settings.billing_cycle_anchor(enum, optional) Can be set tophase_startto set the anchor to the start of the phase orautomaticto automatically change it if needed. Cannot be set tophase_startif this phase specifies a trial. For more information, see the billing cycle documentation. Possible enum values:automaticphase_start
default_settings.billing_thresholds(object, optional) Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.default_settings.billing_thresholds.amount_gte(integer, optional) Monetary threshold that triggers the subscription to advance to a new billing perioddefault_settings.billing_thresholds.reset_billing_cycle_anchor(boolean, optional) Indicates if thebilling_cycle_anchorshould be reset when a threshold is reached. If true,billing_cycle_anchorwill be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
default_settings.collection_method(enum, optional) Eithercharge_automatically, orsend_invoice. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription asactive. Defaults tocharge_automaticallyon creation. Possible enum values:charge_automaticallysend_invoice
default_settings.default_payment_method(string, optional) ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer’s invoice settings.default_settings.description(string, optional) Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.The maximum length is 500 characters.
default_settings.invoice_settings(object, optional) All invoices will be billed using the specified settings.default_settings.invoice_settings.account_tax_ids(array of strings, optional) The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule.default_settings.invoice_settings.days_until_due(integer, optional) Number of days within which a customer must pay invoices generated by this subscription schedule. This value will benullfor subscription schedules wherecollection_method=charge_automatically.default_settings.invoice_settings.issuer(object, optional) The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.default_settings.invoice_settings.issuer.type(enum, required) Type of the account referenced in the request. Possible enum values:accountIndicates that the account being referenced is a connected account which is different from the account making the API request but related to it.selfIndicates that the account being referenced is the account making the API request.
default_settings.invoice_settings.issuer.account(string, required only if type is account) The connected account being referenced whentypeisaccount.
default_settings.on_behalf_of(string, optional) The account on behalf of which to charge, for each of the associated subscription’s invoices.default_settings.transfer_data(object, optional) The data with which to automatically create a Transfer for each of the associated subscription’s invoices.default_settings.transfer_data.destination(string, required) ID of an existing, connected Stripe account.default_settings.transfer_data.amount_percent(float, optional) A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
end_behavior(enum, optional) Behavior of the subscription schedule and underlying subscription when it ends. Possible values arereleaseorcancelwith the default beingrelease.releasewill end the subscription schedule and keep the underlying subscription running.cancelwill end the subscription schedule and cancel the underlying subscription. Possible enum values:cancelCancel the underlying subscription when the subscription schedule ends.releasePersist the underlying subscription in its current state when the subscription schedule ends.
metadata(object, optional) Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value tometadata.phases(array of objects, optional) List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, theend_dateof one phase will always equal thestart_dateof the next phase. Note that past phases can be omitted.phases.items(array of objects, required) List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.phases.items.billing_thresholds(object, optional) Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.phases.items.billing_thresholds.usage_gte(integer, required) Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary threshold)
phases.items.discounts(array of objects, optional) The coupons to redeem into discounts for the subscription item.phases.items.discounts.coupon(string, optional) ID of the coupon to create a new discount for.phases.items.discounts.discount(string, optional) ID of an existing discount on the object (or one of its ancestors) to reuse.phases.items.discounts.promotion_code(string, optional) ID of the promotion code to create a new discount for.
phases.items.metadata(object, optional) Set of key-value pairs that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item’smetadatawhen the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item’smetadatacan be unset by posting an empty value to them in the configuration item’smetadata. To unset all keys in the subscription item’smetadata, update the subscription item directly or unset every key individually from the configuration item’smetadata.phases.items.price(string, optional) The ID of the price object.phases.items.price_data(object, optional) Data used to generate a new Price object inline.phases.items.price_data.currency(enum, required) Three-letter ISO currency code, in lowercase. Must be a supported currency.phases.items.price_data.product(string, required) The ID of the Product that this Price will belong to.phases.items.price_data.recurring(object, required) The recurring components of a price such asintervalandinterval_count.phases.items.price_data.recurring.interval(enum, required) Specifies billing frequency. Eitherday,week,monthoryear. Possible enum values:daymonthweekyear
phases.items.price_data.recurring.interval_count(integer, optional) The number of intervals between subscription billings. For example,interval=monthandinterval_count=3bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
phases.items.price_data.tax_behavior(enum, recommended if calculating taxes) Only required if a default tax behavior) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One ofinclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed. Possible enum values:exclusiveinclusiveunspecified
phases.items.price_data.unit_amount(integer, optional) A positive integer in the smallest currency unit (or 0 for a free price) representing how much to charge.phases.items.price_data.unit_amount_decimal(string, required conditionally) Same asunit_amount, but accepts a decimal value in the smallest currency unit with at most 12 decimal places. Only one ofunit_amountandunit_amount_decimalcan be set.
phases.items.quantity(integer, optional) Quantity for the given price. Can be set only if the price’susage_typeislicensedand notmetered.phases.items.tax_rates(array of strings, optional) A list of Tax Rate ids. These Tax Rates will override thedefault_tax_rateson the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
phases.add_invoice_items(array of objects, optional) A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.phases.add_invoice_items.discountable(boolean, optional) Controls whether discounts apply to this invoice item. Defaults to true if no value is provided.phases.add_invoice_items.discounts(array of objects, optional) The coupons to redeem into discounts for the item.phases.add_invoice_items.discounts.coupon(string, optional) ID of the coupon to create a new discount for.phases.add_invoice_items.discounts.discount(string, optional) ID of an existing discount on the object (or one of its ancestors) to reuse.phases.add_invoice_items.discounts.promotion_code(string, optional) ID of the promotion code to create a new discount for.
phases.add_invoice_items.metadata(object, optional) Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value tometadata.phases.add_invoice_items.period(object, optional) The period associated with this invoice item. If not set,period.start.typedefaults tomax_item_period_startandperiod.end.typedefaults tomin_item_period_end.phases.add_invoice_items.period.end(object, required) End of the invoice item period.phases.add_invoice_items.period.end.type(enum, required) Select how to calculate the end of the invoice item period. Possible enum values:min_item_period_endThe minimumcurrent_period_endof all underlying subscription items whose periods overlap this phasephase_endEnd of the phasetimestampCustom timestamp to use for the end of the invoice item period
phases.add_invoice_items.period.end.timestamp(timestamp, optional) A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal toperiod.start.
phases.add_invoice_items.period.start(object, required) Start of the invoice item period.phases.add_invoice_items.period.start.type(enum, required) Select how to calculate the start of the invoice item period. Possible enum values:max_item_period_startThe maximumcurrent_period_startof all underlying subscription items whose periods overlap this phasephase_startStart of the phasetimestampCustom timestamp to use for the start of the invoice item period
phases.add_invoice_items.period.start.timestamp(timestamp, optional) A precise Unix timestamp for the start of the invoice item period. Must be less than or equal toperiod.end.
phases.add_invoice_items.price(string, optional) The ID of the price object. One ofpriceorprice_datais required.phases.add_invoice_items.price_data(object, optional) Data used to generate a new Price object inline. One ofpriceorprice_datais required.phases.add_invoice_items.price_data.currency(enum, required) Three-letter ISO currency code, in lowercase. Must be a supported currency.phases.add_invoice_items.price_data.product(string, required) The ID of the Product that this Price will belong to.phases.add_invoice_items.price_data.tax_behavior(enum, recommended if calculating taxes) Only required if a default tax behavior) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One ofinclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed. Possible enum values:exclusiveinclusiveunspecified
phases.add_invoice_items.price_data.unit_amount(integer, optional) A positive integer in the smallest currency unit (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.phases.add_invoice_items.price_data.unit_amount_decimal(string, required conditionally) Same asunit_amount, but accepts a decimal value in the smallest currency unit with at most 12 decimal places. Only one ofunit_amountandunit_amount_decimalcan be set.
phases.add_invoice_items.quantity(integer, optional) Quantity for this item. Defaults to 1.phases.add_invoice_items.tax_rates(array of strings, optional) The tax rates which apply to the item. When set, thedefault_tax_ratesdo not apply to this item.
phases.application_fee_percent(float, optional) A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees documentation.phases.automatic_tax(object, optional) Automatic tax settings for this phase.phases.automatic_tax.enabled(boolean, required) Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.phases.automatic_tax.liability(object, optional) The account that’s liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.phases.automatic_tax.liability.type(enum, required) Type of the account referenced in the request. Possible enum values:accountIndicates that the account being referenced is a connected account which is different from the account making the API request but related to it.selfIndicates that the account being referenced is the account making the API request.
phases.automatic_tax.liability.account(string, required only if type is account) The connected account being referenced whentypeisaccount.
phases.billing_cycle_anchor(enum, optional) Can be set tophase_startto set the anchor to the start of the phase orautomaticto automatically change it if needed. Cannot be set tophase_startif this phase specifies a trial. For more information, see the billing cycle documentation. Possible enum values:automaticphase_start
phases.billing_thresholds(object, optional) Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.phases.billing_thresholds.amount_gte(integer, optional) Monetary threshold that triggers the subscription to advance to a new billing periodphases.billing_thresholds.reset_billing_cycle_anchor(boolean, optional) Indicates if thebilling_cycle_anchorshould be reset when a threshold is reached. If true,billing_cycle_anchorwill be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
phases.collection_method(enum, optional) Eithercharge_automatically, orsend_invoice. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription asactive. Defaults tocharge_automaticallyon creation. Possible enum values:charge_automaticallysend_invoice
phases.default_payment_method(string, optional) ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer’s invoice settings.phases.default_tax_rates(array of strings, optional) A list of Tax Rate ids. These Tax Rates will set the Subscription’sdefault_tax_rates, which means they will be the Invoice’sdefault_tax_ratesfor any Invoices issued by the Subscription during this Phase.phases.description(string, optional) Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.The maximum length is 500 characters.
phases.discounts(array of objects, optional) The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription’s customer. Pass an empty string to avoid inheriting any discounts.phases.discounts.coupon(string, optional) ID of the coupon to create a new discount for.phases.discounts.discount(string, optional) ID of an existing discount on the object (or one of its ancestors) to reuse.phases.discounts.promotion_code(string, optional) ID of the promotion code to create a new discount for.
phases.duration(object, optional) The number of intervals the phase should last. If set,end_datemust not be set.phases.duration.interval(enum, required) Specifies phase duration. Eitherday,week,monthoryear. Possible enum values:daymonthweekyear
phases.duration.interval_count(integer, optional) The multiplier applied to the interval.
phases.end_date(timestamp | string, optional) The date at which this phase of the subscription schedule ends. If set,durationmust not be set.phases.invoice_settings(object, optional) All invoices will be billed using the specified settings.phases.invoice_settings.account_tax_ids(array of strings, optional) The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.phases.invoice_settings.days_until_due(integer, optional) Number of days within which a customer must pay invoices generated by this subscription schedule. This value will benullfor subscription schedules wherebilling=charge_automatically.phases.invoice_settings.issuer(object, optional) The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.phases.invoice_settings.issuer.type(enum, required) Type of the account referenced in the request. Possible enum values:accountIndicates that the account being referenced is a connected account which is different from the account making the API request but related to it.selfIndicates that the account being referenced is the account making the API request.
phases.invoice_settings.issuer.account(string, required only if type is account) The connected account being referenced whentypeisaccount.
phases.metadata(object, optional) Set of key-value pairs that you can attach to a phase. Metadata on a schedule’s phase will update the underlying subscription’smetadatawhen the phase is entered, adding new keys and replacing existing keys in the subscription’smetadata. Individual keys in the subscription’smetadatacan be unset by posting an empty value to them in the phase’smetadata. To unset all keys in the subscription’smetadata, update the subscription directly or unset every key individually from the phase’smetadata.phases.on_behalf_of(string, optional) The account on behalf of which to charge, for each of the associated subscription’s invoices.phases.proration_behavior(enum, optional) Controls whether the subscription schedule should create prorations when transitioning to this phase if there is a difference in billing configuration. It’s different from the request-level proration_behavior parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. Possible enum values:always_invoiceProrate changes, and force an invoice to be immediately created for any prorations.create_prorationsProrate changes, but leave any prorations as pending invoice items to be picked up on the customer’s next invoice.noneDoes not create any prorations.
phases.start_date(timestamp | string, optional) The date at which this phase of the subscription schedule starts ornow. Must be set on the first phase.phases.transfer_data(object, optional) The data with which to automatically create a Transfer for each of the associated subscription’s invoices.phases.transfer_data.destination(string, required) ID of an existing, connected Stripe account.phases.transfer_data.amount_percent(float, optional) A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
phases.trial(boolean, optional) If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.phases.trial_end(timestamp | string, optional) Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined withtrial
proration_behavior(enum, optional) If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value iscreate_prorations. Possible enum values:always_invoiceProrate changes, and force an invoice to be immediately created for any prorations.create_prorationsProrate changes, but leave any prorations as pending invoice items to be picked up on the customer’s next invoice.noneDoes not create any prorations.
curl
curl https://api.stripe.com/v1/subscription_schedules/{{SUBSCRIPTION_SCHEDULE_ID}} \
-u "<<YOUR_SECRET_KEY>>" \
-d end_behavior=releaseResponse ​
json
{
"id": "sub_sched_1Mr3YdLkdIwHu7ixjop3qtff",
"object": "subscription_schedule",
"application": null,
"canceled_at": null,
"completed_at": null,
"created": 1680113835,
"current_phase": null,
"customer": "cus_NcI8FsMbh0OeFs",
"default_settings": {
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": null
},
"billing_cycle_anchor": "automatic",
"collection_method": "charge_automatically",
"default_payment_method": null,
"default_source": null,
"description": null,
"invoice_settings": {
"issuer": {
"type": "self"
}
},
"on_behalf_of": null,
"transfer_data": null
},
"end_behavior": "release",
"livemode": false,
"metadata": {},
"phases": [
{
"add_invoice_items": [],
"application_fee_percent": null,
"billing_cycle_anchor": null,
"collection_method": null,
"currency": "usd",
"default_payment_method": null,
"default_tax_rates": [],
"description": null,
"end_date": 1712339228,
"invoice_settings": null,
"items": [
{
"metadata": {},
"plan": "price_1Mr3YcLkdIwHu7ixYCFhXHNb",
"price": "price_1Mr3YcLkdIwHu7ixYCFhXHNb",
"quantity": 1,
"tax_rates": []
}
],
"metadata": {},
"on_behalf_of": null,
"proration_behavior": "create_prorations",
"start_date": 1680716828,
"transfer_data": null,
"trial_end": null
}
],
"released_at": null,
"released_subscription": null,
"renewal_interval": null,
"status": "not_started",
"subscription": null,
"test_clock": null
}