Skip to content

Applications ​

EndpointDescription
POST /v1/applicationsRegister an application
POST /v1/applications/{id}Save a draft
POST /v1/applications/{id}/publishPublish to terminals
GET /v1/applications/{id}Retrieve an application and per-terminal deployment state
GET /v1/applicationsList 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 ​

http
POST /v1/applications
ItemValue
AuthSecret key only

Request body

ParameterTypeRequiredDescription
nameStringYesApplication name shown on the terminal home screen
urlStringYesHTTPS, default port, public host name; no user info or # fragment
roleStringNoapp (default): home screen application; customer_display: customer display page, not on the home screen
chromeObjectNoExit 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)

HTTPCodeDescription
400application_url_invalidURL does not meet the requirements
400application_role_invalidInvalid role
400application_chrome_invalidInvalid chrome value
400application_manifest_invalidOther field missing or invalid

Save a draft ​

http
POST /v1/applications/{id}

Submits the full draft as a new revision. The published version stays on terminals until the next publish.

ItemValue
AuthSecret key only

Request body: as in Register an application, plus:

ParameterTypeRequiredDescription
revisionintYesDraft revision being edited, for concurrency control

Errors

HTTPCodeDescription
409application_revision_conflictDraft changed since it was read
404application_not_foundApplication does not exist

Publish to terminals ​

http
POST /v1/applications/{id}/publish

Publishes 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.

ItemValue
AuthSecret key only; physical terminals require a live key
IdempotencyDeduplicated by request_id in the body

Request body

ParameterTypeRequiredDescription
revisionintYesDraft revision to publish
request_idStringYesUnique request ID. Same ID and content returns the first result
environmentStringYessandbox: virtual terminals; physical: physical terminals
terminal_idsArray<String>YesComplete set of target terminals. Terminals not listed lose the application
disablebooleanNotrue removes the application from all terminals; send an empty terminal_ids

Request example

bash
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

HTTPCodeDescription
400application_request_id_requiredMissing request_id
400application_environment_requiredMissing environment
400application_environment_mismatchenvironment does not match the terminal type
400application_targets_requiredMissing terminal_ids
400application_targets_invalidInvalid terminal_ids
403live_key_requiredTest key used to publish to physical terminals
404terminal_not_foundTerminal does not exist or belongs to another account
409application_revision_conflictrevision is not the current draft
409application_request_conflictrequest_id used with different content

Retrieve an application ​

http
GET /v1/applications/{id}

Returns the application and the deployment state of each target terminal.

ItemValue
AuthSecret key

Response: 200 OK

json
{
  "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:

FieldTypeDescription
terminal_idStringTerminal ID
desired_revisionintRevision that should be deployed
applied_revisionintRevision deployed on the terminal
stateStringpending, applied, failed (see error_code), overridden (superseded by other terminal configuration), unassigned (removed from the target set)
error_codeStringDeployment failure reason
reported_atStringLast report from the terminal

Before switching a terminal's customer display to the application, confirm the terminal is state=applied.

List applications ​

http
GET /v1/applications
ItemValue
AuthSecret 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:

FieldTypeValuesDefault
exitStringbadge visible badge, hidden_taps hidden exitbadge standalone, hidden_taps companion mode
sizeStringa (48 px), b (56 px)a
opacityint100, 85, 70100
colorStringdark, light, #rrggbbdark
cornerStringtop_right, top_lefttop_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:

VariableValues
--kuvex-corner-size48px, 56px; 0px for the hidden exit
--kuvex-corner-sideright, left
js
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 ​

FieldTypeDescription
idStringApplication ID, app_ prefix
revisionintCurrent draft revision; send it back when saving or publishing
published_revisionintPublished revision; null if never published
lifecycleStringdraft, published, disabled
draftObjectCurrent draft: name, url, role, chrome
chrome_effectiveObjectExit control settings with defaults applied
created_at / updated_atStringCreation / update time