Offline & Edge POS Synchronization
Network instability should never halt retail counter sales. Tracepos supports Offline-First Edge Architecture, allowing POS terminals and tablets to continue ringing up customers and printing receipts even when the internet is completely unavailable.
Offline Architecture Flow
[ In-Store Cashier Terminal ]
|
+---> 1. Terminal detects internet outage.
+---> 2. Stores orders in local encrypted SQLite / IndexedDB.
+---> 3. Assigns deterministic offline ID: "OFFLINE-{TERMINAL_ID}-{TIMESTAMP}".
+---> 4. Prints customer receipt locally with offline QR code.
|
v (Network Connectivity Restored)
|
+---> 5. Background sync worker drains local queue to Tracepos API.
+---> 6. Tracepos checks Idempotency / unique_id to prevent duplicates.
+---> 7. Deducts inventory & posts journal entries in original order date sequence.
Client Synchronization Checklist
When developing an offline POS client for Tracepos:
Local Catalog Caching:
- Cache products, barcodes, tax rates, and payment modes locally during the morning boot sequence (
GET /products?limit=1000). - Store locally in SQLite, Room (Android), or IndexedDB (Web/PWA).
- Cache products, barcodes, tax rates, and payment modes locally during the morning boot sequence (
Deterministic Invoice Numbering:
- Never generate sequential integers offline that could collide with another lane.
- Use a compound prefix:
LANE01-OFFLINE-20260930-184912.
Batch Sync Payload:
- When connection returns, iterate through unsynced orders and post them to
POST /saleswith:order_date: Original offline creation timestamp.Idempotency-Key: Matches the local order reference.
- When connection returns, iterate through unsynced orders and post them to
Handling Stock Discrepancies:
- If an item was sold offline that another lane sold out online, Tracepos accommodates negative stock adjustments if configured in warehouse settings, and logs a stock discrepancy alert for store managers to audit.
