/v1/invoices/create_previewAt any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.
You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update.
The recommended way to get only the prorations being previewed on the invoice is to consider line items where parent.subscription_item_details.proration is true.
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.
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
| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| automatic_tax | object | Settings for automatic tax lookup for this invoice preview. 2 nested fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| currency | string (currency) | The currency to preview this invoice in. Defaults to that of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| customer | string | The identifier of the customer whose upcoming invoice you're retrieving. If | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| customer_account | string | The identifier of the account representing the customer whose upcoming invoice you're retrieving. If | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| customer_details | object | Details about the customer you want to invoice or overrides for an existing customer. If 5 nested fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| discounts | array<object> | string | 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expand | array<string> | Specifies which fields in the response should be expanded. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invoice_items | array<object> | List of invoice items to add or update in the upcoming invoice preview (up to 250). array item fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| issuer | object | The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. 2 nested fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on_behalf_of | string | string | 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_mode | string | Customizes the types of values to include when calculating the invoice. Defaults to | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| schedule | string | The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| schedule_details | object | The schedule creation or modification params to apply as a preview. Cannot be used with 4 nested fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subscription | string | The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subscription_details | object | The subscription creation or modification params to apply as a preview. Cannot be used with 13 nested fields
|
| Field | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| account_country | string | The country of the business associated with this invoice, most often the business creating the invoice. | ||||||||||||||||||
| account_name | string | The public name of the business associated with this invoice, most often the business creating the invoice. | ||||||||||||||||||
| account_tax_ids | array<string | tax_id | deleted_tax_id> | The account tax IDs associated with the invoice. Only editable when the invoice is a draft. | ||||||||||||||||||
| amount_due* | integer | Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the | ||||||||||||||||||
| amount_overpaid* | integer | Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance. | ||||||||||||||||||
| amount_paid* | integer | The amount, in cents (or local equivalent), that was paid. | ||||||||||||||||||
| amount_paid_off_stripe* | integer | Amount, in cents (or local equivalent), that was paid on the invoice outside of Stripe. | ||||||||||||||||||
| amount_remaining* | integer | The difference between amount_due and amount_paid, in cents (or local equivalent). | ||||||||||||||||||
| amount_shipping* | integer | This is the sum of all the shipping amounts. | ||||||||||||||||||
| application | string | application | deleted_application | ID of the Connect Application that created the invoice. | ||||||||||||||||||
| attempt_count* | integer | Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. | ||||||||||||||||||
| attempted* | boolean | Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the | ||||||||||||||||||
| auto_advance* | boolean | Controls whether Stripe performs automatic collection of the invoice. If | ||||||||||||||||||
| automatic_tax* | automatic_tax | 5 nested fields
| ||||||||||||||||||
| automatically_finalizes_at | integer (unix-time) | The time when this invoice is currently scheduled to be automatically finalized. The field will be | ||||||||||||||||||
| billing_reason | string | Indicates the reason why the invoice was created.
* | ||||||||||||||||||
| collection_method* | string | Either | ||||||||||||||||||
| confirmation_secret | invoices_resource_confirmation_secret | The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization. | ||||||||||||||||||
| created* | integer (unix-time) | Time at which the object was created. Measured in seconds since the Unix epoch. | ||||||||||||||||||
| currency* | string (currency) | Three-letter ISO currency code, in lowercase. Must be a supported currency. | ||||||||||||||||||
| custom_fields | array<invoice_setting_custom_field> | Custom fields displayed on the invoice. array item fields
| ||||||||||||||||||
| customer* | string | customer | deleted_customer | The ID of the customer to bill. | ||||||||||||||||||
| customer_account | string | The ID of the account representing the customer to bill. | ||||||||||||||||||
| customer_address | address | The customer's address. Until the invoice is finalized, this field will equal | ||||||||||||||||||
| customer_email | string | The customer's email. Until the invoice is finalized, this field will equal | ||||||||||||||||||
| customer_name | string | The customer's name. Until the invoice is finalized, this field will equal | ||||||||||||||||||
| customer_phone | string | The customer's phone number. Until the invoice is finalized, this field will equal | ||||||||||||||||||
| customer_shipping | shipping | The customer's shipping information. Until the invoice is finalized, this field will equal | ||||||||||||||||||
| customer_tax_exempt | string | The customer's tax exempt status. Until the invoice is finalized, this field will equal | ||||||||||||||||||
| customer_tax_ids | array<invoices_resource_invoice_tax_id> | The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as array item fields
|