Invoice events

The policy events that fire across an invoice's lifecycle

Overview

Invoices emit standard policy events at each significant transition. Subscribe to these the same way you subscribe to any other policy event, for example to send a notification with the invoice PDF attached, or to reconcile against an external system.

Events

Every event carries the invoice_id and the timestamp.

EventWritten whenAlso carries
invoice_createdThe invoice is finalised and takes its reference, moving from draft to openreference
invoice_sentThe invoice is dispatched to the policyholder
invoice_paidThe invoice is marked paid, either by a successful payment or by handpayment_id, external_reference
invoice_voidedThe invoice is voidedreason
invoice_refundedA credit note is raised against this invoice. Written on the original invoicerefund_invoice_id, the credit note
invoice_uncollectibleThe invoice is written off as bad debtreason
📘

Payloads are deliberately small.

An event carries the invoice ID and the few fields above,
never the line items and never the PDF. invoice_created in particular has no document file
ID, because the invoice is rendered after the event is written.

📘

Transitions are idempotent where they can be.

Redelivering the same payment against an
already-paid invoice does not write a second invoice_paid. Build consumers for at-least-once
delivery regardless.




Did this page help you?