# pairDeviceToRegister

mutation · in the family [Device fleet](/reference/device-fleet/)

## What it does

Point a POS device at a register — which drawer this till drives.

Set/replace the 0..1 one-way Register binding on an ACTIVE POS-class Device: the Register tenant-scoped + ACTIVE; a pi_bridge refuses VALIDATION/INVALID; REFUSES CONFLICT/REFERENCED while the CURRENTLY-paired Register has a LIVE TillSession (the gate's intent — never orphan an open drawer). Template class A3_DEVICE (hand-derived v30).

## Careful

Refuses while the currently-paired register has an open till session — no orphaned drawers.

## Who may call it

Capability area: **Device fleet** — Enrolling, pairing, suspending and retiring the devices at your registers.

- Owner
- Manager
- An API key whose scope allows `api:pairDeviceToRegister`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | [PairDeviceToRegisterInput](/types/PairDeviceToRegisterInput/) `PairDeviceToRegisterInput!` | yes | No further notes. |

## Returns

[Device](/types/Device/) `Device!` — A Device — the PHYSICAL hardware identity (native POS apps, the in-Office browser POS, the Pi legacy-peripheral bridge), kept separate from the logical Register it serves: the pairing ref is ONE-WAY Device→Register (0..1, re-pairable — registerId lives HERE, never on the Register). Born pending_pairing via the BESPOKE enrollDevice (the pairing code returns ONCE, TTL 15 min); completePairingDevice (PUBLIC — the code IS the auth) flips it active and returns the device credential ONCE (hash-only at rest; mandatory 12-month rotation, decision I). active ⇄ suspended is the kill-switch pair; dooms from active/suspended gate on the paired Register's open TillSession. At POS the REAL principal is COMPOSITE (decision E): device session (WHERE/trust) + user session (WHO/authority) — the auth seam. NOT searchable (infrastructure — the Register non-joiner stance).

## Example request

```graphql
mutation ExamplePairDeviceToRegister($input: PairDeviceToRegisterInput!) {
  pairDeviceToRegister(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    deviceType
    registerId
    code
  }
}
```

Variables:

```json
{
  "input": {
    "deviceId": "01900000-0000-7000-8000-7c291d9e0000",
    "registerId": "01900000-0000-7000-8000-c30413dd0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000"
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "pairDeviceToRegister": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "DE-EXMP-0000-000F",
      "type": "Device",
      "caption": "Blue jeans",
      "status": "pending_pairing",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "deviceType": "pos_native_ios_phone",
      "registerId": "01900000-0000-7000-8000-c30413dd0000",
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))

## Used in

- [Connect a till](/use-cases/connect-a-till/)
- [Set up a register position — and shut a lost till off](/use-cases/set-up-a-register/)
