iRetail PRO store node 1.0.0-m1: devices
4 операции
← Вся документация · Источник: контракты, openapi/store-v1.yaml на коммите 8000474.
Справочники на английском — на языке контрактов, из которых они созданы.
← iRetail PRO store node 1.0.0-m1
Операции
GET
/v1/devices
Registered devices (workplaces).
operationId
listDevices · Право device.manage
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
Ответы
POST
/v1/devices
Register a device; the token is shown once.
operationId
createDevice · Право device.manage
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
Approval-Token
|
header | string |
One-time approval from POST /v1/approvals for this operation's permission. |
Тело запроса обязательный
application/jsonDeviceCreate
Ответы
-
201OKDeviceCreated -
400Error (spec/API.md).Error -
401Error (spec/API.md).Error -
403Error (spec/API.md).Error -
409Error (spec/API.md).Error
PUT
/v1/devices/{id}/fiscal
Set a register's fiscal back ends (spec/FISCAL.md).
operationId
setDeviceFiscal · Право device.manage
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
id обязательный
|
path | string (uuid) |
Id. |
Тело запроса обязательный
application/jsonFiscalSetup
Ответы
DELETE
/v1/devices/{id}
Revoke a device and its token.
operationId
revokeDevice · Право device.manage
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
IRetail-App
|
header | string |
Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking). |
id обязательный
|
path | string (uuid) |
Id. |
Approval-Token
|
header | string |
One-time approval from POST /v1/approvals for this operation's permission. |
Ответы
Схемы
Error object
Every error response.
error обязательный
|
string |
Stable code, see spec/API.md. |
message обязательный
|
string |
English text for logs. |
details
|
object |
Device object
A workplace and its device token.
id обязательный
|
string (uuid) |
|
store_id обязательный
|
string (uuid) |
|
kind обязательный
|
"register" | "handheld" | "back_office" | "kitchen_display" | "gateway" |
A gateway device holds store.read alone, for the device gateway's own update (spec/RBAC.md, Principals; spec/RELEASES.md, The gateway). |
name обязательный
|
string |
|
created_at обязательный
|
string (date-time) |
|
revoked_at обязательный
|
string (date-time) | null |
|
wg_address обязательный
|
string | null |
The device's address in the private network, null without a peer (spec/NETWORK.md). |
wg_public_key обязательный
|
string | null |
The device's WireGuard public key, null without a peer. |
fiscal обязательный
|
FiscalSetup | null |
A register's fiscal back ends; null for other devices and for a register without one (spec/FISCAL.md). |
app обязательный
|
DeviceApp | null |
The device's last update report (spec/RELEASES.md, Reporting); null before its first. It never crosses to the hub with the device record. |
DeviceCreate object
kind обязательный
|
"register" | "handheld" | "back_office" | "kitchen_display" | "gateway" |
|
name обязательный
|
string |
DeviceCreated object
device обязательный
|
Device |
|
token обязательный
|
string |
Shown once. |
FiscalSetup object
A register's fiscal back ends (spec/FISCAL.md, Back ends).
mode обязательный
|
"none" | "required" |
|
backends обязательный
|
array of object |
ReleasePlatform "linux-x64" | "linux-arm64" | "windows-x64" | "macos-universal"
A platform a release ships for (spec/RELEASES.md).
linux-x64 · linux-arm64 · windows-x64 · macos-universal
AppId "cashier" | "manager" | "gateway"
An app that updates itself from its node (spec/RELEASES.md, The apps, The gateway); the manifest's component.
cashier · manager · gateway
AppUpdateState "idle" | "downloading" | "ready" | "waiting" | "installing" | "installed" | "failed" | "rolled_back"
Where an app's update stands (spec/RELEASES.md, Reporting).
idle · downloading · ready · waiting · installing · installed · failed · rolled_back
AppUpdateStep "download" | "verify" | "migrate" | "install" | "start"
The step a failed or rolled back app update stopped at.
download · verify · migrate · install · start
AppUpdateError "malformed" | "unsupported_format" | "unknown_key" | "bad_signature" | "downgrade" | "missing_artifact" | "size_mismatch" | "sha256_mismatch" | "unknown_artifact" | "install_marker" | "source_unreachable" | "storage_failed" | "install_failed" | "start_failed"
Why an app update stopped, one code, never text from outside (spec/RELEASES.md, Reporting).
malformed · unsupported_format · unknown_key · bad_signature · downgrade · missing_artifact · size_mismatch · sha256_mismatch · unknown_artifact · install_marker · source_unreachable · storage_failed · install_failed · start_failed
DeviceApp object
A device's last accepted update report, with when its state last changed and when the node took it.
app обязательный
|
AppId |
|
platform обязательный
|
ReleasePlatform |
|
version обязательный
|
string |
|
previous_version обязательный
|
string | null |
|
target_version обязательный
|
string | null |
|
state обязательный
|
AppUpdateState |
|
step обязательный
|
AppUpdateStep | null |
|
error обязательный
|
AppUpdateError | null |
|
since обязательный
|
string (date-time) |
|
reported_at обязательный
|
string (date-time) |