Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
Parameters
- customerstring
The identifier of the customer to create the subscription schedule for.
- metadataobject
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 to
metadata. - phasesarray of objects
List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the
end_of one phase will always equal thedate start_of the next phase.date - phases.
itemsarray of objectsRequired List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
- phases.
items. billing_ thresholdsobject 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_ gteintegerRequired 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. discountsarray of objects The coupons to redeem into discounts for the subscription item.
- phases.
items. discounts. couponstring ID of the coupon to create a new discount for.
- phases.
items. discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- phases.
items. discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- phases.
items. metadataobject Set of key-value pairs that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item’s
metadatawhen 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. pricestring The ID of the price object.
- phases.
items. price_ dataobject Data used to generate a new Price object inline.
- phases.
items. price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- phases.
items. price_data. productstringRequired - phases.
items. price_data. recurringobjectRequired The recurring components of a price such as
intervalandinterval_.count - phases.
items. price_data. recurring. intervalenumRequired Specifies billing frequency. Either
day,week,monthoryear.Possible enum valuesdaymonthweekyear - phases.
items. price_data. recurring. interval_ countinteger The number of intervals between subscription billings. For example,
interval=monthandinterval_bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).count=3
- phases.
items. price_data. tax_ behaviorenumRecommended 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 of
inclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed.Possible enum valuesexclusiveinclusiveunspecified - phases.
items. price_data. unit_ amountinteger A positive integer in cents (or 0 for a free price) representing how much to charge.
- phases.
items. price_data. unit_ amount_ decimalstringRequired conditionally Same as
unit_, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_andamount unit_can be set.amount_ decimal
- phases.
items. quantityinteger Quantity for the given price. Can be set only if the price’s
usage_istype licensedand notmetered. - phases.
items. tax_ ratesarray of strings A list of Tax Rate ids. These Tax Rates will override the
default_on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.tax_ rates
- phases.
add_ invoice_ itemsarray of objects 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. discountsarray of objects The coupons to redeem into discounts for the item.
- phases.
add_invoice_items. discounts. couponstring ID of the coupon to create a new discount for.
- phases.
add_invoice_items. discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- phases.
add_invoice_items. discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- phases.
add_invoice_items. pricestring The ID of the price object. One of
priceorprice_is required.data - phases.
add_invoice_items. price_ dataobject Data used to generate a new Price object inline. One of
priceorprice_is required.data - phases.
add_invoice_items. price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- phases.
add_invoice_items. price_data. productstringRequired - phases.
add_invoice_items. price_data. tax_ behaviorenumRecommended 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 of
inclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed.Possible enum valuesexclusiveinclusiveunspecified - phases.
add_invoice_items. price_data. unit_ amountinteger A positive integer in cents (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_ decimalstringRequired conditionally Same as
unit_, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_andamount unit_can be set.amount_ decimal
- phases.
add_invoice_items. quantityinteger Quantity for this item. Defaults to 1.
- phases.
add_invoice_items. tax_ ratesarray of strings The tax rates which apply to the item. When set, the
default_do not apply to this item.tax_ rates
- phases.
application_ fee_ percentfloatConnect only 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_ taxobject Automatic tax settings for this phase.
- phases.
automatic_tax. enabledbooleanRequired Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
- phases.
automatic_tax. liabilityobjectConnect only 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. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccountIndicates 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. accountstringRequired only if type is account The connected account being referenced when
typeisaccount.
- phases.
billing_ cycle_ anchorenum Can be set to
phase_to set the anchor to the start of the phase orstart automaticto automatically change it if needed. Cannot be set tophase_if this phase specifies a trial. For more information, see the billing cycle documentation.start Possible enum valuesautomaticphase_start - phases.
billing_ thresholdsobject 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_ gteinteger Monetary threshold that triggers the subscription to advance to a new billing period
- phases.
billing_thresholds. reset_ billing_ cycle_ anchorboolean Indicates if the
billing_should be reset when a threshold is reached. If true,cycle_ anchor billing_will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.cycle_ anchor
- phases.
collection_ methodenum Either
charge_, orautomatically send_. 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 asinvoice active. Defaults tocharge_on creation.automatically Possible enum valuescharge_automatically send_invoice - phases.
currencyenum Three-letter ISO currency code, in lowercase. Must be a supported currency.
- phases.
default_ payment_ methodstring 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_ ratesarray of strings A list of Tax Rate ids. These Tax Rates will set the Subscription’s
default_, which means they will be the Invoice’stax_ rates default_for any Invoices issued by the Subscription during this Phase.tax_ rates - phases.
descriptionstring 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.
- phases.
discountsarray of objects 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. couponstring ID of the coupon to create a new discount for.
- phases.
discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- phases.
discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- phases.
end_ datetimestamp The date at which this phase of the subscription schedule ends. If set,
iterationsmust not be set. - phases.
invoice_ settingsobject All invoices will be billed using the specified settings.
- phases.
invoice_settings. account_ tax_ idsarray of strings 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_ dueinteger Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be
nullfor subscription schedules wherebilling=charge_.automatically - phases.
invoice_settings. issuerobjectConnect only 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. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccountIndicates 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. accountstringRequired only if type is account The connected account being referenced when
typeisaccount.
- phases.
iterationsinteger Integer representing the multiplier applied to the price interval. For example,
iterations=2applied to a price withinterval=monthandinterval_results in a phase of durationcount=3 2 * 3 months = 6 months. If set,end_must not be set.date - phases.
metadataobject Set of key-value pairs that you can attach to a phase. Metadata on a schedule’s phase will update the underlying subscription’s
metadatawhen 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_ ofstringConnect only The account on behalf of which to charge, for each of the associated subscription’s invoices.
- phases.
proration_ behaviorenum 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 valuesalways_invoice Prorate changes, and force an invoice to be immediately created for any prorations.
create_prorations Prorate 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.
transfer_ dataobjectConnect only The data with which to automatically create a Transfer for each of the associated subscription’s invoices.
- phases.
transfer_data. destinationstringRequired ID of an existing, connected Stripe account.
- phases.
transfer_data. amount_ percentfloat 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.
trialboolean If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
- phases.
trial_ endtimestamp Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with
trial
- start_
datetimestamp | string When the subscription schedule starts. We recommend using
nowso that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
More parameters
- billing_
modeobject Controls how prorations and invoices for subscriptions are calculated and orchestrated.
- billing_mode.
typeenumRequired Controls the calculation and orchestration of prorations and invoices for subscriptions.
Possible enum valuesclassicCalculations for subscriptions and invoices are based on legacy defaults.
flexibleSupports more flexible calculation and orchestration options for subscriptions and invoices.
- default_
settingsobject Object representing the subscription schedule’s default settings.
- default_settings.
application_ fee_ percentfloatConnect only 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_ taxobject Default settings for automatic tax computation.
- default_settings.
automatic_tax. enabledbooleanRequired Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
- default_settings.
automatic_tax. liabilityobjectConnect only 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. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccountIndicates 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. accountstringRequired only if type is account The connected account being referenced when
typeisaccount.
- default_settings.
billing_ cycle_ anchorenum Can be set to
phase_to set the anchor to the start of the phase orstart automaticto automatically change it if needed. Cannot be set tophase_if this phase specifies a trial. For more information, see the billing cycle documentation.start Possible enum valuesautomaticphase_start - default_settings.
billing_ thresholdsobject 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_ gteinteger Monetary threshold that triggers the subscription to advance to a new billing period
- default_settings.
billing_thresholds. reset_ billing_ cycle_ anchorboolean Indicates if the
billing_should be reset when a threshold is reached. If true,cycle_ anchor billing_will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.cycle_ anchor
- default_settings.
collection_ methodenum Either
charge_, orautomatically send_. 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 asinvoice active. Defaults tocharge_on creation.automatically Possible enum valuescharge_automatically send_invoice - default_settings.
default_ payment_ methodstring 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.
descriptionstring 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.
- default_settings.
invoice_ settingsobject All invoices will be billed using the specified settings.
- default_settings.
invoice_settings. account_ tax_ idsarray of strings 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_ dueinteger Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be
nullfor subscription schedules wherecollection_.method=charge_ automatically - default_settings.
invoice_settings. issuerobjectConnect only 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. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccountIndicates 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. accountstringRequired only if type is account The connected account being referenced when
typeisaccount.
- default_settings.
on_ behalf_ ofstringConnect only The account on behalf of which to charge, for each of the associated subscription’s invoices.
- default_settings.
transfer_ dataobjectConnect only The data with which to automatically create a Transfer for each of the associated subscription’s invoices.
- default_settings.
transfer_data. destinationstringRequired ID of an existing, connected Stripe account.
- default_settings.
transfer_data. amount_ percentfloat 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_
behaviorenum Behavior of the subscription schedule and underlying subscription when it ends. Possible values are
releaseorcancelwith 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 valuescancelCancel the underlying subscription when the subscription schedule ends.
releasePersist the underlying subscription in its current state when the subscription schedule ends.
- from_
subscriptionstring Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription’s item(s), set to auto-renew using the subscription’s interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls.
Returns
Returns a subscription schedule object if the call succeeded.
{ "id": "sub_sched_1Mr3YdLkdIwHu7ixjop3qtff", "object": "subscription_schedule", "application": null, "canceled_at": null, "completed_at": null, "created": 1724058651, "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, "discounts": null, "end_date": 1818666418, "invoice_settings": null, "items": [ { "discounts": null, "metadata": {}, "plan": "price_1Mr3YcLkdIwHu7ixYCFhXHNb", "price": "price_1Mr3YcLkdIwHu7ixYCFhXHNb", "quantity": 1, "tax_rates": [] } ], "metadata": {}, "on_behalf_of": null, "proration_behavior": "create_prorations", "start_date": 1787130418, "transfer_data": null, "trial_end": null } ], "released_at": null, "released_subscription": null, "renewal_interval": null, "status": "not_started", "subscription": null, "test_clock": null}