Hooks & events
Hook reference: invoice.issued
Read a newly issued invoice and distinguish manual, order-linked and recurring-period documents.
About 2 min read
Trigger and payload
InvoiceService dispatches invoice.issued after the invoice transaction commits. The payload keys are invoice_id, renewal_key and order_id. A manual invoice may have no order; an initial order invoice may have no renewal key. Preserve null values rather than converting them into a made-up linkage.
{"invoice_id": 123, "renewal_key": null, "order_id": null}
This example shows shape only. Use the received ID to read the issued invoice's real owner, seller snapshot, currency, lines and dates.
Appropriate use
Maintain an addon-owned document index, flag a reviewed operational workflow or queue permitted post-issue work. Deduplicate by invoice ID. A renewal key identifies the core's own recurring-period issuance; it is not a reusable instruction to create another invoice.
Financial boundary
The invoice has been issued with its original accounting meaning. An addon must not rewrite seller identity, number, currency, total or historical lines merely because it receives the event. Invoice issuance does not prove funds were received, nor does it authorise automatic delivery or processor charging. Use the payment ledger and normal activation workflow for those later steps.
Failure and testing
Cover manual and order-linked invoices, nullable fields, a renewal repeat and a rolled-back issue. Re-delivery must not generate a duplicate invoice or customer notification. Logs should contain safe reference IDs and failure categories, not full invoice/customer snapshots. Inspect hook delivery for the dispatcher's failure/recovery rules.