Invoice
The Invoice entity in Billing.
An Invoice is a billable statement issued to a customer. It collects line items, taxes, discounts, and shipping into a single total_amount, tracks how much has been collected (amount_paid / amount_due), and exposes the actions to deliver, charge, remind, void, or render a PDF. Invoices come from two sources: created directly via createInvoice for ad-hoc billing, or generated automatically by the Subscription engine at each cycle.
Lifecycle
DRAFT— created and editable. Patch withupdateInvoiceto add items, change amounts, or move dates.OPEN— finalized and ready for collection. Subscription-generated invoices skip straight toOPEN.SENT/VIEWED—sendInvoicedelivers the email and (optionally) attaches the PDF;last_sent_atandlast_viewed_attrack engagement. Emitsinvoice.created,invoice.finalized.OVERDUE/PARTIALLY_PAID— pastdue_datewith an outstanding balance. Dunning may take over forcharge_automaticallyinvoices. Emitsinvoice.payment_failed.PAID—amount_duereaches zero viapayInvoiceor the customer's hosted payment page. Emitsinvoice.paid.VOID/VOIDED— terminated byvoidInvoiceor by a dunning terminal action. Emitsinvoice.voidedorinvoice.marked_uncollectible.
Relationships
An invoice references a buyer through buyer_id (a Customer) and may be linked from a Subscription via latest_invoice_id. Each InvoiceItem may carry a price_id (linking back to a Price) and coupon_ids for line-level discounts. Successful payments produce transfers visible under the customer's order history.
Fields that matter
status(InvoiceStatus) —DRAFT,OPEN,SENT,VIEWED,OVERDUE,PARTIALLY_PAID,PAID,UNPAID,VOID,VOIDED.collection_method(charge_automatically|send_invoice) —charge_automaticallyrunspayInvoiceagainst the customer's default instrument when the invoice opens;send_invoicewaits for the customer to pay via the hosted page.items(InvoiceItem[]) — each line carriesdescription,quantity,unit_price(smallest currency unit), and optionallyprice_id,coupon_ids,manual_tax_rate.due_date(ISO date) — required on create; drivesOVERDUEand reminder behavior.is_recurring+recurrence_interval— generates child invoices onWEEKLY/BIWEEKLY/MONTHLY/QUARTERLY/YEARLYcadence; pair withrecurrence_auto_sendto skip the manual send step.amount_due/amount_paid/total_amount(number, smallest currency unit) — the running balance the dunning engine and webhooks act on.