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 StartedWhat 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
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:
| Endpoint | Method | Purpose |
|---|---|---|
| /pos/register/ | POST | Terminal registration — issues device API key scoped to company/store/terminal |
| /pos/init/ | GET | Full master-data seed for a POS terminal (products, campaigns, customers, config) |
| /pos/transactions/ | POST | Accept completed sale documents from PyPOS offline queue |
| /pos/closures/ | POST | Accept end-of-day closure records from PyPOS |
| /pos/campaigns/ | GET | Active campaigns for a terminal, scoped to store and company |
| /pos/products/ | GET | Product catalogue for a terminal, with price list applied |
| /admin/stores/ | GET/POST | Store management (Company Admin only) |
| /admin/terminals/ | GET/POST | Terminal 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