For the complete documentation index, see llms.txt. This page is also available as Markdown.

Verify a user's PIN and sign them in

Check a user's PIN server-side and sign them in. This is what the lock screen on a shared service device calls: the app locks between users, and each person unlocks it with their own user id and PIN rather than working as the screen account, the login the screen itself is signed in with. A correct PIN answers AccountLoginResponse: accessToken, the unlock token — an access token for the user in the path — and tenantUser, that user's record. The unlock token is the platform's own access token, with the same lifetime as the access token post-account issues, and the client sends it as the bearer on everything that follows while the screen is unlocked. The caller of each of those requests is the person the platform authenticated by PIN: every request is judged on their permissions, and every write is attributed to them and recorded in the audit entries under their name — never under a uid a client chose to send. The unlock token also carries the screen account — the login the screen is signed in with — and the time of the unlock. The screen account is the login this operation is called under, except under an unlock token, when the screen passes from one person to the next: the new unlock token then carries the screen account of the old one, not the person it was issued for. The unlock time is the time of this verification. Every event written under the unlock token records the screen account as screenAccountTenantUserUid, so the timeline says which screen account the work was done under as well as who did it. The unlock token is refreshed through post-tenants-account, which answers a fresh one carrying the same screen account and the same unlock time. An unlock token already issued works until it expires, unless the user can no longer log in, which every operation refuses at once; the refresh is refused with a 401 once the unlock is older than 12 hours or while the user's PIN is locked (pinLocked), and the person then unlocks again with their PIN. Failed attempts are counted server-side on the tenant user, for every tenant. The first four consecutive failures against one user cost nothing. From the fifth on, every second failure starts a wait before the next attempt against that user is judged — 10 seconds after the fifth, 30 seconds after the seventh, 1 minute after the ninth, 5 minutes after the eleventh, 10 minutes after the thirteenth and 30 minutes after the fifteenth, the failure between each pair costing nothing — and the seventeenth locks the user until someone holding TENANT_USER gives them a new PIN through the tenant user update. An attempt made while a wait is running or a lock is set is refused exactly as a wrong PIN, is not counted and does not extend the wait. A correct PIN of a user who can log in resets the count of the user in the path; the seventeenth failure in a row against a user locks them. A count with no failure for 24 hours starts again from nothing on the next attempt; a lock is never lifted by time. Every attempt that does not succeed and is not refused for a running wait or a lock counts as a failure against the user in the path — a wrong PIN, an empty PIN, and a user who cannot log in whatever PIN is sent, alike; an attempt against a uid that names nobody is refused and counts nowhere, and its answer is the same 401. A user has one ladder across every operation that takes their PIN — this one, the secret reveal, the cash reconciliation review, post-account and post-device-link: a failure on any of them counts on it, a wait or a lock set through any of them refuses all of them, and a correct PIN of a user who can log in, on any of them, resets it. The answer never says whether the user exists or is locked: a wrong PIN, an unknown user, a user who cannot log in, an empty PIN, a running wait and a lock are all the same 401 with the same body, so the answer to an attempt cannot be used to tell which uids belong to the tenant's staff. Blocking a user's access to the tenant deactivates them, so a blocked user is one who cannot log in. The state of the ladder is read on the user record instead, which every member of the tenant can list, among the account types their own account type lets them see: pinLockedUntil says when a running wait ends and pinLocked that the user is locked, which is how a client shows a countdown or sends the person to a tenant administrator. A new PIN set through the tenant user update, which TENANT_USER guards, clears it; a user setting their own PIN through the tenant account update does not. The PIN is never returned anywhere in the API. It is not open to an integration token: an integration account is not a screen anyone unlocks.

Required permissions: SERVICE_ORDER

post
/tenants/{tenantUid}/users/{tenantUserUid}/verifypin
Authorizations
AuthorizationstringRequired

Access token recevied after user login with a deviceToken

Path parameters
tenantUidstringRequired

Reference to a tenant.

Pattern: ^[A-Za-z0-9-_]+
tenantUserUidstringRequired

Reference to a TenantUser.

Pattern: ^[A-Za-z0-9-_]+
Body

The PIN of the user in the path, sent to be checked. It is the whole body: nothing else is needed to establish that the person at the device is who they say they are. The PIN is compared server-side and never returned by any operation. It is the same PIN as the password the device login and the device link take, and the one the secret reveal verifies again.

pinstringWrite-onlyRequired

The PIN the user unlocks with. It is compared server-side and never echoed back.

Responses
200

Example response

application/json
accessTokenstringRequired
post/tenants/{tenantUid}/users/{tenantUserUid}/verifypin
POST /v2/tenants/{tenantUid}/users/{tenantUserUid}/verifypin HTTP/1.1
Host: api.flowretail.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 14

{
  "pin": "text"
}
{
  "accessToken": "text",
  "tenantUser": {
    "accountType": "FULL",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "defaultStoreUid": "text",
    "displayName": "text",
    "email": "text",
    "externalId": "text",
    "firstname": "text",
    "lastAccessed": "2026-01-01T00:00:00.000Z",
    "lastModifiedAt": "2026-01-01T00:00:00.000Z",
    "lastname": "text",
    "mobile": "text",
    "pinLocked": true,
    "pinLockedUntil": "2026-01-01T00:00:00.000Z",
    "status": "PENDING_INVITE",
    "storeAccess": [
      {
        "createdAt": "2026-01-01T00:00:00.000Z",
        "lastModifiedAt": "2026-01-01T00:00:00.000Z",
        "storeAccessUid": "text",
        "storeUid": "text",
        "storeRole": "ADMIN"
      }
    ],
    "tenantUid": "text",
    "tenantName": "text",
    "tenantRole": "ACCESS",
    "tenantUserUid": "text",
    "userCode": "text",
    "languageCode": "text",
    "permissions": {
      "tenant": [
        "text"
      ],
      "stores": [
        {
          "store": {
            "name": "text",
            "storeUid": "text",
            "organizationUid": "text",
            "organizationName": "text"
          },
          "permissions": [
            "text"
          ]
        }
      ],
      "organizations": [
        {
          "organization": {
            "name": "text",
            "organizationUid": "text"
          },
          "permissions": [
            "text"
          ]
        }
      ]
    }
  }
}

Last updated

Was this helpful?