Tracepos Developer HubTracepos Developer Hub
Home
Guide
POS & Integrations
API Reference
Webhooks
Home
Guide
POS & Integrations
API Reference
Webhooks
  • POS Terminals & Hardware

    • Smart POS Terminal Integration Guide
  • Platform Integrations

    • E-Commerce & Omnichannel Storefronts
    • Payment Gateways & Settlement Reconciliation
    • Offline & Edge POS Synchronization

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:

  1. 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).
  2. Deterministic Invoice Numbering:

    • Never generate sequential integers offline that could collide with another lane.
    • Use a compound prefix: LANE01-OFFLINE-20260930-184912.
  3. Batch Sync Payload:

    • When connection returns, iterate through unsynced orders and post them to POST /sales with:
      • order_date: Original offline creation timestamp.
      • Idempotency-Key: Matches the local order reference.
  4. 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.
Prev
Payment Gateways & Settlement Reconciliation