Authentication
Refresh Token
Refreshes the authentication token. Does not require Bearer token as the current token is used from the request context.
Log In
Authenticate an active buyer with email and password and receive a bearer token. `email` and `password` are required; `remember` (optional, default false) keeps the session longer-lived. Wrong credentials and inactive accounts both return a generic 401 with no indication of which failed.
Request Login Code
Send a 6-digit one-time sign-in code to the buyer's email. Always returns a generic success message so the response never reveals whether an account exists. Rate limited.
Verify Login Code
Exchange a valid 6-digit email code for a bearer token. `email` and `code` are required. Invalid or expired codes return a 422 validation error.
Accept Invitation
Set a password from a single-use, time-limited invitation token (delivered by email when a merchant invites a buyer) and activate the account. Returns a bearer token so the buyer is signed in immediately. `token`, `password`, and a matching `password_confirmation` are required. Expired or already-used tokens return a 422 validation error.
Request Password Reset
Email a password-reset link to an active buyer. Always returns a generic success message regardless of whether the account exists. Rate limited.
Reset Password
Set a new password using the token from a reset email. `token`, `password`, and a matching `password_confirmation` are required. Expired or invalid tokens return a 422 validation error.
Open Staff View
Trades the single-use code from a merchant's staff-view link for a read-only session token on the buyer. The code works once and expires 5 minutes after it was issued; the session lasts 30 minutes.
End Staff View (tab closed)
Sent by the portal tab as a `navigator.sendBeacon` on page hide, to end a staff 'View as buyer' session when its tab closes without Exit. A beacon cannot send an Authorization header, so the view's own token travels in the body (the route is exempt from CSRF). The session ends with reason `closed`; a reload of the same tab within ~20 seconds resumes it. Anything that is not a live view-as token on this tenant is ignored. Always answers 204. Throttled 30/min.
Start SSO Sign-In
Begin a company SSO (SAML/OIDC) sign-in for the given company. Returns 501 when SSO is not configured for the account.
Complete SSO Sign-In
Handle the SSO provider callback for the given company. Returns 501 when SSO is not configured for the account.
Log Out
Revoke the current bearer token. Requires authentication.
Keep Staff View Alive
Extends a staff 'View as buyer' session. A staff view is an idle window: every authenticated request already pushes its expiry out to 60 minutes from now, and this endpoint does so explicitly (the 'Keep viewing' action shown before the view expires). It never extends past `ends_by`, 8 hours after the view opened. Allowed on a read-only staff view; it changes nothing of the buyer's.