Roles
Every account has one or more roles, carried as claims inside the access token:
Endpoints under API Reference → Admin, and the write endpoints under Inventory (Admin),
require
ADMIN or SUPER_ADMIN. Everything else that requires auth accepts any authenticated
user unless the endpoint description says otherwise.
Retail sign-up
1
Register
POST /v1/auth/register with email, password, first/last name, and phone. The account is
created unverified and a 6-digit code is emailed to the address given.2
Verify email
POST /v1/auth/verify-email with the email and code. The code expires 10 minutes after
it’s sent — use POST /v1/auth/verify-email/resend to get a new one. On success, this
returns the same token pair as login.3
Log in
POST /v1/auth/login with email and password returns accessToken, refreshToken, and
expiresIn (seconds).Wholesale (trade) sign-up
Trade accounts go through a review step rather than self-serve verification:POST /v1/wholesale/apply— public, no password collected. Returns a human-readable tracking ID (e.g.CRA-2658190). This creates the account under review; no login is possible yet.- An admin approves or rejects the application (
API Reference → Admin → Wholesale Applications). - On approval, a set-password code is emailed.
POST /v1/wholesale/set-passwordwith that code activates the account and returns a token pair.
Using the access token
Send it as a standard bearer token on every authenticated request:POST /v1/auth/refresh with
the refresh token (valid 7 days) to get a new pair. POST /v1/auth/logout invalidates the
current refresh token.
Two-factor authentication (TOTP)
Any authenticated user can turn on TOTP (Google Authenticator-style) 2FA:POST /v1/auth/totp/setup— generates a secret and QR code.POST /v1/auth/totp/verify— confirms the code from the authenticator app and turns 2FA on.POST /v1/auth/totp/disable— turns it back off.