Create an invoice
Changed onThis 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
- Base URL: https://api.stripe.com
- URL: https://api.stripe.com/v1/invoices
- Auth: one of:
- HTTP basic
- HTTP bearer
Request body application/x-www-form-urlencoded
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.
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.
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.
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.
The currency to create this invoice in. Defaults to that of customer if not specified.
The ID of the customer to bill.
The ID of the account to bill.
The number of days from when the invoice is created until it is due. Valid only for invoices where collection_method=send_invoice.
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.
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.
The tax rates that will apply to any line item that does not have tax_rates set.
An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
The date on which payment for this invoice is due. Valid only for invoices where collection_method=send_invoice.
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.
Specifies which fields in the response should be expanded.
Footer to be displayed on the invoice.
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.
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.
How to handle pending invoice items on invoice creation. Defaults to exclude if the parameter is omitted.
Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default statement_descriptor will be set to the first subscription item's product's statement_descriptor.
The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected.
Response
Successful response.
The country of the business associated with this invoice, most often the business creating the invoice.
The public name of the business associated with this invoice, most often the business creating the invoice.
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 that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
The amount, in cents (or local equivalent), that was paid.
Amount, in cents (or local equivalent), that was paid on the invoice outside of Stripe.
The difference between amount_due and amount_paid, in cents (or local equivalent).
This is the sum of all the shipping amounts.
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.
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.
Controls whether Stripe performs automatic collection of the invoice. If false, the invoice's state doesn't automatically advance without an explicit action.
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.
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.
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.
Time at which the object was created. Measured in seconds since the Unix epoch.
Three-letter ISO currency code, in lowercase. Must be a supported currency.
The ID of the account representing the customer to bill.
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.
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.
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.
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.
An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically.
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 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.
Footer displayed on the invoice.
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.
Unique identifier for the object. For preview invoices created using the create preview endpoint, this id will be prefixed with upcoming_in.
The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
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.
The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice.
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.
String representing the object's type. Objects of the same type share the same value.
The latest timestamp at which invoice items can be associated with this invoice. Use the line item period to get the service period for each price.
The earliest timestamp at which invoice items can be associated with this invoice. Use the line item period to get the service period for each price.
Total amount of all post-payment credit notes issued for this invoice.
Total amount of all pre-payment credit notes issued for this invoice.
This is the transaction number that appears on email receipts sent for this invoice.
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.
Extra information about an invoice for the customer's credit card statement.
The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more
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
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
Total after discounts and taxes.
The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
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.
Changes
- info
added to the
/////////response propertyanyOflist for the response status - info
removed from the
/////////response propertyanyOflist for the response status
- info
- info
added the required property
///to the response with the status
- info
Some revisions have not been checked yet.