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 the subscription_
parameter when doing the actual subscription update. 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_
value passed in the request.
Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more
Parameters
- automatic_
taxobject Settings for automatic tax lookup for this invoice preview.
- automatic_tax.
enabledbooleanRequired Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified tax rates, negative amounts, or
tax_
) cannot be added to automatic tax invoices.behavior=unspecified - automatic_tax.
liabilityobjectConnect only The account that’s liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
- automatic_tax.
liability. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccount
Indicates that the account being referenced is a connected account which is different from the account making the API request but related to it.
self
Indicates that the account being referenced is the account making the API request.
- automatic_tax.
liability. accountstringRequired only if type is account The connected account being referenced when
type
isaccount
.
- customerstring
The identifier of the customer whose upcoming invoice you’d like to retrieve. If
automatic_
is enabled then one oftax customer
,customer_
,details subscription
, orschedule
must be set. - subscriptionstring
The identifier of the subscription for which you’d like to retrieve the upcoming invoice. If not provided, but a
subscription_
is provided, you will preview creating a subscription with those items. If neitherdetails. items subscription
norsubscription_
is provided, you will retrieve the next upcoming invoice from among the customer’s subscriptions.details. items
More parameters
- couponstringDeprecated
The ID of the coupon to apply to this invoice. This field has been deprecated and will be removed in a future API version. Use
discounts
instead. - currencyenum
The currency to preview this invoice in. Defaults to that of
customer
if not specified. - customer_
detailsobject Details about the customer you want to invoice or overrides for an existing customer. If
automatic_
is enabled then one oftax customer
,customer_
,details subscription
, orschedule
must be set.- customer_details.
addressobjectRequired if calculating taxes The customer’s address.
- customer_details.
address. citystring City, district, suburb, town, or village.
- customer_details.
address. countrystringRequired for calculating taxes Two-letter country code (ISO 3166-1 alpha-2).
- customer_details.
address. line1string Address line 1 (e.g., street, PO Box, or company name).
- customer_details.
address. line2string Address line 2 (e.g., apartment, suite, unit, or building).
- customer_details.
address. postal_ codestringRequired for calculating taxes ZIP or postal code.
- customer_details.
address. statestring State, county, province, or region.
- customer_details.
shippingobject The customer’s shipping information. Appears on invoices emailed to this customer.
- customer_details.
shipping. addressobjectRequired Customer shipping address.
- customer_details.
shipping. address. citystring City, district, suburb, town, or village.
- customer_details.
shipping. address. countrystringRequired if calculating taxes A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code (ISO 3166-1 alpha-2).
- customer_details.
shipping. address. line1string Address line 1 (e.g., street, PO Box, or company name).
- customer_details.
shipping. address. line2string Address line 2 (e.g., apartment, suite, unit, or building).
- customer_details.
shipping. address. postal_ codestringRequired if calculating taxes ZIP or postal code.
- customer_details.
shipping. address. statestring State, county, province, or region.
- customer_details.
shipping. namestringRequired Customer name.
- customer_details.
shipping. phonestring Customer phone (including extension).
- customer_details.
taxobject Tax details about the customer.
- customer_details.
tax. ip_ addressstring 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.
- customer_details.
tax_ exemptenum The customer’s tax exemption. One of
none
,exempt
, orreverse
.Possible enum valuesexempt
none
reverse
- customer_details.
tax_ idsarray of objects The customer’s tax IDs.
- customer_details.
tax_ids. typestringRequired Type of the tax ID, one of
ad_
,nrt ae_
,trn ar_
,cuit au_
,abn au_
,arn bg_
,uic bh_
,vat bo_
,tin br_
,cnpj br_
,cpf by_
,tin ca_
,bn ca_
,gst_ hst ca_
,pst_ bc ca_
,pst_ mb ca_
,pst_ sk ca_
,qst ch_
,uid ch_
,vat cl_
,tin cn_
,tin co_
,nit cr_
,tin de_
,stn do_
,rcn ec_
,ruc eg_
,tin es_
,cif eu_
,oss_ vat eu_
,vat gb_
,vat ge_
,vat hk_
,br hr_
,oib hu_
,tin id_
,npwp il_
,vat in_
,gst is_
,vat jp_
,cn jp_
,rn jp_
,trn ke_
,pin kr_
,brn kz_
,bin li_
,uid li_
,vat ma_
,vat md_
,vat mx_
,rfc my_
,frp my_
,itn my_
,sst ng_
,tin no_
,vat no_
,voec nz_
,gst om_
,vat 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 tz_
,vat ua_
,vat us_
,ein uy_
,ruc uz_
,tin uz_
,vat ve_
,rif vn_
, ortin za_
vat - customer_details.
tax_ids. valuestringRequired Value of the tax ID.
- discountsarray of objects
The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
- discounts.
couponstring ID of the coupon to create a new discount for.
- discounts.
discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- discounts.
promotion_ codestring ID of the promotion code to create a new discount for.
- invoice_
itemsarray of objects List of invoice items to add or update in the upcoming invoice preview (up to 250).
- invoice_items.
amountinteger The integer amount in cents of previewed invoice item.
- invoice_items.
currencyenum Three-letter ISO currency code, in lowercase. Must be a supported currency. Only applicable to new invoice items.
- invoice_items.
descriptionstring An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
- invoice_items.
discountableboolean Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
- invoice_items.
discountsarray of objects The coupons to redeem into discounts for the invoice item in the preview.
- invoice_items.
discounts. couponstring ID of the coupon to create a new discount for.
- invoice_items.
discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- invoice_items.
discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- invoice_items.
invoiceitemstring 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.
- invoice_items.
metadataobject Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
. - invoice_items.
periodobject 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 enabled, the period will be used to recognize and defer revenue. See the Revenue Recognition documentation for details.
- invoice_items.
period. endtimestampRequired The end of the period, which must be greater than or equal to the start. This value is inclusive.
- invoice_items.
period. starttimestampRequired The start of the period. This value is inclusive.
- invoice_items.
pricestring The ID of the price object. One of
price
orprice_
is required.data - invoice_items.
price_ dataobject Data used to generate a new Price object inline. One of
price
orprice_
is required.data - invoice_items.
price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- invoice_items.
price_data. productstringRequired The ID of the product that this price will belong to.
- invoice_items.
price_data. tax_ behaviorenumRecommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed.Possible enum valuesexclusive
inclusive
unspecified
- invoice_items.
price_data. unit_ amountinteger A positive integer in cents (or 0 for a free price) representing how much to charge.
- invoice_items.
price_data. unit_ amount_ decimalstringRequired conditionally Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- invoice_items.
quantityinteger Non-negative integer. The quantity of units for the invoice item.
- invoice_items.
tax_ behaviorenumRecommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed.Possible enum valuesexclusive
inclusive
unspecified
- invoice_items.
tax_ codestringRecommended if calculating taxes A tax code ID.
- invoice_items.
tax_ ratesarray of strings The tax rates that apply to the item. When set, any
default_
do not apply to this item.tax_ rates - invoice_items.
unit_ amountinteger The integer unit amount in cents 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.
- invoice_items.
unit_ amount_ decimalstring Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- issuerobjectConnect only
The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
- issuer.
typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccount
Indicates that the account being referenced is a connected account which is different from the account making the API request but related to it.
self
Indicates that the account being referenced is the account making the API request.
- issuer.
accountstringRequired only if type is account The connected account being referenced when
type
isaccount
.
- on_
behalf_ ofstringConnect only 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 documentation for details.
- preview_
modeenum Customizes the types of values to include when calculating the invoice. Defaults to
next
if unspecified.Possible enum valuesnext
Will calculate the next invoice for the customer or subscription, factoring in all one-time and recurring items.
recurring
Will calculate an invoice that is an estimate of the subscription’s long-term recurring bill. The invoice lines will only include recurring subscription items, taxes, and coupons with
duration=repeating
orduration=forever
.To calculate a recurring estimate, you must provide at least one of
subscription
orsubscription_
. Prorations, subscription cancellations, and trials are not supported with recurring estimates.details. items - schedulestring
The identifier of the schedule whose upcoming invoice you’d like to retrieve. Cannot be used with subscription or subscription fields.
- schedule_
detailsobject The schedule creation or modification params to apply as a preview. Cannot be used with
subscription
orsubscription_
prefixed fields.- schedule_details.
end_ behaviorenum Behavior of the subscription schedule and underlying subscription when it ends. Possible values are
release
orcancel
with the default beingrelease
.release
will end the subscription schedule and keep the underlying subscription running.cancel
will end the subscription schedule and cancel the underlying subscription.Possible enum valuescancel
release
- schedule_details.
phasesarray of objects List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the
end_
of one phase will always equal thedate start_
of the next phase.date - schedule_details.
phases. itemsarray of objectsRequired List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
- schedule_details.
phases. items. billing_ thresholdsobject 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.
- schedule_details.
phases. items. billing_thresholds. usage_ gteintegerRequired Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary threshold)
- schedule_details.
phases. items. discountsarray of objects The coupons to redeem into discounts for the subscription item.
- schedule_details.
phases. items. discounts. couponstring ID of the coupon to create a new discount for.
- schedule_details.
phases. items. discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- schedule_details.
phases. items. discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- schedule_details.
phases. items. metadataobject Set of key-value pairs that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item’s
metadata
when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item’smetadata
can be unset by posting an empty value to them in the configuration item’smetadata
. To unset all keys in the subscription item’smetadata
, update the subscription item directly or unset every key individually from the configuration item’smetadata
. - schedule_details.
phases. items. pricestring The ID of the price object.
- schedule_details.
phases. items. price_ dataobject Data used to generate a new Price object inline.
- schedule_details.
phases. items. price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- schedule_details.
phases. items. price_data. productstringRequired The ID of the product that this price will belong to.
- schedule_details.
phases. items. price_data. recurringobjectRequired The recurring components of a price such as
interval
andinterval_
.count - schedule_details.
phases. items. price_data. recurring. intervalenumRequired Specifies billing frequency. Either
day
,week
,month
oryear
.Possible enum valuesday
month
week
year
- schedule_details.
phases. items. price_data. recurring. interval_ countinteger The number of intervals between subscription billings. For example,
interval=month
andinterval_
bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).count=3
- schedule_details.
phases. items. price_data. tax_ behaviorenumRecommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed.Possible enum valuesexclusive
inclusive
unspecified
- schedule_details.
phases. items. price_data. unit_ amountinteger A positive integer in cents (or 0 for a free price) representing how much to charge.
- schedule_details.
phases. items. price_data. unit_ amount_ decimalstringRequired conditionally Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- schedule_details.
phases. items. quantityinteger Quantity for the given price. Can be set only if the price’s
usage_
istype licensed
and notmetered
. - schedule_details.
phases. items. tax_ ratesarray of strings A list of Tax Rate ids. These Tax Rates will override the
default_
on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.tax_ rates
- schedule_details.
phases. add_ invoice_ itemsarray of objects A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
- schedule_details.
phases. add_invoice_items. discountsarray of objects The coupons to redeem into discounts for the item.
- schedule_details.
phases. add_invoice_items. discounts. couponstring ID of the coupon to create a new discount for.
- schedule_details.
phases. add_invoice_items. discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- schedule_details.
phases. add_invoice_items. discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- schedule_details.
phases. add_invoice_items. pricestring The ID of the price object. One of
price
orprice_
is required.data - schedule_details.
phases. add_invoice_items. price_ dataobject Data used to generate a new Price object inline. One of
price
orprice_
is required.data - schedule_details.
phases. add_invoice_items. price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- schedule_details.
phases. add_invoice_items. price_data. productstringRequired The ID of the product that this price will belong to.
- schedule_details.
phases. add_invoice_items. price_data. tax_ behaviorenumRecommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed.Possible enum valuesexclusive
inclusive
unspecified
- schedule_details.
phases. add_invoice_items. price_data. unit_ amountinteger A positive integer in cents (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
- schedule_details.
phases. add_invoice_items. price_data. unit_ amount_ decimalstringRequired conditionally Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- schedule_details.
phases. add_invoice_items. quantityinteger Quantity for this item. Defaults to 1.
- schedule_details.
phases. add_invoice_items. tax_ ratesarray of strings The tax rates which apply to the item. When set, the
default_
do not apply to this item.tax_ rates
- schedule_details.
phases. application_ fee_ percentfloatConnect only A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner’s Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees documentation.
- schedule_details.
phases. automatic_ taxobject Automatic tax settings for this phase.
- schedule_details.
phases. automatic_tax. enabledbooleanRequired Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
- schedule_details.
phases. automatic_tax. liabilityobjectConnect only The account that’s liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
- schedule_details.
phases. automatic_tax. liability. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccount
Indicates that the account being referenced is a connected account which is different from the account making the API request but related to it.
self
Indicates that the account being referenced is the account making the API request.
- schedule_details.
phases. automatic_tax. liability. accountstringRequired only if type is account The connected account being referenced when
type
isaccount
.
- schedule_details.
phases. billing_ cycle_ anchorenum Can be set to
phase_
to set the anchor to the start of the phase orstart automatic
to automatically change it if needed. Cannot be set tophase_
if this phase specifies a trial. For more information, see the billing cycle documentation.start Possible enum valuesautomatic
phase_
start - schedule_details.
phases. billing_ thresholdsobject Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
- schedule_details.
phases. billing_thresholds. amount_ gteinteger Monetary threshold that triggers the subscription to advance to a new billing period
- schedule_details.
phases. billing_thresholds. reset_ billing_ cycle_ anchorboolean Indicates if the
billing_
should be reset when a threshold is reached. If true,cycle_ anchor billing_
will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.cycle_ anchor
- schedule_details.
phases. collection_ methodenum Either
charge_
, orautomatically send_
. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription asinvoice active
. Defaults tocharge_
on creation.automatically Possible enum valuescharge_
automatically send_
invoice - schedule_details.
phases. couponstringDeprecated The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use
discounts
instead. - schedule_details.
phases. default_ payment_ methodstring ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer’s invoice settings.
- schedule_details.
phases. default_ tax_ ratesarray of strings A list of Tax Rate ids. These Tax Rates will set the Subscription’s
default_
, which means they will be the Invoice’stax_ rates default_
for any Invoices issued by the Subscription during this Phase.tax_ rates - schedule_details.
phases. descriptionstring Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
- schedule_details.
phases. discountsarray of objects The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription’s customer. Pass an empty string to avoid inheriting any discounts.
- schedule_details.
phases. discounts. couponstring ID of the coupon to create a new discount for.
- schedule_details.
phases. discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- schedule_details.
phases. discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- schedule_details.
phases. end_ datetimestamp | string The date at which this phase of the subscription schedule ends. If set,
iterations
must not be set. - schedule_details.
phases. invoice_ settingsobject All invoices will be billed using the specified settings.
- schedule_details.
phases. invoice_settings. account_ tax_ idsarray of strings The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
- schedule_details.
phases. invoice_settings. days_ until_ dueinteger Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be
null
for subscription schedules wherebilling=charge_
.automatically - schedule_details.
phases. invoice_settings. issuerobjectConnect only The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
- schedule_details.
phases. invoice_settings. issuer. typeenumRequired Type of the account referenced in the request.
Possible enum valuesaccount
Indicates that the account being referenced is a connected account which is different from the account making the API request but related to it.
self
Indicates that the account being referenced is the account making the API request.
- schedule_details.
phases. invoice_settings. issuer. accountstringRequired only if type is account The connected account being referenced when
type
isaccount
.
- schedule_details.
phases. iterationsinteger Integer representing the multiplier applied to the price interval. For example,
iterations=2
applied to a price withinterval=month
andinterval_
results in a phase of durationcount=3 2 * 3 months = 6 months
. If set,end_
must not be set.date - schedule_details.
phases. metadataobject Set of key-value pairs that you can attach to a phase. Metadata on a schedule’s phase will update the underlying subscription’s
metadata
when the phase is entered, adding new keys and replacing existing keys in the subscription’smetadata
. Individual keys in the subscription’smetadata
can be unset by posting an empty value to them in the phase’smetadata
. To unset all keys in the subscription’smetadata
, update the subscription directly or unset every key individually from the phase’smetadata
. - schedule_details.
phases. on_ behalf_ ofstringConnect only The account on behalf of which to charge, for each of the associated subscription’s invoices.
- schedule_details.
phases. proration_ behaviorenum Whether the subscription schedule will create prorations when transitioning to this phase. The default value is
create_
. 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 parameter which controls what happens if the update request affects the billing configuration of the current phase.prorations Possible enum valuesalways_
invoice Prorate changes, and force an invoice to be immediately created for any prorations.
create_
prorations Prorate changes, but leave any prorations as pending invoice items to be picked up on the customer’s next invoice.
none
Does not create any prorations.
- schedule_details.
phases. start_ datetimestamp | string The date at which this phase of the subscription schedule starts or
now
. Must be set on the first phase. - schedule_details.
phases. transfer_ dataobjectConnect only The data with which to automatically create a Transfer for each of the associated subscription’s invoices.
- schedule_details.
phases. transfer_data. destinationstringRequired ID of an existing, connected Stripe account.
- schedule_details.
phases. transfer_data. amount_ percentfloat A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
- schedule_details.
phases. trialboolean If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
- schedule_details.
phases. trial_ endtimestamp | string 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
- schedule_details.
proration_ behaviorenum In cases where the
schedule_
params update the currently active phase, specifies if and how to prorate at the time of the request.details Possible enum valuesalways_
invoice Prorate changes, and force an invoice to be created for those prorations instead of leaving the prorations pending.
create_
prorations Prorate changes, but leave any prorations as pending invoice items to be picked up on the customer’s next invoice.
none
Does not create any prorations.
- subscription_
detailsobject The subscription creation or modification params to apply as a preview. Cannot be used with
schedule
orschedule_
fields.details - subscription_details.
billing_ cycle_ anchorstring | timestamp For new subscriptions, a future timestamp to anchor the subscription’s billing cycle. This is used to determine the date of the first full invoice, and, for plans with
month
oryear
intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonow
orunchanged
. - subscription_details.
cancel_ attimestamp 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_
. If set during a future period, this will always cause a proration for that period.behavior - subscription_details.
cancel_ at_ period_ endboolean Indicate whether this subscription should cancel at the end of the current period (
current_
). Defaults toperiod_ end false
. - subscription_details.
cancel_ nowboolean This simulates the subscription being canceled or expired immediately.
- subscription_details.
default_ tax_ ratesarray of strings 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_
set.rates - subscription_details.
itemsarray of objects A list of up to 20 subscription items, each with an attached price.
- subscription_details.
items. billing_ thresholdsobject 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.
- subscription_details.
items. billing_thresholds. usage_ gteintegerRequired Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary threshold)
- subscription_details.
items. clear_ usageboolean Delete all usage for a given subscription item. Allowed only when
deleted
is set totrue
and the current plan’susage_
istype metered
. - subscription_details.
items. deletedboolean A flag that, if set to
true
, will delete the specified item. - subscription_details.
items. discountsarray of objects The coupons to redeem into discounts for the subscription item.
- subscription_details.
items. discounts. couponstring ID of the coupon to create a new discount for.
- subscription_details.
items. discounts. discountstring ID of an existing discount on the object (or one of its ancestors) to reuse.
- subscription_details.
items. discounts. promotion_ codestring ID of the promotion code to create a new discount for.
- subscription_details.
items. idstring Subscription item to update.
- subscription_details.
items. metadataobject Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
. - subscription_details.
items. pricestring The ID of the price object. One of
price
orprice_
is required. When changing a subscription item’s price,data quantity
is set to 1 unless aquantity
parameter is provided. - subscription_details.
items. price_ dataobject Data used to generate a new Price object inline. One of
price
orprice_
is required.data - subscription_details.
items. price_data. currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- subscription_details.
items. price_data. productstringRequired The ID of the product that this price will belong to.
- subscription_details.
items. price_data. recurringobjectRequired The recurring components of a price such as
interval
andinterval_
.count - subscription_details.
items. price_data. recurring. intervalenumRequired Specifies billing frequency. Either
day
,week
,month
oryear
.Possible enum valuesday
month
week
year
- subscription_details.
items. price_data. recurring. interval_ countinteger The number of intervals between subscription billings. For example,
interval=month
andinterval_
bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).count=3
- subscription_details.
items. price_data. tax_ behaviorenumRecommended if calculating taxes Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of
inclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed.Possible enum valuesexclusive
inclusive
unspecified
- subscription_details.
items. price_data. unit_ amountinteger A positive integer in cents (or 0 for a free price) representing how much to charge.
- subscription_details.
items. price_data. unit_ amount_ decimalstringRequired conditionally Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- subscription_details.
items. quantityinteger Quantity for this item.
- subscription_details.
items. tax_ ratesarray of strings A list of Tax Rate ids. These Tax Rates will override the
default_
on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.tax_ rates
- subscription_details.
proration_ behaviorenum Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resetting
billing_
, or starting a trial), or if an item’scycle_ anchor=now quantity
changes. The default value iscreate_
.prorations Possible enum valuesalways_
invoice Always invoice immediately for prorations.
create_
prorations Will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under certain conditions.
none
Disable creating prorations in this request.
- subscription_details.
proration_ datetimestamp If previewing an update to a subscription, and doing proration,
subscription_
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,details. proration_ date subscription
, and one ofsubscription_
, ordetails. items subscription_
are required. Also,details. trial_ end subscription_
cannot be set to ‘none’.details. proration_ behavior - subscription_details.
resume_ atstring For paused subscriptions, setting
subscription_
todetails. resume_ at now
will preview the invoice that will be generated if the subscription is resumed. - subscription_details.
start_ datetimestamp Date a subscription is intended to start (can be future or past).
- subscription_details.
trial_ endstring | timestamp If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of
subscription_
ordetails. items subscription
is required.
Returns
Returns an invoice if valid customer information is provided. Raises an error otherwise.
{ "id": "upcoming_in_1MtHbELkdIwHu7ixl4OzzPMv", "object": "invoice", "account_country": "US", "account_name": "Stripe Docs", "account_tax_ids": null, "amount_due": 0, "amount_paid": 0, "amount_remaining": 0, "amount_shipping": 0, "application": null, "application_fee_amount": null, "attempt_count": 0, "attempted": false, "auto_advance": false, "automatic_tax": { "enabled": false, "status": null }, "billing_reason": "manual", "charge": null, "collection_method": "charge_automatically", "created": 1680644467, "currency": "usd", "custom_fields": null, "customer": "cus_NeZwdNtLEOXuvB", "customer_address": null, "customer_email": "jennyrosen@example.com", "customer_name": "Jenny Rosen", "customer_phone": null, "customer_shipping": null, "customer_tax_exempt": "none", "customer_tax_ids": [], "default_payment_method": null, "default_source": null, "default_tax_rates": [], "description": null, "discount": null, "discounts": [], "due_date": null, "ending_balance": null, "footer": null, "from_invoice": null, "hosted_invoice_url": null, "invoice_pdf": null, "last_finalization_error": null, "latest_revision": null, "lines": { "object": "list", "data": [], "has_more": false, "total_count": 0, "url": "/v1/invoices/in_1MtHbELkdIwHu7ixl4OzzPMv/lines" }, "livemode": false, "metadata": {}, "next_payment_attempt": null, "number": null, "on_behalf_of": null, "paid": false, "paid_out_of_band": false, "payment_intent": null, "payment_settings": { "default_mandate": null, "payment_method_options": null, "payment_method_types": null }, "period_end": 1680644467, "period_start": 1680644467, "post_payment_credit_notes_amount": 0, "pre_payment_credit_notes_amount": 0, "quote": null, "receipt_number": null, "rendering_options": null, "shipping_cost": null, "shipping_details": null, "starting_balance": 0, "statement_descriptor": null, "status": "draft", "status_transitions": { "finalized_at": null, "marked_uncollectible_at": null, "paid_at": null, "voided_at": null }, "subscription": null, "subtotal": 0, "subtotal_excluding_tax": 0, "tax": null, "test_clock": null, "total": 0, "total_discount_amounts": [], "total_excluding_tax": 0, "total_tax_amounts": [], "transfer_data": null, "webhooks_delivered_at": 1680644467}