Skip to content

Store hosts ​

EndpointDescriptionAuth
POST /v1/hostsRegister a host and request pairingSecret key
GET /v1/hosts/{id}Retrieve a hostSecret key
GET /v1/hostsList hostsSecret key
POST /v1/hosts/{id}/pairingsRequest pairing with a terminalSecret key
DELETE /v1/hosts/{id}/pairings/{terminal_id}End a pairingSecret key
DELETE /v1/hosts/{id}Revoke a hostSecret key
POST /v1/hosts/{id}/sessionsGet a host tokenHost private key signature
GET /v1/hosts/selfHost reads its own pairingsHost token

A store host is the register computer that drives a terminal in companion mode. It never holds a secret key. Authentication flow:

  1. The store host generates an Ed25519 key pair locally; the private key never leaves the machine.
  2. Your server calls Register a host with the public key and requests pairing with a terminal.
  3. A store manager checks the comparison code and confirms the pairing on the terminal.
  4. The store host signs a request to Get a host token and uses the 900-second token for subsequent calls.

Register a host ​

http
POST /v1/hosts

Registers the store host's public key and requests pairing with a terminal. Call it from your server.

ItemValue
AuthSecret key only

Request body

ParameterTypeRequiredDescription
nameStringYesHost name, 1–80 printable chars, shown on the terminal confirmation screen
public_keyStringYesEd25519 public key, Base64 of the SubjectPublicKeyInfo DER
terminal_idStringYesFirst terminal to pair; must be in companion mode

Comparison code: while a pairing is pending, the response carries a six-digit comparison_code. The host computes and displays the same code; the manager checks they match and confirms on the terminal within 10 minutes. Computation:

SHA-256("kuvex-host-pair-v1\n{host_id}\n{terminal_id}\n{public_key}")
read the first 4 bytes as a big-endian unsigned integer, modulo 1,000,000, left-pad with zeros to 6 digits

Response

StatusDescription
201 CreatedNew host, or an existing host started a new pairing request
200 OKPublic key already registered and its pairing with this terminal is active or pending; the existing host is returned unchanged
json
{
  "object": "host",
  "id": "host_4kW9nT2qX7mV1pL5sR8b",
  "host_id": "host_4kW9nT2qX7mV1pL5sR8b",
  "name": "Register 1",
  "livemode": true,
  "created_at": "2026-11-30T16:02:00Z",
  "revoked_at": null,
  "pairings": [
    { "terminal_id": "KV100023", "status": "pending", "comparison_code": "482913", "expires_at": "2026-11-30T16:12:00Z" }
  ]
}

Fields: Host fields.

Errors

HTTPCodeDescriptionRetriable
400host_name_invalidName empty, too long, or contains unprintable charactersNo
400host_public_key_invalidInvalid public key formatNo
404terminal_not_foundTerminal does not exist or belongs to another accountNo
409host_pairing_not_enabledTerminal is not in companion mode. Test terminals can be switched with Switch run modeNo
409host_key_conflictPublic key registered in another account or the other mode; generate a new key pairNo
409terminal_livemode_mismatchKey and terminal are in different modesNo

Retrieve a host ​

http
GET /v1/hosts/{id}

Returns the host with all its pairings. After registering, poll until the pairing becomes active, rejected or expired.

ItemValue
AuthSecret key only

List hosts ​

http
GET /v1/hosts

Returns hosts of the current mode (test / live) in reverse creation order, with their pairings.

ItemValue
AuthSecret key only

Query parameters

ParameterTypeRequiredDescription
terminal_idStringNoOnly hosts with a pairing record (any status) for this terminal
limitintNoNumber of results

Request pairing with a terminal ​

http
POST /v1/hosts/{id}/pairings

Requests pairing of a registered host with another terminal, or re-requests a rejected, expired or revoked pairing. The manager must confirm on the terminal again.

ItemValue
AuthSecret key only

Request body

ParameterTypeRequiredDescription
terminal_idStringYesTerminal ID

Response: 201 Created (new request) or 200 OK (already active / pending). Errors as in Register a host, plus 404 host_not_found.

End a pairing ​

http
DELETE /v1/hosts/{id}/pairings/{terminal_id}

Ends the pairing between the host and one terminal; other pairings are unaffected. An already ended pairing is returned as is.

ItemValue
AuthSecret key only

Errors

HTTPCodeDescriptionRetriable
404host_not_foundHost does not existNo
404pairing_not_foundNo pairing record between the host and the terminalNo

Revoke a host ​

http
DELETE /v1/hosts/{id}

Ends all pairings of the host; issued host tokens stop working immediately and return 401 host_revoked. Use when a store host is lost or replaced. Idempotent. To reuse the host, request pairing and have the manager confirm.

ItemValue
AuthSecret key only

Response: 200 OK

json
{ "object": "host", "id": "host_4kW9nT2qX7mV1pL5sR8b", "revoked_at": "2026-11-30T20:15:00Z", "revoked_pairings": 1 }
FieldTypeDescription
revoked_pairingsintPairings ended by this call; 0 on a repeated call

Get a host token ​

http
POST /v1/hosts/{id}/sessions

Called by the store host to exchange a signature for a host token. No Authorization header.

ItemValue
AuthKuvex-Host-Signature header: signature with the host private key
Rate limitPer IP. Cache the token and renew only when it is about to expire

Request headers

NameRequiredDescription
Kuvex-Host-SignatureYesBase64 Ed25519 signature over the UTF-8 bytes of kuvex-host-session-v1\n{host_id}\n{timestamp_ms}\n{nonce} (three line feeds, no trailing newline)

Request body

ParameterTypeRequiredDescription
timestamp_mslongYesHost clock, Unix milliseconds; within 60 seconds of Kuvex time
nonceStringYesRandom value, unique per request; accepted once

Response: 201 Created

json
{
  "object": "host_session",
  "token": "kvs_...",
  "expires_in": 900,
  "host_id": "host_4kW9nT2qX7mV1pL5sR8b",
  "livemode": true,
  "terminal_ids": ["KV100023"]
}
FieldTypeDescription
tokenStringHost token; keep in memory only
expires_inintLifetime in seconds
terminal_idsArrayTerminals with an active pairing

An expired token returns 401 session_expired; sign a new request with a new nonce. A host token may call only endpoints whose Auth lists "host token", and only for paired terminals; anything else returns 403 scope_forbidden.

Errors

HTTPCodeDescriptionRetriable
401host_signature_invalidBad signature, clock skew over 60 seconds, reused nonce, or unknown hostNo
401host_revokedHost has no active pairingNo
403host_not_pairedPairing not yet confirmedNo

Host reads its own pairings ​

http
GET /v1/hosts/self

Returns the calling host and its pairings, as in Retrieve a host. Read-only.

ItemValue
AuthHost token only

Host fields ​

FieldTypeDescription
id / host_idStringHost ID, host_ prefix; identical values
nameStringHost name
livemodebooleanMode
created_atStringRegistration time
revoked_atStringTime the whole host was revoked; null otherwise
pairingsArrayOne record per terminal, fields below

pairings fields:

FieldTypeDescription
terminal_idStringTerminal ID
statusStringpending (awaiting confirmation, 10 minutes), active, rejected (declined by the manager), expired (not confirmed in time), revoked
comparison_codeStringSix-digit comparison code; only while pending
expires_atStringConfirmation deadline; only while pending
paired_atStringPairing time
last_used_atStringLast call by this host for the terminal
revoked_atStringRevocation time
revoked_reasonStringisv (merchant), kuvex, terminal_manager (ended on the terminal), terminal_reassigned (terminal ownership changed)