- Subscription preview: When creating a new subscription, view the line items on the invoice that will be issued for a checkout flow
- Upgrade preview: When executing a plan change, view the line items on invoices that will be issued, and credit notes that may be created (e.g. as the result of an in-advance fee credit). This can be useful for understanding charges on an upgrade or downgrade.
- Internal assertions and testing: When executing a backdated subscription action, understand the invoices that will be voided and/or re-issued
Usage
To use this functionality, pass the following header into your subscription mutation call:- Key:
Include-Changed-Resources - Value:
true
changed_resources with the following properties:
created_invoices: These are the invoices that Orb will create as the result of this mutation. Note that Orb automatically creates a few lookahead invoices, which are invoices that are expected to exist in the future, so this might include more than the first invoice.voided_invoices: These are the invoices that Orb will void as the result of this mutation.created_credit_notes: These are the credit note objects that Orb will create as the result of this mutation.voided_credit_notes: These are the credit note objects that Orb will void as the result of this mutation.
Currently, this list of changed resources is not exhaustive. Each individual entry is expected to be complete, but there may be other side effects (e.g. the removal of a draft invoice) that isn’t yet returned.
Payable invoices only
If you only need the invoices that require immediate payment, you can pass a lighter-weight header value:- Key:
Include-Changed-Resources - Value:
payable_invoices
created_invoices where is_payable_now is true, skipping voided invoices, credit notes, and expensive metric recomputation. The response shape is the same changed_resources object, but only the created_invoices field will be populated, and only with the payable invoices.
This is particularly useful for checkout flows where you only need to know the amount to charge upfront and don’t need the full set of side effects.