API key and device id
Every API-key route requires both headers:X-Device-ID. Reuse that identifier on every request, including login and reads. Missing device ids return 401; using a bound key from another device returns 403. Provision separate keys for separate devices. Regenerating a key clears its device binding.
Revoked or expired keys return 401. Keys tied to archived locations return 403.
Employee sessions
Call employee login with the key, device id, username, and password. Savetoken and sessionExpiresAt.
401.
Non-admin employees need the API key’s location in locationIds. Empty assignments grant no location access. Admin employees bypass the location assignment check. A location restriction returns 403.
Validate employee credentials accepts a username and password. It does not check an existing token or create a new session.
Authentication by route
Public payment sessions use the unguessable token as their secret. Keep it private and avoid logging it.
