> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POS integration guide

> Connect your point of sale app, kiosk, or backend to Authsignal reader terminals using the controller-driven or server-driven pathway.

This guide walks through registering Authsignal reader terminals, authenticating your POS device (controller) or backend, running in-person digital credential verifications, and handling busy readers and retries.

## Prerequisites

Before integrating with the Terminal API, make sure you have:

1. **Terminals enabled** for your Authsignal tenant. Contact [support@authsignal.com](mailto:support@authsignal.com) if terminals are not yet enabled on your tenant.
2. **A terminal action**: The action type that defines what your readers request during in-person verification.
3. **A location**: Create a location in the [Terminals section of the Authsignal Portal](https://portal.authsignal.com/terminals), assign your terminal action to it, and copy the `terminalLocationId` from its settings.

> [!NOTE]
>
> The examples on this page use the US base URL, `https://api.authsignal.com/v1`. If your tenant is
> in another region, use your [regional base
> URL](https://docs.authsignal.com/api-reference/terminal-api/overview.md#region-selection) instead.

## Step 1: Register readers

Register each reader into a location before sending it verifications. You can register readers either directly in the Authsignal Portal or programmatically from your POS backend.

> [tab] Authsignal Portal
>
> **1. Start setup on the reader**
>
> Start registration on the reader device. It displays an 8-character one-time code (such as
> `K7QF-3M9X`) and a QR code linking to the Authsignal Portal. The code expires after 10
> minutes.
>
> **2. Claim the reader in the Portal**
>
> Scan the QR code or open the [Terminals section](https://portal.authsignal.com/terminals),
> select your location, enter the code, and give the reader a label (such as `Bar 2`).
>
> **3. Confirm on the reader**
>
> The reader shows your tenant name and the assigned label. Staff have 10 minutes to tap
> **Confirm** on the reader. Once confirmed, the reader receives its credentials and is ready
> for verifications.

> [tab] Programmatic (POS backend)
>
> **1. Read the registration code from the reader**
>
> Start setup on the reader. Enter the displayed 8-character code (such as `K7QF-3M9X`) in
> your POS system, or scan the QR code and read its `code` query parameter.
>
> **2. Call Register a reader from your server**
>
> Call [Register a reader](https://docs.authsignal.com/api-reference/terminal-api/register-reader.md)
> (`POST /v1/terminal/readers`) using your unrestricted tenant secret key via HTTP Basic
> authentication:
>
> ```bash theme={null}
> curl -u "YOUR_SECRET_KEY:" https://api.authsignal.com/v1/terminal/readers \
>   --json '{
>     "registrationCode": "K7QF-3M9X",
>     "label": "Bar 2",
>     "terminalLocationId": "YOUR_LOCATION_ID"
>   }'
> ```
>
> Store the returned `terminalId`. Its `status` starts as `CLAIMED`.
>
> **3. Wait for staff confirmation**
>
> The reader displays your tenant name and label, and staff have 10 minutes to tap
> **Confirm** (or decline if it is the wrong tenant).
>
> To check whether confirmation succeeded, resend the exact same `POST /v1/terminal/readers`
> request within 10 minutes of the last state change. It is idempotent and returns the same
> reader with `status: "REGISTERED"` once confirmed, or `409` if staff declined it. You can
> only send verifications to a `REGISTERED` reader.

## Step 2: Authenticate your POS or kiosk

Choose the controller-driven pathway if POS devices (such as iPad devices or kiosks) call Authsignal directly, or the server-driven pathway if calls originate from your backend server.

> [tab] Controller-driven (POS device / kiosk)
>
> A **controller** pairs directly to one location using a device-generated EC P-256 key pair and
> exchanges signed assertions for short-lived bearer tokens (`actl_...`). No tenant secret key is
> ever stored on the POS device.
>
> **1. Create a controller in the Portal**
>
> Open your location in the [Terminals section](https://portal.authsignal.com/terminals) and
> add a new controller (for example, `Front Bar iPad`). The Portal displays a single-use
> 10-character claim code (such as `ABCD-EFGH-JK`) valid for 24 hours.
>
> **2. Generate a key pair and claim the controller**
>
> On the POS device, generate an EC P-256 key pair (preferring hardware-backed storage such as
> iOS Secure Enclave or Android Keystore) and call
> [Claim a controller](https://docs.authsignal.com/api-reference/terminal-api/claim-controller.md)
> (`POST /v1/terminal/controllers/claim`):
>
> ```bash theme={null}
> curl https://api.authsignal.com/v1/terminal/controllers/claim \
>   --json '{
>     "code": "ABCD-EFGH-JK",
>     "publicKey": {
>       "kty": "EC",
>       "crv": "P-256",
>       "x": "<base64url-x>",
>       "y": "<base64url-y>"
>     },
>     "device": {
>       "model": "iPad14,3",
>       "appVersion": "1.0.0"
>     }
>   }'
> ```
>
> Store the returned `controllerId`, `location`, and `tenantName` alongside your private key.
>
> **3. Mint a short-lived access token**
>
> Sign a compact ES256 JWS using the controller's private key with the following claims:
>
> * `aud`: `"authsignal:terminal:controller:token"`
> * `sub`: your `controllerId`
> * `iat`: current Unix timestamp in seconds
> * `exp`: `iat + 60` (must be at most 60 seconds after `iat`)
> * `jti`: a unique single-use identifier (for example, a UUID, max 128 characters)
>
> Exchange the JWS at
> [Create a controller token](https://docs.authsignal.com/api-reference/terminal-api/create-controller-token.md)
> (`POST /v1/terminal/controllers/{controllerId}/token`):
>
> ```bash theme={null}
> curl -X POST https://api.authsignal.com/v1/terminal/controllers/YOUR_CONTROLLER_ID/token \
>   -H "Authorization: Bearer YOUR_SIGNED_ES256_JWS" \
>   --json '{}'
> ```
>
> The response returns an `accessToken` (`actl_<controllerId>.<token>`) valid for **15
> minutes** (`expiresIn: 900`). Refresh it before expiry. During rotation, the previous
> access token remains valid until its original expiry so in-flight requests do not fail.
>
> **4. Discover readers in your location**
>
> Call [Get controller](https://docs.authsignal.com/api-reference/terminal-api/get-controller.md)
> (`GET /v1/terminal/controller`) with `Authorization: Bearer YOUR_ACCESS_TOKEN` to retrieve
> the registered readers (`terminals`) available in your paired location and let staff select
> which reader to target.

> [tab] Server-driven (POS backend)
>
> Call the Terminal API from your backend server using your unrestricted tenant secret key with
> HTTP Basic authentication (secret key as the username, empty password), the same way as the
> [Server API](https://docs.authsignal.com/api-reference/server-api/overview.md):
>
> ```bash theme={null}
> curl -u "YOUR_SECRET_KEY:" https://api.authsignal.com/v1/terminal/proximity-verifications \
>   --json '{"terminalId": "YOUR_TERMINAL_ID", "reference": "sale-1042"}'
> ```
>
> * Use an **unrestricted** secret key from the [API keys
>   page](https://portal.authsignal.com/organisations/tenants/api). Restricted keys return `403`.
> * If your tenant uses an IP allowlist, requests must originate from an allowed IP address.
> * Keep the secret key strictly on your backend; never ship it to POS devices or readers.

## Step 3: Run and poll a verification

Both controller-driven (`Authorization: Bearer actl_...`) and server-driven (`Authorization: Basic ...`) callers use the same three endpoints to run in-person verifications.

**1. Start the verification**

Call [Create an in-person
verification](https://docs.authsignal.com/api-reference/terminal-api/create-in-person-verification.md)
(`POST /v1/terminal/proximity-verifications`) with the reader's `terminalId` and a unique
`reference` for the current sale (for example, `sale-1042`).

The endpoint returns `202 Accepted` with a `verificationId` and status `PENDING`. Authsignal
wakes the reader, and the customer taps their phone over NFC or presents a QR code.

**2. Poll for the result**

Poll [Get an in-person verification](https://docs.authsignal.com/api-reference/terminal-api/get-in-person-verification.md)
(`GET /v1/terminal/proximity-verifications/{verificationId}`) every 1 to 2 seconds until
`status` reaches a final state:

* `PENDING`: Waiting for the reader to pick up the verification.
* `IN_PROGRESS`: The reader is prompting the customer to present their wallet.
* `VERIFYING`: Authsignal is checking the cryptographic signature, issuer trust, and revocation
  status.
* `COMPLETED`, `FAILED`, `CANCELLED`, or `EXPIRED`: Final states. Stop polling.

**3. Validate the verdict and claims**

When `status` is `COMPLETED`, verify all of the following before unlocking checkout or
approving the interaction:

1. `result.state` is `RESPONSE_RECEIVED`
2. `result.actionState` is `CHALLENGE_SUCCEEDED`
3. Each presented credential in `result.credentials` has `claimsVerified: true`,
   `deviceAuthVerified: true`, and `issuer.trusted: true`, and `revocationStatus` is not
   `REVOKED`
4. The disclosed claim values in `result.claims` satisfy your business rule (for example,
   `result.claims.age_over_18 === true`)

If your flow requests `portrait`, it is returned as a base64 data URL so staff can visually
confirm the holder matches the credential. Results stay available until `resultExpiresAt`.

## Step 4: Handle busy readers, retries, and cancellation

A reader processes one verification at a time. Design your POS checkout flow around these rules:

| Verification on the reader | Start one for a different sale | Cancel it |
| - | - | - |
| Waiting for customer's phone (`PENDING` / `IN_PROGRESS` before tap) | Replaces it (old becomes `CANCELLED`) | Cancels it |
| Customer presented phone (`IN_PROGRESS` after tap or `VERIFYING`) | `409 verification_in_progress` | Cancels it unless result is recorded |
| Finished (`COMPLETED`, `FAILED`, `CANCELLED`, or `EXPIRED`) | Starts a new verification | Returns it unchanged |

While an active verification has not finished, sending `POST /v1/terminal/proximity-verifications` again from the same caller with the same `reference` acts as a retry and returns the existing verification.

### Retry best practices

* **Always pass a per-sale `reference`.** If a network timeout happens when starting a verification, retry `POST /v1/terminal/proximity-verifications` with the same `terminalId` and `reference`.
* For **server-driven** callers, omitting `reference` (or sending an empty string) never retries: every request is treated as a different sale to prevent collisions across registers.
* **Cancel abandoned sales.** If a cashier cancels a transaction before verification finishes, call [Cancel an in-person verification](https://docs.authsignal.com/api-reference/terminal-api/cancel-in-person-verification.md) to return the reader to idle. A cancelled verification never returns a `result`.

### Revoking access

* To disconnect a lost, decommissioned, or compromised POS device, delete its controller on the location's page in the [Terminals section](https://portal.authsignal.com/terminals). Its `actl_` access tokens stop working immediately.
* To replace a reader, delete it from its location in the Portal and register the replacement reader.

## Next steps

* [Terminal API reference](https://docs.authsignal.com/api-reference/terminal-api/overview.md): Full schemas, error codes, and regional base URLs.
* [Locations](https://docs.authsignal.com/terminals/locations.md): Organize readers and controllers across sites and branches.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.