Invoices
post/v1/invoices

Create an invoice

This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.

Request body

FieldTypeDescription
account_tax_idsarray<string> | string

The account tax IDs associated with the invoice. Only editable when the invoice is a draft.

application_fee_amountinteger

A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation.

auto_advanceboolean

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

automatic_taxobject

Settings for automatic tax lookup for this invoice.

2 nested fields
FieldTypeDescription
enabled*boolean
liabilityobject
2 nested fields
FieldTypeDescription
accountstring
type*string
automatically_finalizes_atinteger (unix-time)

The time when this invoice should be scheduled to finalize (up to 5 years in the future). The invoice is finalized at this time if it's still in draft state.

collection_methodstring

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. Defaults to charge_automatically.

currencystring (currency)

The currency to create this invoice in. Defaults to that of customer if not specified.

custom_fieldsarray<object> | string

A list of up to 4 custom fields to be displayed on the invoice.

customerstring

The ID of the customer to bill.

customer_accountstring

The ID of the account to bill.

days_until_dueinteger

The number of days from when the invoice is created until it is due. Valid only for invoices where collection_method=send_invoice.

default_payment_methodstring

ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.

default_sourcestring

ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.

default_tax_ratesarray<string>

The tax rates that will apply to any line item that does not have tax_rates set.

descriptionstring

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

discountsarray<object> | string

The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts.

due_dateinteger (unix-time)

The date on which payment for this invoice is due. Valid only for invoices where collection_method=send_invoice.

effective_atinteger (unix-time)

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.

expandarray<string>

Specifies which fields in the response should be expanded.

footerstring

Footer to be displayed on the invoice.

from_invoiceobject

Revise an existing invoice. The new invoice will be created in status=draft. See the revision documentation for more details.

2 nested fields
FieldTypeDescription
action*string
invoice*string
issuerobject

The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.

2 nested fields
FieldTypeDescription
accountstring
type*string
metadataobject | string

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.

numberstring

Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.

on_behalf_ofstring

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.

payment_settingsobject

Configuration settings for the PaymentIntent that is generated when the invoice is finalized.

3 nested fields
FieldTypeDescription
default_mandatestring | string
payment_method_optionsobject
10 nested fields
FieldTypeDescription
acss_debitobject | string
bancontactobject | string
cardobject | string
customer_balanceobject | string
konbiniobject | string
paytoobject | string
pixobject | string
sepa_debitobject | string
upiobject | string
us_bank_accountobject | string
payment_method_typesarray<string> | string
pending_invoice_items_behaviorstring

How to handle pending invoice items on invoice creation. Defaults to exclude if the parameter is omitted.

renderingobject

The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.

4 nested fields
FieldTypeDescription
amount_tax_displaystring
pdfobject
1 nested field
FieldTypeDescription
page_sizestring
templatestring
template_versioninteger | string
shipping_costobject

Settings for the cost of shipping for this invoice.

2 nested fields
FieldTypeDescription
shipping_ratestring
shipping_rate_dataobject
7 nested fields
FieldTypeDescription
delivery_estimateobject
2 nested fields
FieldTypeDescription
maximumobject
2 nested fields
FieldTypeDescription
unit*string
value*integer
minimumobject
2 nested fields
FieldTypeDescription
unit*string
value*integer
display_name*string
fixed_amountobject
3 nested fields
FieldTypeDescription
amount*integer
currency*string (currency)
currency_optionsobject
metadataobject
tax_behaviorstring
tax_codestring
typestring
shipping_detailsobject

Shipping details for the invoice. The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer.

3 nested fields
FieldTypeDescription
address*object
6 nested fields
FieldTypeDescription
citystring
countrystring
line1string
line2string
postal_codestring
statestring
name*string
phonestring | string

Response

FieldTypeDescription
account_countrystring

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

account_namestring

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

account_tax_idsarray<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_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_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.

applicationstring | 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 invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users.

auto_advance*boolean

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

automatic_tax*automatic_tax
5 nested fields
FieldTypeDescription
disabled_reasonstring

If Stripe disabled automatic tax, this enum describes why.

enabled*boolean

Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified tax rates, negative amounts, or tax_behavior=unspecified) cannot be added to automatic tax invoices.

liabilityconnect_account_reference

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.

providerstring

The tax provider powering automatic tax.

statusstring

The status of the most recent automated tax calculation for this invoice.

automatically_finalizes_atinteger (unix-time)

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_reasonstring

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*string

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.

confirmation_secretinvoices_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_fieldsarray<invoice_setting_custom_field>

Custom fields displayed on the invoice.

array item fields
FieldTypeDescription
name*string

The name of the custom field.

value*string

The value of the custom field.

customer*string | customer | deleted_customer

The ID of the customer to bill.

customer_accountstring

The ID of the account representing the customer to bill.

customer_addressaddress

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

customer_emailstring

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

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

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_shippingshipping

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

customer_tax_exemptstring

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.

customer_tax_idsarray<invoices_resource_invoice_tax_id>

The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated.

array item fields
FieldTypeDescription
type*string

The type of the tax ID, one of ad_nrt, ar_cuit, eu_vat, bo_tin, br_cnpj, br_cpf, cn_tin, co_nit, cr_tin, do_rcn, ec_ruc, eu_oss_vat, hr_oib, pe_ruc, ro_tin, rs_pib, sv_nit, uy_ruc, ve_rif, vn_tin, gb_vat, nz_gst, au_abn, au_arn, in_gst, no_vat, no_voec, za_vat, ch_vat, mx_rfc, sg_uen, ru_inn, ru_kpp, ca_bn, hk_br, es_cif, pl_nip, it_cf, fo_vat, gi_tin, py_ruc, tw_vat, th_vat, jp_cn, jp_rn, jp_trn, li_uid, li_vat, lk_vat, my_itn, us_ein, kr_brn, ca_qst, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, my_sst, sg_gst, ae_trn, cl_tin, sa_vat, id_npwp, my_frp, il_vat, ge_vat, ua_vat, is_vat, bg_uic, hu_tin, si_tin, ke_pin, tr_tin, eg_tin, ph_tin, al_tin, bh_vat, kz_bin, ng_tin, om_vat, de_stn, ch_uid, tz_vat, uz_vat, uz_tin, md_vat, ma_vat, by_tin, ao_tin, bs_tin, bb_tin, cd_nif, mr_nif, me_pib, zw_tin, ba_tin, gn_nif, mk_vat, sr_fin, sn_ninea, am_tin, np_pan, tj_tin, ug_tin, zm_tin, kh_tin, aw_tin, az_tin, bd_bin, bj_ifu, et_tin, kg_tin, la_tin, cm_niu, cv_nif, bf_ifu, or unknown

valuestring

The value of the tax ID.