Skip to content

API Reference

Both HQ and Store servers expose REST APIs under the /api/v1/ prefix. All responses use the standard envelope:

json
{
  "success": true,
  "data": { ... },
  "error": "string (only on failure)"
}

Paginated endpoints add total, page, and pageSize to the response.

Authentication

MethodPathAuthDescription
POST/api/v1/auth/loginNoLogin with username + PIN/password
POST/api/v1/auth/pin-loginNoLogin with PIN only (POS/store)
POST/api/v1/auth/refreshNoRefresh access token
GET/api/v1/auth/meJWTGet current user info + permissions
POST/api/v1/auth/change-credentialJWTChange PIN/password

Login Request

json
{ "username": "admin", "pin": "1234" }

Login Response

json
{
  "success": true,
  "data": {
    "accessToken": "eyJ...",
    "refreshToken": "eyJ...",
    "user": { "id": "uuid", "username": "admin", "displayName": "Administrator", "isActive": true },
    "permissions": ["products.view", "products.create", ...]
  }
}

Products

All routes require JWT authentication.

MethodPathPermissionDescription
GET/api/v1/productsproducts.viewList products (search, departmentId, page, pageSize)
GET/api/v1/products/:idproducts.viewGet single product with tax rates
POST/api/v1/productsproducts.createCreate product
PUT/api/v1/products/:idproducts.editUpdate product
PATCH/api/v1/products/:id/toggle-activeproducts.editToggle active status
DELETE/api/v1/products/:idproducts.deleteSoft delete (sets isActive=false)
GET/api/v1/products/barcode/:barcodeproducts.viewLook up product by barcode
GET/api/v1/products/:productId/suppliersproducts.viewList suppliers for a product
POST/api/v1/products/:productId/suppliersproducts.editLink supplier to product
PUT/api/v1/products/:productId/suppliers/:supplierIdproducts.editUpdate product-supplier link
DELETE/api/v1/products/:productId/suppliers/:supplierIdproducts.editUnlink supplier from product

Create/Update Product Body

json
{
  "sku": "PROD-001",
  "barcode": "1234567890123",
  "name": "Product Name",
  "description": "Optional description",
  "departmentId": "uuid or null",
  "costPrice": 500,
  "sellPrice": 999,
  "taxGroupId": "uuid or null",
  "trackStock": true
}

Departments

MethodPathPermissionDescription
GET/api/v1/departmentsproducts.viewList all departments
POST/api/v1/departmentsproducts.createCreate department
PUT/api/v1/departments/:idproducts.editUpdate department
DELETE/api/v1/departments/:idproducts.deleteDelete department

Taxes

MethodPathPermissionDescription
GET/api/v1/taxestaxes.viewList tax rates
POST/api/v1/taxestaxes.manageCreate tax rate
PUT/api/v1/taxes/:idtaxes.manageUpdate tax rate
DELETE/api/v1/taxes/:idtaxes.manageDelete tax rate
GET/api/v1/taxes/groupstaxes.viewList tax groups
GET/api/v1/taxes/groups/:idtaxes.viewGet single tax group with rates
POST/api/v1/taxes/groupstaxes.manageCreate tax group
PUT/api/v1/taxes/groups/:idtaxes.manageUpdate tax group
DELETE/api/v1/taxes/groups/:idtaxes.manageDelete tax group

Suppliers

MethodPathPermissionDescription
GET/api/v1/supplierssuppliers.viewList suppliers
POST/api/v1/supplierssuppliers.createCreate supplier
PUT/api/v1/suppliers/:idsuppliers.editUpdate supplier
DELETE/api/v1/suppliers/:idsuppliers.deleteDelete supplier

Users

MethodPathPermissionDescription
GET/api/v1/usersusers.viewList users
POST/api/v1/usersusers.createCreate user
PUT/api/v1/users/:idusers.editUpdate user
GET/api/v1/users/store-employeesJWTList employees for current store

Roles

MethodPathPermissionDescription
GET/api/v1/rolesroles.viewList roles
POST/api/v1/rolesroles.manageCreate role
PUT/api/v1/roles/:idroles.manageUpdate role
GET/api/v1/roles/permissions/allroles.viewList all available permissions
PUT/api/v1/roles/:id/permissionsroles.manageUpdate role's permission set

Stores

MethodPathPermissionDescription
GET/api/v1/storesstores.viewList stores
GET/api/v1/stores/currentJWTGet current store info (store mode)
GET/api/v1/stores/dashboardstores.viewStore dashboard with sales, sync, registers
POST/api/v1/storesstores.createCreate store
PUT/api/v1/stores/:idstores.editUpdate store

Sales

MethodPathPermissionDescription
GET/api/v1/salespos.sellList sales (date_from, date_to, store_id, status, page)
POST/api/v1/salespos.sellCreate a complete sale with items and payments
PUT/api/v1/sales/:id/voidpos.voidVoid a sale
POST/api/v1/sales/printpos.sellGenerate receipt data

Create Sale Body

json
{
  "receiptNumber": "R-0001",
  "cashierId": "uuid",
  "terminalId": "T01",
  "subtotal": 1998,
  "taxTotal": 165,
  "discountTotal": 0,
  "grandTotal": 2163,
  "storeId": "uuid",
  "salesRepId": "uuid or null",
  "customerId": "uuid or null",
  "items": [
    {
      "productId": "uuid",
      "productName": "Coffee",
      "quantity": 2000,
      "unitPrice": 999,
      "taxRate": 825,
      "taxAmount": 165,
      "discountAmount": 0,
      "lineTotal": 2163,
      "taxes": [
        { "taxRateName": "State Tax", "rate": 825, "taxAmount": 165, "isCompound": false, "sortOrder": 0 }
      ]
    }
  ],
  "payments": [
    { "method": "CASH", "amount": 2200, "reference": null }
  ]
}

Inventory

MethodPathPermissionDescription
GET/api/v1/inventoryinventory.viewList inventory levels (store_id, product_id, low_stock, page)
POST/api/v1/inventory/adjustmentsinventory.adjustCreate inventory adjustment
GET/api/v1/inventory/cross-storeinventory.viewCross-store inventory view

Transfers

MethodPathPermissionDescription
GET/api/v1/transferstransfers.viewList transfers
GET/api/v1/transfers/:idtransfers.viewGet single transfer with items
POST/api/v1/transferstransfers.createCreate transfer
PUT/api/v1/transfers/:id/sendtransfers.sendMark transfer as sent
PUT/api/v1/transfers/:id/receivetransfers.receiveReceive transfer
PUT/api/v1/transfers/:id/canceltransfers.createCancel transfer

Registers

MethodPathPermissionDescription
GET/api/v1/registersregisters.viewList register sessions
GET/api/v1/registers/currentJWTGet current open register session
POST/api/v1/registers/openregisters.openOpen register
POST/api/v1/registers/closeregisters.closeClose register
PUT/api/v1/registers/:id/closeregisters.closeClose specific session

Tenders

MethodPathPermissionDescription
GET/api/v1/tenderstenders.viewList payment methods
POST/api/v1/tenderstenders.manageCreate tender type
PUT/api/v1/tenders/:idtenders.manageUpdate tender type
DELETE/api/v1/tenders/:idtenders.manageDelete tender type

Customers

MethodPathPermissionDescription
GET/api/v1/customerscustomers.viewList customers
GET/api/v1/customers/:idcustomers.viewGet single customer
POST/api/v1/customerscustomers.createCreate customer
PUT/api/v1/customers/:idcustomers.editUpdate customer
DELETE/api/v1/customers/:idcustomers.editDelete customer

Sales Reps

MethodPathPermissionDescription
GET/api/v1/sales-repssales_reps.viewList sales representatives
GET/api/v1/sales-reps/:idsales_reps.viewGet single sales rep
POST/api/v1/sales-repssales_reps.createCreate sales rep
PUT/api/v1/sales-reps/:idsales_reps.editUpdate sales rep
PATCH/api/v1/sales-reps/:id/toggle-activesales_reps.editToggle active status
DELETE/api/v1/sales-reps/:idsales_reps.deleteDelete sales rep

Store Prices

MethodPathPermissionDescription
GET/api/v1/store-pricesstore_prices.viewList store price overrides
POST/api/v1/store-pricesstore_prices.manageUpsert store price override
DELETE/api/v1/store-prices/:idstore_prices.manageDelete store price override

Purchase Orders

MethodPathPermissionDescription
GET/api/v1/purchase-orderspurchase_orders.viewList purchase orders
GET/api/v1/purchase-orders/:idpurchase_orders.viewGet PO with items
POST/api/v1/purchase-orderspurchase_orders.createCreate PO
PUT/api/v1/purchase-orders/:idpurchase_orders.editUpdate PO
PATCH/api/v1/purchase-orders/:id/submitpurchase_orders.createSubmit PO for approval
PATCH/api/v1/purchase-orders/:id/approvepurchase_orders.approveApprove PO
PATCH/api/v1/purchase-orders/:id/sendpurchase_orders.editMark PO as sent
PATCH/api/v1/purchase-orders/:id/receivepurchase_orders.receiveReceive PO items
PATCH/api/v1/purchase-orders/:id/cancelpurchase_orders.editCancel PO
DELETE/api/v1/purchase-orders/:idpurchase_orders.deleteDelete draft PO
POST/api/v1/purchase-orders/:id/itemspurchase_orders.editAdd item to PO
PUT/api/v1/purchase-orders/:id/items/:itemIdpurchase_orders.editUpdate PO item
DELETE/api/v1/purchase-orders/:id/items/:itemIdpurchase_orders.editRemove PO item

Specials

MethodPathPermissionDescription
GET/api/v1/specialsspecials.viewList all specials
GET/api/v1/specials/activespecials.viewList currently active specials
POST/api/v1/specialsspecials.manageCreate special
PUT/api/v1/specials/:idspecials.manageUpdate special
DELETE/api/v1/specials/:idspecials.manageDelete special

Worksheets

MethodPathPermissionDescription
GET/api/v1/worksheetsworksheets.viewList worksheets
GET/api/v1/worksheets/:idworksheets.viewGet worksheet with items and stores
POST/api/v1/worksheetsworksheets.createCreate worksheet
PUT/api/v1/worksheets/:idworksheets.createUpdate draft worksheet
DELETE/api/v1/worksheets/:idworksheets.deleteDelete draft worksheet
PATCH/api/v1/worksheets/:id/submitworksheets.submitSubmit for approval
PATCH/api/v1/worksheets/:id/approveworksheets.approveApprove worksheet
PATCH/api/v1/worksheets/:id/rejectworksheets.approveReject worksheet
PATCH/api/v1/worksheets/:id/applyworksheets.applyApply approved worksheet to products

Reports

MethodPathPermissionDescription
GET/api/v1/reports/sales-summaryreports.view_globalSales summary (date_from, date_to, store_id)
GET/api/v1/reports/taxreports.view_globalTax report
GET/api/v1/reports/inventory-valuereports.view_globalInventory valuation
GET/api/v1/reports/x-reportreports.x_reportX report (session_id)
GET/api/v1/reports/z-reportreports.z_reportZ report (session_id)
GET/api/v1/reports/product-performancereports.product_performanceProduct performance
GET/api/v1/reports/sales-by-periodreports.view_globalSales by period
GET/api/v1/reports/sales-by-repreports.sales_by_repSales by representative
GET/api/v1/reports/profit-marginreports.profit_marginProfit margin by department
GET/api/v1/reports/cashier-performancereports.cashier_performanceCashier performance
GET/api/v1/reports/department-salesreports.view_globalSales by department
GET/api/v1/reports/inventory-turnoverreports.view_globalInventory turnover
GET/api/v1/reports/discount-analysisreports.discount_analysisDiscount usage analysis

Sync (HQ Server Only)

These endpoints use sync token authentication (not user JWT), except for the dashboard endpoints which use user JWT.

Store-Facing Endpoints (Sync Token Auth)

MethodPathAuthDescription
GET/api/v1/sync/pullSync TokenPull entity updates from HQ
POST/api/v1/sync/pushSync TokenPush store data to HQ
GET/api/v1/sync/statusSync TokenGet sync status for the store
WebSocket/api/v1/sync/wsSync TokenReal-time sync notifications

Dashboard Endpoints (User JWT Auth)

MethodPathPermissionDescription
GET/api/v1/sync/dashboardJWTOverview of all stores' sync status
GET/api/v1/sync/errorsJWTList unresolved sync errors
POST/api/v1/sync/retry/:idJWTRetry a failed sync entry
POST/api/v1/sync/resolve/:idJWTMark failed entry as resolved
POST/api/v1/sync/retry-allJWTRetry all failed entries (optionally by store)

Health Check

MethodPathAuthDescription
GET/healthNoReturns { status: 'ok' } (store also includes storeId, storeCode)