Hardware: receipts, cash drawer, scanner, customer display, card readers
Receipt printers, cash drawers, scanners, customer displays and card readers are part of the Kuvex terminal and are addressed by the same terminal_id as payments. The integration sends structured data; Kuvex Runtime on the terminal drives the hardware and reports the result. No printer drivers, printer command streams, scanner listeners, reader integrations or model-specific code are required.
| Capability | Endpoint | Result | Sandbox behavior |
|---|---|---|---|
| Print a receipt | POST /v1/terminals/{id}/print | Webhook print.succeeded / print.failed / print.delivery_unknown | The virtual terminal renders a paper strip |
| Open the cash drawer | POST /v1/terminals/{id}/cash-drawer/open | cash_drawer on Retrieve a terminal | The virtual terminal reports the pulse as sent |
| Scan a barcode or QR code | POST /v1/terminals/{id}/scan | Synchronous response, up to 30 seconds | Returns a generated code immediately |
| Show the cart to the customer | PUT /v1/terminals/{id}/display/cart | GET on the same path | The virtual terminal draws the cart |
| Take a card payment | POST /v1/payments | Webhook or Retrieve a payment | Tap, Insert and Decline buttons |
All capabilities on this page can be tested in the sandbox without hardware.
Prerequisites
- Create a sandbox session with
POST /v1/sandbox/sessionor the button on the sandbox page. The response contains a test secret key (sk_test_…) and aterminal_id. - Keep the virtual terminal tab open while testing.
The same operations are available in the SDKs:
| Operation | Browser SDK (@kuvex/web) | Server SDK (Node) |
|---|---|---|
kuvex.print(receipt, paymentId) | kuvex.terminals.print(id, params) | |
| Scan | kuvex.scan() | kuvex.terminals.scan(id) |
| Open the cash drawer | kuvex.openCashDrawer() | kuvex.terminals.openCashDrawer(id) |
| Push the cart | kuvex.setCartDisplay(snapshot) | kuvex.terminals.setCart(id, snapshot) |
| Retrieve the cart | kuvex.getCartDisplay() | kuvex.terminals.getCart(id) |
Credentials:
| Credential | Print, scan, cash drawer | Cart, retrieve terminal |
|---|---|---|
| Secret key | Yes | Yes |
| Browser session token | Yes, for the terminal it was issued for | Yes, for the terminal it was issued for |
| Host token (companion mode) | No, 403 scope_forbidden; route these calls through the backend | Yes |
Terminal connectivity:
- Print, scan and cash drawer require the terminal to be online; otherwise the call returns
409 terminal_offline. - A cart is stored even while the terminal is offline and is delivered on reconnect if it has not expired.
202on a cart push means stored, not displayed. A cart expires 5 minutes after it was stored; push the next revision to keep it.
Receipt printing
Print content is a structured receipt (lines and amounts), not an image or a printer command stream. The terminal lays it out for the printer available to it: the built-in printer, or an external network printer assigned to that terminal. The caller does not select the printer.
- Call Print with the
receiptand, optionally, the relatedpayment_id. - The response is
202with a print job in statusdispatched: accepted and sent to the terminal, not yet printed. - Read the final result from the
print.*webhook (see Print result).
curl https://api.kuvex.com/v1/terminals/$TERMINAL_ID/print \
-H "Authorization: Bearer $KUVEX_KEY" -H "Content-Type: application/json" \
-d '{
"payment_id": "pay_…",
"receipt": {
"header": "DEMO CAFE",
"order_number": "A-102",
"lines": [
{ "name": "Latte", "qty": 2, "amount_cents": 900 },
{ "name": "Croissant", "qty": 1, "amount_cents": 425, "detail": "warmed" }
],
"subtotal_cents": 1325,
"tax_cents": 118,
"total_cents": 1443,
"footer": "Thank you"
}
}'{ "id": "prt_…", "object": "print_job", "terminal_id": "…", "status": "dispatched" }Receipt content
Common fields (header, store block, order block, lines, totals, tax_rate_label, qr_data / qr_hint) are listed under Print. kind selects the document layout; each layout accepts additional fields:
kind | Document | Additional fields |
|---|---|---|
| omitted | Sales receipt | — |
order | Order ticket | serve_type, table_or_pickup_no, remark, delivery{…} |
kitchen | Kitchen ticket | serve_type, table_or_pickup_no, remark, delivery{…} |
call_number | Call-number ticket | number, number_label, guest_name, party_size, queue_tip |
refund | Refund ticket | original_total_cents, refund_type, refund_time |
Content rules:
- Amounts are integers in cents.
- Most text fields are truncated at 300 characters; line names at 200.
headerandfooterare printed as sent; keep them short. - Card details and the paid amount are not accepted from the caller. When
payment_idis given, the terminal adds the card lines from its own record of that payment; such fields inreceiptare dropped.
Print result
The final state of a print job is delivered by webhook only; there is no endpoint to poll a print job. data is { id, object: "print_job", terminal_id, payment_id, status, reason }; reason is null on success.
| Event | Meaning | Recommended handling |
|---|---|---|
print.succeeded | The printer completed the job | None |
print.failed | Not printed; cause in reason | Show the cause to staff; print again after it is resolved |
print.delivery_unknown | The terminal lost power or crashed after printing started; output unknown | Confirm with staff before printing again; a blind retry can produce a duplicate |
reason | Meaning |
|---|---|
printer_unreachable | The terminal cannot reach its printer (network printer: powered off, unplugged or on another network) |
printer_not_configured | No printer is configured for this terminal |
printer_needs_attention | Out of paper or cover open, not resolved in time |
print_rejected | The printer rejected the job |
delivery_unknown | See print.delivery_unknown |
print_failed | Any other failure |
No event is sent in two cases:
- Paper out or cover open: the terminal holds the job and alerts the staff at the terminal. Only the final state produces an event.
- The terminal has no printer: the job ends without printing. This is not a failure.
Automatic card receipt
After a successful payment, the terminal that took it prints the card receipt automatically if it has a working printer and automatic receipts are enabled for it; no print call is needed. Use print for documents Kuvex has no data for: order tickets, kitchen tickets, call numbers, merchant-branded receipts.
Sandbox behavior
- The virtual terminal renders a paper strip with
header,lines,total_centsandfooter; other fields are accepted but not drawn. - The virtual printer always succeeds; the event is
print.succeeded. - To receive the event without a webhook endpoint, pass the
payment_idof a test payment created withPOST /v1/payments; the event then appears in the Dashboard webhook test inbox. Print jobs without a payment are not captured by the inbox; register a webhook endpoint for those.
Cash drawer
The cash drawer connects to the drawer port of the receipt printer and opens when the printer sends it a pulse. Kuvex sends the pulse through the external network receipt printer assigned to the terminal; a terminal without one reports failed.
- Call Open the cash drawer. The response is
202with arequest_idand statuspending. - Retrieve the terminal and read
cash_drawer. - Use the result only when
cash_drawer.last_result.request_idequals therequest_idfrom step 1; otherwise it belongs to an earlier request.
curl -X POST https://api.kuvex.com/v1/terminals/$TERMINAL_ID/cash-drawer/open \
-H "Authorization: Bearer $KUVEX_KEY"{ "request_id": "drw_…", "terminal_id": "…", "status": "pending" }curl https://api.kuvex.com/v1/terminals/$TERMINAL_ID -H "Authorization: Bearer $KUVEX_KEY""cash_drawer": {
"status": "dispatched",
"request_id": "drw_…",
"last_result": { "request_id": "drw_…", "ok": true, "reason": null, "device_at": "2026-11-13T21:58:02Z" }
}cash_drawer.status | Meaning |
|---|---|
unknown | No drawer request has been made on this terminal |
pending | Accepted; the terminal has not reported |
dispatched | The pulse was sent to the printer |
failed | The pulse was not sent; cause in last_result.reason, usually no printer with a drawer port configured for the terminal, or the printer is unreachable |
Notes:
- The pulse is one-way. A printer cannot report whether a drawer is attached or whether it opened.
dispatchedconfirms only that the pulse left the terminal for the printer; it does not confirm that the drawer opened and must not be used for cash accounting. - There is no webhook for the cash drawer.
- With
Kuvex-Version: 2026-09-10thedispatchedstate is namedopened, with the same meaning.
Sandbox behavior
The virtual terminal answers the drawer request: the status moves from pending to dispatched and the virtual terminal panel shows that a pulse was sent. No drawer is attached to a virtual terminal; this matches what dispatched means on a physical terminal.
Barcode and QR scanning
Scan activates the terminal scanner and holds the request open until one code is read, for up to 30 seconds.
curl -X POST https://api.kuvex.com/v1/terminals/$TERMINAL_ID/scan \
-H "Authorization: Bearer $KUVEX_KEY"{ "id": "scn_…", "object": "scan", "status": "completed", "data": "0123456789012" }If nothing is read in time, the response is still 200:
{ "id": "scn_…", "object": "scan", "status": "timeout", "data": null }- Accept a code only when
statusiscompletedanddatais not empty.timeoutis not an error; call again when the customer is ready. - One call reads one code. There is no continuous mode and no webhook.
- Set the HTTP client timeout above 30 seconds.
datais the code text exactly as read; its meaning (loyalty ID, coupon, order) is defined by the integration.- Scanning requires a terminal with a scanner. See Device capabilities by model.
Sandbox behavior
The virtual terminal answers immediately with a generated code (eleven fixed digits and one random digit), so the flow that follows a scan can be built and tested.
Customer display
The terminal can serve as the customer-facing screen while the cashier enters items: the integration pushes the cart, the terminal displays it, and the same terminal then takes the payment for that order.
curl -X PUT https://api.kuvex.com/v1/terminals/$TERMINAL_ID/display/cart \
-H "Authorization: Bearer $KUVEX_KEY" -H "Content-Type: application/json" \
-d '{
"revision": 1,
"session_id": "register-1",
"order_id": "A-102",
"currency": "usd",
"lines": [ { "id": "l1", "name": "Latte", "quantity": 2, "amount_cents": 900 } ],
"subtotal_cents": 900,
"tax_cents": 80,
"total_cents": 980
}'- A cart is not a receipt: cart lines carry
idandquantity(receipt lines useqty). - Each push carries the next
revisionfor the terminal. Read the current revision with Retrieve the cart before the first push. - The default renderer is
native: the terminal draws the cart itself, with no development and on every terminal. - Two web renderers exist: a Kuvex-hosted page with the merchant logo and colors, and an ISV web page. They apply only to terminals in companion mode, require a recent Kuvex Runtime and are enabled per device; contact Kuvex before planning one.
- Whichever renderer draws the cart, the payment, result and receipt screens are always rendered by Kuvex Runtime; an ISV page never receives card data.
Cart rules, the three renderers, branding and fallback: Customer display. Endpoints: Customer display reference.
Sandbox behavior
Push a cart with the test key; the virtual terminal draws it. Create a payment with the same order_id; the virtual terminal switches from the cart to the payment screen.
Card readers
There is no reader API. The reader is part of the terminal, and the terminal is selected by terminal_id; the payment call is identical on every device:
curl https://api.kuvex.com/v1/payments \
-H "Authorization: Bearer $KUVEX_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: order-A-102" \
-d '{ "terminal_id": "'$TERMINAL_ID'", "amount_cents": 980, "order_id": "A-102" }'| Device form | Reader |
|---|---|
| Terminal with a built-in certified reader | Tap, insert and swipe built in |
| Tablet or PC with KReader | External certified reader over USB or Bluetooth. Kuvex pairs the reader and reconnects it when it is plugged back in; the integration is not involved |
In both forms, card data travels from the reader to the acquirer inside certified hardware and Kuvex Runtime; the ISV page and server never receive it.
To check whether a terminal can take a payment now, read payment_ready on Retrieve a terminal: true when the terminal is connected, idle and has reported that it is ready to take a payment. There is no separate reader status.
Sandbox behavior
Create a payment on the virtual terminal and press Tap, Insert or Decline. The buttons stand in for a card; the payment object and webhooks are the same as with a physical reader.
Device capabilities by model
The API is identical on every Kuvex device; the hardware differs: the printer may be built in or external, not every terminal has a scanner, and a cash drawer requires a printer with a drawer port.
A device is listed for a capability only after that capability has passed acceptance on the physical device, not on the basis of a specification sheet. The list is not yet published. Until it is, send the counter requirements (receipts, cash drawer, scanning, customer-facing screen, countertop or handheld) to hello@kuvex.com for a device recommendation.
Errors and limits
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 409 | terminal_offline | The terminal is not connected | Yes, after it reconnects |
| 404 | terminal_not_found | No such terminal on this account in this mode | No |
| 403 | scope_forbidden | The credential is not allowed to make this call (for example, a host token calling print, scan or cash drawer) | No |
| 429 | rate_limited | Too many writes to this terminal | Yes, after Retry-After seconds |
Writes to one terminal (print, scan, cash drawer, cart, settings) share a limit of about 60 per minute per terminal. Each terminal has its own limit.
Every response carries Kuvex-Request-Id. To investigate a call, look it up by that ID in the Dashboard under Developers → Request log.