HomeSaleFlex GATE
Central API Hub

SaleFlex GATE — Central API Hub & Integration Gateway

As a retail operation grows beyond a single store, it needs a central service that manages company/store/terminal hierarchy, enforces access boundaries, and connects edge clients to ERP, loyalty, and payment platforms. SaleFlex GATE is the Django implementation in this ecosystem.

View on GitHub Getting Started

What GATE does

Without a central hub, each store manages its own master data independently. Price changes, new campaigns, and customer loyalty updates must be manually propagated to every terminal. A central hub reduces this operational drift by giving each client a versioned API and a clear company/store/terminal scope.

Multi-tenant hierarchy

Company → Store → Terminal scoping applied to every data model and API endpoint. Data cannot leak across tenant boundaries.

JWT auth + RBAC

Role-based access is being expanded around company and store scope. User sessions use the portal; unattended terminals use device-oriented authentication.

Integration gateway

Pluggable adapter architecture for ERP systems (SAP, Oracle, Logo), external loyalty platforms, payment service providers, and campaign engines.

Versioned REST APIs

The target API convention uses /api/v1/, JSON payloads, structured errors, and idempotency for financial writes. OpenAPI documentation is on the roadmap.

Push & pull sync

PyPOS terminals push transactions and pull master data via GATE. GATE can also push campaign and price updates proactively to connected terminals.

Self-hosted or cloud

Deploy GATE on your own server, VPS, or container platform. Managed hosting and ready-to-run packages are described as future commercial services.

Technology stack

Python
3.12+
Django
6.0.x
DRF
REST Framework
JWT
Auth
PostgreSQL
primary DB
RBAC
multi-tenant

Key API surface

A representative target API surface for GATE. The route family is still being expanded and should be checked against the repository before integration work:

EndpointMethodPurpose
/pos/register/POSTTerminal registration — issues device API key scoped to company/store/terminal
/pos/init/GETFull master-data seed for a POS terminal (products, campaigns, customers, config)
/pos/transactions/POSTAccept completed sale documents from PyPOS offline queue
/pos/closures/POSTAccept end-of-day closure records from PyPOS
/pos/campaigns/GETActive campaigns for a terminal, scoped to store and company
/pos/products/GETProduct catalogue for a terminal, with price list applied
/admin/stores/GET/POSTStore management (Company Admin only)
/admin/terminals/GET/POSTTerminal management (Store Manager+)

Add a central API boundary when the store model needs it

GATE is AGPLv3 open source and designed for self-hosted multi-store experiments today, with production hardening and broader REST coverage still active roadmap work.

GATE on GitHub Full Architecture