iRetail PRO store node 1.0.0-m1: imports

10 операций

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

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

← iRetail PRO store node 1.0.0-m1

Операции

POST /v1/imports Read a CSV, XLSX or Google Sheet into an import session (spec/IMPORT.md).

operationId createImport · Право item.edit

Параметры

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

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

Ответы

GET /v1/imports/{id} An import session.

operationId getImport · Право item.edit

Параметры

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

Ответы

POST /v1/imports/{id}/preview What each row would do under a mapping; writes nothing.

operationId previewImport · Право item.edit

Параметры

Имя Где Тип Описание
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.
offset query integer First row to answer (0 is the first data row).
limit query integer Rows to answer.

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

Ответы

POST /v1/imports/{id}/apply Write the create and update rows in one transaction; error rows are skipped.

Needs price.edit too when the mapping has price. Applying the same session with the same mapping again returns the first result.

operationId applyImport · Право item.edit

Параметры

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

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

Ответы

GET /v1/exports/items Every item with the import's columns, as CSV or XLSX (spec/IMPORT.md, Export).

operationId exportItems · Право item.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).
format обязательный query "csv" | "xlsx" File format.

Ответы

  • 200 The file. string
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
GET /v1/exports/stock The stock report as CSV or XLSX.

operationId exportStock · Право report.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).
format обязательный query "csv" | "xlsx" File format.

Ответы

  • 200 The file. string
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
GET /v1/exports/sales The sales report as CSV or XLSX.

operationId exportSales · Право report.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).
from обязательный query string (date-time) Start, inclusive (RFC 3339).
to обязательный query string (date-time) End, exclusive (RFC 3339).
group_by обязательный query "day" | "employee" | "item" | "group" | "tender" Rows by day, employee, item, group or tender.
roll_up_variants query boolean By item: count a variant under its parent (spec/VARIANTS.md).
format обязательный query "csv" | "xlsx" File format.

Ответы

  • 200 The file. string
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
GET /v1/exports/tax The tax report as CSV or XLSX.

operationId exportTax · Право report.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).
from обязательный query string (date) First business date, inclusive.
to обязательный query string (date) Last business date, inclusive.
format обязательный query "csv" | "xlsx" File format.

Ответы

  • 200 The file. string
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
GET /v1/exports/service-charges The service charge report as CSV or XLSX.

operationId exportServiceChargeReport · Право report.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).
from обязательный query string (date-time) Start, inclusive (RFC 3339).
to обязательный query string (date-time) End, exclusive (RFC 3339).
group_by обязательный query "day" | "employee" | "charge" Rows by day, employee or charge.
format обязательный query "csv" | "xlsx" File format.

Ответы

  • 200 The file. string
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
GET /v1/exports/restaurant The restaurant report as CSV or XLSX.

operationId exportRestaurantReport · Право report.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).
from обязательный query string (date-time) Start, inclusive (RFC 3339).
to обязательный query string (date-time) End, exclusive (RFC 3339).
group_by обязательный query "day" | "waiter" | "table" | "area" Rows by day, waiter, table or area.
format обязательный query "csv" | "xlsx" File format.

Ответы

  • 200 The file. string
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error

Схемы

Error object

Every error response.

error обязательный string Stable code, see spec/API.md.
message обязательный string English text for logs.
details object

ImportUpload object

A file as base64 (csv, xlsx) or a Google Sheet's URL (google_sheet).

format обязательный "csv" | "xlsx" | "google_sheet"
file_name string
content_base64 string The file, for csv and xlsx; at most 10 MB decoded.
url string (uri) For google_sheet; https://docs.google.com/spreadsheets/d/... only.

ImportSession object

id обязательный string (uuid)
format обязательный "csv" | "xlsx" | "google_sheet"
file_name обязательный string | null
header обязательный array of string
row_count обязательный integer
sample_rows обязательный array of array of string
suggested_mapping обязательный map of string Header name → field.
created_at обязательный string (date-time)
expires_at обязательный string (date-time)
applied обязательный boolean

ImportMapping object

mapping обязательный map of "sku" | "name_en" | "name_ru" | "kind" | "base_unit" | "price" | "barcode" | "plu" | "tax_codes" | "group" | "discountable" | "active" Header name → field (spec/IMPORT.md, Mapping).

ImportPreviewRow object

row обязательный integer The row's number in the table; the header is row 1.
action обязательный "create" | "update" | "error"
fields обязательный object Normalized values (spec/IMPORT.md).
errors обязательный array of object

ImportPreview object

rows обязательный array of ImportPreviewRow
counts обязательный object

ImportResult object

created обязательный integer
updated обязательный integer
skipped обязательный integer Error rows, not written.
groups_created обязательный integer