Companion mode
In companion mode, the merchant's POS (the store host) owns the order. A Kuvex terminal placed next to it displays the cart to the customer, accepts the card and returns the result to the POS. No code runs on the terminal.
your backend ──(secret key sk_)──▶ Kuvex API registers the host, starts pairing, refunds, reconciles
store host ──(host token kvs_)─▶ Kuvex API ──▶ terminal cart → payment → resultFeatures marked Runtime 294 or later require that Runtime version on the terminal. The version is reported in runtime_version by Retrieve a terminal, for example 0.1.294.261120; the third component (294) is the Runtime version. runtime_version is null for the sandbox virtual terminal and for a terminal that has not reported yet. firmware contains the raw string reported by the terminal and is retained for compatibility.
Related documentation: Customer display · Reconciliation · First live launch · API reference · OpenAPI file
Quick start in the sandbox
Runs the complete flow against a sandbox virtual terminal in about 10 minutes. No account or hardware is required; Node 18 or later and curl are.
# 1. A test key and a virtual terminal. The JSON is shown once — keep the file.
curl -s -X POST https://api.kuvex.com/v1/sandbox/session > session.json
# 2. Print the address of your virtual terminal, open it in a browser tab, and keep that tab in the foreground.
node -e 'const s=require("./session.json");console.log("https://api.kuvex.com/sandbox/terminal.html?"+new URLSearchParams({terminal_id:s.terminal_id,secret:s.device_secret,mqtt_url:s.mqtt.url,mqtt_user:s.mqtt.username,mqtt_pass:s.mqtt.password}))'
# 3. The two example programs (no dependencies).
curl -sO https://api.kuvex.com/examples/companion/isv-backend.mjs
curl -sO https://api.kuvex.com/examples/companion/host.mjs
# 4. Window 1 — a stand-in for YOUR backend. The secret key lives here and nowhere else.
KUVEX_KEY=sk_test_… KUVEX_TERMINAL=KV… node isv-backend.mjs
# 5. Window 2 — the store host. It never sees the secret key.
KUVEX_TERMINAL=KV… node host.mjsReplace sk_test_… with api_key and KV… with terminal_id from session.json. Then:
host.mjsprints a six-digit comparison code and waits.- On the virtual terminal, click Open pairing window (the sandbox has no manager PIN), verify that the code matches, and click Codes match · Confirm.
host.mjsobtains a host token, pushes the cart and creates a payment. When it prints "present a card", click a card button on the virtual terminal.host.mjsprints the payment result and the action the cashier should take.
The sections below describe each step performed by host.mjs, in the same order. Example sources: README · isv-backend.mjs · host.mjs
Credentials
Secret key sk_test_… / sk_live_… | Host token kvs_… | |
|---|---|---|
| Stored on | Your backend only (secret manager) | In memory on one store machine, for at most 15 minutes |
| Issued by | Dashboard → Developers; sandbox: POST /v1/sandbox/session | Signed request from the store host with its own private key (Obtain a host token) |
| Scope | All operations in the account | Paired terminals only: read the terminal, push the cart, create, read and cancel payments before the terminal starts processing (Host token permissions) |
| Impact if leaked | All stores, all payments, refunds | Terminals of one store; no refunds. Revoke the host (Manage hosts) |
Never install a secret key on a store machine. A register can be stolen, imaged or left logged in, and a secret key on it can refund any payment and reconfigure any terminal in the account. The store host therefore has its own identity: an Ed25519 key pair it generates itself, approved once by a store manager on the terminal.
A host token is required only when a store machine calls Kuvex directly. If the POS is a web page served by your backend and only the backend calls Kuvex, the backend can keep using the secret key, as in the Customer display guide. The calls from Configure the customer display to Reconciliation are identical with either credential.
Integration flow
| Step | Performed by | Action | API |
|---|---|---|---|
| 1 | Backend | Switch the terminal to companion mode | POST /v1/terminals/{id}/run-profile (test mode) |
| 2 | Store host | Generate a key pair and send the public key to the backend | — |
| 3 | Backend | Register the store host; this creates the first pairing request | POST /v1/hosts |
| 4 | Store manager | Confirm the pairing on the terminal | — |
| 5 | Store host | Obtain a host token and renew it before expiry | POST /v1/hosts/{id}/sessions |
| 6 | Backend | (Optional) Configure the customer display | POST /v1/terminals/{id}/customer-display, POST /v1/terminals/{id}/idle-screen |
| 7 | Store host | Push the cart on every change | PUT /v1/terminals/{id}/display/cart |
| 8 | Store host | Create a payment | POST /v1/payments |
| 9 | Store host | Poll for the result | GET /v1/payments/{id} |
| 10 | Store host / backend | Cancel a pending payment; refund or void a completed payment (backend only) | POST /v1/payments/{id}/void, POST /v1/payments/{id}/refund |
| 11 | Backend | Reconcile and manage hosts | Reconciliation, Store hosts |
Prerequisites
Test key and sandbox terminal
Create a sandbox: POST https://api.kuvex.com/v1/sandbox/session requires no authentication and returns 201:
{
"isv_id": "isv_…",
"api_key": "sk_test_…",
"session_token": "kvs_…",
"session_expires_in": 900,
"terminal_id": "KV…",
"merchant_id": "sandbox",
"device_secret": "…",
"mqtt": { "url": "wss://api.kuvex.com/mqtt", "username": "…", "password": "…", "client_id": "KV…", "topics": { "cmd": "…", "evt": "…", "status": "…" } },
"session_id": "…",
"expires_at": "2026-11-19T17:00:00.000Z",
"livemode": false
}| Field | Type | Description |
|---|---|---|
api_key | String | Secret key of this sandbox. Valid for 14 days (until expires_at); afterwards every call returns 401 sandbox_expired. Cannot be converted into a live key. |
terminal_id | String | Virtual terminal ID |
device_secret | String | Virtual terminal credential. Used by the virtual terminal page (step 2 of the quick start), not by your code. |
mqtt | Object | Virtual terminal connection settings. Used by the virtual terminal page, not by your code. |
session_token | String | Browser session token for the JavaScript SDK, bound to this terminal, valid for 15 minutes (session_expires_in seconds). Not used in companion mode. |
With an account, create test keys in the Dashboard under Developers → API keys → Create test key.
Switch the terminal to companion mode
A terminal runs in companion mode or standalone mode (see Run modes). While the terminal is not in companion mode, host registration and pairing return 409 host_pairing_not_enabled.
Test mode. Switch any test-mode terminal with the secret key through Switch run mode:
curl -s -X POST https://api.kuvex.com/v1/terminals/KV…/run-profile \
-H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
-d '{"profile":"host_call_secondary"}'
# 200 {"object":"terminal_run_profile","terminal_id":"KV…","profile":"host_call_secondary",…}
# The terminal is now in companion mode. {"profile":"standalone"} switches it back.| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 400 | run_profile_invalid | profile is neither host_call_secondary nor standalone | No |
| 403 | run_profile_managed_by_kuvex | Live terminal; the mode is set by Kuvex (see Live mode below) | No |
| 403 | scope_forbidden | Called with a host token (kvs_). Only a secret key can change the mode. | No |
Live mode. Kuvex sets the mode when the terminal ships or when the merchant goes live, because the mode determines who can start payments on the device and which functions store staff can use on it. Request it in the hardware order or in the go-live request (through your Kuvex contact or hello@kuvex.com), listing the serial numbers of the terminals that run in companion mode. The Dashboard shows the mode under Terminals → terminal → Run profile (read-only for live terminals; test terminals can be switched there). Retrieve a terminal returns it in run_profile.
Register the store host
Generate a key pair
Run once on the store machine. The algorithm is Ed25519; the private key never leaves the machine.
// Node 18+, built-in modules only
import crypto from 'node:crypto';
import fs from 'node:fs';
const { privateKey } = crypto.generateKeyPairSync('ed25519');
fs.writeFileSync('kuvex-host-key.pem', privateKey.export({ format: 'pem', type: 'pkcs8' }), { mode: 0o600, flag: 'wx' });
// What you register: base64 of the public key's SubjectPublicKeyInfo (DER) — 60 characters.
const publicKey = crypto.createPublicKey(privateKey).export({ format: 'der', type: 'spki' }).toString('base64');
console.log(publicKey);Equivalent with OpenSSL 3:
openssl genpkey -algorithm ed25519 -out kuvex-host-key.pem && chmod 600 kuvex-host-key.pem
openssl pkey -in kuvex-host-key.pem -pubout -outform DER | base64Private key storage:
- Store the key only on the store machine: in a file readable only by the POS user (mode 600), or in the operating system key store (Windows DPAPI, macOS Keychain, Android Keystore).
- Never send it to your backend or to Kuvex, and never place it in a web page, a log, a shared backup or a support ticket.
- Use one key pair per machine; do not copy a key to a second register. To replace a machine, revoke the old host (Manage hosts) and register a new key.
Register the public key
- The store machine sends its public key to your backend over your own authenticated channel (POS login, device enrollment). The backend decides which terminal the store may pair with; do not accept a terminal ID from the store machine without verifying it.
- The backend calls Register a host with the secret key:
curl -s -X POST https://api.kuvex.com/v1/hosts \
-H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
-d '{"name":"Front counter","public_key":"MCowBQYDK2VwAyEA…","terminal_id":"KV…"}'Response 201 Created:
{
"object": "host",
"id": "host_…",
"host_id": "host_…",
"name": "Front counter",
"livemode": false,
"created_at": "2026-11-12T17:02:11.118Z",
"revoked_at": null,
"permissions": ["display", "payments.create", "payments.read", "payments.cancel"],
"pairings": [
{ "terminal_id": "KV…", "status": "pending", "comparison_code": "482915",
"expires_at": "2026-11-12T17:12:11.118Z", "paired_at": null, "last_used_at": null, "last_channel": null,
"revoked_at": null, "revoked_reason": null }
]
}Parameter rules in addition to the reference:
name: 1–80 printable characters. It is shown to the store manager on the terminal; use a recognizable name such as "Front counter" or "Register 2".public_key: Base64 Ed25519 SubjectPublicKeyInfo (DER), as generated above.terminal_id: a terminal in your account, in the same mode as the key (test or live), and in companion mode.
id and host_id carry the same value. Return host_id to the store machine and store it next to the private key; it is an identifier, not a secret. Registration also creates the first pairing request (pairings[0], pending).
Registering the same public key again returns the existing host without changing its name, so the call can be retried safely after a lost response:
| Status | Condition |
|---|---|
200 OK | No new request was started: the pairing with this terminal is already active or pending |
201 Created | A new pending request was started: a different terminal, or the previous pairing was rejected, expired or revoked |
Errors
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 400 | host_name_invalid | Name empty, longer than 80 characters, or contains control characters | No |
| 400 | host_public_key_invalid | Not a Base64 Ed25519 SubjectPublicKeyInfo | No |
| 403 | scope_forbidden | Called with a host token (kvs_). Only a secret key can register hosts. | No |
| 404 | terminal_not_found | The terminal is not in your account, or was retired | No |
| 409 | terminal_livemode_mismatch | Test key with a live terminal, or the reverse | No |
| 409 | host_pairing_not_enabled | The terminal is not in companion mode (Prerequisites) | No |
| 409 | host_key_conflict | The public key is registered in another account or in the other mode (test / live). Generate a new key pair. | No |
Pair the store host with a terminal
Pairing is the confirmation by a person in the store that the store machine may start payments on the terminal. Neither Kuvex nor your backend can complete it.
Request pairing
Registration creates the first pairing request. The backend calls Request pairing with a terminal with the secret key to pair the same host with another terminal, or to start again after a request expired, was rejected or was revoked:
curl -s -X POST https://api.kuvex.com/v1/hosts/host_…/pairings \
-H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
-d '{"terminal_id":"KV…"}'The response is the host, in the same format as the registration response.
| Status | Description |
|---|---|
201 Created | A new request is waiting for the store manager. A rejected, expired or revoked pairing restarts as a new pending request and requires the manager's confirmation again. |
200 OK | No change: the pairing is already active, or a request is already pending; the body shows which |
An unknown host_id returns 404 host_not_found; other errors are the same as for registration.
Poll the pairing status
While the store host displays the comparison code, the backend polls Retrieve a host (GET /v1/hosts/{host_id}) every 2 seconds. Values of pairings[].status:
| Value | Meaning | Recommended handling |
|---|---|---|
pending | Waiting for the store manager. comparison_code and expires_at are present. | Display the code on the store host |
active | Paired; paired_at is set | The store host can obtain tokens (Obtain a host token) |
rejected | The manager selected "does not match" | Determine the cause before requesting pairing again |
expired | Not confirmed within 10 minutes | Request pairing again |
revoked | Ended; revoked_at is set. revoked_reason: isv (your backend), kuvex, terminal_manager (a manager on the terminal) or terminal_reassigned (the terminal was moved or retired) | Request pairing again |
Comparison code
A six-digit code that both screens display. Both sides compute it from public values, so the store host does not depend on the value in the API response: compute the code on the store host and display the computed value.
code = SHA-256( "kuvex-host-pair-v1\n" + host_id + "\n" + terminal_id + "\n" + public_key ) // UTF-8, "\n" = one line feed
→ first 4 bytes as a big-endian unsigned integer → modulo 1,000,000 → left-pad with zeros to 6 digitsfunction comparisonCode(hostId, terminalId, publicKey) {
const digest = crypto.createHash('sha256').update(`kuvex-host-pair-v1\n${hostId}\n${terminalId}\n${publicKey}`).digest();
return String(digest.readUInt32BE(0) % 1_000_000).padStart(6, '0');
}public_key is the exact string that was registered. If the computed code differs from comparison_code in the API response, abort the pairing and do not ask the manager to confirm.
Confirmation on the terminal
With the code displayed on the store host, a store manager performs the following on the terminal:
- Opens Pair host (secondary display) and enters the manager PIN. This opens a 2-minute pairing window; the terminal displays the remaining seconds. In companion mode the entry is on the maintenance page (Maintenance access).
- The terminal lists every waiting host with the host name, your company name, the permissions the host will receive (show the cart; start, check and cancel payments on this terminal; no refunds, voids, tip changes, settlement or configuration) and the comparison code.
- The manager compares the code with the store host screen and taps Matches, pair or Does not match, reject.
A pairing request is valid for 10 minutes; the pairing window for 2 minutes. If the window closes first, the manager opens Pair host (secondary display) again; the request remains available until its 10 minutes have elapsed. A rejection sets status: rejected (reason rejected_on_terminal).
Incomplete pairing
If pairing does not complete, the terminal displays "Pairing not completed" with one of the following reasons. The API reflects the same outcome in the pairing status (Poll the pairing status).
| Reason | Cause | Resolution |
|---|---|---|
pairing_window_closed | The 2-minute window ended before the manager confirmed | The manager opens Pair host (secondary display) again (PIN) and confirms. No API call is needed while the request is still pending. |
request_expired | The request is older than 10 minutes (status: expired) | The backend requests pairing again; the store host displays the code again |
comparison_code_mismatch | The code confirmed on the terminal is not the code of this request | Stop. Verify that the store host displays the code it computed itself and that the manager is looking at the correct host entry, then start again. Never read the code out over the phone to make the codes match. |
request_generation_mismatch | A newer request for the same host replaced the request on screen | Close the dialog, open Pair host (secondary display) again and confirm the current request |
not_pending | The request is no longer waiting (already rejected, expired or revoked) | Read GET /v1/hosts/{host_id}, then request pairing again |
not_found | The terminal has no request from this host | Check the terminal_id used by the backend; the host is waiting on another terminal |
Rehearse pairing in the sandbox
The virtual terminal page has a pairing panel that sends the same messages as a physical terminal. There is no manager PIN: click Open pairing window (2 minutes), compare the code, then click Codes match · Confirm or Reject. The panel also lists the paired hosts, each with Unpair (manager). The quick start uses this panel.
Obtain a host token
The store host authenticates by signing a message with its private key and calling Get a host token. The request has no Authorization header; the signature is the credential.
Sign the request
Message to sign:
timestamp_ms = current Unix time in milliseconds, as an integer
nonce = 16 to 64 characters from A–Z a–z 0–9 _ - (random; new for every request)
message = "kuvex-host-session-v1\n" + host_id + "\n" + timestamp_ms + "\n" + nonce
(UTF-8; "\n" is a single line feed; nothing after the nonce)
signature = base64( Ed25519-sign( private_key, message ) ) // 88 charactersRequest:
POST /v1/hosts/{host_id}/sessions
Kuvex-Host-Signature: {signature}
Content-Type: application/json
{"timestamp_ms": 1794502931118, "nonce": "3f9c1a7be04d52a86c0f17e9"}timestamp_ms in the body must be the same integer that was signed, sent as a JSON number, not a string.
// Node 18+, built-in modules only
import crypto from 'node:crypto';
import fs from 'node:fs';
const privateKey = crypto.createPrivateKey(fs.readFileSync('kuvex-host-key.pem', 'utf8'));
async function newHostSession(hostId, base = 'https://api.kuvex.com') {
const timestamp_ms = Date.now();
const nonce = crypto.randomBytes(12).toString('hex'); // 24 characters, never reused
const message = Buffer.from(`kuvex-host-session-v1\n${hostId}\n${timestamp_ms}\n${nonce}`, 'utf8');
const signature = crypto.sign(null, message, privateKey).toString('base64');
const r = await fetch(`${base}/v1/hosts/${encodeURIComponent(hostId)}/sessions`, {
method: 'POST',
headers: { 'content-type': 'application/json', 'kuvex-host-signature': signature }, // no Authorization header
body: JSON.stringify({ timestamp_ms, nonce }),
});
const body = await r.json();
if (r.status !== 201) throw Object.assign(new Error(body?.error?.code || `http_${r.status}`), { status: r.status, body });
return { token: body.token, expiresAtMs: timestamp_ms + body.expires_in * 1000, terminalIds: body.terminal_ids };
}Response 201 Created:
{
"object": "host_session",
"token": "kvs_…",
"expires_in": 900,
"host_id": "host_…",
"livemode": false,
"terminal_ids": ["KV…"],
"permissions": ["display", "payments.create", "payments.read", "payments.cancel"]
}Send the token as Authorization: Bearer kvs_… in the calls from Push the cart to Cancel a pending payment. Keep it in memory only; never write it to disk.
Request rules
| Item | Rule |
|---|---|
| Clock | timestamp_ms must be within 60 seconds of Kuvex time. Keep time synchronization (NTP) enabled. |
| Nonce | Each nonce is accepted once per host. A resent body is refused; sign a new request. |
| Rate limit | At most 30 session requests per minute per public IP address. Request a token when needed (about every 14 minutes), not before every call. |
| Lifetime | expires_in is 900 seconds. A token cannot be extended or refreshed. |
Errors
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 401 | host_signature_invalid | Invalid signature, timestamp more than 60 seconds off, nonce malformed or already used, or unknown host; all cases return the same code by design. Check the clock first, then the message format (Sign the request), then that the key file is the one that was registered. | No |
| 403 | host_not_paired | The host has no active pairing. Complete pairing. | No |
| 429 | rate_limited | Too many session requests from this network. Wait Retry-After seconds. | Yes |
Renew the token
Sign a new request before the token expires, for example when less than 60 seconds remain, and replace the token in memory. Because the store host clock and the Kuvex clock never agree exactly, a call can still return 401 session_expired. Such a call was not executed: obtain a new token and resend the same request with the same Idempotency-Key.
Behavior after revocation
Kuvex checks the pairing on every request, not only when the token is issued:
- The host has no active pairing left: every call with its token, reads included, returns
401 host_revoked, and a new session request returns403 host_not_paired. Stop taking payments on that machine and show the cashier a clear message. To use the machine again, the backend requests pairing and a manager confirms it on the terminal. - The host is still paired with other terminals: calls for the unpaired terminal return
403 scope_forbidden.
Configure the customer display
Two per-terminal settings, both set by the backend with the secret key. Neither affects cart or payment processing.
Renderer
The renderer determines what draws the cart. Set it with Set the customer display renderer.
renderer | Cart rendered by | ISV implementation | Requirements |
|---|---|---|---|
native (default) | The terminal | None | — |
kuvex_hosted | A Kuvex-hosted page with your logo and colors | None; configure the idle screen | Runtime 294 or later; internet access |
isv_web | Your own HTTPS page | The page | A published customer display application |
curl -s -X POST https://api.kuvex.com/v1/terminals/KV…/customer-display \
-H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
-d '{"renderer":"kuvex_hosted"}'Selection criteria, isv_web page development and fallback behavior are described in the Customer display guide.
Idle screen
The idle screen is what the terminal shows between customers; the kuvex_hosted page uses the same logo and colors. Upload the logo with Upload an idle screen logo, then call Set the idle screen:
# 1) Upload the logo (PNG or JPEG, at most 200 KB). The request body is the image itself.
curl -s -X PUT https://api.kuvex.com/v1/terminals/KV…/idle-screen/logo \
-H "Authorization: Bearer sk_test_…" -H "Content-Type: image/png" --data-binary @logo.png
# 201 {"sha256":"9f2c…","content_type":"image/png","bytes":18234}
# 2) Set the idle screen and point it at that logo
curl -s -X POST https://api.kuvex.com/v1/terminals/KV…/idle-screen \
-H "Authorization: Bearer sk_test_…" -H "Content-Type: application/json" \
-d '{"headline":"Welcome to Demo Café","subline":"Order at the counter","theme":"brand","brand_color":"#1a5c2e","logo_sha256":"9f2c…"}'Response 200 OK with the stored screen and its delivery state:
{ "object": "idle_screen", "terminal_id": "KV…", "configured": true, "screen": { "headline": "…", "subline": "…", "theme": "brand", "brand_color": "#1a5c2e", "logo": { "sha256": "…", "content_type": "image/png", "bytes": 18234 } }, "config_version": 12, "applied": false, "applied_at": null, … }- Each
POSTreplaces the whole screen. Omitted fields return to their defaults (emptyheadlineandsubline,theme: "light"); only the logo is kept unlessremove_logois sent. Omitting bothlogo_sha256andremove_logokeeps the current logo;"remove_logo": trueremoves it. - An empty or omitted
headlinemakes the terminal show the default greeting in its current language (Welcome,欢迎光临orBienvenido); the API stores and returns"". logo_sha256must come from an upload by your account. A logo of another account returns400 idle_screen_invalidwithdetail.field: "logo".applied: truemeans the terminal reported the same configuration.GETon the same path returns the current settings.- Any out-of-range value returns
400 idle_screen_invalidwithdetail.field.
Push the cart
Call Push the cart on every change while the cashier rings up items. A host token or the secret key can be used.
PUT /v1/terminals/{terminal_id}/display/cart
Authorization: Bearer kvs_…
Content-Type: application/json{
"revision": 1,
"session_id": "register-1",
"order_id": "A-1042",
"currency": "usd",
"lines": [
{ "id": "l1", "name": "Latte", "quantity": 2, "amount_cents": 900, "note": "Oat milk, no sugar" },
{ "id": "l2", "name": "Croissant", "quantity": 1, "amount_cents": 350 }
],
"subtotal_cents": 1250,
"discount_cents": 100,
"tax_cents": 102,
"total_cents": 1252
}Response 202 Accepted with the stored cart and its state:
{
"revision": 1, "session_id": "register-1", "currency": "usd",
"lines": [ … ], "subtotal_cents": 1250, "tax_cents": 102, "total_cents": 1252, "order_id": "A-1042", "discount_cents": 100,
"payload_hash": "5d0c…", "expires_at_ms": 1794503231118,
"applied_revision": 0, "status": "pending"
}Field constraints
revision: integer, exactly the terminal's previous revision + 1 (first cart:1). Read the current revision with Retrieve the cart (GETon the same path).session_id: register or session identifier; letters, digits,_,-; up to 64 characters.order_id: optional, up to 128 characters. Send the same value in the payment request so the terminal goes from this cart directly to the card screen.currency: always"usd".lines: up to 100 entries.id: letters, digits,_,-, up to 64 characters, unique within the cart;name: up to 160 characters;quantity: 1–999;amount_cents: the line total, integer, 0 or greater.lines[].note: optional plain text of up to 80 characters for modifiers (for example "Oat milk, no sugar"), shown under the line name. An empty string means no note.discount_cents: optional integer, 0 or greater, for the whole order; shown as a discount between subtotal and tax.subtotal_cents,tax_cents,total_cents: integers, 0 or greater. Kuvex displays the values as sent and does not check that they add up.noteanddiscount_centsare display-only and are shown by terminals on Runtime 294 or later; older terminals show the cart without them.
Processing rules
- Full snapshot. Each push replaces the previous cart.
- Revisions. The same revision with the same body is accepted again without effect. A different body under the same revision, or a skipped number, returns
409 display_revision_conflict;error.detail.revisionis the terminal's current revision, from which to continue. Registers pushing to the same terminal share one counter. 202means stored, not displayed.statusmoves frompendingtoapplied(the terminal confirmed it is on screen), then toconsumed(taken by a payment) orexpired. A terminal that never had a cart returns{"revision":0,"applied_revision":0,"status":"empty"}.- Offline terminals. The push still returns
202. The cart is kept and delivered when the terminal reconnects, if it has not expired. - Expiry. A cart expires 5 minutes after it was stored. Resending the same revision does not extend it; push the next revision to keep a slow order on screen.
- Clearing the screen. Push the next revision with
"lines": []and all totals0. - Consumption by a payment. A payment takes the cart (
status: consumed), including a declined payment. To show the cart again for a retry, push the next revision. - Cart and charge are independent. The charged amount comes only from the payment request.
- No card data. Text containing a card-shaped number is refused: 13–19 digits (spaces and hyphens allowed) that start with a card network prefix, have that network's length and pass the card-number checksum. Magnetic-stripe track data is also refused. A plain numeric order number such as a millisecond timestamp (
1794502931118) is accepted; a number shaped like a real card number is refused even if it is your order ID. - Limits. 16 KB per cart. Writes are rate-limited per terminal at about 60 per minute, counting cart pushes and other writes to that terminal (print, scan, cash drawer, settings); other terminals and other accounts have separate budgets. On
429 rate_limited, waitRetry-Afterseconds and send only the latest cart, not every intermediate state. Push when the cart changes (a line added, removed or re-priced), not on every keystroke, and merge changes that arrive in quick succession into one push.
Errors
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 400 | display_cart_invalid | Unknown field, value out of range, duplicate line IDs, totals without lines, card-like digits, or more than 16 KB. error.detail.field names the field (for example lines[2].note); error.detail.reason gives the reason (unknown_field, too_long, card_data, out_of_range, …). | No |
| 403 | scope_forbidden | Host token: the host is not paired with this terminal | No |
| 404 | terminal_not_found | The terminal does not belong to your account | No |
| 409 | display_revision_conflict | See Revisions above | No |
Create a payment
Call Create a payment with the host token:
POST /v1/payments
Authorization: Bearer kvs_…
Idempotency-Key: A-1042-pay-1
Content-Type: application/json{ "terminal_id": "KV…", "amount_cents": 1252, "order_id": "A-1042", "tip_flow": "off" }Response 201 Created with the payment in pending. The terminal now shows the Kuvex card screen.
{
"id": "pay_…",
"processor_order_id": "…",
"attempt_id": "att_…",
"collection_id": "col_…",
"object": "payment",
"status": "pending",
"amount_cents": 1252,
"currency": "usd",
"refunded_cents": 0,
"terminal_id": "KV…",
"order_id": "A-1042",
"metadata": {},
"card": null,
"auth_code": null,
"processor_response_code": null,
"read_attempts": 1,
"tender": "card",
"tip_flow_effective": "off",
"host_id": "host_…",
"failure": null,
"collection": { "id": "col_…", "requested_cents": 1252, "confirmed_cents": 0, "uncertain_cents": 0, "remaining_cents": 1252, "status": "open" },
"livemode": false,
"created_at": "2026-11-12T17:22:11.118Z"
}host_id is present because the payment was created with a host token. After the card is read, card contains { "brand": "visa", "last4": "4242", "entry_mode": "tap" } and auth_code is set. Card numbers never leave the terminal. Field definitions: Payment fields.
Request and response rules in companion mode:
terminal_id: required with a host token; must be a terminal the host is paired with.amount_cents: positive integer. This is the charged amount, never the cart total. If the two differ, the payment still runs and the terminal shows only the amount, not the cart.order_id: your order ID. Using the same value as in the cart links the two.tip_flow:"default"follows the terminal's tip setting;"off"disables the tip prompt for this payment. A request can only disable tipping, never enable it. Any other value returns400 tip_flow_invalid.tip_cents: a tip already collected by the POS (integer, 0 or greater). Equivalent totip_flow: "off".metadata: any JSON object, echoed back. A cashier name inmetadatais informational only; Kuvex attributes the payment tohost_id.tip_flow_effectivein the response is the tip flow applied to this payment. When the terminal asks for the tip before the card, the payment stayspendingwithtip_selection: "awaiting"until the customer chooses; the tip then appears intip_cents. The sandbox virtual terminal never asks for a tip.- If the merchant has a card-price program configured,
amount_centsin the response is the card price andbase_centsis the amount sent.
Idempotency and retries
- Send an
Idempotency-Keywith every payment request and save it with the order before sending. The same key with the same body returns the first response again (the same payment, never a second charge), so a resend after a timeout or restart is always safe. That response is the snapshot from the first request (status: "pending"); read the payment for its current state. - The same key with a different body returns
409 idempotency_conflict. A resend while the first request is still in progress returns409 idempotency_in_progress; resend after a short delay. - The API accepts a request without the header but cannot deduplicate it; a resend then creates a second payment.
- A new attempt requires a new key. After
failedorcanceled, a retry requested by the customer is a new payment with a new key. Never reuse a key for a retry, and never create a new payment while the previous one has no result. - A terminal processes one payment at a time. A second request while the terminal is busy returns
409 terminal_busy.
See also Idempotency.
Errors (in every case, no payment is created)
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 400 | amount_invalid | amount_cents or tip_cents is not a valid integer amount in cents | No |
| 400 | tip_flow_invalid | tip_flow is neither default nor off | No |
| 400 | currency_unsupported | Only USD is supported | No |
| 403 | scope_forbidden | Host token: the host is not paired with this terminal | No |
| 409 | terminal_offline | The terminal is not connected | Yes |
| 409 | terminal_busy | The terminal is processing another payment (execution.owner_payment_id in GET /v1/terminals/{id}) | Yes |
| 409 | terminal_not_ready | Connected but unable to take a payment now; error.detail.reason gives the reason when the terminal reported one | Yes |
| 409 | terminal_livemode_mismatch | Test credential with a live terminal, or the reverse | No |
| 409 | sales_blocked | Card sales on this terminal are suspended by Kuvex risk control | No |
| 429 | rate_limited | Too many writes within a minute; wait Retry-After seconds. The request had no effect. | Yes |
Retry retriable errors with the same Idempotency-Key.
Get the payment result
Webhooks are delivered to your backend's HTTPS endpoint, and a host token cannot open the WebSocket. The store host therefore polls Retrieve a payment about once per second until the payment has a result:
GET /v1/payments/{payment_id}
Authorization: Bearer kvs_…The response contains the fields of the create response plus timeline (all steps so far) and status_query. Reads are not rate-limited.
const RESULTS = new Set(['succeeded', 'partially_approved', 'offline_approved', 'requires_capture', 'failed', 'canceled', 'review']);
async function waitForResult(paymentId, call /* your function that sends one request with a fresh host token */) {
const deadline = Date.now() + 3 * 60 * 1000;
for (;;) {
const r = await call('GET', `/v1/payments/${encodeURIComponent(paymentId)}`);
if (r.status === 200 && RESULTS.has(r.body.status)) return r.body;
if (Date.now() > deadline) return null; // no result yet — see "No result in time" below
await new Promise((resolve) => setTimeout(resolve, 1000));
}
}Result statuses
Polling ends at one of the following seven statuses. Branch on status; do not infer a result from the absence of an error.
status | Meaning | Store host handling |
|---|---|---|
succeeded | Paid in full. card and auth_code are set. | Release the order. |
partially_approved | Partial approval: only part of the amount was charged. approved_amount_cents is the amount the card paid, remaining_cents the outstanding balance; next_action is collect_remainder_or_void. | Do not release the full order. Collect remaining_cents by another tender (cash, or another card as a new payment for the balance), or have the backend void this payment. Show both amounts to the cashier. |
offline_approved | Offline approval: the terminal approved the payment without reaching the card network. offline: true; risk states that the issuer has not seen the payment and can still decline it, in which case the merchant bears the loss. | Follow the merchant's policy; most merchants release the order. The payment later becomes succeeded, failed with failure.code: "offline_upload_declined", or review; the backend is notified by webhook. Offline approval cannot be requested (Limitations). |
requires_capture | Authorization approved, not yet captured. Occurs only for payments created with "capture_method": "manual". | The backend captures it (POST /v1/payments/{id}/capture). A store host cannot. |
failed | Nothing was charged. Declined, the card could not be read, or the payment never reached the terminal. failure.code and failure.message give the reason. | Inform the customer and offer another card or tender. A retry is a new payment with a new Idempotency-Key; push the cart again first. |
canceled | Nothing was charged. Canceled before a card was read, or voided before settlement. | A new payment can be started. |
review | Unknown outcome: the request reached the card network and the response was lost, or two reports contradict each other. needs_review: true. | Do not charge again, and do not tell the customer the payment failed. Keep the order open and keep reading the same payment until it becomes succeeded or failed. Show the cashier "Checking with the bank — do not take another payment for this order". Escalate to the backend or support if the status persists. |
Intermediate statuses
Continue polling while the payment is in one of these statuses:
status | Meaning |
|---|---|
pending | Created; the terminal has not reported a card yet, or the customer is choosing a tip (tip_selection: "awaiting"). |
processing | A card was presented; the terminal is reading it or requesting authorization. Do not cancel and do not start another payment. |
void_pending | A void of a completed payment is being sent to the terminal. Wait. A second void returns 409 void_in_progress. |
After a result, the backend can still change the payment to refunded or partially_refunded (Refund and void).
Additional fields: safe_to_retry: true is present when a reversal confirmed that no money moved; failure.detail carries additional information when the terminal reported it.
No result in time
A terminal stops waiting for a card after about 90 seconds and then reports a result with nothing charged. If polling times out (3 minutes is a suitable limit), instruct the cashier to check the terminal and keep the payment ID; do not start another payment for the order.
Kuvex closes payments that receive no update:
| Condition | Resulting status |
|---|---|
pending for 10 minutes, and the terminal never received the payment | failed, failure.code: "terminal_no_response" (nothing charged) |
pending for 10 minutes, otherwise | review |
processing for 5 minutes | review |
Request a status inquiry (POST /v1/payments/{id}/query, host token allowed, returns 202) asks Kuvex to look up the payment again. The inquiry only collects evidence; it never creates a payment and never changes the result by itself.
Tip after approval
When the terminal is configured to ask for the tip after approval, or the tip is written on the receipt and entered later, the payment becomes succeeded first and tip_cents is added to the same payment afterwards, seconds or hours later. Read the payment again before closing the check. A successful tip adjustment sends no separate webhook: browsers receive payment.updated on the WebSocket, and backends read the payment. A failed tip adjustment sends the tip.failed webhook.
Recover after a host restart
After a restart, the store host locates the payment it was waiting for in this order:
- Payment ID saved: call
GET /v1/payments/{id}. Idempotency-Keyand request body saved (before sending, as required in Idempotency and retries): send the samePOST /v1/paymentsagain. The response returns the same payment; then poll it.- Nothing saved: call
GET /v1/terminals/{terminal_id};execution.owner_payment_idis the payment the terminal is currently processing, if any.GET /v1/payments?terminal_id=KV…&limit=5lists the terminal's most recent payments, newest first; match onorder_id. With a host tokenterminal_idis required;limitis 1–100, default 20 (List payments).
The store host may start a new payment for the order only when all three checks show no payment for it.
Cancel a pending payment
Cancels a payment that is still waiting for the card, for example when the cashier selected the wrong order or the customer changed their mind. Call Cancel / void:
POST /v1/payments/{payment_id}/void
Authorization: Bearer kvs_…
Idempotency-Key: cancel-pay_…The response depends on whether the terminal has already received the payment:
| Terminal state | Response | Meaning | Store host handling |
|---|---|---|---|
| Has not received the payment (terminal offline, or the customer is still choosing a tip) | 200, payment with status: "canceled" | Canceled. Nothing was charged. | Done. |
| Has received it and runs Runtime 294 or later | 202 { "id": "pay_…", "object": "payment", "status": "pending", "cancel_requested": true, "cancel_requested_at": "…" } (status is processing once a card was presented) | Kuvex asked the terminal to stop. The payment is not canceled yet; cancel_requested_at is set on it. | Keep polling. The terminal stops only if no card has been read; the payment then ends with nothing charged (failure.code: "canceled"). If a card was already read, the cancel is ignored and the actual result follows. |
| Has received it and runs an earlier Runtime | 409 host_cancel_not_safe (host token) or cancel_not_safe (secret key) | Not canceled; nothing changed. | Keep polling. The payment ends when the customer or staff cancels on the terminal, when a card is presented, or when the card prompt times out. |
| Payment already has a result | 403 scope_forbidden (host token) | A store host cannot reverse a completed payment. | See Refund and void. |
The same rules apply to a host token and a secret key, and to pending and processing payments. A host token can cancel only a payment that the same host started on its terminal; a payment started by the backend with the secret key, or by another host, returns 403 scope_forbidden. A repeated cancel while a cancel is requested returns 202 again and sends nothing new; once the payment has a result, a cancel returns that result.
Why the API does not mark the payment canceled immediately. Only the terminal knows whether a card has touched the reader. If the API marked a payment canceled while the terminal was reading a card, the customer would be charged while the POS showed "canceled". For a payment the terminal has already received, the terminal decides, and its report is the result. If a cancel and an approval cross, the payment moves to review and the payment.review_required webhook is sent; an approval is never discarded.
Treat only 200 as canceled. After 202 or 409, the payment remains open until a result is read.
Rehearse in the sandbox. The virtual terminal handles cancel requests like Runtime 294. A cancel sent while the card screen is shown and before a card button is clicked returns 202, and the payment ends failed with failure.code: "canceled". A cancel sent after a card button was clicked is ignored, and the selected outcome arrives.
Refund and void
A host token cannot reverse money movement. Refunds and voids are performed by the backend with the secret key, after your own authorization step (for example, manager approval in the POS).
# Refund — full when amount_cents is omitted, partial otherwise
curl -s -X POST https://api.kuvex.com/v1/payments/pay_…/refund \
-H "Authorization: Bearer sk_test_…" -H "Idempotency-Key: A-1042-refund-1" -H "Content-Type: application/json" \
-d '{"amount_cents":350}'
# Void — reverse a completed payment that has not settled yet
curl -s -X POST https://api.kuvex.com/v1/payments/pay_…/void \
-H "Authorization: Bearer sk_test_…" -H "Idempotency-Key: A-1042-void-1"- Allowed for
succeeded,partially_approvedandpartially_refunded. - Live terminal: the refund runs on the terminal and returns
202{ "refund_id": "ref_…", "payment_id": "pay_…", "amount_cents": 350, "status": "pending" }, followed by the webhookpayment.refunded,refund.failed, orrefund.review_required(unknown outcome: do not refund again). The terminal must be online and idle (otherwiseterminal_offlineorterminal_busy). - Sandbox: the refund completes immediately and returns
200with the payment (statusrefundedorpartially_refunded). - An amount above the refundable balance returns
400 refund_exceedswithdetail.remaining_cents. If nothing is left to refund, the response is400 amount_invalid.
- Allowed for
succeeded,partially_approvedandrequires_capture. - Live terminal: the void runs on the terminal and returns
202{ "payment_id": "pay_…", "void_id": "vd_…", "status": "void_pending" }, followed bypayment.canceled;void.failedwhen the card network refuses (for example, the payment has already settled: refund it instead); orvoid.review_required(unknown outcome: do not void or refund again). - Sandbox: the void completes immediately and returns
200with the payment,status: "canceled". - A payment that has already been refunded returns
409 already_settled.
Common rules
- While another capture, void, tip adjustment or refund on the same payment is in progress or awaiting review, both calls return
409 money_operation_in_progress; wait for the result of the first operation (Money operation exclusivity). - Both calls require an
Idempotency-Key, as payments do. If the first request was interrupted after Kuvex accepted it, the same key returns the created operation withrecovered: true.
Reconciliation
Reconciliation runs on the backend with the secret key; a host token is refused (403 scope_forbidden). See the Reconciliation guide.
| Caller | Available data |
|---|---|
| Store host (host token) | Payments on its own terminals: GET /v1/payments?terminal_id=KV… and GET /v1/payments/{id} for each payment; sufficient for an end-of-shift list on the register |
| Backend (secret key) | All data: orders matched to payments (GET /v1/reconciliation?order_id=…), business-day reports, settlement comparison, exceptions; signed webhooks serve as the book of record |
Every payment started by a store host carries host_id, which identifies the register that took it.
Manage hosts
All calls are made by the backend with the secret key.
| Endpoint | Description |
|---|---|
GET /v1/hosts | Hosts of the current mode (test or live), newest first, each with all its pairings (same format as the registration response). ?terminal_id=KV… returns only hosts that have a pairing with that terminal; limit is 1–500, default 100. |
GET /v1/hosts/{host_id} | One host, same format as the registration response |
DELETE /v1/hosts/{host_id} | Revokes the machine: all pairings of the host end immediately. Use when a register is lost, stolen, sold or replaced. A repeated call has no effect. A new pairing request for the host puts it back in use. |
DELETE /v1/hosts/{host_id}/pairings/{terminal_id} | Ends the pairing with one terminal and keeps the host's other pairings. A pairing that has already ended is returned unchanged. Returns 404 pairing_not_found if the host never had a pairing with that terminal. |
Response of GET /v1/hosts:
{ "object": "list", "data": [ { "object": "host", "id": "host_…", "name": "Front counter", "revoked_at": null, "pairings": [ { "terminal_id": "KV…", "status": "active", "paired_at": "…", "last_used_at": "…", "last_channel": "cloud", … } ], … } ], "has_more": false }Response of DELETE /v1/hosts/{host_id} (200):
{ "object": "host", "id": "host_…", "host_id": "host_…", "revoked_at": "…", "revoked_pairings": 2 }Response of DELETE /v1/hosts/{host_id}/pairings/{terminal_id} (200):
{ "object": "host_pairing", "host_id": "host_…", "terminal_id": "KV…", "status": "revoked", "revoked_at": "…" }An unknown host_id returns 404 host_not_found. A store host reads its own pairings with its token through GET /v1/hosts/self, which returns the same host format; called with a secret key, it returns 403 scope_forbidden.
A revocation takes effect on the host's next request (Behavior after revocation); it is not necessary to wait for the token to expire.
Pairings also end without an API call from your backend:
- when the terminal is moved to another merchant, location or account;
- when the terminal is retired;
- when a store manager removes the host on the terminal: maintenance page → Paired hosts (Runtime 294 or later).
In each case the store host receives host_revoked or scope_forbidden on its next call, and pairing must be repeated for the terminal's new assignment. In the Dashboard, a terminal's page under Terminals lists its paired hosts with an Unpair button, and the Hosts tab lists every host with Revoke.
Troubleshooting
| Symptom | Cause | Resolution |
|---|---|---|
409 host_pairing_not_enabled on registration | The terminal is in standalone mode | Switch the terminal to companion mode |
401 host_signature_invalid | Clock off by more than 60 seconds; nonce reused; a key other than the registered one; the message has a trailing newline; or timestamp_ms in the body is a string or differs from the signed value | Sign the request, Request rules |
403 host_not_paired | No manager has confirmed yet, or the pairing ended | Pair the store host |
401 host_revoked on every call | The host has no active pairing: it was revoked, or the terminal was moved or retired | Behavior after revocation |
403 scope_forbidden | The call is not permitted for a host token, or the terminal is not paired with this host | Host token permissions |
401 session_expired | The token expired | Obtain a new token and resend the same call (Renew the token) |
409 display_revision_conflict | Another register pushed a cart, or the POS restarted with an outdated counter | Continue from error.detail.revision |
400 display_cart_invalid | Unknown field, out-of-range value, or a digit sequence that resembles a card number | error.detail.field and error.detail.reason identify the field and reason; see Push the cart |
The cart stays pending | The terminal is offline; in the sandbox, the virtual terminal tab is in the background | Check status in GET /v1/terminals/{id}; bring the tab to the foreground |
409 terminal_busy | Another payment is in progress | Check execution.owner_payment_id in GET /v1/terminals/{id} |
| The cart disappears after a decline | A payment consumes the cart regardless of its outcome | Push the next revision |
After publishing the customer display page and switching to isv_web immediately, the terminal falls back with app_missing, then switches to the page by itself about 45 seconds later | The terminal had not installed the application yet | After publishing, wait until GET /v1/applications/{id} shows state: "applied" for the terminal's target, then switch |
A payment stays pending | The terminal never received it or has not responded | No result in time |
429 rate_limited | Too many writes within a minute | Wait Retry-After seconds; reads are never rate-limited |
All errors have the same format: { "error": { "code": "…", "message": "…", "retriable": false, "detail": { … } } }. Branch on code; message is intended for developers, not for customers. See Error handling.
Support: hello@kuvex.com. Never send keys, tokens, private keys or card data.
Terminal behavior in companion mode
Run modes
Both modes accept payments pushed by a store host or by your backend. They differ in what a person at the device can do.
Companion mode (host_call_secondary) | Standalone mode (standalone) | |
|---|---|---|
| Use case | Customer-facing terminal next to your POS | Terminal operated by a cashier |
| Screen flow | Idle screen (your brand) → cart → Kuvex card screen → result → idle screen | Full cashier application |
| Sale started by entering an amount | Not available | Available |
| Refund, void, capture, settlement, manual card entry | Not available | Available, subject to staff permissions |
| Payment history and reports | Not available | Available |
| Staff sign-in | Not required. Pushed payments are recorded under the host (host_id), or under your account when the secret key is used | As configured by the merchant |
| Change settings, install applications | Kuvex only | Kuvex only |
"Not available" means the function does not exist in that mode; it is not a hidden or disabled button. The backend can still refund, void and capture payments taken on a companion terminal (Refund and void); the terminal executes them.
Maintenance access
Requires Runtime 294 or later.
- Tap the screen corner 6 times in quick succession. The corner is top-right; on CPad Pay it is top-left, because the tap-to-pay area is top-right. Kuvex can configure the corner per terminal.
- Enter a manager credential: the manager PIN or, where the merchant uses staff codes, a manager's staff number and password. Other staff are refused.
- Five failed attempts lock the exit for 30 seconds; the lock time doubles with further failures, up to 5 minutes. A restart does not reset it. While the exit is locked, the terminal continues to show carts and take payments.
- The exit opens a maintenance page, not the cashier application: network settings, device status and diagnostics, version, Paired hosts and Pair host (secondary display). After 60 seconds the terminal returns to the customer screen automatically.
- The exit never interrupts a payment: during a payment the corner does not respond, and a payment that arrives while the maintenance page is open is shown first.
- To use cashier functions on the device, ask Kuvex to switch it to standalone mode.
Lock status
Retrieve a terminal reports lock_task: { "permitted": …, "active": … } (null when the terminal Runtime is too old to report it); the Dashboard shows "Locked" or "Not locked" on the device page. On models where Kuvex cannot hold the system lock (currently Kozen P8 and SUNMI CPad Pay), a person can leave the Kuvex app with the system buttons. Deploy these models attended only, on a counter with staff present. Unattended use (an unsupervised kiosk) is not supported on them.
Auto-start after a power loss
In companion mode, where the model allows it, the terminal starts Kuvex automatically after boot and returns to the customer screen (Runtime 294 or later). autostart: { "supported": … } in GET /v1/terminals/{id} indicates whether the terminal supports this. Where it is false, Kuvex must be opened manually after a restart; include this in the store's opening checklist.
Receipts
The terminal that took the payment prints the receipt when it has a working printer and automatic receipts are enabled for it. Otherwise nothing is printed and no print event is sent; a terminal without a printer (CPad Pay has no built-in printer) is not an error. If the POS prints its own receipt, that is the POS's responsibility; the payment contains the required data (card.brand, card.last4, auth_code, amounts).
Host token permissions
Any call not permitted below returns 403 scope_forbidden.
| Call | With a host token |
|---|---|
GET /v1/terminals/{id} | Yes, for a paired terminal |
GET /v1/terminals/{id}/display/cart | Yes |
PUT /v1/terminals/{id}/display/cart | Yes |
POST /v1/payments | Yes; terminal_id must be a paired terminal |
GET /v1/payments?terminal_id=… | Yes; terminal_id is required |
GET /v1/payments/{id} | Yes, for payments on its paired terminals |
POST /v1/payments/{id}/query | Yes |
POST /v1/payments/{id}/void | Only to cancel a payment that has no result yet (Cancel a pending payment) |
GET /v1/hosts/self | Yes; returns its own host and pairings |
| Refund, void of a completed payment, capture, tip adjustment, bind | No; backend only |
| Print, scan, cash drawer | No |
| Customer display renderer, idle screen, applications, any configuration | No; backend only |
GET /v1/terminals (list), collections, webhook endpoints, reconciliation, POST /v1/auth/token | No |
WebSocket /v1/ws/events | No; the connection is closed with scope_forbidden. Poll instead. |
| Register, list or revoke hosts | No; backend only |
Limitations
Communicate these limitations to your customers as stated.
- No local network connection between store host and terminal. Every call goes through the Kuvex API. When the store's internet connection is down, the store host cannot push a cart or start a payment. Do not promise sales without internet access.
- Offline approval cannot be requested. Whether a terminal may approve a card while it cannot reach the card network is a setting that Kuvex applies per merchant and terminal; a request cannot enable it. The outcome can only be read:
status: "offline_approved"andrisk. - AI connectors cannot drive a terminal. The Kuvex MCP connector is read-only (merchants and locations); it cannot push a cart or start a payment. See MCP connector.
Go-live checklist
In addition to the First live launch guide:
- [ ] Every companion terminal was ordered or switched as companion mode;
run_profileishost_call_secondary. - [ ] The live secret key is stored only in the backend's secret manager. No store machine, image, installer or configuration file contains an
sk_key. - [ ] Each store host was registered again with the live key (test hosts do not carry over;
terminal_livemode_mismatch) and paired by a manager in that store. - [ ] The private key is stored as described in Generate a key pair; a revocation has been tested and the host was observed to stop (
host_revoked). - [ ] Store machines keep their clocks synchronized.
- [ ] The
Idempotency-Keyis saved with the order before the payment request is sent; the POS has been terminated mid-payment and was observed to recover the same payment. - [ ] The POS displays the correct state for each of the seven result statuses.
reviewis never shown as "failed", andpartially_approvednever releases the full order. - [ ] Cancel handling covers
200,202and409. - [ ] Refunds and voids go through the backend, with your own approval step.
- [ ] The backend's webhook receiver is durable (verifies the exact bytes, records the event ID together with the order change).
- [ ] The customer display renderer is chosen per terminal; for
isv_webthe application showsappliedon every terminal; the idle screen has your headline and logo. - [ ] Models without a system lock are deployed attended only; the terminals that need a manual start after a power loss are known.
- [ ] Receipt printing responsibility is decided.
Appendix: Node SDK
@kuvex/node 1.1.0 supports both the backend and the store host. Installation: npm install https://api.kuvex.com/sdk/node/1.1.0/kuvex-node-1.1.0.tgz
Backend (secret key):
const { Kuvex } = require('@kuvex/node');
const kuvex = new Kuvex(process.env.KUVEX_API_KEY);
const host = await kuvex.hosts.register({ name: 'Front counter', public_key: publicKeyFromTheStoreMachine, terminal_id: 'KV…' });
// later: kuvex.hosts.retrieve(host.host_id), kuvex.hosts.pair(host.host_id, { terminal_id }),
// kuvex.hosts.list(), kuvex.hosts.revoke(host.host_id), kuvex.hosts.unpair(host.host_id, 'KV…')Store machine (no secret key; the constructor rejects one):
const fs = require('node:fs');
const { KuvexHost } = require('@kuvex/node');
// First run only: create the key pair, keep the private key here, send publicKey to your backend.
if (!fs.existsSync('kuvex-host-key.pem')) {
const { privateKeyPem, publicKey } = KuvexHost.generateKeyPair();
fs.writeFileSync('kuvex-host-key.pem', privateKeyPem, { mode: 0o600, flag: 'wx' });
console.log('register this public key through your backend:', publicKey);
}
const host = new KuvexHost({ hostId: 'host_…', privateKey: fs.readFileSync('kuvex-host-key.pem', 'utf8') });
console.log('comparison code:', KuvexHost.comparisonCode('host_…', 'KV…', host.publicKey));
// After the manager confirmed on the terminal. Tokens are requested, cached and renewed for you.
const current = await host.cart.get('KV…');
await host.cart.set('KV…', {
revision: current.revision + 1, session_id: 'register-1', order_id: 'A-1042', currency: 'usd',
lines: [{ id: 'l1', name: 'Latte', quantity: 2, amount_cents: 900 }],
subtotal_cents: 900, tax_cents: 80, total_cents: 980,
});
const payment = await host.payments.create(
{ terminal_id: 'KV…', amount_cents: 980, order_id: 'A-1042', tip_flow: 'off' },
{ idempotencyKey: 'A-1042-pay-1', waitForResult: true, timeoutMs: 180_000 },
);
console.log(payment.status); // one of the seven result statuses (see "Get the payment result")
// host.payments.cancel(payment.id): see "Cancel a pending payment". host.payments.retrieve / list / query / wait: see "Get the payment result".hosts.list, hosts.revoke, hosts.unpair and host.self() call the endpoints listed in Manage hosts.