iRetail PRO store node 1.0.0-m1: documents
14 операций
← Вся документация · Источник: контракты, openapi/store-v1.yaml на коммите 8000474.
Справочники на английском — на языке контрактов, из которых они созданы.
← iRetail PRO store node 1.0.0-m1
Операции
GET
/v1/documents
Stock documents.
operationId
listDocuments · Право document.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). |
kind
|
query | "receiving" | "write_off" | "inventory" | "price_change" | "transfer_out" | "transfer_in" | "purchase_order" | "supplier_return" | "regrade" | "production" |
Kind. |
status
|
query | "draft" | "posted" | "canceled" |
Status. |
order
|
query | "asc" | "desc" |
asc (the default) oldest first, desc newest first. |
limit
|
query | integer |
Page size, 1–200. |
after
|
query | string |
Cursor from the previous page. |
Ответы
-
200OKDocumentPage -
401Error (spec/API.md).Error -
403Error (spec/API.md).Error
POST
/v1/documents
Create a draft document (inventory needs inventory.count or document.edit).
operationId
createDocument · Право document.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). |
Idempotency-Key
|
header | string |
spec/API.md, Idempotency. |
Approval-Token
|
header | string |
One-time approval from POST /v1/approvals for this operation's permission. |
Тело запроса обязательный
application/jsonDocumentCreate
Ответы
GET
/v1/documents/{id}
One document.
operationId
getDocument · Право document.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. |
Ответы
PATCH
/v1/documents/{id}
Change a draft.
operationId
patchDocument · Право document.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. |
If-Match
|
header | string |
The version the change is based on. |
Approval-Token
|
header | string |
One-time approval from POST /v1/approvals for this operation's permission. |
Тело запроса обязательный
application/jsonDocumentPatch
Ответы
POST
/v1/documents/{id}/post
Post a draft: stock changes now.
Some kinds need another permission too (spec/STOCK.md, Documents; spec/RBAC.md, Permissions by request).
operationId
postDocument · Право document.post
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
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. |
Ответы
POST
/v1/documents/{id}/cancel
Cancel a draft.
operationId
cancelDocument · Право document.post
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
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. |
Ответы
POST
/v1/documents/{id}/counts
Add one device's counts to a draft inventory document (spec/STOCK.md, Counts from several devices).
Blind: the answer carries the counted sums, never the book quantities. The Idempotency-Key is required.
operationId
addInventoryCounts · Право inventory.count
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
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. |
Тело запроса обязательный
application/jsonInventoryCounts
Ответы
GET
/v1/transfers
The store's transfers, both documents (spec/STOCK.md, Transfers).
operationId
listTransfers · Право document.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). |
direction
|
query | "outgoing" | "incoming" |
From this store or to it; both when absent. |
state
|
query | TransferState |
State. |
limit
|
query | integer |
Page size, 1–200. |
after
|
query | string |
Cursor from the previous page. |
Ответы
-
200OKTransferPage -
401Error (spec/API.md).Error -
403Error (spec/API.md).Error
GET
/v1/transfers/{id}
One transfer with both documents.
operationId
getTransfer · Право document.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. |
Ответы
POST
/v1/transfers/{id}/receiving
The draft transfer_in of an incoming transfer, prefilled with what was shipped; the existing one when there is one.
operationId
createTransferReceiving · Право document.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. |
Idempotency-Key
|
header | string |
spec/API.md, Idempotency. |
Ответы
POST
/v1/documents/{id}/close
Close a sent purchase order: what is still due is given up.
operationId
closeDocument · Право purchase.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. |
Idempotency-Key
|
header | string |
spec/API.md, Idempotency. |
Ответы
GET
/v1/suppliers
Suppliers.
operationId
listSuppliers · Право document.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). |
Ответы
POST
/v1/suppliers
Add a supplier.
operationId
createSupplier · Право purchase.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). |
Idempotency-Key
|
header | string |
spec/API.md, Idempotency. |
Тело запроса обязательный
application/jsonSupplierWrite
Ответы
PATCH
/v1/suppliers/{id}
Change a supplier.
operationId
patchSupplier · Право purchase.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. |
If-Match
|
header | string |
The version the change is based on. |
Тело запроса обязательный
application/jsonSupplierPatch
Ответы
Схемы
Error object
Every error response.
error обязательный
|
string |
Stable code, see spec/API.md. |
message обязательный
|
string |
English text for logs. |
details
|
object |
DocumentLine object
line_no обязательный
|
integer |
|
item_id обязательный
|
string (uuid) |
|
quantity_milli
|
integer (int64) |
Receiving and write-off: the quantity. |
counted_milli
|
integer (int64) |
Inventory: the counted quantity. |
book_milli
|
integer (int64) |
Inventory, after posting: the book quantity at posting. |
unit_cost_minor
|
integer (int64) |
Receiving: cost per base unit. |
retail_price_minor
|
integer (int64) |
Receiving: sets the store price when given. |
lot
|
string | null |
|
expires_on
|
string (date) | null |
|
batch_id
|
string (uuid) | null |
Write-off, transfer_out, supplier_return, regrade, production: a specific batch instead of allocation. Price change: the batch whose own price the line sets. A posted receiving: the batch the line made, at its unit_cost_minor (spec/STOCK.md). |
reason
|
string | null |
|
price_minor
|
integer (int64) | null |
Price change: the new store price, or the batch's own price (null removes it, spec/PRICING.md). |
batch_price_minor
|
integer (int64) | null |
Receiving: the sale price of the batch the line makes (spec/PRICING.md, Batch prices). |
to_item_id
|
string (uuid) | null |
Re-grade: the item the quantity really is (spec/STOCK.md, Re-grades). |
transfer_line_no
|
integer | null |
Transfer receiving: the transfer's line it receives. |
shipped
|
array of ShippedBatch |
A posted transfer_out: the batches the line took. |
made
|
array of MovedBatch |
A posted transfer_in or re-grade: the batches the line made. |
shortage_milli
|
integer (int64) | null |
A posted transfer_in: shipped less received, when positive. |
surplus_milli
|
integer (int64) | null |
A posted transfer_in: received less shipped, when positive. |
shortage_cost_minor
|
integer (int64) | null |
|
surplus_cost_minor
|
integer (int64) | null |
|
received_milli
|
integer (int64) | null |
Purchase order: what the posted receivings naming it brought of the line's item. |
due_milli
|
integer (int64) | null |
Purchase order: what is still due (spec/STOCK.md, Purchase orders). |
cost_minor
|
integer (int64) | null |
Once posted: the line's cost, rounded once (spec/STOCK.md, Documents). |
previous_price_minor
|
integer (int64) | null |
Price change, after posting: the price it replaced (null without one). |
serials
|
array of string |
A serial-tracked item's serial per unit, as read (spec/VARIANTS.md). |
DocumentLineInput object
item_id обязательный
|
string (uuid) |
|
quantity_milli
|
integer (int64) |
|
counted_milli
|
integer (int64) |
|
unit_cost_minor
|
integer (int64) |
|
retail_price_minor
|
integer (int64) |
|
lot
|
string | null |
|
expires_on
|
string (date) | null |
|
batch_id
|
string (uuid) | null |
|
reason
|
string | null |
|
price_minor
|
integer (int64) | null |
|
serials
|
array of string |
A serial-tracked item's serial per unit, as read (spec/VARIANTS.md). |
batch_price_minor
|
integer (int64) | null |
|
to_item_id
|
string (uuid) | null |
|
transfer_line_no
|
integer |
Document object
id обязательный
|
string (uuid) |
|
kind обязательный
|
"receiving" | "write_off" | "inventory" | "price_change" | "transfer_out" | "transfer_in" | "purchase_order" | "supplier_return" | "regrade" | "production" |
|
status обязательный
|
"draft" | "posted" | "canceled" |
|
number обязательный
|
integer (int64) |
|
comment обязательный
|
string | null |
|
created_at обязательный
|
string (date-time) |
|
created_by обязательный
|
string (uuid) |
|
posted_at обязательный
|
string (date-time) | null |
|
posted_by обязательный
|
string (uuid) | null |
|
lines обязательный
|
array of DocumentLine |
|
version обязательный
|
integer (int64) |
|
reason
|
"repricing" | "markdown" | null |
Price change: why (spec/PRICING.md); null for other kinds. |
origin
|
"expiry_rule" | null |
Made by the node's expiry run (spec/PRICING.md); null when a person made it. |
supplier_id
|
string (uuid) | null |
Purchase order, supplier return, and optionally a receiving: the supplier. |
expected_on
|
string (date) | null |
Purchase order: when the delivery is expected. |
order_state
|
"draft" | "sent" | "partly_received" | "received" | "closed" | "canceled" | null |
Purchase order: its state (spec/STOCK.md, Purchase orders). |
purchase_order_id
|
string (uuid) | null |
Receiving: the order it fills. |
receiving_id
|
string (uuid) | null |
Supplier return: the receiving it returns from. |
from_store_id
|
string (uuid) | null |
Transfer: the sending store. |
to_store_id
|
string (uuid) | null |
Transfer: the receiving store. |
transfer_id
|
string (uuid) | null |
Transfer receiving: the transfer_out it receives. |
transfer_state
|
TransferState | null |
|
recipe_id
|
string (uuid) | null |
Production: the recipe it was filled from. |
planned_milli
|
integer (int64) | null |
Production: the output planned (spec/STOCK.md, Recipes and production). |
output
|
ProductionOutput | null |
|
loss_milli
|
integer (int64) | null |
|
yield_ppm
|
integer (int64) | null |
|
cost_minor
|
integer (int64) | null |
Once posted, the sum of its lines' costs (a production's components'). |
DocumentCreate object
kind обязательный
|
"receiving" | "write_off" | "inventory" | "price_change" | "transfer_out" | "transfer_in" | "purchase_order" | "supplier_return" | "regrade" | "production" |
|
comment
|
string | null |
|
lines
|
array of DocumentLineInput |
|
reason
|
"repricing" | "markdown" | null |
Price change: why (spec/PRICING.md); null for other kinds. |
supplier_id
|
string (uuid) | null |
Purchase order, supplier return, and optionally a receiving: the supplier. |
expected_on
|
string (date) | null |
Purchase order: when the delivery is expected. |
purchase_order_id
|
string (uuid) | null |
Receiving: the order it fills. |
receiving_id
|
string (uuid) | null |
Supplier return: the receiving it returns from. |
to_store_id
|
string (uuid) | null |
Transfer: the receiving store. |
recipe_id
|
string (uuid) | null |
Production: the recipe it was filled from. |
planned_milli
|
integer (int64) | null |
Production: the output planned (spec/STOCK.md, Recipes and production). |
output
|
ProductionOutputInput | null |
DocumentPatch object
Lines, when given, replace all lines.
comment
|
string | null |
|
lines
|
array of DocumentLineInput |
|
reason
|
"repricing" | "markdown" | null |
Price change: why (spec/PRICING.md); null for other kinds. |
supplier_id
|
string (uuid) | null |
Purchase order, supplier return, and optionally a receiving: the supplier. |
expected_on
|
string (date) | null |
Purchase order: when the delivery is expected. |
purchase_order_id
|
string (uuid) | null |
Receiving: the order it fills. |
receiving_id
|
string (uuid) | null |
Supplier return: the receiving it returns from. |
to_store_id
|
string (uuid) | null |
Transfer: the receiving store. |
output
|
ProductionOutputInput | null |
DocumentPage object
items обязательный
|
array of Document |
|
next обязательный
|
string | null |
InventoryCounts object
lines обязательный
|
array of object |
InventoryCounted object
The document's counted sums after the batch; no book quantities (blind count).
document_id обязательный
|
string (uuid) |
|
counted обязательный
|
array of object |
Supplier object
Someone stock is ordered from and returned to (spec/STOCK.md, Purchase orders); hub-owned in a chain.
id обязательный
|
string (uuid) |
|
code обязательный
|
string |
|
name обязательный
|
string |
|
comment обязательный
|
string | null |
|
active обязательный
|
boolean |
|
version обязательный
|
integer (int64) |
SupplierWrite object
code обязательный
|
string |
|
name обязательный
|
string |
|
comment
|
string | null |
|
active
|
boolean |
SupplierPatch object
code
|
string |
|
name
|
string |
|
comment
|
string | null |
|
active
|
boolean |
ShippedBatch object
A batch a posted transfer_out line took (spec/STOCK.md, Transfers).
batch_id обязательный
|
string (uuid) |
|
quantity_milli обязательный
|
integer (int64) |
|
unit_cost_minor обязательный
|
integer (int64) |
|
cost_currency обязательный
|
string |
|
lot обязательный
|
string | null |
|
expires_on обязательный
|
string (date) | null |
MovedBatch object
A batch a posted transfer_in, re-grade or production line made, and the batch it came from.
batch_id обязательный
|
string (uuid) |
|
from_batch_id обязательный
|
string (uuid) | null |
|
quantity_milli обязательный
|
integer (int64) |
|
unit_cost_minor обязательный
|
integer (int64) |
ProductionOutput object
What a production made; batch_id and unit_cost_minor once posted (spec/STOCK.md).
item_id обязательный
|
string (uuid) |
|
quantity_milli обязательный
|
integer (int64) |
|
lot обязательный
|
string | null |
|
expires_on обязательный
|
string (date) | null |
|
batch_id обязательный
|
string (uuid) | null |
|
unit_cost_minor обязательный
|
integer (int64) | null |
ProductionOutputInput object
item_id обязательный
|
string (uuid) |
|
quantity_milli обязательный
|
integer (int64) |
|
lot
|
string | null |
|
expires_on
|
string (date) | null |
TransferState "draft" | "in_transit" | "received" | "canceled"
spec/STOCK.md, Transfers.
draft · in_transit · received · canceled
Transfer object
A transfer with both stores' documents: the sender's transfer_out and the receiver's transfer_in.
id обязательный
|
string (uuid) |
|
from_store_id обязательный
|
string (uuid) |
|
to_store_id обязательный
|
string (uuid) |
|
state обязательный
|
TransferState |
|
transfer обязательный
|
Document |
|
receiving обязательный
|
Document | null |
TransferPage object
items обязательный
|
array of Transfer |
|
next обязательный
|
string | null |