With Lago, you can preview invoices even if the customer doesn’t exist yet or for an active subscription, allowing you to generate dry-run invoices or estimate potential bills.
/invoices/preview
endpoint, you can generate a preview of an invoice for a potential purchase or to estimate the dry-run invoice of an active subscription.
This preview calculates the total invoice amount, itemizes each charge, and applies any relevant taxes or discounts.
By creating a preview, you can share the projected payment details without generating or finalizing an invoice.
Lago returns an invoice payload detailing all line items, applying any eligible discounts, and calculating the total amount.
external_id
along with the relevant subscription or plan details.
Lago will then generate a preview invoice on-demand, prorating all line items based on the billing_time
(calendar or anniversary).
subscription_at
field.
This instructs Lago to calculate and prorate all line items according to the date you specify.
external_id
; instead, provide all relevant customer information you wish to capture.
terminated_at
field in the request payload.
plan_code
in the request payload: