Notifications
These are the messages sent to the policyholder as an invoice moves through its lifecycle.
Each notification is an email or SMS template you write and enable under Communications.
Nothing is sent for an event whose template you have not enabled.
The notifications
| Notification | Sent when | Document attached |
|---|---|---|
invoice_created | An open invoice is sent to the policyholder | The invoice PDF |
invoice_refunded | A credit note is sent, crediting an earlier invoice | The credit note PDF |
invoice_paid | An invoice is marked paid and its receipt is generated | The receipt PDF |
invoice_voided | An invoice is voided | The void PDF |
invoice_uncollectible | An invoice is written off as uncollectible | None |
A credit note is an invoice in its own right, so it sends
invoice_refundedrather thaninvoice_created. That lets the credit note read as a credit rather than as a new amount
owed. Itsoriginal_invoice_idpoints at the invoice being credited.
Attachments
The document is attached to the email for you. You do not reference it in the template, and
you do not need to render its contents: the PDF is the itemised document, and the email body
is the covering message.
Attachments are email only. An SMS template for the same event sends the message on its own.
Merge variables
Three objects are available to an invoice notification template:
| Variable | What it holds |
|---|---|
invoice | The invoice the notification is about |
policy | The policy the invoice was raised against |
policyholder | The policyholder the invoice is addressed to |
policy and policyholder hold the same fields they do in any other notification.
The invoice object
invoice object| Field | Type | Notes |
|---|---|---|
invoice_id | string | |
organization_id | string | |
policy_id | string | The policy the invoice was raised against |
environment | string | sandbox or production |
type | string | Your own invoice type, from settings.invoices.invoiceTypes |
message | string | The free-text note captured when the invoice was created |
status | string | One of draft, open, paid, void, refunded, uncollectible |
reference | string | The invoice reference, assigned when the invoice is finalised |
invoice_date | string | Calendar day, YYYY-MM-DD |
due_date | string | Calendar day, YYYY-MM-DD |
total | integer | What the recipient owes, in the currency's minor unit |
currency | string | ISO 4217, for example ZAR |
document_file_id | string | The rendered invoice PDF |
receipt_document_file_id | string | The receipt PDF, once the invoice is paid |
void_document_file_id | string | The void PDF, once the invoice is voided |
proof_of_payment_file_id | string | Proof of payment, if one was attached |
original_invoice_id | string | Present on a credit note, pointing at the invoice it credits |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
Things worth knowing
total is what the recipient owes, as a positive number. Invoicing stores ledger amounts
from the policyholder's perspective, where a premium owed is negative. The merge variable is
already flipped for you, so {{invoice.total}} on a premium invoice renders a positive figure
and needs no handling in the template. A credit note's total is likewise positive, being the
value of the credit.
Amounts are in the currency's minor unit. A total of 150000 in ZAR is R1 500.00.
Divide by 100 before displaying it.
invoice_date and due_date are calendar days, not timestamps. They render as
2026-09-01, so formatting them as a date needs no timezone handling.
A field with no value is absent, not empty. An invoice that is not yet paid carries no
receipt_document_file_id at all, rather than an empty one, so guard optional fields with
{{#if}} rather than testing them for a blank value.
Example
<p>Hi {{policyholder.first_name}},</p>
<p>
Invoice {{invoice.reference}} for your {{policy.package_name}} policy comes to
{{invoice.currency}} {{invoice.total}}, due on {{invoice.due_date}}.
</p>
<p>The invoice is attached.</p>
{{#if invoice.message}}
<p>{{invoice.message}}</p>
{{/if}}Updated about 1 hour ago