Retrieve an upcoming invoice

GET {{baseUrl}}/v1/invoices/upcoming

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.

Request Params

KeyDatatypeRequiredDescription
automatic_tax[enabled]stringSettings for automatic tax lookup for this invoice preview.
couponstringThe 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.
currencystringThe currency to preview this invoice in. Defaults to that of customer if not specified.
customerstringThe identifier of the customer whose upcoming invoice you'd like to retrieve.
customer_details[address][city]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[address][country]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[address][line1]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[address][line2]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[address][postal_code]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[address][state]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][address][city]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][address][country]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][address][line1]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][address][line2]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][address][postal_code]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][address][state]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][name]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[shipping][phone]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[tax][ip_address]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[tax_exempt]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[tax_ids][0][type]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[tax_ids][0][value]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[tax_ids][1][type]stringDetails about the customer you want to invoice or overrides for an existing customer.
customer_details[tax_ids][1][value]stringDetails about the customer you want to invoice or overrides for an existing customer.
discounts[0][coupon]stringThe 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.
discounts[0][discount]stringThe 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.
discounts[1][coupon]stringThe 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.
discounts[1][discount]stringThe 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[0]stringSpecifies which fields in the response should be expanded.
expand[1]stringSpecifies which fields in the response should be expanded.
invoice_items[0][amount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][currency]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][description]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][discountable]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][discounts][0][coupon]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][discounts][0][discount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][discounts][1][coupon]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][discounts][1][discount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][invoiceitem]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][metadata]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][period][end]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][period][start]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][price]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][price_data][currency]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][price_data][product]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][price_data][tax_behavior]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][price_data][unit_amount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][price_data][unit_amount_decimal]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][quantity]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][tax_behavior]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][tax_code]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][tax_rates][0]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][tax_rates][1]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][unit_amount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[0][unit_amount_decimal]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][amount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][currency]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][description]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][discountable]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][discounts][0][coupon]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][discounts][0][discount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][discounts][1][coupon]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][discounts][1][discount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][invoiceitem]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][metadata]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][period][end]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][period][start]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][price]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][price_data][currency]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][price_data][product]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][price_data][tax_behavior]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][price_data][unit_amount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][price_data][unit_amount_decimal]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][quantity]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][tax_behavior]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][tax_code]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][tax_rates][0]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][tax_rates][1]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][unit_amount]stringList of invoice items to add or update in the upcoming invoice preview.
invoice_items[1][unit_amount_decimal]stringList of invoice items to add or update in the upcoming invoice preview.
schedulestringThe identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
subscriptionstringThe 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.
subscription_cancel_at_period_endstringBoolean indicating whether this subscription should cancel at the end of the current period.
subscription_cancel_nowstringThis simulates the subscription being canceled or expired immediately.
subscription_default_tax_rates[0]stringIf 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.
subscription_default_tax_rates[1]stringIf 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.
subscription_items[0][billing_thresholds][usage_gte]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][clear_usage]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][deleted]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][id]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][metadata]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][currency]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][product]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][recurring][interval]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][recurring][interval_count]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][tax_behavior]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][unit_amount]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][price_data][unit_amount_decimal]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][quantity]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][tax_rates][0]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[0][tax_rates][1]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][billing_thresholds][usage_gte]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][clear_usage]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][deleted]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][id]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][metadata]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][currency]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][product]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][recurring][interval]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][recurring][interval_count]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][tax_behavior]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][unit_amount]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][price_data][unit_amount_decimal]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][quantity]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][tax_rates][0]stringA list of up to 20 subscription items, each with an attached price.
subscription_items[1][tax_rates][1]stringA list of up to 20 subscription items, each with an attached price.
subscription_proration_behaviorstringDetermines how to handle 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.
subscription_proration_datestringIf 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 cannot be before the subscription was on its current plan. If set, subscription, and one of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to 'none'.
subscription_start_datestringDate a subscription is intended to start (can be future or past)
subscription_trial_from_planstringIndicates if a plan's trial_period_days should be applied to the subscription. Setting subscription_trial_end per subscription is preferred, and this defaults to false. Setting this flag to true together with subscription_trial_end is not allowed. See Using trial periods on subscriptions to learn more.

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring