Invoices
Numbering, what an invoice contains, why it can be rebuilt byte-for-byte, and how to resend one.
An invoice is issued the moment an order becomes paid, and delivered to the customer as a PDF over WhatsApp.
When it is issued
At the exact moment of your approval — whether that came from PAID FB-1204 on
WhatsApp or the Approve button in the dashboard — and at the moment a series of
part-payments finally clears the balance.
Nowhere else. Every door converges on the same point, and nothing else in the system can create an invoice.
A part-payment that leaves a balance issues nothing.
What it contains
- Your shop's name and details, and your invoice header settings.
- The invoice number and issue date.
- The order reference, so the two can always be tied together.
- The customer's name and delivery address.
- Every line: product, quantity, unit price, line total — as they were frozen on the order, not as your catalogue reads today.
- The total, in the order's own currency.
Numbering
Sequential per shop, zero-padded: INV-000001, INV-000002.
The number is reserved inside the same transaction that marks the order paid, so a later failure cannot consume one and leave a gap. Gaps in an invoice sequence are the kind of thing an accountant asks about.
Why it can be rebuilt exactly
The renderer is given the invoice record and its lines, and nothing else — no live shop settings, no current catalogue, no database access at all.
That constraint is what makes Rebuild safe. Regenerating a six-month-old invoice cannot pull in today's address, today's prices or today's shop name, because the renderer has no way to reach them. The document's own issue date is used as its creation timestamp, so a rebuild is byte-for-byte identical to the original.
Sending and resending
The PDF is uploaded to WhatsApp and sent as a document.
WhatsApp media ids expire after 30 days, so the id is treated as a delivery detail and never as the document itself. The stored PDF is the durable artifact, and Resend re-uploads from storage.
There is no approved template for documents, so a send outside the customer's 24-hour window is not attempted — it would fail. Instead it is logged, you are alerted, and Resend works the moment the customer messages you again.
Fonts and names
The PDF embeds a Unicode font, so Latin and extended-Latin names render correctly and the text is selectable and searchable rather than an image.
From the dashboard
The order screen offers View, Resend and Rebuild. There is also a Generate action for historical orders that were paid before invoicing existed.

