diff --git a/openapi/spec3.beta.sdk.json b/openapi/spec3.beta.sdk.json index e110052a..e19b60ab 100644 --- a/openapi/spec3.beta.sdk.json +++ b/openapi/spec3.beta.sdk.json @@ -19607,6 +19607,13 @@ "method_type": "custom", "operation": "post", "path": "/v1/invoices/{invoice}/void" + }, + { + "method_name": "create_preview", + "method_on": "service", + "method_type": "custom", + "operation": "post", + "path": "/v1/invoices/create_preview" } ], "x-stripeResource": { @@ -99057,6 +99064,3125 @@ } } }, + "/v1/invoices/create_preview": { + "post": { + "description": "

At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.

\n\n

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.

\n\n

You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource.

", + "operationId": "PostInvoicesCreatePreview", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "encoding": { + "automatic_tax": { + "explode": true, + "style": "deepObject" + }, + "customer_details": { + "explode": true, + "style": "deepObject" + }, + "discounts": { + "explode": true, + "style": "deepObject" + }, + "expand": { + "explode": true, + "style": "deepObject" + }, + "invoice_items": { + "explode": true, + "style": "deepObject" + }, + "issuer": { + "explode": true, + "style": "deepObject" + }, + "on_behalf_of": { + "explode": true, + "style": "deepObject" + }, + "schedule_details": { + "explode": true, + "style": "deepObject" + }, + "subscription_billing_cycle_anchor": { + "explode": true, + "style": "deepObject" + }, + "subscription_cancel_at": { + "explode": true, + "style": "deepObject" + }, + "subscription_default_tax_rates": { + "explode": true, + "style": "deepObject" + }, + "subscription_details": { + "explode": true, + "style": "deepObject" + }, + "subscription_items": { + "explode": true, + "style": "deepObject" + }, + "subscription_prebilling": { + "explode": true, + "style": "deepObject" + }, + "subscription_trial_end": { + "explode": true, + "style": "deepObject" + } + }, + "schema": { + "additionalProperties": false, + "properties": { + "automatic_tax": { + "description": "Settings for automatic tax lookup for this invoice preview.", + "properties": { + "enabled": { + "description": "Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.", + "type": "boolean" + }, + "liability": { + "description": "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.", + "properties": { + "account": { + "description": "The connected account being referenced when `type` is `account`.", + "type": "string" + }, + "type": { + "description": "Type of the account referenced in the request.", + "enum": [ + "account", + "self" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "param", + "type": "object" + } + }, + "required": [ + "enabled" + ], + "title": "automatic_tax_param", + "type": "object" + }, + "coupon": { + "description": "The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string.", + "maxLength": 5000, + "type": "string" + }, + "currency": { + "description": "The currency to preview this invoice in. Defaults to that of `customer` if not specified.", + "type": "string" + }, + "customer": { + "description": "The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.", + "maxLength": 5000, + "type": "string" + }, + "customer_details": { + "description": "Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.", + "properties": { + "address": { + "anyOf": [ + { + "properties": { + "city": { + "description": "City, district, suburb, town, or village.", + "maxLength": 5000, + "type": "string" + }, + "country": { + "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", + "maxLength": 5000, + "type": "string" + }, + "line1": { + "description": "Address line 1 (e.g., street, PO Box, or company name).", + "maxLength": 5000, + "type": "string" + }, + "line2": { + "description": "Address line 2 (e.g., apartment, suite, unit, or building).", + "maxLength": 5000, + "type": "string" + }, + "postal_code": { + "description": "ZIP or postal code.", + "maxLength": 5000, + "type": "string" + }, + "state": { + "description": "State, county, province, or region.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "optional_fields_address", + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The customer's address." + }, + "shipping": { + "anyOf": [ + { + "properties": { + "address": { + "description": "Customer shipping address.", + "properties": { + "city": { + "description": "City, district, suburb, town, or village.", + "maxLength": 5000, + "type": "string" + }, + "country": { + "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", + "maxLength": 5000, + "type": "string" + }, + "line1": { + "description": "Address line 1 (e.g., street, PO Box, or company name).", + "maxLength": 5000, + "type": "string" + }, + "line2": { + "description": "Address line 2 (e.g., apartment, suite, unit, or building).", + "maxLength": 5000, + "type": "string" + }, + "postal_code": { + "description": "ZIP or postal code.", + "maxLength": 5000, + "type": "string" + }, + "state": { + "description": "State, county, province, or region.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "optional_fields_address", + "type": "object" + }, + "name": { + "description": "Customer name.", + "maxLength": 5000, + "type": "string" + }, + "phone": { + "description": "Customer phone (including extension).", + "maxLength": 5000, + "type": "string" + } + }, + "required": [ + "address", + "name" + ], + "title": "customer_shipping", + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The customer's shipping information. Appears on invoices emailed to this customer." + }, + "tax": { + "description": "Tax details about the customer.", + "properties": { + "ip_address": { + "anyOf": [ + { + "type": "string" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes." + } + }, + "title": "tax_param", + "type": "object" + }, + "tax_exempt": { + "description": "The customer's tax exemption. One of `none`, `exempt`, or `reverse`.", + "enum": [ + "", + "exempt", + "none", + "reverse" + ], + "type": "string" + }, + "tax_ids": { + "description": "The customer's tax IDs.", + "items": { + "properties": { + "type": { + "description": "Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`", + "enum": [ + "ad_nrt", + "ae_trn", + "ar_cuit", + "au_abn", + "au_arn", + "bg_uic", + "bo_tin", + "br_cnpj", + "br_cpf", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "ch_vat", + "cl_tin", + "cn_tin", + "co_nit", + "cr_tin", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "hk_br", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kr_brn", + "li_uid", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "no_vat", + "nz_gst", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sv_nit", + "th_vat", + "tr_tin", + "tw_vat", + "ua_vat", + "us_ein", + "uy_ruc", + "ve_rif", + "vn_tin", + "za_vat" + ], + "maxLength": 5000, + "type": "string", + "x-stripeBypassValidation": true + }, + "value": { + "description": "Value of the tax ID.", + "type": "string" + } + }, + "required": [ + "type", + "value" + ], + "title": "data_params", + "type": "object" + }, + "type": "array" + } + }, + "title": "customer_details_param", + "type": "object" + }, + "discounts": { + "anyOf": [ + { + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead." + }, + "expand": { + "description": "Specifies which fields in the response should be expanded.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "invoice_items": { + "description": "List of invoice items to add or update in the upcoming invoice preview.", + "items": { + "properties": { + "amount": { + "description": "The integer amount in cents (or local equivalent) of previewed invoice item.", + "type": "integer" + }, + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.", + "type": "string" + }, + "description": { + "description": "An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.", + "maxLength": 5000, + "type": "string" + }, + "discountable": { + "description": "Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.", + "type": "boolean" + }, + "discounts": { + "anyOf": [ + { + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The coupons to redeem into discounts for the invoice item in the preview." + }, + "invoiceitem": { + "description": "The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.", + "maxLength": 5000, + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) 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`." + }, + "period": { + "description": "The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.", + "properties": { + "end": { + "description": "The end of the period, which must be greater than or equal to the start. This value is inclusive.", + "format": "unix-time", + "type": "integer" + }, + "start": { + "description": "The start of the period. This value is inclusive.", + "format": "unix-time", + "type": "integer" + } + }, + "required": [ + "end", + "start" + ], + "title": "period", + "type": "object" + }, + "price": { + "description": "The ID of the price object.", + "maxLength": 5000, + "type": "string" + }, + "price_data": { + "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", + "properties": { + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", + "type": "string" + }, + "product": { + "description": "The ID of the product that this price will belong to.", + "maxLength": 5000, + "type": "string" + }, + "tax_behavior": { + "description": "Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", + "enum": [ + "exclusive", + "inclusive", + "unspecified" + ], + "type": "string" + }, + "unit_amount": { + "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", + "type": "integer" + }, + "unit_amount_decimal": { + "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", + "format": "decimal", + "type": "string" + } + }, + "required": [ + "currency", + "product" + ], + "title": "one_time_price_data", + "type": "object" + }, + "quantity": { + "description": "Non-negative integer. The quantity of units for the invoice item.", + "type": "integer" + }, + "tax_behavior": { + "description": "Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", + "enum": [ + "exclusive", + "inclusive", + "unspecified" + ], + "type": "string" + }, + "tax_code": { + "anyOf": [ + { + "type": "string" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID." + }, + "tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item." + }, + "unit_amount": { + "description": "The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.", + "type": "integer" + }, + "unit_amount_decimal": { + "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", + "format": "decimal", + "type": "string" + } + }, + "title": "invoice_item_preview_params", + "type": "object" + }, + "type": "array" + }, + "issuer": { + "description": "The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.", + "properties": { + "account": { + "description": "The connected account being referenced when `type` is `account`.", + "type": "string" + }, + "type": { + "description": "Type of the account referenced in the request.", + "enum": [ + "account", + "self" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "param", + "type": "object" + }, + "on_behalf_of": { + "anyOf": [ + { + "type": "string" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details." + }, + "preview_mode": { + "description": "Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.", + "enum": [ + "next", + "recurring" + ], + "type": "string" + }, + "schedule": { + "description": "The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.", + "maxLength": 5000, + "type": "string" + }, + "schedule_details": { + "description": "The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.", + "properties": { + "amendments": { + "description": "Changes to apply to the phases of the subscription schedule, in the order provided.", + "items": { + "properties": { + "amendment_end": { + "description": "Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.", + "properties": { + "discount_end": { + "description": "Use the `end` time of a given discount.", + "properties": { + "discount": { + "description": "The ID of a specific discount.", + "maxLength": 5000, + "type": "string" + } + }, + "required": [ + "discount" + ], + "title": "discount_end_specs", + "type": "object" + }, + "duration": { + "description": "Time span for the amendment starting from the `amendment_start`.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "Select one of three ways to pass the `amendment_end`.", + "enum": [ + "discount_end", + "duration", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "amendment_start": { + "description": "Details to identify the earliest timestamp where the proposed change should take effect.", + "properties": { + "amendment_end": { + "description": "Details of another amendment in the same array, immediately after which this amendment should begin.", + "properties": { + "index": { + "description": "The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.", + "type": "integer" + } + }, + "required": [ + "index" + ], + "title": "amendment_end_index_specs", + "type": "object" + }, + "discount_end": { + "description": "Use the `end` time of a given discount.", + "properties": { + "discount": { + "description": "The ID of a specific discount.", + "maxLength": 5000, + "type": "string" + } + }, + "required": [ + "discount" + ], + "title": "discount_end_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the amendment to start.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "Select one of three ways to pass the `amendment_start`.", + "enum": [ + "amendment_end", + "discount_end", + "now", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "billing_cycle_anchor": { + "description": "For a point-in-time amendment, this attribute lets you set or update whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.", + "enum": [ + "amendment_start", + "automatic" + ], + "type": "string" + }, + "discount_actions": { + "description": "Changes to the coupons being redeemed or discounts being applied during the amendment time span.", + "items": { + "properties": { + "add": { + "description": "Details of the discount to add.", + "properties": { + "coupon": { + "description": "The coupon code to redeem.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "An ID of an existing discount for a coupon that was already redeemed.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "amendment_end" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "amendment_discount_end", + "type": "object" + }, + "index": { + "description": "The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.", + "type": "integer" + }, + "promotion_code": { + "description": "The promotion code to redeem.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "add_discount_specs", + "type": "object" + }, + "remove": { + "description": "Details of the discount to remove.", + "properties": { + "coupon": { + "description": "The coupon code to remove from the `discounts` array.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "The ID of a discount to remove from the `discounts` array.", + "maxLength": 5000, + "type": "string" + }, + "promotion_code": { + "description": "The ID of a promotion code to remove from the `discounts` array.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "remove_discount_specs", + "type": "object" + }, + "set": { + "description": "Details of the discount to replace the existing discounts with.", + "properties": { + "coupon": { + "description": "The coupon code to replace the `discounts` array with.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "An ID of an existing discount to replace the `discounts` array with.", + "maxLength": 5000, + "type": "string" + }, + "promotion_code": { + "description": "An ID of an existing promotion code to replace the `discounts` array with.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "set_discount_specs", + "type": "object" + }, + "type": { + "description": "Determines the type of discount action.", + "enum": [ + "add", + "remove", + "set" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "type": "array" + }, + "item_actions": { + "description": "Changes to the subscription items during the amendment time span.", + "items": { + "properties": { + "add": { + "description": "Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.", + "properties": { + "discounts": { + "description": "The discounts applied to the item. Subscription item discounts are applied before subscription discounts.", + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) 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`.", + "type": "object" + }, + "price": { + "description": "The ID of the price object.", + "maxLength": 5000, + "type": "string" + }, + "quantity": { + "description": "Quantity for this item.", + "type": "integer" + }, + "tax_rates": { + "description": "The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "trial": { + "description": "Options that configure the trial on the subscription item.", + "properties": { + "converts_to": { + "description": "List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "type": { + "description": "Determines the type of trial for this item.", + "enum": [ + "free", + "paid" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "trial_specs", + "type": "object" + } + }, + "required": [ + "price" + ], + "title": "add_item_specs", + "type": "object" + }, + "remove": { + "description": "Details of the subscription item to remove.", + "properties": { + "price": { + "description": "ID of a price to remove.", + "maxLength": 5000, + "type": "string" + } + }, + "required": [ + "price" + ], + "title": "remove_item_specs", + "type": "object" + }, + "set": { + "description": "Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.", + "properties": { + "discounts": { + "description": "If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.", + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.", + "type": "object" + }, + "price": { + "description": "The ID of the price object.", + "maxLength": 5000, + "type": "string" + }, + "quantity": { + "description": "If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.", + "type": "integer" + }, + "tax_rates": { + "description": "If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "trial": { + "description": "If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.", + "properties": { + "converts_to": { + "description": "List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "type": { + "description": "Determines the type of trial for this item.", + "enum": [ + "free", + "paid" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "trial_specs", + "type": "object" + } + }, + "required": [ + "price" + ], + "title": "set_item_specs", + "type": "object" + }, + "type": { + "description": "Determines the type of item action.", + "enum": [ + "add", + "remove", + "set" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "type": "array" + }, + "metadata_actions": { + "description": "Instructions for how to modify phase metadata", + "items": { + "properties": { + "add": { + "additionalProperties": { + "type": "string" + }, + "description": "Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.", + "type": "object" + }, + "remove": { + "description": "Keys to remove from schedule phase metadata.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "set": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten." + }, + "type": { + "description": "Select one of three ways to update phase-level `metadata` on subscription schedules.", + "enum": [ + "add", + "remove", + "set" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "type": "array" + }, + "proration_behavior": { + "description": "Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.", + "enum": [ + "always_invoice", + "create_prorations", + "none" + ], + "type": "string" + }, + "set_pause_collection": { + "description": "Defines how to pause collection for the underlying subscription throughout the duration of the amendment.", + "properties": { + "set": { + "description": "Details of the pause_collection behavior to apply to the amendment.", + "properties": { + "behavior": { + "description": "The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.", + "enum": [ + "keep_as_draft", + "mark_uncollectible", + "void" + ], + "type": "string" + } + }, + "required": [ + "behavior" + ], + "title": "pause_collection_params", + "type": "object" + }, + "type": { + "description": "Determines the type of the pause_collection amendment.", + "enum": [ + "remove", + "set" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "set_schedule_end": { + "description": "Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.", + "enum": [ + "amendment_end", + "amendment_start" + ], + "type": "string" + }, + "trial_settings": { + "description": "Settings related to subscription trials.", + "properties": { + "end_behavior": { + "description": "Defines how the subscription should behave when a trial ends.", + "properties": { + "prorate_up_front": { + "description": "Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.", + "enum": [ + "defer", + "include" + ], + "type": "string" + } + }, + "title": "end_behavior_specs", + "type": "object" + } + }, + "title": "trial_settings_specs", + "type": "object" + } + }, + "required": [ + "amendment_start" + ], + "title": "amendment_specs", + "type": "object" + }, + "type": "array" + }, + "billing_behavior": { + "description": "Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.", + "enum": [ + "prorate_on_next_phase", + "prorate_up_front" + ], + "type": "string" + }, + "end_behavior": { + "description": "Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.", + "enum": [ + "cancel", + "release" + ], + "type": "string" + }, + "phases": { + "description": "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_date` of one phase will always equal the `start_date` of the next phase.", + "items": { + "properties": { + "add_invoice_items": { + "description": "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.", + "items": { + "properties": { + "discounts": { + "description": "The coupons to redeem into discounts for the item.", + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + "price": { + "description": "The ID of the price object.", + "maxLength": 5000, + "type": "string" + }, + "price_data": { + "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", + "properties": { + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", + "type": "string" + }, + "product": { + "description": "The ID of the product that this price will belong to.", + "maxLength": 5000, + "type": "string" + }, + "tax_behavior": { + "description": "Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", + "enum": [ + "exclusive", + "inclusive", + "unspecified" + ], + "type": "string" + }, + "unit_amount": { + "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", + "type": "integer" + }, + "unit_amount_decimal": { + "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", + "format": "decimal", + "type": "string" + } + }, + "required": [ + "currency", + "product" + ], + "title": "one_time_price_data_with_negative_amounts", + "type": "object" + }, + "quantity": { + "description": "Quantity for this item. Defaults to 1.", + "type": "integer" + }, + "tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item." + } + }, + "title": "add_invoice_item_entry", + "type": "object", + "x-stripeParam": { + "class_name": "AddInvoiceItem" + } + }, + "type": "array" + }, + "application_fee_percent": { + "description": "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](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", + "type": "number" + }, + "automatic_tax": { + "description": "Automatic tax settings for this phase.", + "properties": { + "enabled": { + "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", + "type": "boolean" + }, + "liability": { + "description": "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.", + "properties": { + "account": { + "description": "The connected account being referenced when `type` is `account`.", + "type": "string" + }, + "type": { + "description": "Type of the account referenced in the request.", + "enum": [ + "account", + "self" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "param", + "type": "object" + } + }, + "required": [ + "enabled" + ], + "title": "automatic_tax_config", + "type": "object" + }, + "billing_cycle_anchor": { + "description": "Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", + "enum": [ + "automatic", + "phase_start" + ], + "type": "string" + }, + "billing_thresholds": { + "anyOf": [ + { + "properties": { + "amount_gte": { + "description": "Monetary threshold that triggers the subscription to advance to a new billing period", + "type": "integer" + }, + "reset_billing_cycle_anchor": { + "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", + "type": "boolean" + } + }, + "title": "billing_thresholds_param", + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "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." + }, + "collection_method": { + "description": "Either `charge_automatically`, or `send_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 as `active`. Defaults to `charge_automatically` on creation.", + "enum": [ + "charge_automatically", + "send_invoice" + ], + "type": "string" + }, + "coupon": { + "description": "The identifier of the coupon to apply to this phase of the subscription schedule.", + "maxLength": 5000, + "type": "string" + }, + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", + "type": "string" + }, + "default_payment_method": { + "description": "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.", + "maxLength": 5000, + "type": "string" + }, + "default_tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase." + }, + "description": { + "anyOf": [ + { + "maxLength": 500, + "type": "string" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "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." + }, + "discounts": { + "anyOf": [ + { + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "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." + }, + "end_date": { + "anyOf": [ + { + "format": "unix-time", + "type": "integer" + }, + { + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + } + ], + "description": "The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set." + }, + "invoice_settings": { + "description": "All invoices will be billed using the specified settings.", + "properties": { + "days_until_due": { + "description": "Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.", + "type": "integer" + }, + "issuer": { + "description": "The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.", + "properties": { + "account": { + "description": "The connected account being referenced when `type` is `account`.", + "type": "string" + }, + "type": { + "description": "Type of the account referenced in the request.", + "enum": [ + "account", + "self" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "param", + "type": "object" + } + }, + "title": "invoice_settings", + "type": "object" + }, + "items": { + "description": "List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.", + "items": { + "properties": { + "billing_thresholds": { + "anyOf": [ + { + "properties": { + "usage_gte": { + "description": "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](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))", + "type": "integer" + } + }, + "required": [ + "usage_gte" + ], + "title": "item_billing_thresholds_param", + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." + }, + "discounts": { + "anyOf": [ + { + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The coupons to redeem into discounts for the subscription item." + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.", + "type": "object" + }, + "plan": { + "description": "The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.", + "maxLength": 5000, + "type": "string" + }, + "price": { + "description": "The ID of the price object.", + "maxLength": 5000, + "type": "string" + }, + "price_data": { + "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", + "properties": { + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", + "type": "string" + }, + "product": { + "description": "The ID of the product that this price will belong to.", + "maxLength": 5000, + "type": "string" + }, + "recurring": { + "description": "The recurring components of a price such as `interval` and `interval_count`.", + "properties": { + "interval": { + "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).", + "type": "integer" + } + }, + "required": [ + "interval" + ], + "title": "recurring_adhoc", + "type": "object" + }, + "tax_behavior": { + "description": "Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", + "enum": [ + "exclusive", + "inclusive", + "unspecified" + ], + "type": "string" + }, + "unit_amount": { + "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", + "type": "integer" + }, + "unit_amount_decimal": { + "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", + "format": "decimal", + "type": "string" + } + }, + "required": [ + "currency", + "product", + "recurring" + ], + "title": "recurring_price_data", + "type": "object" + }, + "quantity": { + "description": "Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.", + "type": "integer" + }, + "tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." + }, + "trial": { + "description": "Options that configure the trial on the subscription item.", + "properties": { + "converts_to": { + "description": "List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "type": { + "description": "Determines the type of trial for this item.", + "enum": [ + "free", + "paid" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "trial_specs", + "type": "object" + } + }, + "title": "configuration_item_params", + "type": "object" + }, + "type": "array" + }, + "iterations": { + "description": "Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.", + "type": "integer" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.", + "type": "object" + }, + "on_behalf_of": { + "description": "The account on behalf of which to charge, for each of the associated subscription's invoices.", + "type": "string" + }, + "pause_collection": { + "description": "If specified, payment collection for this subscription will be paused.", + "properties": { + "behavior": { + "description": "The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.", + "enum": [ + "keep_as_draft", + "mark_uncollectible", + "void" + ], + "type": "string" + } + }, + "required": [ + "behavior" + ], + "title": "pause_collection_params", + "type": "object" + }, + "proration_behavior": { + "description": "Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.", + "enum": [ + "always_invoice", + "create_prorations", + "none" + ], + "type": "string" + }, + "start_date": { + "anyOf": [ + { + "format": "unix-time", + "type": "integer" + }, + { + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + } + ], + "description": "The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase." + }, + "transfer_data": { + "description": "The data with which to automatically create a Transfer for each of the associated subscription's invoices.", + "properties": { + "amount_percent": { + "description": "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.", + "type": "number" + }, + "destination": { + "description": "ID of an existing, connected Stripe account.", + "type": "string" + } + }, + "required": [ + "destination" + ], + "title": "transfer_data_specs", + "type": "object" + }, + "trial": { + "description": "If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.", + "type": "boolean" + }, + "trial_continuation": { + "description": "Specify trial behavior when crossing phase boundaries", + "enum": [ + "continue", + "none" + ], + "type": "string" + }, + "trial_end": { + "anyOf": [ + { + "format": "unix-time", + "type": "integer" + }, + { + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + } + ], + "description": "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`" + }, + "trial_settings": { + "description": "Settings related to subscription trials.", + "properties": { + "end_behavior": { + "description": "Defines how the subscription should behave when a trial ends.", + "properties": { + "prorate_up_front": { + "description": "Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.", + "enum": [ + "defer", + "include" + ], + "type": "string" + } + }, + "title": "end_behavior_specs", + "type": "object" + } + }, + "title": "trial_settings_specs", + "type": "object" + } + }, + "required": [ + "items" + ], + "title": "phase_configuration_params", + "type": "object" + }, + "type": "array" + }, + "prebilling": { + "anyOf": [ + { + "items": { + "properties": { + "bill_until": { + "description": "The end of the prebilled time period.", + "properties": { + "amendment_end": { + "description": "End the prebilled period when a specified amendment ends.", + "properties": { + "index": { + "description": "The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.", + "type": "integer" + } + }, + "required": [ + "index" + ], + "title": "amendment_end_specs", + "type": "object" + }, + "duration": { + "description": "Time span for prebilling, starting from `bill_from`.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "duration_specs", + "type": "object" + }, + "timestamp": { + "description": "End the prebilled period at a precise integer timestamp, starting from the Unix epoch.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "Select one of several ways to pass the `bill_until` value.", + "enum": [ + "amendment_end", + "duration", + "schedule_end", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "specs", + "type": "object" + }, + "iterations": { + "description": "This is used to determine the number of billing cycles to prebill.", + "type": "integer" + } + }, + "title": "prebilling_params", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Provide any time periods to bill in advance." + }, + "proration_behavior": { + "description": "In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.", + "enum": [ + "always_invoice", + "create_prorations", + "none" + ], + "type": "string" + } + }, + "title": "schedule_details_params", + "type": "object" + }, + "subscription": { + "description": "The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.", + "maxLength": 5000, + "type": "string" + }, + "subscription_billing_cycle_anchor": { + "anyOf": [ + { + "enum": [ + "now", + "unchanged" + ], + "maxLength": 5000, + "type": "string" + }, + { + "format": "unix-time", + "type": "integer" + } + ], + "description": "For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead." + }, + "subscription_cancel_at": { + "anyOf": [ + { + "format": "unix-time", + "type": "integer" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead." + }, + "subscription_cancel_at_period_end": { + "description": "Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead.", + "type": "boolean" + }, + "subscription_cancel_now": { + "description": "This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead.", + "type": "boolean" + }, + "subscription_default_tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead." + }, + "subscription_details": { + "description": "The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.", + "properties": { + "billing_cycle_anchor": { + "anyOf": [ + { + "enum": [ + "now", + "unchanged" + ], + "maxLength": 5000, + "type": "string" + }, + { + "format": "unix-time", + "type": "integer" + } + ], + "description": "For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`." + }, + "cancel_at": { + "anyOf": [ + { + "format": "unix-time", + "type": "integer" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period." + }, + "cancel_at_period_end": { + "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", + "type": "boolean" + }, + "cancel_now": { + "description": "This simulates the subscription being canceled or expired immediately.", + "type": "boolean" + }, + "default_tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set." + }, + "items": { + "description": "A list of up to 20 subscription items, each with an attached price.", + "items": { + "properties": { + "billing_thresholds": { + "anyOf": [ + { + "properties": { + "usage_gte": { + "description": "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](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))", + "type": "integer" + } + }, + "required": [ + "usage_gte" + ], + "title": "item_billing_thresholds_param", + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." + }, + "clear_usage": { + "description": "Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`.", + "type": "boolean" + }, + "deleted": { + "description": "A flag that, if set to `true`, will delete the specified item.", + "type": "boolean" + }, + "discounts": { + "anyOf": [ + { + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The coupons to redeem into discounts for the subscription item." + }, + "id": { + "description": "Subscription item to update.", + "maxLength": 5000, + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) 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`." + }, + "plan": { + "description": "Plan ID for this item, as a string.", + "maxLength": 5000, + "type": "string" + }, + "price": { + "description": "The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.", + "maxLength": 5000, + "type": "string" + }, + "price_data": { + "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", + "properties": { + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", + "type": "string" + }, + "product": { + "description": "The ID of the product that this price will belong to.", + "maxLength": 5000, + "type": "string" + }, + "recurring": { + "description": "The recurring components of a price such as `interval` and `interval_count`.", + "properties": { + "interval": { + "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).", + "type": "integer" + } + }, + "required": [ + "interval" + ], + "title": "recurring_adhoc", + "type": "object" + }, + "tax_behavior": { + "description": "Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", + "enum": [ + "exclusive", + "inclusive", + "unspecified" + ], + "type": "string" + }, + "unit_amount": { + "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", + "type": "integer" + }, + "unit_amount_decimal": { + "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", + "format": "decimal", + "type": "string" + } + }, + "required": [ + "currency", + "product", + "recurring" + ], + "title": "recurring_price_data", + "type": "object" + }, + "quantity": { + "description": "Quantity for this item.", + "type": "integer" + }, + "tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." + } + }, + "title": "subscription_item_update_params", + "type": "object" + }, + "type": "array" + }, + "prebilling": { + "description": "The pre-billing to apply to the subscription as a preview.", + "properties": { + "iterations": { + "description": "This is used to determine the number of billing cycles to prebill.", + "type": "integer" + } + }, + "required": [ + "iterations" + ], + "title": "prebilling_preview_params", + "type": "object" + }, + "proration_behavior": { + "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.", + "enum": [ + "always_invoice", + "create_prorations", + "none" + ], + "type": "string" + }, + "proration_date": { + "description": "If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.", + "format": "unix-time", + "type": "integer" + }, + "resume_at": { + "description": "For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.", + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + }, + "start_date": { + "description": "Date a subscription is intended to start (can be future or past).", + "format": "unix-time", + "type": "integer" + }, + "trial_end": { + "anyOf": [ + { + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + }, + { + "format": "unix-time", + "type": "integer" + } + ], + "description": "If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required." + } + }, + "title": "subscription_details_params", + "type": "object" + }, + "subscription_items": { + "description": "A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead.", + "items": { + "properties": { + "billing_thresholds": { + "anyOf": [ + { + "properties": { + "usage_gte": { + "description": "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](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))", + "type": "integer" + } + }, + "required": [ + "usage_gte" + ], + "title": "item_billing_thresholds_param", + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." + }, + "clear_usage": { + "description": "Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`.", + "type": "boolean" + }, + "deleted": { + "description": "A flag that, if set to `true`, will delete the specified item.", + "type": "boolean" + }, + "discounts": { + "anyOf": [ + { + "items": { + "properties": { + "coupon": { + "description": "ID of the coupon to create a new discount for.", + "maxLength": 5000, + "type": "string" + }, + "discount": { + "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", + "maxLength": 5000, + "type": "string" + }, + "discount_end": { + "description": "Details to determine how long the discount should be applied for.", + "properties": { + "duration": { + "description": "Time span for the redeemed discount.", + "properties": { + "interval": { + "description": "Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.", + "type": "integer" + } + }, + "required": [ + "interval", + "interval_count" + ], + "title": "discount_end_duration_specs", + "type": "object" + }, + "timestamp": { + "description": "A precise Unix timestamp for the discount to end. Must be in the future.", + "format": "unix-time", + "type": "integer" + }, + "type": { + "description": "The type of calculation made to determine when the discount ends.", + "enum": [ + "duration", + "timestamp" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "discount_end", + "type": "object" + }, + "promotion_code": { + "description": "ID of the promotion code to create a new discount for.", + "maxLength": 5000, + "type": "string" + } + }, + "title": "discounts_data_param", + "type": "object" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "The coupons to redeem into discounts for the subscription item." + }, + "id": { + "description": "Subscription item to update.", + "maxLength": 5000, + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) 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`." + }, + "plan": { + "description": "Plan ID for this item, as a string.", + "maxLength": 5000, + "type": "string" + }, + "price": { + "description": "The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.", + "maxLength": 5000, + "type": "string" + }, + "price_data": { + "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", + "properties": { + "currency": { + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", + "type": "string" + }, + "product": { + "description": "The ID of the product that this price will belong to.", + "maxLength": 5000, + "type": "string" + }, + "recurring": { + "description": "The recurring components of a price such as `interval` and `interval_count`.", + "properties": { + "interval": { + "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", + "enum": [ + "day", + "month", + "week", + "year" + ], + "type": "string" + }, + "interval_count": { + "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).", + "type": "integer" + } + }, + "required": [ + "interval" + ], + "title": "recurring_adhoc", + "type": "object" + }, + "tax_behavior": { + "description": "Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) 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`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", + "enum": [ + "exclusive", + "inclusive", + "unspecified" + ], + "type": "string" + }, + "unit_amount": { + "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", + "type": "integer" + }, + "unit_amount_decimal": { + "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", + "format": "decimal", + "type": "string" + } + }, + "required": [ + "currency", + "product", + "recurring" + ], + "title": "recurring_price_data", + "type": "object" + }, + "quantity": { + "description": "Quantity for this item.", + "type": "integer" + }, + "tax_rates": { + "anyOf": [ + { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + { + "enum": [ + "" + ], + "type": "string" + } + ], + "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." + } + }, + "title": "subscription_item_update_params", + "type": "object" + }, + "type": "array" + }, + "subscription_prebilling": { + "description": "The pre-billing to apply to the subscription as a preview. This field has been deprecated and will be removed in a future API version. Use `subscription_details.prebilling` instead.", + "properties": { + "iterations": { + "description": "This is used to determine the number of billing cycles to prebill.", + "type": "integer" + } + }, + "required": [ + "iterations" + ], + "title": "prebilling_preview_params", + "type": "object" + }, + "subscription_proration_behavior": { + "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead.", + "enum": [ + "always_invoice", + "create_prorations", + "none" + ], + "type": "string" + }, + "subscription_proration_date": { + "description": "If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead.", + "format": "unix-time", + "type": "integer" + }, + "subscription_resume_at": { + "description": "For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead.", + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + }, + "subscription_start_date": { + "description": "Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead.", + "format": "unix-time", + "type": "integer" + }, + "subscription_trial_end": { + "anyOf": [ + { + "enum": [ + "now" + ], + "maxLength": 5000, + "type": "string" + }, + { + "format": "unix-time", + "type": "integer" + } + ], + "description": "If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead." + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/invoice" + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + } + }, "/v1/invoices/search": { "get": { "description": "

Search for invoices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.

", diff --git a/openapi/spec3.beta.sdk.yaml b/openapi/spec3.beta.sdk.yaml index c9075320..8ec586f1 100644 --- a/openapi/spec3.beta.sdk.yaml +++ b/openapi/spec3.beta.sdk.yaml @@ -18020,6 +18020,11 @@ components: method_type: custom operation: post path: '/v1/invoices/{invoice}/void' + - method_name: create_preview + method_on: service + method_type: custom + operation: post + path: /v1/invoices/create_preview x-stripeResource: class_name: Invoice has_collection_class: true @@ -89643,6 +89648,3362 @@ paths: schema: $ref: '#/components/schemas/error' description: Error response. + /v1/invoices/create_preview: + post: + description: >- +

At any time, you can preview the upcoming invoice for a customer. + This will show you all the charges that are pending, including + subscription renewal charges, invoice item charges, etc. It will also + show you any discounts that are applicable to the invoice.

+ + +

Note that when you are viewing an upcoming invoice, you are simply + viewing a preview – the invoice has not yet been created. As such, the + upcoming invoice will not show up in invoice listing calls, and you + cannot use the API to pay or edit the invoice. If you want to change the + amount that your customer will be billed, you can add, remove, or update + pending invoice items, or update the customer’s discount.

+ + +

You can preview the effects of updating a subscription, including a + preview of what proration will take place. To ensure that the actual + proration is calculated exactly the same as the previewed proration, you + should pass a proration_date parameter when doing the + actual subscription update. The value passed in should be the same as + the subscription_proration_date returned on the upcoming + invoice resource. The recommended way to get only the prorations being + previewed is to consider only proration line items where + period[start] is equal to the + subscription_proration_date on the upcoming invoice + resource.

+ operationId: PostInvoicesCreatePreview + requestBody: + content: + application/x-www-form-urlencoded: + encoding: + automatic_tax: + explode: true + style: deepObject + customer_details: + explode: true + style: deepObject + discounts: + explode: true + style: deepObject + expand: + explode: true + style: deepObject + invoice_items: + explode: true + style: deepObject + issuer: + explode: true + style: deepObject + on_behalf_of: + explode: true + style: deepObject + schedule_details: + explode: true + style: deepObject + subscription_billing_cycle_anchor: + explode: true + style: deepObject + subscription_cancel_at: + explode: true + style: deepObject + subscription_default_tax_rates: + explode: true + style: deepObject + subscription_details: + explode: true + style: deepObject + subscription_items: + explode: true + style: deepObject + subscription_prebilling: + explode: true + style: deepObject + subscription_trial_end: + explode: true + style: deepObject + schema: + additionalProperties: false + properties: + automatic_tax: + description: Settings for automatic tax lookup for this invoice preview. + properties: + enabled: + description: >- + Whether Stripe automatically computes tax on this + invoice. Note that incompatible invoice items (invoice + items with manually specified [tax + rates](https://stripe.com/docs/api/tax_rates), negative + amounts, or `tax_behavior=unspecified`) cannot be added + to automatic tax invoices. + type: boolean + liability: + description: >- + 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. + properties: + account: + description: >- + The connected account being referenced when `type` + is `account`. + type: string + type: + description: Type of the account referenced in the request. + enum: + - account + - self + type: string + required: + - type + title: param + type: object + required: + - enabled + title: automatic_tax_param + type: object + coupon: + description: >- + The code of the coupon to apply. If `subscription` or + `subscription_items` is provided, the invoice returned will + preview updating or creating a subscription with that + coupon. Otherwise, it will preview applying that coupon to + the customer for the next upcoming invoice from among the + customer's subscriptions. The invoice can be previewed + without a coupon by passing this value as an empty string. + maxLength: 5000 + type: string + currency: + description: >- + The currency to preview this invoice in. Defaults to that of + `customer` if not specified. + type: string + customer: + description: >- + The identifier of the customer whose upcoming invoice you'd + like to retrieve. If `automatic_tax` is enabled then one of + `customer`, `customer_details`, `subscription`, or + `schedule` must be set. + maxLength: 5000 + type: string + customer_details: + description: >- + Details about the customer you want to invoice or overrides + for an existing customer. If `automatic_tax` is enabled then + one of `customer`, `customer_details`, `subscription`, or + `schedule` must be set. + properties: + address: + anyOf: + - properties: + city: + description: 'City, district, suburb, town, or village.' + maxLength: 5000 + type: string + country: + description: >- + Two-letter country code ([ISO 3166-1 + alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + maxLength: 5000 + type: string + line1: + description: >- + Address line 1 (e.g., street, PO Box, or company + name). + maxLength: 5000 + type: string + line2: + description: >- + Address line 2 (e.g., apartment, suite, unit, or + building). + maxLength: 5000 + type: string + postal_code: + description: ZIP or postal code. + maxLength: 5000 + type: string + state: + description: 'State, county, province, or region.' + maxLength: 5000 + type: string + title: optional_fields_address + type: object + - enum: + - '' + type: string + description: The customer's address. + shipping: + anyOf: + - properties: + address: + description: Customer shipping address. + properties: + city: + description: 'City, district, suburb, town, or village.' + maxLength: 5000 + type: string + country: + description: >- + Two-letter country code ([ISO 3166-1 + alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + maxLength: 5000 + type: string + line1: + description: >- + Address line 1 (e.g., street, PO Box, or + company name). + maxLength: 5000 + type: string + line2: + description: >- + Address line 2 (e.g., apartment, suite, + unit, or building). + maxLength: 5000 + type: string + postal_code: + description: ZIP or postal code. + maxLength: 5000 + type: string + state: + description: 'State, county, province, or region.' + maxLength: 5000 + type: string + title: optional_fields_address + type: object + name: + description: Customer name. + maxLength: 5000 + type: string + phone: + description: Customer phone (including extension). + maxLength: 5000 + type: string + required: + - address + - name + title: customer_shipping + type: object + - enum: + - '' + type: string + description: >- + The customer's shipping information. Appears on invoices + emailed to this customer. + tax: + description: Tax details about the customer. + properties: + ip_address: + anyOf: + - type: string + - enum: + - '' + type: string + description: >- + A recent IP address of the customer used for tax + reporting and tax location inference. Stripe + recommends updating the IP address when a new + PaymentMethod is attached or the address field on + the customer is updated. We recommend against + updating this field more frequently since it could + result in unexpected tax location/reporting + outcomes. + title: tax_param + type: object + tax_exempt: + description: >- + The customer's tax exemption. One of `none`, `exempt`, + or `reverse`. + enum: + - '' + - exempt + - none + - reverse + type: string + tax_ids: + description: The customer's tax IDs. + items: + properties: + type: + description: >- + Type of the tax ID, one of `ad_nrt`, `ae_trn`, + `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, + `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, + `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, + `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, + `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, + `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, + `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, + `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, + `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, + `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, + `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, + `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, + `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, + `ve_rif`, `vn_tin`, or `za_vat` + enum: + - ad_nrt + - ae_trn + - ar_cuit + - au_abn + - au_arn + - bg_uic + - bo_tin + - br_cnpj + - br_cpf + - ca_bn + - ca_gst_hst + - ca_pst_bc + - ca_pst_mb + - ca_pst_sk + - ca_qst + - ch_vat + - cl_tin + - cn_tin + - co_nit + - cr_tin + - do_rcn + - ec_ruc + - eg_tin + - es_cif + - eu_oss_vat + - eu_vat + - gb_vat + - ge_vat + - hk_br + - hu_tin + - id_npwp + - il_vat + - in_gst + - is_vat + - jp_cn + - jp_rn + - jp_trn + - ke_pin + - kr_brn + - li_uid + - mx_rfc + - my_frp + - my_itn + - my_sst + - no_vat + - nz_gst + - pe_ruc + - ph_tin + - ro_tin + - rs_pib + - ru_inn + - ru_kpp + - sa_vat + - sg_gst + - sg_uen + - si_tin + - sv_nit + - th_vat + - tr_tin + - tw_vat + - ua_vat + - us_ein + - uy_ruc + - ve_rif + - vn_tin + - za_vat + maxLength: 5000 + type: string + x-stripeBypassValidation: true + value: + description: Value of the tax ID. + type: string + required: + - type + - value + title: data_params + type: object + type: array + title: customer_details_param + type: object + discounts: + anyOf: + - items: + properties: + coupon: + description: ID of the coupon to create a new discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object (or one + of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the discount should + be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. Either + `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the discount to + end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to determine when + the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new discount + for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + - enum: + - '' + type: string + description: >- + The coupons to redeem into discounts for the invoice + preview. If not specified, inherits the discount from the + customer or subscription. This only works for coupons + directly applied to the invoice. To apply a coupon to a + subscription, you must use the `coupon` parameter instead. + Pass an empty string to avoid inheriting any discounts. To + preview the upcoming invoice for a subscription that hasn't + been created, use `coupon` instead. + expand: + description: Specifies which fields in the response should be expanded. + items: + maxLength: 5000 + type: string + type: array + invoice_items: + description: >- + List of invoice items to add or update in the upcoming + invoice preview. + items: + properties: + amount: + description: >- + The integer amount in cents (or local equivalent) of + previewed invoice item. + type: integer + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). Only + applicable to new invoice items. + type: string + description: + description: >- + An arbitrary string which you can attach to the + invoice item. The description is displayed in the + invoice for easy tracking. + maxLength: 5000 + type: string + discountable: + description: >- + Explicitly controls whether discounts apply to this + invoice item. Defaults to true, except for negative + invoice items. + type: boolean + discounts: + anyOf: + - items: + properties: + coupon: + description: >- + ID of the coupon to create a new discount + for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object (or + one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the discount + should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + - enum: + - '' + type: string + description: >- + The coupons to redeem into discounts for the invoice + item in the preview. + invoiceitem: + description: >- + The ID of the invoice item to update in preview. If + not specified, a new invoice item will be added to the + preview of the upcoming invoice. + maxLength: 5000 + type: string + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - enum: + - '' + type: string + description: >- + Set of [key-value + pairs](https://stripe.com/docs/api/metadata) 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`. + period: + description: >- + The period associated with this invoice item. When set + to different values, the period will be rendered on + the invoice. If you have [Stripe Revenue + Recognition](https://stripe.com/docs/revenue-recognition) + enabled, the period will be used to recognize and + defer revenue. See the [Revenue Recognition + documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) + for details. + properties: + end: + description: >- + The end of the period, which must be greater than + or equal to the start. This value is inclusive. + format: unix-time + type: integer + start: + description: The start of the period. This value is inclusive. + format: unix-time + type: integer + required: + - end + - start + title: period + type: object + price: + description: The ID of the price object. + maxLength: 5000 + type: string + price_data: + description: >- + Data used to generate a new + [Price](https://stripe.com/docs/api/prices) object + inline. + properties: + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). + type: string + product: + description: >- + The ID of the product that this price will belong + to. + maxLength: 5000 + type: string + tax_behavior: + description: >- + Only required if a [default tax + behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) + 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`, or `unspecified`. Once + specified as either `inclusive` or `exclusive`, it + cannot be changed. + enum: + - exclusive + - inclusive + - unspecified + type: string + unit_amount: + description: >- + A positive integer in cents (or local equivalent) + (or 0 for a free price) representing how much to + charge. + type: integer + unit_amount_decimal: + description: >- + Same as `unit_amount`, but accepts a decimal value + in cents (or local equivalent) with at most 12 + decimal places. Only one of `unit_amount` and + `unit_amount_decimal` can be set. + format: decimal + type: string + required: + - currency + - product + title: one_time_price_data + type: object + quantity: + description: >- + Non-negative integer. The quantity of units for the + invoice item. + type: integer + tax_behavior: + description: >- + Only required if a [default tax + behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) + 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`, + or `unspecified`. Once specified as either `inclusive` + or `exclusive`, it cannot be changed. + enum: + - exclusive + - inclusive + - unspecified + type: string + tax_code: + anyOf: + - type: string + - enum: + - '' + type: string + description: >- + A [tax + code](https://stripe.com/docs/tax/tax-categories) ID. + tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + The tax rates that apply to the item. When set, any + `default_tax_rates` do not apply to this item. + unit_amount: + description: >- + The integer unit amount in cents (or local equivalent) + of the charge to be applied to the upcoming invoice. + This unit_amount will be multiplied by the quantity to + get the full amount. If you want to apply a credit to + the customer's account, pass a negative unit_amount. + type: integer + unit_amount_decimal: + description: >- + Same as `unit_amount`, but accepts a decimal value in + cents (or local equivalent) with at most 12 decimal + places. Only one of `unit_amount` and + `unit_amount_decimal` can be set. + format: decimal + type: string + title: invoice_item_preview_params + type: object + type: array + issuer: + description: >- + The connected account that issues the invoice. The invoice + is presented with the branding and support information of + the specified account. + properties: + account: + description: >- + The connected account being referenced when `type` is + `account`. + type: string + type: + description: Type of the account referenced in the request. + enum: + - account + - self + type: string + required: + - type + title: param + type: object + on_behalf_of: + anyOf: + - type: string + - enum: + - '' + type: string + description: >- + The account (if any) for which the funds of the invoice + payment are intended. If set, the invoice will be presented + with the branding and support information of the specified + account. See the [Invoices with + Connect](https://stripe.com/docs/billing/invoices/connect) + documentation for details. + preview_mode: + description: >- + Customizes the types of values to include when calculating + the invoice. Defaults to `next` if unspecified. + enum: + - next + - recurring + type: string + schedule: + description: >- + The identifier of the schedule whose upcoming invoice you'd + like to retrieve. Cannot be used with subscription or + subscription fields. + maxLength: 5000 + type: string + schedule_details: + description: >- + The schedule creation or modification params to apply as a + preview. Cannot be used with `subscription` or + `subscription_` prefixed fields. + properties: + amendments: + description: >- + Changes to apply to the phases of the subscription + schedule, in the order provided. + items: + properties: + amendment_end: + description: >- + Details to identify the end of the time range + modified by the proposed change. If not supplied, + the amendment is considered a point-in-time + operation that only affects the exact timestamp at + `amendment_start`, and a restricted set of + attributes is supported on the amendment. + properties: + discount_end: + description: Use the `end` time of a given discount. + properties: + discount: + description: The ID of a specific discount. + maxLength: 5000 + type: string + required: + - discount + title: discount_end_specs + type: object + duration: + description: >- + Time span for the amendment starting from the + `amendment_start`. + properties: + interval: + description: >- + Specifies a type of interval unit. Either + `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the amendment to + end. Must be after the `amendment_start`. + format: unix-time + type: integer + type: + description: >- + Select one of three ways to pass the + `amendment_end`. + enum: + - discount_end + - duration + - schedule_end + - timestamp + - trial_end + - trial_start + - upcoming_invoice + type: string + required: + - type + title: specs + type: object + amendment_start: + description: >- + Details to identify the earliest timestamp where + the proposed change should take effect. + properties: + amendment_end: + description: >- + Details of another amendment in the same + array, immediately after which this amendment + should begin. + properties: + index: + description: >- + The position of the previous amendment in + the `amendments` array after which this + amendment should begin. Indexes start from + 0 and must be less than the index of the + current amendment in the array. + type: integer + required: + - index + title: amendment_end_index_specs + type: object + discount_end: + description: Use the `end` time of a given discount. + properties: + discount: + description: The ID of a specific discount. + maxLength: 5000 + type: string + required: + - discount + title: discount_end_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the amendment to + start. + format: unix-time + type: integer + type: + description: >- + Select one of three ways to pass the + `amendment_start`. + enum: + - amendment_end + - discount_end + - now + - schedule_end + - timestamp + - trial_end + - trial_start + - upcoming_invoice + type: string + required: + - type + title: specs + type: object + billing_cycle_anchor: + description: >- + For a point-in-time amendment, this attribute lets + you set or update whether the subscription's + billing cycle anchor is reset at the + `amendment_start` timestamp. + enum: + - amendment_start + - automatic + type: string + discount_actions: + description: >- + Changes to the coupons being redeemed or discounts + being applied during the amendment time span. + items: + properties: + add: + description: Details of the discount to add. + properties: + coupon: + description: The coupon code to redeem. + maxLength: 5000 + type: string + discount: + description: >- + An ID of an existing discount for a + coupon that was already redeemed. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - amendment_end + type: string + required: + - type + title: amendment_discount_end + type: object + index: + description: >- + The index, starting at 0, at which to + position the new discount. When not + supplied, Stripe defaults to appending + the discount to the end of the + `discounts` array. + type: integer + promotion_code: + description: The promotion code to redeem. + maxLength: 5000 + type: string + title: add_discount_specs + type: object + remove: + description: Details of the discount to remove. + properties: + coupon: + description: >- + The coupon code to remove from the + `discounts` array. + maxLength: 5000 + type: string + discount: + description: >- + The ID of a discount to remove from the + `discounts` array. + maxLength: 5000 + type: string + promotion_code: + description: >- + The ID of a promotion code to remove + from the `discounts` array. + maxLength: 5000 + type: string + title: remove_discount_specs + type: object + set: + description: >- + Details of the discount to replace the + existing discounts with. + properties: + coupon: + description: >- + The coupon code to replace the + `discounts` array with. + maxLength: 5000 + type: string + discount: + description: >- + An ID of an existing discount to replace + the `discounts` array with. + maxLength: 5000 + type: string + promotion_code: + description: >- + An ID of an existing promotion code to + replace the `discounts` array with. + maxLength: 5000 + type: string + title: set_discount_specs + type: object + type: + description: Determines the type of discount action. + enum: + - add + - remove + - set + type: string + required: + - type + title: specs + type: object + type: array + item_actions: + description: >- + Changes to the subscription items during the + amendment time span. + items: + properties: + add: + description: >- + Details of the subscription item to add. If + an item with the same `price` exists, it + will be replaced by this new item. + Otherwise, it adds the new item. + properties: + discounts: + description: >- + The discounts applied to the item. + Subscription item discounts are applied + before subscription discounts. + items: + properties: + coupon: + description: >- + ID of the coupon to create a new + discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object + (or one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + metadata: + additionalProperties: + type: string + description: >- + Set of [key-value + pairs](https://stripe.com/docs/api/metadata) + 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`. + type: object + price: + description: The ID of the price object. + maxLength: 5000 + type: string + quantity: + description: Quantity for this item. + type: integer + tax_rates: + description: >- + The tax rates that apply to this + subscription item. When set, the + `default_tax_rates` on the subscription + do not apply to this + `subscription_item`. + items: + maxLength: 5000 + type: string + type: array + trial: + description: >- + Options that configure the trial on the + subscription item. + properties: + converts_to: + description: >- + List of price IDs which, if present on + the subscription following a paid trial, + constitute opting-in to the paid trial. + items: + maxLength: 5000 + type: string + type: array + type: + description: >- + Determines the type of trial for this + item. + enum: + - free + - paid + type: string + required: + - type + title: trial_specs + type: object + required: + - price + title: add_item_specs + type: object + remove: + description: Details of the subscription item to remove. + properties: + price: + description: ID of a price to remove. + maxLength: 5000 + type: string + required: + - price + title: remove_item_specs + type: object + set: + description: >- + Details of the subscription item to replace + the existing items with. If an item with the + `set[price]` already exists, the `items` + array is not cleared. Instead, all of the + other `set` properties that are passed in + this request will replace the existing + values for the configuration item. + properties: + discounts: + description: >- + If an item with the `price` already + exists, passing this will override the + `discounts` array on the subscription + item that matches that price. Otherwise, + the `items` array is cleared and a + single new item is added with the + supplied `discounts`. + items: + properties: + coupon: + description: >- + ID of the coupon to create a new + discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object + (or one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + metadata: + additionalProperties: + type: string + description: >- + If an item with the `price` already + exists, passing this will override the + `metadata` on the subscription item that + matches that price. Otherwise, the + `items` array is cleared and a single + new item is added with the supplied + `metadata`. + type: object + price: + description: The ID of the price object. + maxLength: 5000 + type: string + quantity: + description: >- + If an item with the `price` already + exists, passing this will override the + quantity on the subscription item that + matches that price. Otherwise, the + `items` array is cleared and a single + new item is added with the supplied + `quantity`. + type: integer + tax_rates: + description: >- + If an item with the `price` already + exists, passing this will override the + `tax_rates` array on the subscription + item that matches that price. Otherwise, + the `items` array is cleared and a + single new item is added with the + supplied `tax_rates`. + items: + maxLength: 5000 + type: string + type: array + trial: + description: >- + If an item with the `price` already + exists, passing this will override the + `trial` configuration on the + subscription item that matches that + price. Otherwise, the `items` array is + cleared and a single new item is added + with the supplied `trial`. + properties: + converts_to: + description: >- + List of price IDs which, if present on + the subscription following a paid trial, + constitute opting-in to the paid trial. + items: + maxLength: 5000 + type: string + type: array + type: + description: >- + Determines the type of trial for this + item. + enum: + - free + - paid + type: string + required: + - type + title: trial_specs + type: object + required: + - price + title: set_item_specs + type: object + type: + description: Determines the type of item action. + enum: + - add + - remove + - set + type: string + required: + - type + title: specs + type: object + type: array + metadata_actions: + description: Instructions for how to modify phase metadata + items: + properties: + add: + additionalProperties: + type: string + description: >- + Key-value pairs to add to schedule phase + metadata. These values will merge with + existing schedule phase metadata. + type: object + remove: + description: Keys to remove from schedule phase metadata. + items: + maxLength: 5000 + type: string + type: array + set: + anyOf: + - additionalProperties: + type: string + type: object + - enum: + - '' + type: string + description: >- + Key-value pairs to set as schedule phase + metadata. Existing schedule phase metadata + will be overwritten. + type: + description: >- + Select one of three ways to update + phase-level `metadata` on subscription + schedules. + enum: + - add + - remove + - set + type: string + required: + - type + title: specs + type: object + type: array + proration_behavior: + description: >- + Changes to how Stripe handles prorations during + the amendment time span. Affects if and how + prorations are created when a future phase starts. + In cases where the amendment changes the currently + active phase, it is used to determine whether or + how to prorate now, at the time of the request. + Also supported as a point-in-time operation when + `amendment_end` is `null`. + enum: + - always_invoice + - create_prorations + - none + type: string + set_pause_collection: + description: >- + Defines how to pause collection for the underlying + subscription throughout the duration of the + amendment. + properties: + set: + description: >- + Details of the pause_collection behavior to + apply to the amendment. + properties: + behavior: + description: >- + The payment collection behavior for this + subscription while paused. One of + `keep_as_draft`, `mark_uncollectible`, or + `void`. + enum: + - keep_as_draft + - mark_uncollectible + - void + type: string + required: + - behavior + title: pause_collection_params + type: object + type: + description: >- + Determines the type of the pause_collection + amendment. + enum: + - remove + - set + type: string + required: + - type + title: specs + type: object + set_schedule_end: + description: >- + Ends the subscription schedule early as dictated + by either the accompanying amendment's start or + end. + enum: + - amendment_end + - amendment_start + type: string + trial_settings: + description: Settings related to subscription trials. + properties: + end_behavior: + description: >- + Defines how the subscription should behave + when a trial ends. + properties: + prorate_up_front: + description: >- + Configure how an opt-in following a paid + trial is billed when using + `billing_behavior: prorate_up_front`. + enum: + - defer + - include + type: string + title: end_behavior_specs + type: object + title: trial_settings_specs + type: object + required: + - amendment_start + title: amendment_specs + type: object + type: array + billing_behavior: + description: >- + Configures when the subscription schedule generates + prorations for phase transitions. Possible values are + `prorate_on_next_phase` or `prorate_up_front` with the + default being `prorate_on_next_phase`. + `prorate_on_next_phase` will apply phase changes and + generate prorations at transition time. + `prorate_up_front` will bill for all phases within the + current billing cycle up front. + enum: + - prorate_on_next_phase + - prorate_up_front + type: string + end_behavior: + description: >- + Behavior of the subscription schedule and underlying + subscription when it ends. Possible values are `release` + or `cancel` with the default being `release`. `release` + will end the subscription schedule and keep the + underlying subscription running. `cancel` will end the + subscription schedule and cancel the underlying + subscription. + enum: + - cancel + - release + type: string + phases: + description: >- + 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_date` of one phase will always equal + the `start_date` of the next phase. + items: + properties: + add_invoice_items: + description: >- + 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. + items: + properties: + discounts: + description: >- + The coupons to redeem into discounts for the + item. + items: + properties: + coupon: + description: >- + ID of the coupon to create a new + discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object + (or one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + price: + description: The ID of the price object. + maxLength: 5000 + type: string + price_data: + description: >- + Data used to generate a new + [Price](https://stripe.com/docs/api/prices) + object inline. + properties: + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). + type: string + product: + description: >- + The ID of the product that this price + will belong to. + maxLength: 5000 + type: string + tax_behavior: + description: >- + Only required if a [default tax + behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) + 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`, or `unspecified`. Once + specified as either `inclusive` or + `exclusive`, it cannot be changed. + enum: + - exclusive + - inclusive + - unspecified + type: string + unit_amount: + description: >- + A positive integer in cents (or local + equivalent) (or 0 for a free price) + representing how much to charge. + type: integer + unit_amount_decimal: + description: >- + Same as `unit_amount`, but accepts a + decimal value in cents (or local + equivalent) with at most 12 decimal + places. Only one of `unit_amount` and + `unit_amount_decimal` can be set. + format: decimal + type: string + required: + - currency + - product + title: one_time_price_data_with_negative_amounts + type: object + quantity: + description: Quantity for this item. Defaults to 1. + type: integer + tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + The tax rates which apply to the item. When + set, the `default_tax_rates` do not apply to + this item. + title: add_invoice_item_entry + type: object + x-stripeParam: + class_name: AddInvoiceItem + type: array + application_fee_percent: + description: >- + 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](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + type: number + automatic_tax: + description: Automatic tax settings for this phase. + properties: + enabled: + description: >- + Enabled automatic tax calculation which will + automatically compute tax rates on all + invoices generated by the subscription. + type: boolean + liability: + description: >- + 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. + properties: + account: + description: >- + The connected account being referenced + when `type` is `account`. + type: string + type: + description: >- + Type of the account referenced in the + request. + enum: + - account + - self + type: string + required: + - type + title: param + type: object + required: + - enabled + title: automatic_tax_config + type: object + billing_cycle_anchor: + description: >- + Can be set to `phase_start` to set the anchor to + the start of the phase or `automatic` to + automatically change it if needed. Cannot be set + to `phase_start` if this phase specifies a trial. + For more information, see the billing cycle + [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + enum: + - automatic + - phase_start + type: string + billing_thresholds: + anyOf: + - properties: + amount_gte: + description: >- + Monetary threshold that triggers the + subscription to advance to a new billing + period + type: integer + reset_billing_cycle_anchor: + description: >- + Indicates if the `billing_cycle_anchor` + should be reset when a threshold is + reached. If true, `billing_cycle_anchor` + will be updated to the date/time the + threshold was last reached; otherwise, the + value will remain unchanged. + type: boolean + title: billing_thresholds_param + type: object + - enum: + - '' + type: string + description: >- + 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. + collection_method: + description: >- + Either `charge_automatically`, or `send_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 as + `active`. Defaults to `charge_automatically` on + creation. + enum: + - charge_automatically + - send_invoice + type: string + coupon: + description: >- + The identifier of the coupon to apply to this + phase of the subscription schedule. + maxLength: 5000 + type: string + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). + type: string + default_payment_method: + description: >- + 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. + maxLength: 5000 + type: string + default_tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + A list of [Tax + Rate](https://stripe.com/docs/api/tax_rates) ids. + These Tax Rates will set the Subscription's + [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), + which means they will be the Invoice's + [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) + for any Invoices issued by the Subscription during + this Phase. + description: + anyOf: + - maxLength: 500 + type: string + - enum: + - '' + type: string + description: >- + 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. + discounts: + anyOf: + - items: + properties: + coupon: + description: >- + ID of the coupon to create a new + discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object + (or one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + - enum: + - '' + type: string + description: >- + 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. + end_date: + anyOf: + - format: unix-time + type: integer + - enum: + - now + maxLength: 5000 + type: string + description: >- + The date at which this phase of the subscription + schedule ends. If set, `iterations` must not be + set. + invoice_settings: + description: >- + All invoices will be billed using the specified + settings. + properties: + days_until_due: + description: >- + Number of days within which a customer must + pay invoices generated by this subscription + schedule. This value will be `null` for + subscription schedules where + `billing=charge_automatically`. + type: integer + issuer: + description: >- + The connected account that issues the invoice. + The invoice is presented with the branding and + support information of the specified account. + properties: + account: + description: >- + The connected account being referenced + when `type` is `account`. + type: string + type: + description: >- + Type of the account referenced in the + request. + enum: + - account + - self + type: string + required: + - type + title: param + type: object + title: invoice_settings + type: object + items: + description: >- + List of configuration items, each with an attached + price, to apply during this phase of the + subscription schedule. + items: + properties: + billing_thresholds: + anyOf: + - properties: + usage_gte: + description: >- + 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](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + type: integer + required: + - usage_gte + title: item_billing_thresholds_param + type: object + - enum: + - '' + type: string + description: >- + Define thresholds at which an invoice will + be sent, and the subscription advanced to a + new billing period. When updating, pass an + empty string to remove previously-defined + thresholds. + discounts: + anyOf: + - items: + properties: + coupon: + description: >- + ID of the coupon to create a new + discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object + (or one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + - enum: + - '' + type: string + description: >- + The coupons to redeem into discounts for the + subscription item. + metadata: + additionalProperties: + type: string + description: >- + Set of [key-value + pairs](https://stripe.com/docs/api/metadata) + that you can attach to a configuration item. + Metadata on a configuration item will update + the underlying subscription item's + `metadata` when the phase is entered, adding + new keys and replacing existing keys. + Individual keys in the subscription item's + `metadata` can be unset by posting an empty + value to them in the configuration item's + `metadata`. To unset all keys in the + subscription item's `metadata`, update the + subscription item directly or unset every + key individually from the configuration + item's `metadata`. + type: object + plan: + description: >- + The plan ID to subscribe to. You may specify + the same ID in `plan` and `price`. + maxLength: 5000 + type: string + price: + description: The ID of the price object. + maxLength: 5000 + type: string + price_data: + description: >- + Data used to generate a new + [Price](https://stripe.com/docs/api/prices) + object inline. + properties: + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). + type: string + product: + description: >- + The ID of the product that this price + will belong to. + maxLength: 5000 + type: string + recurring: + description: >- + The recurring components of a price such + as `interval` and `interval_count`. + properties: + interval: + description: >- + Specifies billing frequency. Either + `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals between + subscription billings. For example, + `interval=month` and `interval_count=3` + bills every 3 months. Maximum of three + years interval allowed (3 years, 36 + months, or 156 weeks). + type: integer + required: + - interval + title: recurring_adhoc + type: object + tax_behavior: + description: >- + Only required if a [default tax + behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) + 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`, or `unspecified`. Once + specified as either `inclusive` or + `exclusive`, it cannot be changed. + enum: + - exclusive + - inclusive + - unspecified + type: string + unit_amount: + description: >- + A positive integer in cents (or local + equivalent) (or 0 for a free price) + representing how much to charge. + type: integer + unit_amount_decimal: + description: >- + Same as `unit_amount`, but accepts a + decimal value in cents (or local + equivalent) with at most 12 decimal + places. Only one of `unit_amount` and + `unit_amount_decimal` can be set. + format: decimal + type: string + required: + - currency + - product + - recurring + title: recurring_price_data + type: object + quantity: + description: >- + Quantity for the given price. Can be set + only if the price's `usage_type` is + `licensed` and not `metered`. + type: integer + tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + A list of [Tax + Rate](https://stripe.com/docs/api/tax_rates) + ids. These Tax Rates will override the + [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) + on the Subscription. When updating, pass an + empty string to remove previously-defined + tax rates. + trial: + description: >- + Options that configure the trial on the + subscription item. + properties: + converts_to: + description: >- + List of price IDs which, if present on + the subscription following a paid trial, + constitute opting-in to the paid trial. + items: + maxLength: 5000 + type: string + type: array + type: + description: >- + Determines the type of trial for this + item. + enum: + - free + - paid + type: string + required: + - type + title: trial_specs + type: object + title: configuration_item_params + type: object + type: array + iterations: + description: >- + Integer representing the multiplier applied to the + price interval. For example, `iterations=2` + applied to a price with `interval=month` and + `interval_count=3` results in a phase of duration + `2 * 3 months = 6 months`. If set, `end_date` must + not be set. + type: integer + metadata: + additionalProperties: + type: string + description: >- + Set of [key-value + pairs](https://stripe.com/docs/api/metadata) that + you can attach to a phase. Metadata on a + schedule's phase will update the underlying + subscription's `metadata` when the phase is + entered, adding new keys and replacing existing + keys in the subscription's `metadata`. Individual + keys in the subscription's `metadata` can be unset + by posting an empty value to them in the phase's + `metadata`. To unset all keys in the + subscription's `metadata`, update the subscription + directly or unset every key individually from the + phase's `metadata`. + type: object + on_behalf_of: + description: >- + The account on behalf of which to charge, for each + of the associated subscription's invoices. + type: string + pause_collection: + description: >- + If specified, payment collection for this + subscription will be paused. + properties: + behavior: + description: >- + The payment collection behavior for this + subscription while paused. One of + `keep_as_draft`, `mark_uncollectible`, or + `void`. + enum: + - keep_as_draft + - mark_uncollectible + - void + type: string + required: + - behavior + title: pause_collection_params + type: object + proration_behavior: + description: >- + Whether the subscription schedule will create + [prorations](https://stripe.com/docs/billing/subscriptions/prorations) + when transitioning to this phase. The default + value is `create_prorations`. This setting + controls prorations when a phase is started + asynchronously and it is persisted as a field on + the phase. It's different from the request-level + [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) + parameter which controls what happens if the + update request affects the billing configuration + of the current phase. + enum: + - always_invoice + - create_prorations + - none + type: string + start_date: + anyOf: + - format: unix-time + type: integer + - enum: + - now + maxLength: 5000 + type: string + description: >- + The date at which this phase of the subscription + schedule starts or `now`. Must be set on the first + phase. + transfer_data: + description: >- + The data with which to automatically create a + Transfer for each of the associated subscription's + invoices. + properties: + amount_percent: + description: >- + 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. + type: number + destination: + description: 'ID of an existing, connected Stripe account.' + type: string + required: + - destination + title: transfer_data_specs + type: object + trial: + description: >- + If set to true the entire phase is counted as a + trial and the customer will not be charged for any + fees. + type: boolean + trial_continuation: + description: >- + Specify trial behavior when crossing phase + boundaries + enum: + - continue + - none + type: string + trial_end: + anyOf: + - format: unix-time + type: integer + - enum: + - now + maxLength: 5000 + type: string + description: >- + 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` + trial_settings: + description: Settings related to subscription trials. + properties: + end_behavior: + description: >- + Defines how the subscription should behave + when a trial ends. + properties: + prorate_up_front: + description: >- + Configure how an opt-in following a paid + trial is billed when using + `billing_behavior: prorate_up_front`. + enum: + - defer + - include + type: string + title: end_behavior_specs + type: object + title: trial_settings_specs + type: object + required: + - items + title: phase_configuration_params + type: object + type: array + prebilling: + anyOf: + - items: + properties: + bill_until: + description: The end of the prebilled time period. + properties: + amendment_end: + description: >- + End the prebilled period when a specified + amendment ends. + properties: + index: + description: >- + The position of the amendment in the + `amendments` array at which prebilling + should end. Indexes start from 0 and + must be less than the total number of + supplied amendments. + type: integer + required: + - index + title: amendment_end_specs + type: object + duration: + description: >- + Time span for prebilling, starting from + `bill_from`. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: duration_specs + type: object + timestamp: + description: >- + End the prebilled period at a precise + integer timestamp, starting from the Unix + epoch. + format: unix-time + type: integer + type: + description: >- + Select one of several ways to pass the + `bill_until` value. + enum: + - amendment_end + - duration + - schedule_end + - timestamp + type: string + required: + - type + title: specs + type: object + iterations: + description: >- + This is used to determine the number of + billing cycles to prebill. + type: integer + title: prebilling_params + type: object + type: array + - enum: + - '' + type: string + description: Provide any time periods to bill in advance. + proration_behavior: + description: >- + In cases where the `schedule_details` params update the + currently active phase, specifies if and how to prorate + at the time of the request. + enum: + - always_invoice + - create_prorations + - none + type: string + title: schedule_details_params + type: object + subscription: + description: >- + The identifier of the subscription for which you'd like to + retrieve the upcoming invoice. If not provided, but a + `subscription_items` is provided, you will preview creating + a subscription with those items. If neither `subscription` + nor `subscription_items` is provided, you will retrieve the + next upcoming invoice from among the customer's + subscriptions. + maxLength: 5000 + type: string + subscription_billing_cycle_anchor: + anyOf: + - enum: + - now + - unchanged + maxLength: 5000 + type: string + - format: unix-time + type: integer + description: >- + For new subscriptions, a future timestamp to anchor the + subscription's [billing + cycle](https://stripe.com/docs/subscriptions/billing-cycle). + This is used to determine the date of the first full + invoice, and, for plans with `month` or `year` intervals, + the day of the month for subsequent invoices. For existing + subscriptions, the value can only be set to `now` or + `unchanged`. This field has been deprecated and will be + removed in a future API version. Use + `subscription_details.billing_cycle_anchor` instead. + subscription_cancel_at: + anyOf: + - format: unix-time + type: integer + - enum: + - '' + type: string + description: >- + A timestamp at which the subscription should cancel. If set + to a date before the current period ends, this will cause a + proration if prorations have been enabled using + `proration_behavior`. If set during a future period, this + will always cause a proration for that period. This field + has been deprecated and will be removed in a future API + version. Use `subscription_details.cancel_at` instead. + subscription_cancel_at_period_end: + description: >- + Boolean indicating whether this subscription should cancel + at the end of the current period. This field has been + deprecated and will be removed in a future API version. Use + `subscription_details.cancel_at_period_end` instead. + type: boolean + subscription_cancel_now: + description: >- + This simulates the subscription being canceled or expired + immediately. This field has been deprecated and will be + removed in a future API version. Use + `subscription_details.cancel_now` instead. + type: boolean + subscription_default_tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + If provided, the invoice returned will preview updating or + creating a subscription with these default tax rates. The + default tax rates will apply to any line item that does not + have `tax_rates` set. This field has been deprecated and + will be removed in a future API version. Use + `subscription_details.default_tax_rates` instead. + subscription_details: + description: >- + The subscription creation or modification params to apply as + a preview. Cannot be used with `schedule` or + `schedule_details` fields. + properties: + billing_cycle_anchor: + anyOf: + - enum: + - now + - unchanged + maxLength: 5000 + type: string + - format: unix-time + type: integer + description: >- + For new subscriptions, a future timestamp to anchor the + subscription's [billing + cycle](https://stripe.com/docs/subscriptions/billing-cycle). + This is used to determine the date of the first full + invoice, and, for plans with `month` or `year` + intervals, the day of the month for subsequent invoices. + For existing subscriptions, the value can only be set to + `now` or `unchanged`. + cancel_at: + anyOf: + - format: unix-time + type: integer + - enum: + - '' + type: string + description: >- + A timestamp at which the subscription should cancel. If + set to a date before the current period ends, this will + cause a proration if prorations have been enabled using + `proration_behavior`. If set during a future period, + this will always cause a proration for that period. + cancel_at_period_end: + description: >- + Boolean indicating whether this subscription should + cancel at the end of the current period. + type: boolean + cancel_now: + description: >- + This simulates the subscription being canceled or + expired immediately. + type: boolean + default_tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + If provided, the invoice returned will preview updating + or creating a subscription with these default tax rates. + The default tax rates will apply to any line item that + does not have `tax_rates` set. + items: + description: >- + A list of up to 20 subscription items, each with an + attached price. + items: + properties: + billing_thresholds: + anyOf: + - properties: + usage_gte: + description: >- + 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](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + type: integer + required: + - usage_gte + title: item_billing_thresholds_param + type: object + - enum: + - '' + type: string + description: >- + Define thresholds at which an invoice will be + sent, and the subscription advanced to a new + billing period. When updating, pass an empty + string to remove previously-defined thresholds. + clear_usage: + description: >- + Delete all usage for a given subscription item. + Allowed only when `deleted` is set to `true` and + the current plan's `usage_type` is `metered`. + type: boolean + deleted: + description: >- + A flag that, if set to `true`, will delete the + specified item. + type: boolean + discounts: + anyOf: + - items: + properties: + coupon: + description: >- + ID of the coupon to create a new + discount for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object + (or one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the + discount should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + - enum: + - '' + type: string + description: >- + The coupons to redeem into discounts for the + subscription item. + id: + description: Subscription item to update. + maxLength: 5000 + type: string + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - enum: + - '' + type: string + description: >- + Set of [key-value + pairs](https://stripe.com/docs/api/metadata) 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`. + plan: + description: 'Plan ID for this item, as a string.' + maxLength: 5000 + type: string + price: + description: >- + The ID of the price object. When changing a + subscription item's price, `quantity` is set to 1 + unless a `quantity` parameter is provided. + maxLength: 5000 + type: string + price_data: + description: >- + Data used to generate a new + [Price](https://stripe.com/docs/api/prices) object + inline. + properties: + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). + type: string + product: + description: >- + The ID of the product that this price will + belong to. + maxLength: 5000 + type: string + recurring: + description: >- + The recurring components of a price such as + `interval` and `interval_count`. + properties: + interval: + description: >- + Specifies billing frequency. Either `day`, + `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals between + subscription billings. For example, + `interval=month` and `interval_count=3` + bills every 3 months. Maximum of three + years interval allowed (3 years, 36 + months, or 156 weeks). + type: integer + required: + - interval + title: recurring_adhoc + type: object + tax_behavior: + description: >- + Only required if a [default tax + behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) + 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`, or `unspecified`. + Once specified as either `inclusive` or + `exclusive`, it cannot be changed. + enum: + - exclusive + - inclusive + - unspecified + type: string + unit_amount: + description: >- + A positive integer in cents (or local + equivalent) (or 0 for a free price) + representing how much to charge. + type: integer + unit_amount_decimal: + description: >- + Same as `unit_amount`, but accepts a decimal + value in cents (or local equivalent) with at + most 12 decimal places. Only one of + `unit_amount` and `unit_amount_decimal` can be + set. + format: decimal + type: string + required: + - currency + - product + - recurring + title: recurring_price_data + type: object + quantity: + description: Quantity for this item. + type: integer + tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + A list of [Tax + Rate](https://stripe.com/docs/api/tax_rates) ids. + These Tax Rates will override the + [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) + on the Subscription. When updating, pass an empty + string to remove previously-defined tax rates. + title: subscription_item_update_params + type: object + type: array + prebilling: + description: >- + The pre-billing to apply to the subscription as a + preview. + properties: + iterations: + description: >- + This is used to determine the number of billing + cycles to prebill. + type: integer + required: + - iterations + title: prebilling_preview_params + type: object + proration_behavior: + description: >- + Determines how to handle + [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) + when the billing cycle changes (e.g., when switching + plans, resetting `billing_cycle_anchor=now`, or starting + a trial), or if an item's `quantity` changes. The + default value is `create_prorations`. + enum: + - always_invoice + - create_prorations + - none + type: string + proration_date: + description: >- + If previewing an update to a subscription, and doing + proration, `subscription_details.proration_date` forces + the proration to be calculated as though the update was + done at the specified time. The time given must be + within the current subscription period and within the + current phase of the schedule backing this subscription, + if the schedule exists. If set, `subscription`, and one + of `subscription_details.items`, or + `subscription_details.trial_end` are required. Also, + `subscription_details.proration_behavior` cannot be set + to 'none'. + format: unix-time + type: integer + resume_at: + description: >- + For paused subscriptions, setting + `subscription_details.resume_at` to `now` will preview + the invoice that will be generated if the subscription + is resumed. + enum: + - now + maxLength: 5000 + type: string + start_date: + description: >- + Date a subscription is intended to start (can be future + or past). + format: unix-time + type: integer + trial_end: + anyOf: + - enum: + - now + maxLength: 5000 + type: string + - format: unix-time + type: integer + description: >- + If provided, the invoice returned will preview updating + or creating a subscription with that trial end. If set, + one of `subscription_details.items` or `subscription` is + required. + title: subscription_details_params + type: object + subscription_items: + description: >- + A list of up to 20 subscription items, each with an attached + price. This field has been deprecated and will be removed in + a future API version. Use `subscription_details.items` + instead. + items: + properties: + billing_thresholds: + anyOf: + - properties: + usage_gte: + description: >- + 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](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + type: integer + required: + - usage_gte + title: item_billing_thresholds_param + type: object + - enum: + - '' + type: string + description: >- + Define thresholds at which an invoice will be sent, + and the subscription advanced to a new billing period. + When updating, pass an empty string to remove + previously-defined thresholds. + clear_usage: + description: >- + Delete all usage for a given subscription item. + Allowed only when `deleted` is set to `true` and the + current plan's `usage_type` is `metered`. + type: boolean + deleted: + description: >- + A flag that, if set to `true`, will delete the + specified item. + type: boolean + discounts: + anyOf: + - items: + properties: + coupon: + description: >- + ID of the coupon to create a new discount + for. + maxLength: 5000 + type: string + discount: + description: >- + ID of an existing discount on the object (or + one of its ancestors) to reuse. + maxLength: 5000 + type: string + discount_end: + description: >- + Details to determine how long the discount + should be applied for. + properties: + duration: + description: Time span for the redeemed discount. + properties: + interval: + description: >- + Specifies a type of interval unit. + Either `day`, `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals, as an whole + number greater than 0. Stripe multiplies + this by the interval type to get the + overall duration. + type: integer + required: + - interval + - interval_count + title: discount_end_duration_specs + type: object + timestamp: + description: >- + A precise Unix timestamp for the + discount to end. Must be in the future. + format: unix-time + type: integer + type: + description: >- + The type of calculation made to + determine when the discount ends. + enum: + - duration + - timestamp + type: string + required: + - type + title: discount_end + type: object + promotion_code: + description: >- + ID of the promotion code to create a new + discount for. + maxLength: 5000 + type: string + title: discounts_data_param + type: object + type: array + - enum: + - '' + type: string + description: >- + The coupons to redeem into discounts for the + subscription item. + id: + description: Subscription item to update. + maxLength: 5000 + type: string + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - enum: + - '' + type: string + description: >- + Set of [key-value + pairs](https://stripe.com/docs/api/metadata) 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`. + plan: + description: 'Plan ID for this item, as a string.' + maxLength: 5000 + type: string + price: + description: >- + The ID of the price object. When changing a + subscription item's price, `quantity` is set to 1 + unless a `quantity` parameter is provided. + maxLength: 5000 + type: string + price_data: + description: >- + Data used to generate a new + [Price](https://stripe.com/docs/api/prices) object + inline. + properties: + currency: + description: >- + Three-letter [ISO currency + code](https://www.iso.org/iso-4217-currency-codes.html), + in lowercase. Must be a [supported + currency](https://stripe.com/docs/currencies). + type: string + product: + description: >- + The ID of the product that this price will belong + to. + maxLength: 5000 + type: string + recurring: + description: >- + The recurring components of a price such as + `interval` and `interval_count`. + properties: + interval: + description: >- + Specifies billing frequency. Either `day`, + `week`, `month` or `year`. + enum: + - day + - month + - week + - year + type: string + interval_count: + description: >- + The number of intervals between subscription + billings. For example, `interval=month` and + `interval_count=3` bills every 3 months. + Maximum of three years interval allowed (3 + years, 36 months, or 156 weeks). + type: integer + required: + - interval + title: recurring_adhoc + type: object + tax_behavior: + description: >- + Only required if a [default tax + behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) + 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`, or `unspecified`. Once + specified as either `inclusive` or `exclusive`, it + cannot be changed. + enum: + - exclusive + - inclusive + - unspecified + type: string + unit_amount: + description: >- + A positive integer in cents (or local equivalent) + (or 0 for a free price) representing how much to + charge. + type: integer + unit_amount_decimal: + description: >- + Same as `unit_amount`, but accepts a decimal value + in cents (or local equivalent) with at most 12 + decimal places. Only one of `unit_amount` and + `unit_amount_decimal` can be set. + format: decimal + type: string + required: + - currency + - product + - recurring + title: recurring_price_data + type: object + quantity: + description: Quantity for this item. + type: integer + tax_rates: + anyOf: + - items: + maxLength: 5000 + type: string + type: array + - enum: + - '' + type: string + description: >- + A list of [Tax + Rate](https://stripe.com/docs/api/tax_rates) ids. + These Tax Rates will override the + [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) + on the Subscription. When updating, pass an empty + string to remove previously-defined tax rates. + title: subscription_item_update_params + type: object + type: array + subscription_prebilling: + description: >- + The pre-billing to apply to the subscription as a preview. + This field has been deprecated and will be removed in a + future API version. Use `subscription_details.prebilling` + instead. + properties: + iterations: + description: >- + This is used to determine the number of billing cycles + to prebill. + type: integer + required: + - iterations + title: prebilling_preview_params + type: object + subscription_proration_behavior: + description: >- + Determines how to handle + [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) + when the billing cycle changes (e.g., when switching plans, + resetting `billing_cycle_anchor=now`, or starting a trial), + or if an item's `quantity` changes. The default value is + `create_prorations`. This field has been deprecated and will + be removed in a future API version. Use + `subscription_details.proration_behavior` instead. + enum: + - always_invoice + - create_prorations + - none + type: string + subscription_proration_date: + description: >- + If previewing an update to a subscription, and doing + proration, `subscription_proration_date` forces the + proration to be calculated as though the update was done at + the specified time. The time given must be within the + current subscription period and within the current phase of + the schedule backing this subscription, if the schedule + exists. If set, `subscription`, and one of + `subscription_items`, or `subscription_trial_end` are + required. Also, `subscription_proration_behavior` cannot be + set to 'none'. This field has been deprecated and will be + removed in a future API version. Use + `subscription_details.proration_date` instead. + format: unix-time + type: integer + subscription_resume_at: + description: >- + For paused subscriptions, setting `subscription_resume_at` + to `now` will preview the invoice that will be generated if + the subscription is resumed. This field has been deprecated + and will be removed in a future API version. Use + `subscription_details.resume_at` instead. + enum: + - now + maxLength: 5000 + type: string + subscription_start_date: + description: >- + Date a subscription is intended to start (can be future or + past). This field has been deprecated and will be removed in + a future API version. Use `subscription_details.start_date` + instead. + format: unix-time + type: integer + subscription_trial_end: + anyOf: + - enum: + - now + maxLength: 5000 + type: string + - format: unix-time + type: integer + description: >- + If provided, the invoice returned will preview updating or + creating a subscription with that trial end. If set, one of + `subscription_items` or `subscription` is required. This + field has been deprecated and will be removed in a future + API version. Use `subscription_details.trial_end` instead. + type: object + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/invoice' + description: Successful response. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/error' + description: Error response. /v1/invoices/search: get: description: >-