API & Postman Collection

POSVelo's backend is a clean REST API. Everything the web app does, you can do through the API — handy for integrations, custom front-ends, or automation.

Base URL & versioning

http://localhost:5000/api/v1/...      ← core POS modules
http://localhost:5000/api/v2/...      ← HR, Payroll, ESS and newer modules

POSVelo serves two active, side-by-side API namespaces — there is no unversioned /api/... alias, so always include the version segment:

  • /api/v1 hosts the core POS platform: auth, setup, tenants, billing, stores, users, products, inventory, sales, POS, payments, customers, suppliers, purchases, expenses, reports, super-admin, audit, receipts and RBAC.
  • /api/v2 hosts the HR/Payroll suite, Employee Self-Service, and the newer v2 modules (stores v2, brands, reports v2, notifications). HR endpoints live under /api/v2/hr/... and ESS under /api/v2/me.

Both namespaces are current; v1 is not deprecated. See Updating & Upgrading.

In production replace localhost:5000 with your API domain (e.g. https://api.yourdomain.com).

Authentication

The API uses JWT with access + refresh tokens.

  1. Log in to receive an access_token (short-lived) and a refresh_token.
  2. Send the access token on every protected request:
    Authorization: Bearer <access_token>
    
  3. When the access token expires, call the refresh endpoint with the refresh token to get a new pair. Refresh tokens rotate; reuse of an old one triggers a full session revocation (theft protection).

The business (tenant) is derived from your token automatically — you never pass a tenant id.

Using the Postman collection

A complete Postman collection is included in the Postman folder of your package:

  • POSVelo-API.postman_collection.json — every endpoint (v1 + v2), grouped by module and version
  • POSVelo-Development.postman_environment.json — matching environment

To use it:

  1. Open Postman → Import → select the collection file.
  2. Import the environment file and select it (top-right).
  3. Set the environment's base_url to http://localhost:5000 (or your server).
  4. Run Login / Register first — the test scripts automatically save your access_token and refresh_token into the environment.
  5. All other requests inherit the bearer token automatically. Create endpoints save returned IDs (e.g. employee_id, brand_id) so you can chain calls.

Endpoint groups

The API mirrors the modules in this documentation.

Core (/api/v1): auth · setup · tenants · billing · stores · users · rbac · products (includes categories) · inventory · suppliers · purchases · sales · pos · payments · customers · expenses · reports · super-admin · audit · receipts

HR / Payroll / newer (/api/v2): hr/departments · hr/designations · hr/employees · hr/attendance · hr/shifts · hr/leave · hr/holidays · hr/payroll · me (ESS) · stores · brands · reports · notifications

Response shape & contract notes

  • Responses are JSON with a consistent success/error envelope.
  • Clients must tolerate unknown enum values — new enum values can be added in a minor release and are not considered breaking.
  • Adding a new field or endpoint is non-breaking. Removing/renaming fields only happens across a major version, with a deprecation window.

The included Postman collection is the full endpoint catalogue — every path, method and example request/response, grouped by module and version.