iRetail PRO store node 1.0.0-m1: shifts

6 операций

← Вся документация · Источник: контракты, openapi/store-v1.yaml на коммите 8000474.

Справочники на английском — на языке контрактов, из которых они созданы.

← iRetail PRO store node 1.0.0-m1

Операции

GET /v1/shifts Shifts.

operationId listShifts · Право shift.read

Параметры

Имя Где Тип Описание
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).
status query "open" | "closed" Status.
workplace_id query string (uuid) Workplace.
limit query integer Page size, 1–200.
after query string Cursor from the previous page.

Ответы

POST /v1/shifts Open a shift on the caller's workplace.

operationId openShift · Право shift.open

Параметры

Имя Где Тип Описание
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).
Idempotency-Key header string spec/API.md, Idempotency.
Approval-Token header string One-time approval from POST /v1/approvals for this operation's permission.

Тело запроса обязательный

Ответы

  • 201 OK Shift
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
GET /v1/shifts/{id} One shift.

operationId getShift · Право shift.read

Параметры

Имя Где Тип Описание
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.

Ответы

  • 200 OK Shift
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
POST /v1/shifts/{id}/cash-operations Deposit (shift.cash.deposit), payout (shift.cash.payout, limited) or pickup (shift.cash.pickup).

The kind decides the permission (spec/RBAC.md, Permissions by request).

operationId createCashOperation · Право shift.cash.deposit

Параметры

Имя Где Тип Описание
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.
Idempotency-Key header string spec/API.md, Idempotency.
Approval-Token header string One-time approval from POST /v1/approvals for this operation's permission.

Тело запроса обязательный

Ответы

GET /v1/shifts/{id}/report X totals of a shift so far, of the whole shift or one cashier (spec/API.md, Shared registers).

operationId shiftReport · Право shift.report.x

Параметры

Имя Где Тип Описание
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.
cashier_id query string (uuid) Only this employee's receipts and cash operations.

Ответы

POST /v1/shifts/{id}/close Close a shift with Z totals and the counted cash.

operationId closeShift · Право shift.close

Параметры

Имя Где Тип Описание
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.
Idempotency-Key header string spec/API.md, Idempotency.
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

Shift object

id обязательный string (uuid)
workplace_id обязательный string (uuid)
cashier_id обязательный string (uuid)
number обязательный integer (int64)
status обязательный "open" | "closed"
opened_at обязательный string (date-time)
closed_at обязательный string (date-time) | null
opening_cash_minor обязательный integer (int64)
currency обязательный string
fiscal обязательный ShiftFiscal | null The fiscal shift's Z report, once closed with one; null otherwise (spec/FISCAL.md).

ShiftOpen object

opening_cash_minor обязательный integer (int64)

CashOperation object

id обязательный string (uuid)
shift_id обязательный string (uuid)
kind обязательный "deposit" | "payout" | "pickup"
amount_minor обязательный integer (int64)
comment обязательный string | null
created_at обязательный string (date-time)
created_by обязательный string (uuid)

CashOperationCreate object

kind обязательный "deposit" | "payout" | "pickup"
amount_minor обязательный integer (int64)
comment string | null

TenderTotal object

tender обязательный "cash" | "card" | "ebt_snap" | "ebt_cash" | "gift_card" | "online" | "other" online is a preorder's payment captured at hand-over (spec/PAYMENTS_ONLINE.md), read as other by an app before 1.1.
amount_minor обязательный integer (int64)

ShiftTotals object

open_checks обязательный OpenChecks The store's open and billed restaurant checks when the totals were read; a shift closes with them open (spec/RESTAURANT.md, Split and close).
cashier_id обязательный string (uuid) | null The cashier the totals are for; null for the whole shift (spec/API.md, Shared registers).
taxes обязательный array of ReceiptTax Per tax code, the base and the tax of sales minus refunds, in the store's code order.
sale_count обязательный integer
refund_count обязательный integer
void_count обязательный integer
sales_minor обязательный integer (int64) Totals of sale receipts, voids excluded.
refunds_minor обязательный integer (int64)
net_sales_minor обязательный integer (int64)
tax_minor обязательный integer (int64)
discounts_minor обязательный integer (int64)
tips_minor обязательный integer (int64)
service_charges_minor обязательный integer (int64) The sales' service charges without their tax, less what refunds took back; beside tips_minor, never in it (spec/API.md, Shared registers).
payments обязательный array of TenderTotal
cash обязательный object

ShiftClose object

counted_cash_minor обязательный integer (int64)
fiscal ShiftFiscal | null The fiscal Z report taken before the close, from a register with a fiscal back end (spec/FISCAL.md).

ShiftFiscal object

The fiscal shift and its Z report as the fiscal unit counted them (spec/FISCAL.md).

shift_number обязательный integer (int64)
z_number обязательный integer (int64)
z_at обязательный string (date-time)
sales_minor обязательный integer (int64)
refunds_minor обязательный integer (int64)
taxes обязательный array of ReceiptTax
tenders обязательный array of object

ShiftClosed object

shift обязательный Shift
totals обязательный ShiftTotals
counted_cash_minor обязательный integer (int64)
difference_minor обязательный integer (int64) counted − expected

ReceiptTax object

code обязательный string
base обязательный integer (int64)
amount обязательный integer (int64)

ShiftPage object

items обязательный array of Shift
next обязательный string | null

OpenChecks object

The store's open and billed checks when the totals were read (spec/RESTAURANT.md, Split and close).

count обязательный integer
total_minor обязательный integer (int64)