2023-08-16
Breaking Changes2
InvoiceLineItem `quantity` and `amount` fields
Line items on `Invoice` objects now consistently represent a single item. Consequently, the `quantity` and `amount` fields on `InvoiceLineItem` objects are now always `null`. Integrations must be updated to not rely on these fields for amount calculation.
Accessing `invoiceLineItem.quantity` or `invoiceLineItem.amount` expecting a numerical value to calculate totals.
Retrieve total values directly from `InvoiceLineItem` object fields like `amount_total`, `tax_exclusive_amount`, or `tax_inclusive_amount`.
Refactor invoice parsing logic to no longer use `InvoiceLineItem` `quantity` or `amount`.
LineItem `price` and `quantity` fields
For `LineItem` objects (e.g., within `CheckoutSession` or `Subscription`), the `price` and `quantity` fields can now be `null` if discounts are applied directly to the line item. Integrations must include null checks before accessing these fields.
Accessing `lineItem.price` or `lineItem.quantity` assuming they are always present and non-null.
Add null checks for `lineItem.price` and `lineItem.quantity` before processing or displaying these values.
Implement null checks for `price` and `quantity` on all `LineItem` objects.
Never get blindsided by an API change again
Deprecatr AI monitors 150+ providers, maps changes to your codebase, and delivers migration checklists before your team hits a breaking change.
Join the Waitlist