Skip to content
OrderAgentOrderAgent

How it works end to end

The full path a message takes: understanding, drafting, confirming, paying, verifying, invoicing and delivering.

This page follows one order all the way through, naming what happens at each point and what could stop it. Every other page in this section is a closer look at one part of it.

1. The message arrives

A customer sends a message to your shop's WhatsApp number. WhatsApp delivers it to us, we acknowledge it immediately, and the work happens behind that acknowledgement.

Every message is recorded with its WhatsApp id. That id is what stops a duplicate: WhatsApp retries a delivery it thinks failed, for up to seven days, and without the id one order could be created several times.

2. Cheap decisions first

Before anything expensive runs, three questions are answered from data we already hold:

  • Is this STOP or START? Opt-out is honoured before anything else.
  • Is this the owner? A message from the registered owner number is a command, not an order.
  • Is this only an acknowledgement? "ok", "thanks", "coming", a thumbs-up. These get a read receipt and nothing else — replying "the owner will get back to you" to "thanks" is noise, and it used to happen four times per delivery.

The acknowledgement check requires every word to be an acknowledgement, so "ok 2kg" is still an order and "thanks, when is delivery?" is still a question.

3. Context is assembled

Who the customer is, whether they have an open order, their last few messages, your catalogue, their saved address. This is read from the database — no language model is involved.

4. The message is classified

One call to a language model, against that context, produces a label: is this a new order, an addition to an open one, a question about payment, a request for the catalogue, an address, a question about their own history, or something else entirely.

5. A draft order is built

Matched lines become order lines at your current prices. Anything unmatched becomes a question. Anything that was never a product line becomes a note.

The customer sees a card: the items, the quantities, the line totals, the order total, any notes, and buttons.

6. Confirm

Until they tap Confirm, no stock has moved and no order exists in any meaningful sense. The tap does three things in one indivisible step: reserves the stock, freezes the prices, and sets the payment deadline.

If any line has gone short in the meantime — someone else bought the last tin four minutes ago — the whole confirm is rolled back and the customer is told exactly which lines are short and how much is left, so they can reduce the quantity instead of starting again.

7. Payment instructions

Your QR image and bank details go out immediately, with the amount, the order reference and the deadline. The reference matters: it is what the customer types into the bank transfer, and it is the first thing we look for when a receipt arrives.

Reminders go out before the deadline; if it passes with no payment, the order expires and the stock goes back. Both of those respect your shop's quiet hours.

8. The receipt

An image or PDF arrives. It is downloaded, hashed, and stored in a private bucket. Then it is read, and the result is put through six checks in a fixed order — duplicate image, duplicate reference, currency, date, amount, recipient account. The first failure wins and names itself.

Whatever the outcome, the receipt lands on your phone as a card and in the dashboard's Today queue.

9. Your approval

You tap Paid. That is the only thing in the entire system that can mark an order paid.

The moment you do, the invoice number is reserved and the invoice record is written inside the same transaction — so a failure there cannot consume a number — and then the PDF is rendered, stored and sent. A crash in the PDF renderer cannot un-approve a payment.

10. Fulfilment

PACK, SHIP, DELIVERED — from WhatsApp while your hands are full, or from the dashboard. Each real transition sends the customer one message. Skipping a stage sends one message about where the order actually got to, not three narrating a journey that did not happen.

11. The evening

After 8pm your shop gets one summary: what sold, what is still owed, what needs a decision, and what is running low. A quiet day still gets a summary saying so — a report that goes silent on bad days is a report you stop trusting.