v4

latestOpenAPI 3.0.02026-07-12228151.6 MB

Finalize an invoice

Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.

post/v1/invoices/{invoice}/finalize

Path parameters

invoicestring required

Response

Successful response.

account_countrystring nullable

The country of the business associated with this invoice, most often the business creating the invoice.

account_namestring nullable

The public name of the business associated with this invoice, most often the business creating the invoice.

amount_dueinteger required

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_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.

amount_overpaidinteger required

Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.

amount_paidinteger required

The amount, in cents (or local equivalent), that was paid.

amount_remaininginteger required

The difference between amount_due and amount_paid, in cents (or local equivalent).

amount_shippinginteger required

This is the sum of all the shipping amounts.

attempt_countinteger required

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.

attemptedboolean required

Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users.

auto_advanceboolean required

Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action.

automatically_finalizes_atinteger nullable

The time when this invoice is currently scheduled to be automatically finalized. The field will be null if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be null - see finalized_at for the time when an already-finalized invoice was finalized.

billing_reason'automatic_pending_invoice_item_invoice' | 'manual' | 'quote_accept' | 'subscription' | 'subscription_create' | 'subscription_cycle' | 'subscription_threshold' | 'subscription_update' | 'upcoming' nullable

Indicates the reason why the invoice was created.

  • manual: Unrelated to a subscription, for example, created via the invoice editor.
  • subscription: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
  • subscription_create: A new subscription was created.
  • subscription_cycle: A subscription advanced into a new period.
  • subscription_threshold: A subscription reached a billing threshold.
  • subscription_update: A subscription was updated.
  • upcoming: Reserved for upcoming invoices created through the Create Preview Invoice API or when an invoice.upcoming event is generated for an upcoming invoice on a subscription.
collection_method'charge_automatically' | 'send_invoice' required

Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.

createdinteger required

Time at which the object was created. Measured in seconds since the Unix epoch.

currencystring currency required

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customer_accountstring nullable

The ID of the account representing the customer to bill.

customer_emailstring nullable

The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated.

customer_namestring nullable

The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated.

customer_phonestring nullable

The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated.

customer_tax_exempt'exempt' | 'none' | 'reverse' nullable

The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated.

descriptionstring nullable

An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.

due_dateinteger nullable

The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically.

effective_atinteger nullable

The date when this invoice is in effect. Same as finalized_at unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.

ending_balanceinteger nullable

Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.

footerstring nullable

Footer displayed on the invoice.

hosted_invoice_urlstring nullable

The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.

idstring required

Unique identifier for the object. For preview invoices created using the create preview endpoint, this id will be prefixed with upcoming_in.

invoice_pdfstring nullable

The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.

livemodeboolean required

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadataobject nullable

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.

next_payment_attemptinteger nullable

The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice.

numberstring nullable

A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.

object'invoice' required

String representing the object's type. Objects of the same type share the same value.

period_endinteger required

End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price.

period_startinteger required

Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the line item period to get the service period for each price.

post_payment_credit_notes_amountinteger required

Total amount of all post-payment credit notes issued for this invoice.

pre_payment_credit_notes_amountinteger required

Total amount of all pre-payment credit notes issued for this invoice.

receipt_numberstring nullable

This is the transaction number that appears on email receipts sent for this invoice.

starting_balanceinteger required

Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.

statement_descriptorstring nullable

Extra information about an invoice for the customer's credit card statement.

status'draft' | 'open' | 'paid' | 'uncollectible' | 'void' nullable

The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more

subtotalinteger required

Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated

subtotal_excluding_taxinteger nullable

The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated

totalinteger required

Total after discounts and taxes.

total_excluding_taxinteger nullable

The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.

webhooks_delivered_atinteger nullable

Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.