How a till keeps selling with no internet
Published , updated
A till that stops when the internet stops is not a till. It is a web page that sells things when conditions allow.
The difference is the order of operations. In an offline first till the sale is written to the tablet first, the receipt prints second, and the server is told third. If the third step fails, nothing the customer experienced depended on it.
The order, in full
- The line drops. Load shedding, a dead uplink, an ISP outage. The till does not find out until it tries to reach the server, and by then it no longer needs to.
- The sale completes. Items, total and payment method are written to storage on the tablet itself.
- The receipt prints. Bytes go straight to the thermal printer over Bluetooth or USB-C. The printer has never needed the internet.
- The queue drains. When the connection returns, the stored sales upload in order.
Nothing in steps two and three waits on a network. That is the whole design, and everything else follows from it.
Why the queue cannot double charge
The obvious failure in any offline queue is uploading the same sale twice: a flaky connection, a half finished upload, a retry. You get two records of one sale, and your day’s total is wrong.
The sale carries its receipt number from the moment it is rung up, and the server keeps one record per number. Offer the same sale ten times and it is stored once. The queue can therefore be as stupid and as persistent as it likes, which is what you want from something running unattended on a tablet.
Two counters at once
Two tills running offline at the same time is the harder version of the same problem. If both are counting receipts upward from the last number they saw, they will both reach the same one.
Each terminal issues its own numbers instead, so two counters can sell through the same outage without ever producing the same receipt number. There is a longer piece on this: two counters, no duplicate receipt numbers.
What this does not fix
Being honest about the edges, because they matter more than the feature:
- A mis-rung sale can be undone at the till for about 20 seconds. After it has synced there is no refund and no void. Corrections after that point happen outside the system.
- Orders from the online menu still need the internet. They arrive over WhatsApp, and WhatsApp needs a connection. The till is what keeps working; the ordering channel is not.
- The tablet has to survive. Sales live on it until they upload. A tablet that is wiped or lost during an outage takes the unsynced sales with it.
Questions
Can the till take a sale when the internet is down?
The till takes the sale, prints the receipt and opens the drawer with no connection at all. Each sale is written to the tablet before any server is contacted, so losing the line removes nothing from the sequence the counter depends on.
What happens to sales made while the connection was down?
Sales made offline sit in a queue on the tablet and upload when the connection returns. Each one carries the identifier it was given at the counter, so a sale that uploads twice is recognised and stored once.
Can a customer be charged twice when the queue syncs?
A customer cannot be charged twice by the queue. Every sale is recorded with the receipt number it was issued at the till, and the server stores one record per number no matter how many times the queue offers it.
Ask about your own shop
Every shop is set up by hand, so the first step is a conversation. If this will not fit what you do, we will tell you.