Applications
| Endpoint | Description |
|---|---|
POST /v1/applications | Register an application |
POST /v1/applications/{id} | Save a draft |
POST /v1/applications/{id}/publish | Publish to terminals |
GET /v1/applications/{id} | Retrieve an application and per-terminal deployment state |
GET /v1/applications | List applications |
An application is a merchant web app loaded by Kuvex Runtime in a full-screen WebView on the terminal (integration mode 4). Applications with role customer_display can serve as the customer display.
Lifecycle: register (creates a draft, revision 1) → save drafts (revision increments) → publish to terminals → each terminal deploys and reports its state. The Dashboard offers the same under Applications.
Register an application
POST /v1/applications| Item | Value |
|---|---|
| Auth | Secret key only |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Application name shown on the terminal home screen |
url | String | Yes | HTTPS, default port, public host name; no user info or # fragment |
role | String | No | app (default): home screen application; customer_display: customer display page, not on the home screen |
chrome | Object | No | Exit control style, see Exit control |
Response: 200 OK with the application. Fields: Application fields.
Errors (message repeats the code; the offending field is in error.field)
| HTTP | Code | Description |
|---|---|---|
| 400 | application_url_invalid | URL does not meet the requirements |
| 400 | application_role_invalid | Invalid role |
| 400 | application_chrome_invalid | Invalid chrome value |
| 400 | application_manifest_invalid | Other field missing or invalid |
Save a draft
POST /v1/applications/{id}Submits the full draft as a new revision. The published version stays on terminals until the next publish.
| Item | Value |
|---|---|
| Auth | Secret key only |
Request body: as in Register an application, plus:
| Parameter | Type | Required | Description |
|---|---|---|---|
revision | int | Yes | Draft revision being edited, for concurrency control |
Errors
| HTTP | Code | Description |
|---|---|---|
| 409 | application_revision_conflict | Draft changed since it was read |
| 404 | application_not_found | Application does not exist |
Publish to terminals
POST /v1/applications/{id}/publishPublishes a draft revision to a set of terminals. The publish is atomic in the cloud; each terminal then deploys and reports. Read deployment state with Retrieve an application.
| Item | Value |
|---|---|
| Auth | Secret key only; physical terminals require a live key |
| Idempotency | Deduplicated by request_id in the body |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
revision | int | Yes | Draft revision to publish |
request_id | String | Yes | Unique request ID. Same ID and content returns the first result |
environment | String | Yes | sandbox: virtual terminals; physical: physical terminals |
terminal_ids | Array<String> | Yes | Complete set of target terminals. Terminals not listed lose the application |
disable | boolean | No | true removes the application from all terminals; send an empty terminal_ids |
Request example
curl https://api.kuvex.com/v1/applications/app_5nK2wT8qX3mV9pL1sR7b/publish \
-H "Authorization: Bearer $KUVEX_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"revision": 2, "request_id": "publish-42", "environment": "physical", "terminal_ids": ["KV100023", "KV100024"]}'Response: 200 OK with application and targets.
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | application_request_id_required | Missing request_id |
| 400 | application_environment_required | Missing environment |
| 400 | application_environment_mismatch | environment does not match the terminal type |
| 400 | application_targets_required | Missing terminal_ids |
| 400 | application_targets_invalid | Invalid terminal_ids |
| 403 | live_key_required | Test key used to publish to physical terminals |
| 404 | terminal_not_found | Terminal does not exist or belongs to another account |
| 409 | application_revision_conflict | revision is not the current draft |
| 409 | application_request_conflict | request_id used with different content |
Retrieve an application
GET /v1/applications/{id}Returns the application and the deployment state of each target terminal.
| Item | Value |
|---|---|
| Auth | Secret key |
Response: 200 OK
{
"application": { "id": "app_5nK2wT8qX3mV9pL1sR7b", "revision": 2, "published_revision": 2 },
"targets": [
{ "terminal_id": "KV100023", "desired_revision": 2, "applied_revision": 2, "state": "applied" },
{ "terminal_id": "KV100024", "desired_revision": 2, "applied_revision": 1, "state": "pending" }
]
}targets fields:
| Field | Type | Description |
|---|---|---|
terminal_id | String | Terminal ID |
desired_revision | int | Revision that should be deployed |
applied_revision | int | Revision deployed on the terminal |
state | String | pending, applied, failed (see error_code), overridden (superseded by other terminal configuration), unassigned (removed from the target set) |
error_code | String | Deployment failure reason |
reported_at | String | Last report from the terminal |
Before switching a terminal's customer display to the application, confirm the terminal is state=applied.
List applications
GET /v1/applications| Item | Value |
|---|---|
| Auth | Secret key |
Response: 200 OK, { "applications": [applications] }.
Exit control
While an application runs, the terminal keeps an exit control back to Kuvex in a screen corner; it does not respond during a transaction. The default depends on the terminal run mode: standalone terminals show a visible badge (its menu's first item is "Return to Kuvex home"); companion-mode terminals use a hidden exit (6 taps on the corner, then manager authentication).
Configure with chrome; all fields optional; changes take effect on the next publish:
| Field | Type | Values | Default |
|---|---|---|---|
exit | String | badge visible badge, hidden_taps hidden exit | badge standalone, hidden_taps companion mode |
size | String | a (48 px), b (56 px) | a |
opacity | int | 100, 85, 70 | 100 |
color | String | dark, light, #rrggbb | dark |
corner | String | top_right, top_left | top_right |
A custom color with less than 3:1 contrast against the white circle falls back to dark.
The terminal injects CSS variables so the page can avoid the badge area:
| Variable | Values |
|---|---|
--kuvex-corner-size | 48px, 56px; 0px for the hidden exit |
--kuvex-corner-side | right, left |
const s = getComputedStyle(document.documentElement);
const size = s.getPropertyValue('--kuvex-corner-size').trim();
const side = s.getPropertyValue('--kuvex-corner-side').trim();
header.style[side === 'left' ? 'paddingLeft' : 'paddingRight'] = size || '0px';Application fields
| Field | Type | Description |
|---|---|---|
id | String | Application ID, app_ prefix |
revision | int | Current draft revision; send it back when saving or publishing |
published_revision | int | Published revision; null if never published |
lifecycle | String | draft, published, disabled |
draft | Object | Current draft: name, url, role, chrome |
chrome_effective | Object | Exit control settings with defaults applied |
created_at / updated_at | String | Creation / update time |