Update an invoice
POST / v1 / invoices /:id
Draft invoices are fully editable. Once an invoice is finalized, monetary values, as well as collection_method, become uneditable.
If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.
Parameters
- auto _ advance boolean Controls whether Stripe performs automatic collection of the invoice.
- automatic _ tax object Settings for automatic tax lookup for this invoice.
- collection _ method enum Either
charge_automaticallyorsend_invoice. This field can be updated only ondraftinvoices. Possible enum valuescharge_automaticallysend_invoice - description string An arbitrary string attached to the object. Often useful for displaying to users. Referenced as ‘memo’ in the Dashboard.
- metadata map 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.
More parameters
- account _ tax _ ids array of strings
- application _ fee _ amount integer Connect only
- automatically _ finalizes _ at timestamp
- custom _ fields array of objects
- days _ until _ due integer
- default _ payment _ method string
- default _ source string
- default _ tax _ rates array of strings
- discounts array of objects
- due _ date timestamp
- effective _ at timestamp
- footer string
- issuer object Connect only
- number string
- on _ behalf _ of string Connect only
- payment _ settings object
- rendering object
- shipping _ cost object
- shipping _ details object
- statement _ descriptor string
- transfer _ data object Connect only
Returns
Returns the invoice object.
Response
Retrieve an invoice
GET / v1 / invoices /:id
Retrieves the invoice with the given ID.
Parameters
No parameters.
Returns
Returns an invoice object if a valid invoice ID was provided. Raises an error otherwise.
The invoice object contains a lines hash that contains information about the subscriptions and invoice items that have been applied to the invoice, as well as any prorations that Stripe has automatically calculated. Each line on the invoice has an amount attribute that represents the amount actually contributed to the invoice’s total. For invoice items and prorations, the amount attribute is the same as for the invoice item or proration respectively. For subscriptions, the amount may be different from the plan’s regular price depending on whether the invoice covers a trial period or the invoice period differs from the plan’s usual interval.
The invoice object has both a subtotal and a total. The subtotal represents the total before any discounts, while the total is the final amount to be charged to the customer after all coupons have been applied.
The invoice also has a next_payment_attempt attribute that tells you the next time (as a Unix timestamp) payment for the invoice will be automatically attempted. For invoices with manual payment collection, that have been closed, or that have reached the maximum number of retries (specified in your subscriptions settings), the next_payment_attempt will be null.
Response
List all invoices
GET / v1 / invoices
You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
Parameters
- customer string Only return invoices for the customer specified by this customer ID.
- customer _ account string Only return invoices for the account representing the customer specified by this account ID.
- status enum The status of the invoice, one of
draft,open,paid,uncollectible, orvoid. Learn more - subscription string Only return invoices for the subscription specified by this subscription ID.
More parameters
- collection _ method enum
- created object
- ending _ before string
- limit integer
- starting _ after string
Returns
A dictionary with a data property that contains an array invoice attachments,
Response
