Finalize and collect
Use invoice lifecycle operations to draft, finalize, send, pay, void, and reconcile an invoice. Keep line items, tax, discounts, due dates, and customer identifiers on the invoice so your accounting and fulfillment systems have one stable record.send means paid.
Handle invoice events idempotently. A paid invoice can arrive after an earlier failure, and a failed invoice can be retried later. Update access and dunning state from the latest verified event. For open, past_due, or payment-failed state, provide a recovery path; for void or uncollectible, apply the policy you communicated to the customer.