Adds support for multiple (partial) payments on invoicesBreaking changes
What’s new
We’re introducing support for multiple (partial) payments on invoices and credit notes. Invoices also track over-payments and can track out of band payments now. In addition, we’re adding a confirmation_ field on the Invoice object to enhance support for using the Payment Element.
Why is this a breaking change?
- Removed the
payment_,intent charge,paid, andpaid_fields from theout_ of_ band Invoiceobject. - Removed the
invoicefield from the Payment Intent and Charge objects. - Deprecated the
refundfield on the Credit Note object and replaced it with arefundsarray. - The
amount_field on thepaid Invoiceobject now reflects out of band payments.
Impact
We introduced the Invoice Payment object to represent the connection between payments and invoices and removed previous invoice and payment pointers on relevant objects. Make sure that you update your integration to no longer assume that a single invoice must be paid by a single payment, and use the new Invoice Payment object to understand the connection between payments and invoices.
Inspect the invoice. payments array for payment information
You can inspect invoice. when interacting with the Invoice object by expanding the payments property:
The invoice. array provides a list of all the payments associated with the invoice and their respective allocation and payment status.
Use the new Invoice Payment endpoints for payments and invoice connection
To understand the connection between a Payment Intent and Invoice object, you can use the List Invoice Payment endpoint:
Use confirmation_secret for Payment Element integrations
For Payment Element integrations, especially Subscription integrations, that previously relied on expanding invoice. or latest_, you can now use the new invoice. field on the Invoice object by expanding confirmation_:
Identify invoices with out-of-band payments
With the removal of the paid_ field, you can now identify invoices with out-of-band payments using the invoice.payments property.
To check if an invoice is fully paid out of band, verify the invoice status is paid, the amount_due is greater than 0, and the sum of payments of type PaymentIntent in the invoice.payments array equals 0.
To check if an invoice is partially paid out of band, verify the amount_ is greater than 0, and the sum of payments of type PaymentIntent in the invoice. array is less than amount_paid.
Changes
Upgrade
Related changes
- Replaces top-level price fields with improved price modeling on Invoice Items and Invoice Line Items
- Replaces top-level tax-related properties with improved tax modeling on Invoices, Invoice Line Items, and Credit Note Line Items
- Adds jurisdiction level and taxability reason to manual tax amounts on invoices