{"openapi":"3.1.0","info":{"title":"Рекс.Селлер API","version":"1.0.0","summary":"Orders, customers, catalog, stock, shipments and purchases of a Рекс.Селлер company — for your own programs.","description":"REST API of [Рекс.Селлер](https://reks.com.ua) for server-to-server integrations: your site, 1С/BAS, a warehouse script, Make / Zapier / n8n.\n\nGuide (authentication, errors, limits, pagination, webhooks): https://reks.com.ua/developers\n\n**Authentication.** `Authorization: Bearer rks_live_…` — create a key in the app: Налаштування → API. A key belongs to one company and acts for the member who created it: it can do what its scopes allow AND that member’s role allows, in that member’s shops.\n\n**Formats.** JSON, camelCase. Money and quantities are decimal strings (`\"1250.00\"`), dates `YYYY-MM-DD` (Kyiv), instants ISO-8601. Absent values are `null`. New fields may appear in responses at any time — ignore what you don’t know.","contact":{"name":"Рекс.Селлер support","url":"https://reks.com.ua/developers"}},"servers":[{"url":"https://api.reks.com.ua/v1"}],"tags":[{"name":"Account","description":"The key itself: company, scopes, limits."},{"name":"Orders","description":"Orders («Продажі»): list, read, create, edit, cancel, move between stages, payments."},{"name":"Customers","description":"Customers («Клієнти»)."},{"name":"Catalog","description":"Products, variants, categories («Каталог»)."},{"name":"Inventory","description":"Stock per warehouse, setting stock («Склад»)."},{"name":"Shipments","description":"Parcels and their tracking («Посилки»)."},{"name":"Purchases","description":"Supplier invoices («Закупівлі»)."},{"name":"Suppliers","description":"Suppliers («Постачальники»)."},{"name":"Reference","description":"Shops, warehouses, order stages, payment methods, order tags, custom fields, currencies, delivery services, sales channels."},{"name":"Webhooks","description":"Webhook endpoints: events pushed to your server, signed."}],"paths":{"/me":{"get":{"operationId":"getAccount","tags":["Account"],"summary":"The key and its company","description":"Check a key: which company it belongs to, its scopes and shops, whose access it uses. Call it first.\n\n**Scope:** any key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/orders":{"get":{"operationId":"listOrders","tags":["Orders"],"summary":"List orders","description":"Newest changes first by default. For a sync, page through `sort=updatedAt:asc&updatedSince=<last updatedAt you saw>`.\n\n**Scope:** `orders:read`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"updatedSince","in":"query","required":false,"description":"Only items changed at or after this instant (ISO-8601). Sync loop: remember the largest `updatedAt` you saw and pass it next time.","schema":{"type":"string","format":"date-time"}},{"name":"createdFrom","in":"query","required":false,"description":"Order date from (inclusive).","schema":{"type":"string","format":"date","example":"2026-11-15"}},{"name":"createdTo","in":"query","required":false,"description":"Order date to (inclusive).","schema":{"type":"string","format":"date","example":"2026-11-15"}},{"name":"status","in":"query","required":false,"description":"Any of these statuses (comma-separated).","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"paymentStatus","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"shipmentStatus","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"stageId","in":"query","required":false,"description":"Any of these workflow stages.","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"shopId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"customerId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"externalId","in":"query","required":false,"description":"Exact external id — find the order you created from your system.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"q","in":"query","required":false,"description":"Search: number, customer name / phone, ТТН, product, comment.","schema":{"type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"description":"Use updatedAt:asc with updatedSince to sync.","schema":{"default":"updatedAt:desc","type":"string","enum":["updatedAt:asc","updatedAt:desc","orderDate:asc","orderDate:desc","number:asc","number:desc"]}},{"name":"expand","in":"query","required":false,"description":"`items` — return full orders (lines and payments); pageSize is then at most 25.","schema":{"type":"string","enum":["items"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/OrderExpandedPage"},{"$ref":"#/components/schemas/OrderPage"}]}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:read"]}]},"post":{"operationId":"createOrder","tags":["Orders"],"summary":"Create an order","description":"Stock is reserved at once (FIFO), the customer is found or created by phone, prices default to the shop’s. The order’s `source` is `api`. Send an `Idempotency-Key` header so a retry never creates a second order.\n\n**Scope:** `orders:write`\n\n**Errors:** `INSUFFICIENT_STOCK`, `PRODUCT_NOT_FOUND`, `CUSTOM_FIELD_INVALID`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/orders/{id}":{"get":{"operationId":"getOrder","tags":["Orders"],"summary":"Get an order","description":"With its lines and payments.\n\n**Scope:** `orders:read`\n\n**Errors:** `ORDER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:read"]}]},"patch":{"operationId":"updateOrder","tags":["Orders"],"summary":"Update an order","description":"Partial: only the fields you send change. `items`, when sent, is the full new list of lines.\n\n**Scope:** `orders:write`\n\n**Errors:** `ORDER_NOT_FOUND`, `ORDER_LOCKED`, `INSUFFICIENT_STOCK`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrderRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/orders/{id}/cancel":{"post":{"operationId":"cancelOrder","tags":["Orders"],"summary":"Cancel an order","description":"Releases the reserved stock.\n\n**Scope:** `orders:write`\n\n**Errors:** `ORDER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/orders/{id}/deliver":{"post":{"operationId":"deliverOrder","tags":["Orders"],"summary":"Mark an order delivered","description":"**Scope:** `orders:write`\n\n**Errors:** `ORDER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverOrderRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/orders/{id}/payments":{"post":{"operationId":"addOrderPayment","tags":["Orders"],"summary":"Record a payment","description":"Adds a payment (negative amount = refund); the order’s payment status follows. Send an `Idempotency-Key`.\n\n**Scope:** `orders:payments`\n\n**Errors:** `ORDER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:payments"]}]}},"/orders/{id}/payments/{paymentId}":{"delete":{"operationId":"deleteOrderPayment","tags":["Orders"],"summary":"Delete a payment","description":"**Scope:** `orders:payments`\n\n**Errors:** `ORDER_NOT_FOUND`, `PAYMENT_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"paymentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:payments"]}]}},"/orders/{id}/ship":{"post":{"operationId":"shipOrder","tags":["Orders"],"summary":"Mark an order shipped","description":"Consumes the reserved stock; optionally records the waybill (ТТН) number.\n\n**Scope:** `orders:write`\n\n**Errors:** `ORDER_NOT_FOUND`, `ORDER_AWAITING_STOCK`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipOrderRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/orders/{id}/tags":{"put":{"operationId":"setOrderTags","tags":["Orders"],"summary":"Replace the tags of an order","description":"**Scope:** `orders:write`\n\n**Errors:** `ORDER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetOrderTagsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/orders/{id}/transitions":{"get":{"operationId":"listOrderTransitions","tags":["Orders"],"summary":"Stage and possible moves","description":"The order’s workflow stage and the moves («Відправити», «Скасувати», …) the company’s pipeline offers from it, with unmet rules.\n\n**Scope:** `orders:read`\n\n**Errors:** `ORDER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderTransitions"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:read"]}]},"post":{"operationId":"transitionOrder","tags":["Orders"],"summary":"Move an order to another stage","description":"Takes one of the moves of GET /orders/{id}/transitions: its rules are checked and its automatic actions run (mark shipped, cancel, assign, tags, …), as when a manager presses the button. Two actions need more than `orders:write`: recording the payment needs `orders:payments` on the key; creating a carrier waybill (ТТН) needs the «Shipments → Create» permission, which no scope grants in v1 — a move that would create one answers 422 `WORKFLOW_RULES_FAILED` (make the ТТН in the app, or set `trackingNumber` on the order first), and is otherwise taken without the waybill step.\n\n**Scope:** `orders:write`\n\n**Errors:** `ORDER_NOT_FOUND`, `WORKFLOW_RULES_FAILED`, `WORKFLOW_TRANSITION_FORBIDDEN`, `WORKFLOW_STAGE_CHANGED`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionOrderRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionOrderResult"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["orders:write"]}]}},"/customers":{"get":{"operationId":"listCustomers","tags":["Customers"],"summary":"List customers","description":"Newest changes first by default. For a sync, page through `sort=updatedAt:asc&updatedSince=<last updatedAt you saw>`. `phone` finds the customer of a phone exactly.\n\n**Scope:** `customers:read`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Search: name words, phone digits, email, Instagram / Telegram, city.","schema":{"type":"string","maxLength":200}},{"name":"phone","in":"query","required":false,"description":"Exact phone in any common format (normalised to E.164) — find the customer of a phone.","schema":{"example":"0671234567","type":"string","minLength":1,"maxLength":40}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CustomerType"}},{"name":"tag","in":"query","required":false,"description":"Customers with ANY of these tags (comma-separated).","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"updatedSince","in":"query","required":false,"description":"Only items changed at or after this instant (ISO-8601). Sync loop: remember the largest `updatedAt` you saw and pass it next time.","schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","required":false,"description":"Use updatedAt:asc with updatedSince to sync.","schema":{"default":"updatedAt:desc","type":"string","enum":["updatedAt:asc","updatedAt:desc","createdAt:asc","createdAt:desc","name:asc","name:desc"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["customers:read"]}]},"post":{"operationId":"createCustomer","tags":["Customers"],"summary":"Create a customer","description":"A phone is unique in the company: a taken one answers 409 CUSTOMER_PHONE_TAKEN with the existing `customerId` in `details`. Send an `Idempotency-Key` header so a retry never creates a second customer.\n\n**Scope:** `customers:write`\n\n**Errors:** `CUSTOMER_PHONE_TAKEN`, `CUSTOM_FIELD_INVALID`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["customers:write"]}]}},"/customers/{id}":{"get":{"operationId":"getCustomer","tags":["Customers"],"summary":"Get a customer","description":"**Scope:** `customers:read`\n\n**Errors:** `CUSTOMER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["customers:read"]}]},"patch":{"operationId":"updateCustomer","tags":["Customers"],"summary":"Update a customer","description":"Partial: only the fields you send change.\n\n**Scope:** `customers:write`\n\n**Errors:** `CUSTOMER_NOT_FOUND`, `CUSTOMER_PHONE_TAKEN`, `CUSTOM_FIELD_INVALID`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["customers:write"]}]}},"/categories":{"get":{"operationId":"listCategories","tags":["Catalog"],"summary":"List categories","description":"All of them (a company has tens to hundreds), in tree order. Build the tree from `parentId`.\n\n**Scope:** `catalog:read`","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["catalog:read"]}]}},"/products":{"get":{"operationId":"listProducts","tags":["Catalog"],"summary":"List products","description":"Every row by default: plain products, products with variants and the variants themselves (each variant is a product of its own, with `variantParentId`). Archived products are included (`isActive: false`); deleted ones are not. For a sync, page through `sort=updatedAt:asc&updatedSince=<last updatedAt you saw>`.\n\n**Scope:** `catalog:read`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Search: name words, SKU, barcode, supplier / shop names and SKUs.","schema":{"type":"string","maxLength":200}},{"name":"sku","in":"query","required":false,"description":"Exact internal SKU.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"categoryId","in":"query","required":false,"description":"Products of this category and its subcategories; `none` = uncategorised.","schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"none"}]}},{"name":"includeSubcategories","in":"query","required":false,"description":"With `categoryId`: false = that category only. Default true.","schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"isActive","in":"query","required":false,"description":"false = archived products only.","schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProductType"}},{"name":"view","in":"query","required":false,"description":"all — every row (plain products, products with variants and their variants); sellable — what orders and stock refer to (no products with variants); catalog — no variant rows.","schema":{"default":"all","type":"string","enum":["all","sellable","catalog"]}},{"name":"variantParentId","in":"query","required":false,"description":"Only the variants of this product.","schema":{"type":"string","format":"uuid"}},{"name":"updatedSince","in":"query","required":false,"description":"Only items changed at or after this instant (ISO-8601). Sync loop: remember the largest `updatedAt` you saw and pass it next time.","schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","required":false,"description":"Use updatedAt:asc with updatedSince to sync.","schema":{"default":"updatedAt:desc","type":"string","enum":["updatedAt:asc","updatedAt:desc","createdAt:asc","createdAt:desc","name:asc","name:desc","sku:asc","sku:desc"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["catalog:read"]}]},"post":{"operationId":"createProduct","tags":["Catalog"],"summary":"Create a product","description":"A plain product, a service, a kit (`components`) or a product with variants (`variantOptions` + `variants`). Send an `Idempotency-Key` header so a retry never creates a second product.\n\n**Scope:** `catalog:write`\n\n**Errors:** `PRODUCT_SKU_TAKEN`, `CATEGORY_NOT_FOUND`, `UNIT_NOT_FOUND`, `KIT_COMPONENTS_REQUIRED`, `PRODUCT_COMPONENT_NOT_FOUND`, `PRODUCT_COMPONENT_NOT_GOODS`, `PRODUCT_COMPONENT_SELF`, `PRODUCT_PORTIONS_UNIT`, `PRODUCT_LISTING_SKU_TAKEN`, `SHOP_ACCESS_DENIED`, `SHOP_NOT_FOUND`, `CUSTOM_FIELD_INVALID`, `PRODUCT_VARIANTS_GOODS_ONLY`, `PRODUCT_VARIANT_VALUES_INVALID`, `PRODUCT_VARIANT_DUPLICATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["catalog:write"]}]}},"/products/{id}":{"get":{"operationId":"getProduct","tags":["Catalog"],"summary":"Get a product","description":"With its category path, shop listings (the key’s shops), variants (a product with variants) and components (a kit).\n\n**Scope:** `catalog:read`\n\n**Errors:** `PRODUCT_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["catalog:read"]}]},"patch":{"operationId":"updateProduct","tags":["Catalog"],"summary":"Update a product","description":"Partial: only the fields you send change. Archive with `isActive: false` (there is no DELETE).\n\n**Scope:** `catalog:write`\n\n**Errors:** `PRODUCT_NOT_FOUND`, `PRODUCT_SKU_TAKEN`, `CATEGORY_NOT_FOUND`, `UNIT_NOT_FOUND`, `KIT_COMPONENTS_REQUIRED`, `PRODUCT_COMPONENT_NOT_FOUND`, `PRODUCT_COMPONENT_NOT_GOODS`, `PRODUCT_COMPONENT_SELF`, `PRODUCT_PORTIONS_UNIT`, `PRODUCT_LISTING_SKU_TAKEN`, `SHOP_ACCESS_DENIED`, `SHOP_NOT_FOUND`, `CUSTOM_FIELD_INVALID`, `PRODUCT_DELETED`, `PRODUCT_TYPE_LOCKED`, `PRODUCT_USED_IN_KIT`, `PRODUCT_HAS_STOCK_HISTORY`, `PRODUCT_VARIANT_NESTED`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["catalog:write"]}]}},"/stock":{"get":{"operationId":"listStock","tags":["Inventory"],"summary":"Stock per product and warehouse","description":"One row per product × warehouse that has (or had) stock, reservations or expected purchases there — by product name, then warehouse. Products never stocked (and kits, services) have no rows.\n\n**Scope:** `inventory:read`\n\n**Errors:** `WAREHOUSE_NOT_FOUND`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"productId","in":"query","required":false,"description":"Only these products (comma-separated, up to 100).","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"sku","in":"query","required":false,"description":"Exact internal SKU.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"warehouseId","in":"query","required":false,"description":"One warehouse (GET /warehouses).","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLevelPage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["inventory:read"]}]}},"/stock/set":{"post":{"operationId":"setStock","tags":["Inventory"],"summary":"Set stock quantities","description":"Sets the ON-HAND quantity of products in one warehouse (absolute numbers, e.g. from your warehouse program). Products already at the given quantity are left alone; the rest get one adjustment document («Інвентаризація / списання», type «Коригування») with the differences, as the catalog’s «Залишок» does — so a periodic full sync posts nothing when nothing changed: removed units leave FIFO (oldest first, reservations re-planned); added units arrive as a new lot costing `unitCost`, else the product’s latest stock cost (any warehouse), else 0. Goods with stock tracking only — not services, kits or products with variants (set their variants). Send an `Idempotency-Key` header so a retry is not applied twice.\n\n**Scope:** `inventory:write`\n\n**Errors:** `PRODUCT_NOT_FOUND`, `STOCK_PRODUCT_DUPLICATE`, `PRODUCT_STOCK_NOT_TRACKED`, `PRODUCT_HAS_VARIANTS`, `WAREHOUSE_NOT_FOUND`, `WAREHOUSE_REQUIRED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetStockRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetStockResult"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["inventory:write"]}]}},"/shipments":{"get":{"operationId":"listShipments","tags":["Shipments"],"summary":"List shipments","description":"Newest first by default. For a sync, page through `sort=updatedAt:asc&updatedSince=<last updatedAt you saw>` — tracking updates change `updatedAt`.\n\n**Scope:** `shipments:read`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"updatedSince","in":"query","required":false,"description":"Only items changed at or after this instant (ISO-8601). Sync loop: remember the largest `updatedAt` you saw and pass it next time.","schema":{"type":"string","format":"date-time"}},{"name":"orderId","in":"query","required":false,"description":"Waybills of this order.","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"description":"Any of these statuses (comma-separated).","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"carrier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"active","in":"query","required":false,"description":"`true` — only shipments still being tracked (not in a final status).","schema":{"type":"string","enum":["true","false"]}},{"name":"createdFrom","in":"query","required":false,"description":"Created on or after this day (Kyiv).","schema":{"type":"string","format":"date","example":"2026-11-15"}},{"name":"createdTo","in":"query","required":false,"description":"Calendar date (Kyiv), YYYY-MM-DD.","schema":{"type":"string","format":"date","example":"2026-11-15"}},{"name":"q","in":"query","required":false,"description":"Search: ТТН, recipient name / phone, order number.","schema":{"type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"description":"Use updatedAt:asc with updatedSince to sync.","schema":{"default":"createdAt:desc","type":"string","enum":["updatedAt:asc","updatedAt:desc","createdAt:asc","createdAt:desc"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentPage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["shipments:read"]}]}},"/shipments/{id}":{"get":{"operationId":"getShipment","tags":["Shipments"],"summary":"Get a shipment","description":"The waybill with its boxes and tracking history.\n\n**Scope:** `shipments:read`\n\n**Errors:** `SHIPMENT_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shipment"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["shipments:read"]}]}},"/purchases":{"get":{"operationId":"listPurchases","tags":["Purchases"],"summary":"List purchases","description":"Newest purchase date first by default. For a sync, page through `sort=updatedAt:asc&updatedSince=<last updatedAt you saw>` — edits, payments and receiving change `updatedAt`; stock of the lines selling out does not (read stock through the inventory resources).\n\n**Scope:** `purchases:read`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"updatedSince","in":"query","required":false,"description":"Only items changed at or after this instant (ISO-8601). Sync loop: remember the largest `updatedAt` you saw and pass it next time.","schema":{"type":"string","format":"date-time"}},{"name":"dateFrom","in":"query","required":false,"description":"Purchase date from (inclusive).","schema":{"type":"string","format":"date","example":"2026-11-15"}},{"name":"dateTo","in":"query","required":false,"description":"Purchase date to (inclusive).","schema":{"type":"string","format":"date","example":"2026-11-15"}},{"name":"status","in":"query","required":false,"description":"Any of these statuses (comma-separated).","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"paymentStatus","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"name":"supplierId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"warehouseId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"productId","in":"query","required":false,"description":"Invoices with a line of this product.","schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","required":false,"description":"Search: number, title, tracking number, supplier, line names.","schema":{"type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"description":"Use updatedAt:asc with updatedSince to sync.","schema":{"default":"purchaseDate:desc","type":"string","enum":["updatedAt:asc","updatedAt:desc","purchaseDate:asc","purchaseDate:desc","number:asc","number:desc"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchasePage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["purchases:read"]}]},"post":{"operationId":"createPurchase","tags":["Purchases"],"summary":"Create a purchase","description":"Lines become stock lots: expected (on the way) until the purchase is received, then available at their landed cost. With `receivedDate` the goods are in stock at once. Send an `Idempotency-Key` header so a retry never creates a second purchase.\n\n**Scope:** `purchases:write`\n\n**Errors:** `PRODUCT_NOT_FOUND`, `PRODUCT_IS_KIT`, `PRODUCT_HAS_VARIANTS`, `SUPPLIER_NOT_FOUND`, `WAREHOUSE_NOT_FOUND`, `DELIVERY_SERVICE_NOT_FOUND`, `CURRENCY_NOT_FOUND`, `SHOP_NOT_FOUND`, `SHOP_ACCESS_DENIED`, `CUSTOM_FIELD_INVALID`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Purchase"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["purchases:write"]}]}},"/purchases/{id}":{"get":{"operationId":"getPurchase","tags":["Purchases"],"summary":"Get a purchase","description":"With its lines (stock lots) and payments.\n\n**Scope:** `purchases:read`\n\n**Errors:** `PURCHASE_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Purchase"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["purchases:read"]}]}},"/purchases/{id}/receive":{"post":{"operationId":"receivePurchase","tags":["Purchases"],"summary":"Mark a purchase received","description":"The goods arrive: the lines’ stock lots become available (at their landed cost) and pre-orders waiting for them can ship.\n\n**Scope:** `purchases:write`\n\n**Errors:** `PURCHASE_NOT_FOUND`, `SHOP_ACCESS_DENIED`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivePurchaseRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Purchase"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["purchases:write"]}]}},"/suppliers":{"get":{"operationId":"listSuppliers","tags":["Suppliers"],"summary":"List suppliers","description":"Newest changes first by default. For a sync, page through `sort=updatedAt:asc&updatedSince=<last updatedAt you saw>`.\n\n**Scope:** `suppliers:read`","parameters":[{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"description":"Search: name, contact, phone, email, website.","schema":{"type":"string","maxLength":200}},{"name":"marketplaceId","in":"query","required":false,"description":"Suppliers of this marketplace; `none` = without one.","schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"none"}]}},{"name":"updatedSince","in":"query","required":false,"description":"Only items changed at or after this instant (ISO-8601). Sync loop: remember the largest `updatedAt` you saw and pass it next time.","schema":{"type":"string","format":"date-time"}},{"name":"sort","in":"query","required":false,"description":"Use updatedAt:asc with updatedSince to sync.","schema":{"default":"updatedAt:desc","type":"string","enum":["updatedAt:asc","updatedAt:desc","createdAt:asc","createdAt:desc","name:asc","name:desc"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierPage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["suppliers:read"]}]},"post":{"operationId":"createSupplier","tags":["Suppliers"],"summary":"Create a supplier","description":"Send an `Idempotency-Key` header so a retry never creates a second supplier.\n\n**Scope:** `suppliers:write`\n\n**Errors:** `MARKETPLACE_NOT_FOUND`, `CUSTOM_FIELD_INVALID`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID) per operation. A retry with the same key returns the first answer instead of doing it twice. Kept 24 h.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupplierRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict, the same `Idempotency-Key` is still being processed (`IDEMPOTENCY_IN_PROGRESS`), or it already succeeded and its answer is no longer kept (`IDEMPOTENCY_ANSWER_NOT_KEPT` — read the resource instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["suppliers:write"]}]}},"/suppliers/{id}":{"get":{"operationId":"getSupplier","tags":["Suppliers"],"summary":"Get a supplier","description":"**Scope:** `suppliers:read`\n\n**Errors:** `SUPPLIER_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["suppliers:read"]}]},"patch":{"operationId":"updateSupplier","tags":["Suppliers"],"summary":"Update a supplier","description":"Partial: only the fields you send change. A new `marketplaceId` moves the supplier’s purchase invoices with it.\n\n**Scope:** `suppliers:write`\n\n**Errors:** `SUPPLIER_NOT_FOUND`, `MARKETPLACE_NOT_FOUND`, `CUSTOM_FIELD_INVALID`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupplierRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["suppliers:write"]}]}},"/currencies":{"get":{"operationId":"listCurrencies","tags":["Reference"],"summary":"List currencies","description":"The base currency and the ones the company turned on, with the latest exchange rate of each.\n\n**Scope:** any key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/custom-fields":{"get":{"operationId":"listCustomFields","tags":["Reference"],"summary":"List custom fields","description":"What the `customFields` objects of orders, customers, products, … may hold.\n\n**Scope:** any key","parameters":[{"name":"entity","in":"query","required":false,"description":"Only the fields of this entity.","schema":{"$ref":"#/components/schemas/CustomFieldEntity"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/delivery-services":{"get":{"operationId":"listDeliveryServices","tags":["Reference"],"summary":"List delivery methods","description":"`deliveryServiceId` of orders and purchases.\n\n**Scope:** any key","parameters":[{"name":"isActive","in":"query","required":false,"description":"`true` — only active methods.","schema":{"type":"string","enum":["true","false"]}},{"name":"usage","in":"query","required":false,"description":"Methods used for sales / purchases (including `both`).","schema":{"type":"string","enum":["sales","purchases"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryServiceList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/order-stages":{"get":{"operationId":"listOrderStages","tags":["Reference"],"summary":"List order stages","description":"The company’s order pipeline — `stage` of orders, `stageId` filter of GET /orders.\n\n**Scope:** any key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStageList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/order-tags":{"get":{"operationId":"listOrderTags","tags":["Reference"],"summary":"List order tags","description":"**Scope:** any key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderTagList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/payment-methods":{"get":{"operationId":"listPaymentMethods","tags":["Reference"],"summary":"List payment methods","description":"`paymentMethodId` of order payments.\n\n**Scope:** any key","parameters":[{"name":"isActive","in":"query","required":false,"description":"`true` — only active methods.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/sales-channels":{"get":{"operationId":"listSalesChannels","tags":["Reference"],"summary":"List sales channels","description":"Marketplaces and sites — `salesChannelId` of orders, `marketplace` of purchases.\n\n**Scope:** any key","parameters":[{"name":"kind","in":"query","required":false,"description":"`sales` — channels orders come from; `purchase` — where goods are bought (both include `both`).","schema":{"type":"string","enum":["sales","purchase"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesChannelList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/shops":{"get":{"operationId":"listShops","tags":["Reference"],"summary":"List shops","description":"The shops the key may use — `shopId` of orders and purchases.\n\n**Scope:** any key","parameters":[{"name":"isActive","in":"query","required":false,"description":"`true` — only active shops.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/warehouses":{"get":{"operationId":"listWarehouses","tags":["Reference"],"summary":"List warehouses","description":"Active warehouses by default — `warehouseId` of orders, purchases and stock.\n\n**Scope:** any key","parameters":[{"name":"shopId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"includeInactive","in":"query","required":false,"description":"`true` — also switched-off warehouses.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarehouseList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}},"/webhooks":{"get":{"operationId":"listWebhookEndpoints","tags":["Webhooks"],"summary":"List webhook endpoints","description":"All endpoints of the company, and the events this key may subscribe to.\n\n**Scope:** `webhooks:manage`","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]},"post":{"operationId":"createWebhookEndpoint","tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"The answer carries the signing secret — shown only once. Each delivery is a POST of JSON signed per Standard Webhooks (https://www.standardwebhooks.com): headers `webhook-id` (the event id — deduplicate on it), `webhook-timestamp` (unix seconds) and `webhook-signature: v1,<base64 HMAC-SHA256 of \"<id>.<timestamp>.<raw body>\" with the base64-decoded part of your `whsec_` secret>`. Answer 2xx within 10 s; anything else is retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h. Redirects are not followed. 30 failed attempts in a row switch the endpoint off.\n\n**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_URL_INVALID`, `WEBHOOK_EVENTS_NOT_ALLOWED`, `WEBHOOK_LIMIT`","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointRequest"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]}},"/webhooks/{id}":{"delete":{"operationId":"deleteWebhookEndpoint","tags":["Webhooks"],"summary":"Delete a webhook endpoint","description":"**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done."},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]},"patch":{"operationId":"updateWebhookEndpoint","tags":["Webhooks"],"summary":"Update a webhook endpoint","description":"Partial. `isActive: false` pauses it, `true` switches it on again (and resets the failure streak). Changing `url` / `events` is for the endpoint’s creator.\n\n**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_NOT_FOUND`, `WEBHOOK_URL_INVALID`, `WEBHOOK_EVENTS_NOT_ALLOWED`, `WEBHOOK_NOT_YOURS`, `WEBHOOK_OWNER_INACTIVE`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]}},"/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Webhooks"],"summary":"List deliveries of an endpoint","description":"Newest first, kept 30 days, with the payload sent and the last attempt’s result.\n\n**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"description":"Page number, from 1.","schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"pageSize","in":"query","required":false,"description":"Items per page, 1–100.","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"description":"pending (will be retried), succeeded, failed (gave up).","schema":{"type":"string","enum":["pending","succeeded","failed"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]}},"/webhooks/{id}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","tags":["Webhooks"],"summary":"Rotate the signing secret","description":"A new secret at once (the old one stops verifying); shown only in this answer.\n\n**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_NOT_FOUND`, `WEBHOOK_NOT_YOURS`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]}},"/webhooks/{id}/test":{"post":{"operationId":"testWebhookEndpoint","tags":["Webhooks"],"summary":"Send a test event","description":"Delivers a `ping` event now (also to a paused endpoint) and answers with the result. Never retried, not counted as a failure.\n\n**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_NOT_FOUND`","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]}},"/webhooks/deliveries/{deliveryId}/redeliver":{"post":{"operationId":"redeliverWebhook","tags":["Webhooks"],"summary":"Send a delivery again","description":"Sends the same event (same `webhook-id`) now, whatever its status, and answers with the result. Refused (409) when the endpoint’s creator lost access or the API key it was registered with was revoked / expired.\n\n**Scope:** `webhooks:manage`\n\n**Errors:** `WEBHOOK_DELIVERY_NOT_FOUND`, `WEBHOOK_OWNER_INACTIVE`, `WEBHOOK_KEY_REVOKED`","parameters":[{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Invalid request — `VALIDATION_FAILED` lists the fields in `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No, wrong, revoked or expired key (`API_KEY_MISSING`, `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`, `API_KEY_OWNER_INACTIVE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (`API_SCOPE_MISSING`), its creator’s role lost the permission (`PERMISSION_DENIED`), or the address is not allowed (`API_KEY_IP_NOT_ALLOWED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or outside the key’s shops).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (`RATE_LIMITED`): wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":["webhooks:manage"]}]}}},"webhooks":{"order.created":{"post":{"operationId":"webhookOrderCreated","tags":["Webhooks"],"summary":"order.created","description":"An order was created (in the app, a shop, a marketplace or the API).\n\n**Subscribe:** needs `orders:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"order.updated":{"post":{"operationId":"webhookOrderUpdated","tags":["Webhooks"],"summary":"order.updated","description":"An order changed (lines, delivery, payments, tags, stage, …).\n\n**Subscribe:** needs `orders:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"order.status_changed":{"post":{"operationId":"webhookOrderStatusChanged","tags":["Webhooks"],"summary":"order.status_changed","description":"The derived status of an order changed (new → ready → shipped → delivered …). Sent together with `order.updated`.\n\n**Subscribe:** needs `orders:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatusChangedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"order.stage_changed":{"post":{"operationId":"webhookOrderStageChanged","tags":["Webhooks"],"summary":"order.stage_changed","description":"An order moved to another workflow stage. Sent together with `order.updated`.\n\n**Subscribe:** needs `orders:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStageChangedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"order.deleted":{"post":{"operationId":"webhookOrderDeleted","tags":["Webhooks"],"summary":"order.deleted","description":"An order was deleted.\n\n**Subscribe:** needs `orders:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDeletedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"customer.created":{"post":{"operationId":"webhookCustomerCreated","tags":["Webhooks"],"summary":"customer.created","description":"A customer was created.\n\n**Subscribe:** needs `customers:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"customer.updated":{"post":{"operationId":"webhookCustomerUpdated","tags":["Webhooks"],"summary":"customer.updated","description":"A customer changed.\n\n**Subscribe:** needs `customers:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"customer.deleted":{"post":{"operationId":"webhookCustomerDeleted","tags":["Webhooks"],"summary":"customer.deleted","description":"A customer was deleted or merged into another one.\n\n**Subscribe:** needs `customers:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDeletedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"product.created":{"post":{"operationId":"webhookProductCreated","tags":["Webhooks"],"summary":"product.created","description":"A product (or a variant) was created.\n\n**Subscribe:** needs `catalog:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"product.updated":{"post":{"operationId":"webhookProductUpdated","tags":["Webhooks"],"summary":"product.updated","description":"A product changed (also bulk edits: one event per product).\n\n**Subscribe:** needs `catalog:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"product.deleted":{"post":{"operationId":"webhookProductDeleted","tags":["Webhooks"],"summary":"product.deleted","description":"A product was deleted.\n\n**Subscribe:** needs `catalog:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDeletedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"stock.changed":{"post":{"operationId":"webhookStockChanged","tags":["Webhooks"],"summary":"stock.changed","description":"Stock of a product changed (sales, purchases, adjustments, transfers). One event per product.\n\n**Subscribe:** needs `inventory:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockChangedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"shipment.updated":{"post":{"operationId":"webhookShipmentUpdated","tags":["Webhooks"],"summary":"shipment.updated","description":"A parcel was created, changed or got a new tracking status.\n\n**Subscribe:** needs `shipments:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"purchase.updated":{"post":{"operationId":"webhookPurchaseUpdated","tags":["Webhooks"],"summary":"purchase.updated","description":"A supplier invoice was created, changed or deleted (`data.change`).\n\n**Subscribe:** needs `purchases:read` (the creator’s role must be able to read the data).","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}},"ping":{"post":{"operationId":"webhookPing","tags":["Webhooks"],"summary":"ping","description":"Test event sent by «Надіслати тест» / POST /webhooks/{id}/test. Never retried.","parameters":[{"name":"webhook-id","in":"header","required":true,"description":"Event id (= `id` in the body). The same on every retry: deduplicate on it.","schema":{"type":"string","format":"uuid"}},{"name":"webhook-timestamp","in":"header","required":true,"description":"Unix seconds of this attempt. Refuse old ones (e.g. > 5 min) against replays.","schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,<base64 HMAC-SHA256(key, \"<webhook-id>.<webhook-timestamp>.<raw body>\")>`, key = base64-decoded part of your `whsec_…` secret (Standard Webhooks; space-separated when there are several).","schema":{"type":"string"}},{"name":"user-agent","in":"header","required":false,"schema":{"type":"string","example":"RexSeller-Webhooks/1.0"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingEvent"}}}},"responses":{"2XX":{"description":"Received. Answer within 10 s — do the work asynchronously."},"default":{"description":"Anything else (or no answer, or a redirect) is a failure: retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"rks_live_…","description":"API key from Налаштування → API. Scopes: `orders:read` (orders.read); `orders:write` (orders.create, orders.update); `orders:payments` (orders.payments); `customers:read` (customers.read); `customers:write` (customers.create, customers.update); `catalog:read` (catalog.read); `catalog:write` (catalog.create, catalog.update); `inventory:read` (inventory.read); `inventory:write` (inventory.adjust); `shipments:read` (shipments.read); `purchases:read` (purchases.read); `purchases:write` (purchases.create, purchases.update); `suppliers:read` (suppliers.read); `suppliers:write` (suppliers.create, suppliers.update); `profit:read` (reports.profit); `webhooks:manage` (settings.api)."}},"schemas":{"Account":{"type":"object","properties":{"company":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"baseCurrency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code.","example":"UAH"}},"required":["id","name","baseCurrency"]},"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"shopIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"}},{"type":"null"}],"description":"Shops the key works in; null = all shops of the company."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]}},"required":["id","name","scopes","shopIds","expiresAt"]},"actingAs":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"}},"required":["id","name"],"description":"The member the key acts for (who created it)."},"rateLimit":{"type":"object","properties":{"perKeyPerMinute":{"type":"integer"},"perCompanyPerMinute":{"type":"integer"}},"required":["perKeyPerMinute","perCompanyPerMinute"]}},"required":["company","key","actingAs","rateLimit"]},"CancelOrderRequest":{"type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}},"Carrier":{"type":"string","enum":["nova_poshta","ukrposhta","meest"],"description":"The carrier: nova_poshta (Нова Пошта), ukrposhta (Укрпошта), meest (Meest)."},"Category":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"parentId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"name":{"type":"string"},"position":{"type":"integer","description":"Order among its siblings."},"depth":{"type":"integer","description":"0 = top level."},"productsCount":{"type":"integer","description":"Products directly in it (variants count once, with their product)."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","parentId","name","position","depth","productsCount","createdAt","updatedAt"]},"CategoryList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}},"required":["items"],"description":"Every category, in tree order: a parent first, then its children by position."},"CreateCustomerRequest":{"type":"object","properties":{"type":{"description":"Default: person.","$ref":"#/components/schemas/CustomerType"},"name":{"type":"string","minLength":1,"maxLength":300},"phone":{"description":"Any common format; stored as E.164. A phone another customer has → 409 CUSTOMER_PHONE_TAKEN.","example":"+380671234567","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"instagram":{"description":"Handle or profile link.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"telegram":{"description":"Username, link or phone.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"requiresSalesInvoice":{"type":"boolean"},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"customFields":{"description":"Values by key (see GET /custom-fields); keys you leave out keep their values on update.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"color":"red"}}},"required":["name"]},"CreateOrderRequest":{"type":"object","properties":{"shopId":{"description":"Default: the company’s first shop the key may use.","type":"string","format":"uuid"},"customerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"customer":{"description":"Customer by phone when you don’t know its id. Neither → the walk-in customer.","anyOf":[{"$ref":"#/components/schemas/OrderCustomerInput"},{"type":"null"}]},"salesChannelId":{"description":"Sales channel (GET /sales-channels).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"orderDate":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"deliveryServiceId":{"description":"GET /delivery-services.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"delivery":{"anyOf":[{"$ref":"#/components/schemas/OrderDeliveryInput"},{"type":"null"}]},"trackingNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"paymentMethod":{"anyOf":[{"$ref":"#/components/schemas/PaymentKind"},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"packingNote":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tags":{"description":"Tag names; unknown ones are added to the company’s tags.","maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"discount":{"description":"Order-level absolute discount.","example":"1250.00","type":["string","number"]},"deliveryCharge":{"anyOf":[{"description":"Amount: a decimal string (\"1250.00\") or a number with up to 2 decimals.","example":"1250.00","type":["string","number"]},{"type":"null"}]},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/OrderItemInput"}},"payments":{"description":"Payments already received (needs the `orders:payments` scope).","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/OrderPaymentInput"}},"allowBackorder":{"description":"Reserve beyond stock (pre-order) instead of failing with INSUFFICIENT_STOCK (when selling beyond stock is off in the company).","type":"boolean"}},"required":["items"]},"CreateProductRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"categoryId":{"description":"GET /categories.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"type":{"description":"Default: goods.","$ref":"#/components/schemas/ProductType"},"unit":{"description":"A unit code of the company (default шт; 400 UNIT_NOT_FOUND otherwise).","type":"string","minLength":1,"maxLength":16},"barcode":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"uktzed":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"price":{"description":"Default sale price.","anyOf":[{"description":"Amount: a non-negative decimal string (\"1250.00\") or a number with up to 2 decimals.","example":"1250.00","type":["string","number"]},{"type":"null"}]},"weightKg":{"anyOf":[{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]},{"type":"null"}]},"warrantyMonths":{"anyOf":[{"type":"integer","minimum":0,"maximum":1200},{"type":"null"}]},"trackInventory":{"description":"Goods: count stock (default true).","type":"boolean"},"isActive":{"description":"false = archive the product (there is no DELETE).","type":"boolean"},"customFields":{"description":"Values by key (GET /custom-fields); keys you leave out keep their values on update.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"color":"red"}},"components":{"description":"A kit: its goods (at least one; replaces the whole list).","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/KitComponentInput"}},"portions":{"description":"A product sold by measure (кг / л / м): portion amounts in its unit; replaces the list.","maxItems":10,"type":"array","items":{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]}},"listings":{"description":"Per-shop name / SKU / link / price. Replaces the listings of the shops the key may use; other shops’ listings are kept.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/ProductListingInput"}},"variantOptions":{"description":"Goods only: make a product with variants.","maxItems":3,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"Колір"},"values":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}}},"required":["name","values"]}},"variants":{"description":"The variants (combinations of the option values).","maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/ProductVariantInput"}}},"required":["name"]},"CreatePurchaseRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300,"description":"Short name, e.g. the supplier’s order number."},"shopId":{"description":"The shop the purchase is for; null / omitted = the whole company.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"supplierId":{"description":"GET /suppliers.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"warehouseId":{"description":"Where the goods arrive; default: the shop’s / company’s default warehouse.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"currency":{"description":"Invoice currency (GET /currencies); default: the company’s base currency.","type":"string","minLength":3,"maxLength":3},"purchaseDate":{"description":"Default: today.","type":"string","format":"date","example":"2026-11-15"},"shippedDate":{"description":"The supplier shipped it → in_transit.","anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"receivedDate":{"description":"Already received → the goods are in stock at once.","anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"trackingNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"deliveryServiceId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"deliveryCostMode":{"description":"Default per_lot.","type":"string","enum":["per_lot","total_by_price","total_by_weight"]},"deliveryCostTotal":{"description":"Invoice-level delivery (total_by_price / total_by_weight).","example":"12.50","type":["string","number"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"items":{"minItems":1,"maxItems":1000,"type":"array","items":{"$ref":"#/components/schemas/PurchaseItemInput"}}},"required":["title","items"],"description":"Payments are recorded in the app («Закупівлі»)."},"CreateSupplierRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"marketplaceId":{"description":"A marketplace of the company (400 MARKETPLACE_NOT_FOUND otherwise).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"website":{"description":"http(s) address or a bare host; other schemes are refused.","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"description":"Any common format; stored as E.164.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"iban":{"anyOf":[{"type":"string","maxLength":34},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"customFields":{"description":"Values by key (see GET /custom-fields); keys you leave out keep their values on update.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"color":"red"}}},"required":["name"]},"CreateWebhookEndpointRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/[^\\s/?#@]+(?::\\d{1,5})?(?:[/?][^\\s#]*)?$","description":"Public HTTPS URL of your receiver (no credentials, no fragment; private / local addresses are refused).","example":"https://example.com/hooks/rex"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"maxItems":14,"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}}},"required":["url","events"]},"Currency":{"type":"object","properties":{"code":{"type":"string","minLength":3,"maxLength":3,"example":"USD"},"name":{"type":"string","description":"In the language of `Accept-Language`."},"symbol":{"type":"string"},"decimals":{"type":"integer"},"isBase":{"type":"boolean","description":"The company’s base currency (amounts marked “base currency” are in it)."},"rate":{"description":"Latest rate: base-currency units per 1 unit of this currency (\"1\" for the base one); null when none is known.","example":"41.2500","type":["string","null"]},"rateDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"rateSource":{"anyOf":[{"type":"string","enum":["nbu","manual","base"]},{"type":"null"}],"description":"nbu (the National Bank’s official rate), manual (set by the company), base."}},"required":["code","name","symbol","decimals","isBase","rate","rateDate","rateSource"],"description":"A currency the company uses."},"CurrencyList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Currency"}}},"required":["items"],"description":"The company’s currencies, the base one first, with their latest rates. The whole list (no paging)."},"Customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"$ref":"#/components/schemas/CustomerType"},"name":{"type":"string"},"phone":{"description":"E.164 (`+380671234567`). Unique in the company.","example":"+380671234567","type":["string","null"]},"email":{"type":["string","null"]},"instagram":{"description":"Instagram handle, without `@`.","type":["string","null"]},"telegram":{"description":"Telegram username (without `@`) or phone.","type":["string","null"]},"taxId":{"description":"РНОКПП / ЄДРПОУ.","type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"notes":{"type":["string","null"]},"requiresSalesInvoice":{"type":"boolean","description":"«Потрібна видаткова накладна»: packing prints a delivery note with every order."},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"isRetail":{"type":"boolean","description":"The company’s walk-in customer («Роздрібний покупець») — orders without a customer go to it."},"stats":{"anyOf":[{"$ref":"#/components/schemas/CustomerStats"},{"type":"null"}],"description":"null for a key limited to some shops (the numbers span all shops)."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","type","name","phone","email","instagram","telegram","taxId","address","city","notes","requiresSalesInvoice","tags","customFields","isRetail","stats","createdAt","updatedAt"],"description":"A customer («Клієнт»). Customers belong to the company, not to a shop."},"CustomerCreatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"customer.created"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookCustomerData"}},"required":["id","type","createdAt","companyId","data"]},"CustomerDeletedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"customer.deleted"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookCustomerDeletedData"}},"required":["id","type","createdAt","companyId","data"]},"CustomerPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"CustomerStats":{"type":"object","properties":{"ordersCount":{"type":"integer","description":"Orders that are not cancelled."},"totalSpent":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Sum of order totals (not cancelled / returned).","example":"1250.00"},"debt":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Unpaid remainder of those orders.","example":"1250.00"},"lastOrderDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]}},"required":["ordersCount","totalSpent","debt","lastOrderDate"],"description":"Order statistics over all shops of the company."},"CustomerType":{"type":"string","enum":["person","company"],"description":"person — a private buyer; company — an organisation."},"CustomerUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"customer.updated"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookCustomerData"}},"required":["id","type","createdAt","companyId","data"]},"CustomField":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"entity":{"$ref":"#/components/schemas/CustomFieldEntity"},"key":{"type":"string","description":"The key in `customFields` of the resource.","example":"color"},"label":{"type":"string","description":"In the language of `Accept-Language`."},"type":{"type":"string","enum":["text","textarea","number","decimal","boolean","date","select","multiselect","url","email","phone"]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"description":"Allowed values of select / multiselect fields."},"required":{"type":"boolean"},"defaultValue":{"description":"Used when a new record doesn’t give the field; null = none."},"position":{"type":"integer"}},"required":["id","entity","key","label","type","options","required","defaultValue","position"],"description":"A custom field («Додаткові поля») defined by the company."},"CustomFieldEntity":{"type":"string","enum":["customer","supplier","product","order","purchase_invoice","expense","shop"],"description":"What the field belongs to."},"CustomFieldList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}}},"required":["items"],"description":"Active custom fields by entity and position. The whole list (no paging)."},"DeliverOrderRequest":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"}}},"DeliveryService":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"provider":{"type":"string","enum":["nova_poshta","ukrposhta","meest","pickup","courier","other"],"description":"nova_poshta, ukrposhta, meest, pickup, courier, other."},"systemKey":{"anyOf":[{"type":"string","enum":["nova_poshta","ukrposhta","meest","pickup"]},{"type":"null"}],"description":"Set for the four predefined methods (nova_poshta, ukrposhta, meest, pickup)."},"usage":{"type":"string","enum":["sales","purchases","both"],"description":"sales, purchases or both."},"carrierAccountId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The connected carrier account waybills are created with."},"description":{"type":["string","null"]},"website":{"type":["string","null"]},"isActive":{"type":"boolean"},"position":{"type":"integer"}},"required":["id","name","provider","systemKey","usage","carrierAccountId","description","website","isActive","position"],"description":"A delivery method («Способи доставки») — `deliveryServiceId` of orders and purchases."},"DeliveryServiceList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryService"}}},"required":["items"],"description":"Delivery methods in display order. The whole list (no paging)."},"Error":{"type":"object","properties":{"statusCode":{"type":"integer","example":404},"code":{"type":"string","description":"Stable machine-readable code — branch on this, not on `message`.","example":"ORDER_NOT_FOUND"},"message":{"type":"string","description":"Human-readable, in the language of `Accept-Language` (uk, en, ru).","example":"Order not found"},"details":{"description":"Extra data of some codes, e.g. the fields of VALIDATION_FAILED: `[{ path, code, message }]`."}},"required":["statusCode","code","message"]},"KitComponent":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"sku":{"type":["string","null"]},"unit":{"type":"string"},"qty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Units per ONE kit.","example":"2"}},"required":["productId","name","sku","unit","qty"]},"KitComponentInput":{"type":"object","properties":{"productId":{"type":"string","format":"uuid"},"qty":{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]}},"required":["productId","qty"]},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Order number in the company («00045»).","example":"00045"},"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"warehouseId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"payeeId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"«Отримувач оплати» — who the order is invoiced by."},"status":{"$ref":"#/components/schemas/OrderStatus"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"shipmentStatus":{"$ref":"#/components/schemas/ShipmentStatus"},"stage":{"anyOf":[{"$ref":"#/components/schemas/OrderStage"},{"type":"null"}]},"source":{"$ref":"#/components/schemas/OrderSource"},"salesChannel":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}],"description":"Sales channel (marketplace / site) the order belongs to."},"externalId":{"description":"The order’s id in your system / the site it came from.","type":["string","null"]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"]},{"type":"null"}]},"orderDate":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"paidDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"shippedDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"deliveredDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"$ref":"#/components/schemas/PaymentKind"},{"type":"null"}],"description":"Expected way of payment (e.g. cod). Actual payments are in `payments`."},"deliveryService":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"delivery":{"anyOf":[{"$ref":"#/components/schemas/OrderDelivery"},{"type":"null"}]},"trackingNumber":{"description":"Waybill (ТТН) number.","type":["string","null"]},"comment":{"type":["string","null"]},"packingNote":{"description":"«Коментар для комплектації» — what the packer sees.","type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code.","example":"UAH"},"subtotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"discount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"deliveryCharge":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Delivery charged to the customer (in `total`); null = the customer pays the carrier."},"total":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"paidTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"refundedTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"remaining":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"total − payments.","example":"1250.00"},"costTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost of goods (FIFO). null without the `profit:read` scope."},"profit":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"total − cost − order expenses. null without `profit:read`."},"assignedUser":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"invoiceSentAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/OrderPayment"}},"cancelReason":{"type":["string","null"]},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]}},"required":["id","number","shopId","warehouseId","payeeId","status","paymentStatus","shipmentStatus","stage","source","salesChannel","externalId","customer","orderDate","paidDate","shippedDate","deliveredDate","paymentMethod","deliveryService","delivery","trackingNumber","comment","packingNote","tags","currency","subtotal","discount","deliveryCharge","total","paidTotal","refundedTotal","remaining","costTotal","profit","assignedUser","customFields","invoiceSentAt","createdAt","updatedAt","items","payments","cancelReason","cancelledAt"]},"OrderCreatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"order.created"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookOrderData"}},"required":["id","type","createdAt","companyId","data"]},"OrderCustomerInput":{"type":"object","properties":{"phone":{"type":"string","minLength":5,"maxLength":40,"description":"Customers are matched by phone: an existing one is reused, otherwise created.","example":"+380671234567"},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["phone"]},"OrderDeletedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"order.deleted"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookOrderDeletedData"}},"required":["id","type","createdAt","companyId","data"]},"OrderDelivery":{"type":"object","properties":{"service":{"description":"Carrier key: nova_poshta, ukrposhta, meest, pickup, courier, other.","type":["string","null"]},"deliveryType":{"description":"warehouse (branch / postomat) or address (courier).","type":["string","null"]},"cityName":{"type":["string","null"]},"cityRef":{"description":"Carrier city reference (Nova Poshta CityRef, …).","type":["string","null"]},"area":{"description":"Область.","type":["string","null"]},"district":{"description":"Район.","type":["string","null"]},"warehouseName":{"type":["string","null"]},"warehouseRef":{"type":["string","null"]},"postcode":{"type":["string","null"]},"street":{"type":["string","null"]},"house":{"type":["string","null"]},"flat":{"type":["string","null"]},"address":{"description":"Free-text address line.","type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientPhone":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientEdrpou":{"type":["string","null"]},"desiredDate":{"type":["string","null"]},"desiredTime":{"type":["string","null"]},"comment":{"type":["string","null"]}},"description":"Delivery details of the order. Unknown keys are ignored."},"OrderDeliveryInput":{"type":"object","properties":{"service":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"deliveryType":{"anyOf":[{"type":"string","enum":["warehouse","address"]},{"type":"null"}]},"cityName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"cityRef":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"area":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"district":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"warehouseName":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"warehouseRef":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"street":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"house":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"flat":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"recipientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"recipientPhone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"recipientCompany":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"recipientEdrpou":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}]},"desiredDate":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"desiredTime":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"OrderExpandedPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of orders with their lines and payments (`expand=items`)."},"OrderItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"productId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Catalog product; null for a free-text line."},"sku":{"type":["string","null"]},"name":{"type":"string","description":"The name the buyer sees (documents, receipts)."},"unit":{"type":["string","null"]},"qty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"unitPrice":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"discount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Line discount amount.","example":"1250.00"},"total":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"qty × unitPrice − discount.","example":"1250.00"},"unitCost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost per unit (FIFO). null without the `profit:read` scope."},"qtyReturned":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"stockState":{"type":"string","description":"available, expected (on an incoming purchase), short (no stock), consumed (shipped), untracked."}},"required":["id","productId","sku","name","unit","qty","unitPrice","discount","total","unitCost","qtyReturned","stockState"]},"OrderItemInput":{"type":"object","properties":{"productId":{"description":"Catalog product. Omit for a free-text line (then `name` is required).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sku":{"description":"Find the product by SKU instead of `productId`.","type":"string","minLength":1,"maxLength":100},"name":{"description":"Line name; defaults to the product’s name in the shop.","type":"string","maxLength":300},"qty":{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]},"unitPrice":{"description":"Defaults to the product’s price in the shop.","example":"1250.00","type":["string","number"]},"discount":{"description":"Absolute line discount.","example":"1250.00","type":["string","number"]}},"required":["qty"]},"OrderPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderSummary"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"OrderPayment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"date":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"amount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Negative = refund.","example":"1250.00"},"method":{"anyOf":[{"$ref":"#/components/schemas/PaymentKind"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}],"description":"The company payment method."},"comment":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","date","amount","method","paymentMethod","comment","createdAt"]},"OrderPaymentInput":{"type":"object","properties":{"amount":{"description":"Negative = refund.","example":"1250.00","type":["string","number"]},"date":{"description":"Default: today.","type":"string","format":"date","example":"2026-11-15"},"paymentMethodId":{"description":"Company payment method (GET /payment-methods).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"method":{"description":"Or a kind: the first active method of that kind is used.","anyOf":[{"$ref":"#/components/schemas/PaymentKind"},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["amount"]},"OrderSource":{"type":"string","enum":["manual","marketplace","ai","api","storefront"],"description":"Where the order came from. Orders created through this API are `api`."},"OrderStage":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"category":{"type":"string","description":"new, in_progress, done or cancelled."},"systemKey":{"description":"A built-in stage every company has (new, shipped, delivered, completed, cancelled, returned); null for your own stages.","type":["string","null"]}},"required":["id","name","category","systemKey"],"description":"Workflow stage («Етап»): the company’s own pipeline (GET /order-stages)."},"OrderStageChangedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"order.stage_changed"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookOrderStageData"}},"required":["id","type","createdAt","companyId","data"]},"OrderStatus":{"type":"string","enum":["new","awaiting_stock","ready","shipped","delivered","completed","cancelled","returned"],"description":"Derived from the facts (stock, payments, shipment) — not set directly. new → awaiting_stock / ready → shipped → delivered → completed; or cancelled / returned."},"OrderStatusChangedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"order.status_changed"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookOrderStatusData"}},"required":["id","type","createdAt","companyId","data"]},"OrderSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Order number in the company («00045»).","example":"00045"},"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"warehouseId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"payeeId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"«Отримувач оплати» — who the order is invoiced by."},"status":{"$ref":"#/components/schemas/OrderStatus"},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"shipmentStatus":{"$ref":"#/components/schemas/ShipmentStatus"},"stage":{"anyOf":[{"$ref":"#/components/schemas/OrderStage"},{"type":"null"}]},"source":{"$ref":"#/components/schemas/OrderSource"},"salesChannel":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}],"description":"Sales channel (marketplace / site) the order belongs to."},"externalId":{"description":"The order’s id in your system / the site it came from.","type":["string","null"]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"]},{"type":"null"}]},"orderDate":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"paidDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"shippedDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"deliveredDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"$ref":"#/components/schemas/PaymentKind"},{"type":"null"}],"description":"Expected way of payment (e.g. cod). Actual payments are in `payments`."},"deliveryService":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"delivery":{"anyOf":[{"$ref":"#/components/schemas/OrderDelivery"},{"type":"null"}]},"trackingNumber":{"description":"Waybill (ТТН) number.","type":["string","null"]},"comment":{"type":["string","null"]},"packingNote":{"description":"«Коментар для комплектації» — what the packer sees.","type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code.","example":"UAH"},"subtotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"discount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"deliveryCharge":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Delivery charged to the customer (in `total`); null = the customer pays the carrier."},"total":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"paidTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"refundedTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"remaining":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"total − payments.","example":"1250.00"},"costTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost of goods (FIFO). null without the `profit:read` scope."},"profit":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"total − cost − order expenses. null without `profit:read`."},"assignedUser":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"invoiceSentAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","number","shopId","warehouseId","payeeId","status","paymentStatus","shipmentStatus","stage","source","salesChannel","externalId","customer","orderDate","paidDate","shippedDate","deliveredDate","paymentMethod","deliveryService","delivery","trackingNumber","comment","packingNote","tags","currency","subtotal","discount","deliveryCharge","total","paidTotal","refundedTotal","remaining","costTotal","profit","assignedUser","customFields","invoiceSentAt","createdAt","updatedAt"],"description":"An order as lists return it (no lines)."},"OrderTag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","slate","blue","sky","indigo","brand","purple","pink","success","warning","orange","error"]},"position":{"type":"integer"}},"required":["id","name","color","position"],"description":"An order tag («Теги»). Orders carry tag names; unknown names sent with an order are added here."},"OrderTagList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderTag"}}},"required":["items"],"description":"Order tags in display order. The whole list (no paging)."},"OrderTransition":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"label":{"type":"string","description":"Button text in the app («Відправити»)."},"toStage":{"$ref":"#/components/schemas/OrderStage"},"requireComment":{"type":"boolean"},"allowed":{"type":"boolean","description":"The key’s creator may take it (role rules of the workflow)."},"blockers":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"]},"description":"Unmet rules — the move is refused while any is present."}},"required":["id","label","toStage","requireComment","allowed","blockers"]},"OrderTransitions":{"type":"object","properties":{"stage":{"anyOf":[{"$ref":"#/components/schemas/OrderStage"},{"type":"null"}]},"transitions":{"type":"array","items":{"$ref":"#/components/schemas/OrderTransition"}}},"required":["stage","transitions"]},"OrderUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"order.updated"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookOrderData"}},"required":["id","type","createdAt","companyId","data"]},"PaymentKind":{"type":"string","enum":["cash","card","cod","bank_transfer","monobank","privatbank","liqpay","wayforpay","marketplace","other"],"description":"Kind of a payment method. Company methods (GET /payment-methods) each have one."},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/PaymentKind"},"payeeId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The «Отримувач оплати» it belongs to; null = shared."},"isActive":{"type":"boolean"},"position":{"type":"integer"}},"required":["id","name","kind","payeeId","isActive","position"],"description":"A company payment method («Способи оплати») — `paymentMethodId` of order payments."},"PaymentMethodList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}}},"required":["items"],"description":"Payment methods in display order. The whole list (no paging)."},"PaymentStatus":{"type":"string","enum":["unpaid","partial","paid","refunded"]},"PingEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"ping"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookPingData"}},"required":["id","type","createdAt","companyId","data"]},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"sku":{"description":"Internal code, unique in the company.","type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/ProductType"},"unit":{"type":"string","description":"Unit code (шт, кг, л, м, …).","example":"шт"},"barcode":{"type":["string","null"]},"uktzed":{"description":"УКТ ЗЕД code.","type":["string","null"]},"price":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Default sale price (a shop may have its own: `listings`). A variant with null sells at its product’s price."},"weightKg":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},{"type":"null"}],"example":"0.350"},"warrantyMonths":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trackInventory":{"type":"boolean","description":"Goods whose stock is counted (false = sold without stock)."},"isActive":{"type":"boolean","description":"false = archived: not offered in new orders."},"category":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"images":{"type":"array","items":{"$ref":"#/components/schemas/ProductImage"}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"variantOptions":{"type":"array","items":{"$ref":"#/components/schemas/VariantOption"},"description":"A product with variants: its options. Such a product is not sold itself — its variants are. Empty otherwise."},"variantCount":{"type":"integer","description":"A product with variants: how many it has; 0 otherwise."},"variantParentId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Set on a variant: its product."},"variantValues":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Set on a variant: its option values.","example":{"Колір":"Чорний"}},"portions":{"type":"array","items":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"description":"«Фасування» of a product sold by measure (кг / л / м): portion amounts in the product unit, smallest first.","example":["0.3","1"]},"unitCost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost per unit (base currency, FIFO): the next unit to be sold from stock, else the last purchase cost. null without the `profit:read` scope or when the product was never stocked."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"categoryPath":{"type":"array","items":{"$ref":"#/components/schemas/Ref"},"description":"Category root → leaf."},"listings":{"type":"array","items":{"$ref":"#/components/schemas/ProductListing"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariant"},"description":"A product with variants: its variants in option order; empty otherwise."},"components":{"type":"array","items":{"$ref":"#/components/schemas/KitComponent"},"description":"A kit: its goods; empty otherwise."}},"required":["id","sku","name","description","type","unit","barcode","uktzed","price","weightKg","warrantyMonths","trackInventory","isActive","category","images","customFields","variantOptions","variantCount","variantParentId","variantValues","portions","unitCost","createdAt","updatedAt","categoryPath","listings","variants","components"]},"ProductCreatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"product.created"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookProductData"}},"required":["id","type","createdAt","companyId","data"]},"ProductDeletedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"product.deleted"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookProductData"}},"required":["id","type","createdAt","companyId","data"]},"ProductImage":{"type":"object","properties":{"fileId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"position":{"type":"integer"}},"required":["fileId","position"],"description":"A photo (an uploaded file of the company; the first is the main one)."},"ProductListing":{"type":"object","properties":{"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"shopName":{"type":"string"},"name":{"description":"Name in that shop (what its buyers see); null = the catalog name.","type":["string","null"]},"sku":{"description":"SKU in that shop — matches the shop’s incoming orders.","type":["string","null"]},"url":{"description":"The product page in that shop.","type":["string","null"]},"price":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Price in that shop; null = the default price."},"hidden":{"type":"boolean","description":"«Рекс.Магазин» shop: the product is not shown in the store."}},"required":["shopId","shopName","name","sku","url","price","hidden"],"description":"The product in one of the company’s shops («Магазини»). Only the shops the key may use are listed."},"ProductListingInput":{"type":"object","properties":{"shopId":{"type":"string","format":"uuid","description":"A shop the key may use (403 SHOP_ACCESS_DENIED otherwise)."},"name":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"url":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"price":{"anyOf":[{"description":"Amount: a non-negative decimal string (\"1250.00\") or a number with up to 2 decimals.","example":"1250.00","type":["string","number"]},{"type":"null"}]},"hidden":{"type":"boolean"}},"required":["shopId"],"description":"Empty fields fall back to the catalog; an all-empty row = no listing in that shop."},"ProductPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductSummary"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"ProductSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"sku":{"description":"Internal code, unique in the company.","type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/ProductType"},"unit":{"type":"string","description":"Unit code (шт, кг, л, м, …).","example":"шт"},"barcode":{"type":["string","null"]},"uktzed":{"description":"УКТ ЗЕД code.","type":["string","null"]},"price":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Default sale price (a shop may have its own: `listings`). A variant with null sells at its product’s price."},"weightKg":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},{"type":"null"}],"example":"0.350"},"warrantyMonths":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trackInventory":{"type":"boolean","description":"Goods whose stock is counted (false = sold without stock)."},"isActive":{"type":"boolean","description":"false = archived: not offered in new orders."},"category":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"images":{"type":"array","items":{"$ref":"#/components/schemas/ProductImage"}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"variantOptions":{"type":"array","items":{"$ref":"#/components/schemas/VariantOption"},"description":"A product with variants: its options. Such a product is not sold itself — its variants are. Empty otherwise."},"variantCount":{"type":"integer","description":"A product with variants: how many it has; 0 otherwise."},"variantParentId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Set on a variant: its product."},"variantValues":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Set on a variant: its option values.","example":{"Колір":"Чорний"}},"portions":{"type":"array","items":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"description":"«Фасування» of a product sold by measure (кг / л / м): portion amounts in the product unit, smallest first.","example":["0.3","1"]},"unitCost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost per unit (base currency, FIFO): the next unit to be sold from stock, else the last purchase cost. null without the `profit:read` scope or when the product was never stocked."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","sku","name","description","type","unit","barcode","uktzed","price","weightKg","warrantyMonths","trackInventory","isActive","category","images","customFields","variantOptions","variantCount","variantParentId","variantValues","portions","unitCost","createdAt","updatedAt"],"description":"A product as lists return it."},"ProductType":{"type":"string","enum":["goods","service","kit"],"description":"goods — stock-tracked; service — no stock; kit — a set of goods sold as one (its stock is its components’ stock)."},"ProductUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"product.updated"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookProductData"}},"required":["id","type","createdAt","companyId","data"]},"ProductVariant":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string","example":"Сумка Mini — Чорний"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"sku":{"type":["string","null"]},"barcode":{"type":["string","null"]},"price":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Own price; null = the product’s."},"weightKg":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},{"type":"null"}]},"isActive":{"type":"boolean"}},"required":["id","name","values","sku","barcode","price","weightKg","isActive"],"description":"A variant (also a product of its own: GET /products/{id} with its id; stock and orders refer to it)."},"ProductVariantInput":{"type":"object","properties":{"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1,"maxLength":60},"description":"One value of every option.","example":{"Колір":"Чорний"}},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"barcode":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"price":{"description":"Own price; omit for the product’s.","anyOf":[{"description":"Amount: a non-negative decimal string (\"1250.00\") or a number with up to 2 decimals.","example":"1250.00","type":["string","number"]},{"type":"null"}]},"weightKg":{"anyOf":[{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]},{"type":"null"}]},"isActive":{"type":"boolean"}},"required":["values"]},"Purchase":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Invoice number in the company."},"title":{"type":"string"},"shopId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"null = the whole company."},"supplier":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"marketplace":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}],"description":"Where it was bought (GET /sales-channels)."},"warehouseId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Where the goods arrive (GET /warehouses)."},"deliveryServiceId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"GET /delivery-services."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code.","example":"UAH"},"purchaseDate":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"paidDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"shippedDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"trackingNumber":{"description":"The supplier’s tracking number.","type":["string","null"]},"status":{"$ref":"#/components/schemas/PurchaseStatus"},"specialStatus":{"anyOf":[{"$ref":"#/components/schemas/PurchaseSpecialStatus"},{"type":"null"}]},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"deliveryCostMode":{"type":"string","enum":["per_lot","total_by_price","total_by_weight"],"description":"per_lot (delivery given per line), total_by_price / total_by_weight (one sum split over the lines)."},"goodsTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Invoice currency.","example":"1250.00"},"deliveryTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"total":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"paidTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"remaining":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"paidActualBase":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Actually paid, base currency."},"costBase":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Landed cost of all lines, base currency.","example":"1250.00"},"itemsCount":{"type":"integer"},"totalQty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"daysInTransit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"transitAlert":{"anyOf":[{"type":"string","enum":["warning","critical"]},{"type":"null"}],"description":"In transit too long (the company’s «Закупівлі» settings)."},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"description":{"type":["string","null"]},"deliveryCostTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Invoice-level delivery (total_by_* modes), invoice currency.","example":"1250.00"},"rateAtPurchase":{"description":"Exchange rate (base per 1 unit of the invoice currency) on the purchase date.","type":["string","null"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseItem"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/PurchasePayment"}}},"required":["id","number","title","shopId","supplier","marketplace","warehouseId","deliveryServiceId","currency","purchaseDate","paidDate","shippedDate","receivedDate","trackingNumber","status","specialStatus","paymentStatus","deliveryCostMode","goodsTotal","deliveryTotal","total","paidTotal","remaining","paidActualBase","costBase","itemsCount","totalQty","daysInTransit","transitAlert","customFields","createdAt","updatedAt","description","deliveryCostTotal","rateAtPurchase","items","payments"],"description":"A purchase invoice («Закупівля»): goods bought from a supplier; its lines become stock lots when received. Purchase prices and landed cost are part of the purchase and come with `purchases:read` (as in the app) — `profit:read` is not needed here."},"PurchaseItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"position":{"type":"integer"},"productId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"sku":{"description":"The catalog product’s SKU.","type":["string","null"]},"name":{"type":"string"},"unit":{"type":"string"},"originalName":{"description":"The name in the supplier’s invoice.","type":["string","null"]},"supplierSku":{"type":["string","null"]},"url":{"description":"Link to the product at the supplier.","type":["string","null"]},"lotsQty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Lots (packs) bought.","example":"2"},"itemsPerLot":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Units in one lot.","example":"2"},"totalQty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"lotsQty × itemsPerLot — units that come into stock.","example":"2"},"weightTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},{"type":"null"}],"description":"kg"},"lotPrice":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Price of one lot, invoice currency.","example":"1250.00"},"unitPrice":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Price of one unit, invoice currency.","example":"1250.00"},"lotDelivery":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Delivery of one lot (deliveryCostMode per_lot), invoice currency."},"goodsTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"deliveryTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"total":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"landedUnitCost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost of one unit with its share of delivery, BASE currency — the cost the stock lot gets."},"landedTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Base currency.","example":"1250.00"},"costIsFinal":{"type":"boolean","description":"false while the cost is estimated at today’s rate (not paid yet)."},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"stock":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["expected","available","lost"],"description":"expected (not received yet), available (in stock), lost."},"remaining":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"reserved":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"out":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Already sold / written off.","example":"2"}},"required":["status","remaining","reserved","out"]},{"type":"null"}],"description":"The stock lot of this line."}},"required":["id","position","productId","sku","name","unit","originalName","supplierSku","url","lotsQty","itemsPerLot","totalQty","weightTotal","lotPrice","unitPrice","lotDelivery","goodsTotal","deliveryTotal","total","landedUnitCost","landedTotal","costIsFinal","paymentStatus","stock"],"description":"A line of the purchase invoice = a stock lot."},"PurchaseItemInput":{"type":"object","properties":{"productId":{"description":"Catalog product (a variant, not a product with variants; not a kit).","type":"string","format":"uuid"},"sku":{"description":"Or find the product by SKU.","type":"string","minLength":1,"maxLength":100},"name":{"description":"Line name; defaults to the product’s name.","type":"string","maxLength":500},"originalName":{"description":"The name in the supplier’s invoice.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"supplierSku":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"url":{"description":"Where the line was bought: http(s) address or a bare host; other schemes are refused.","anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"lotsQty":{"description":"Lots (packs) bought.","example":"2","type":["string","number"]},"itemsPerLot":{"description":"Units in one lot; default 1. Stock gets lotsQty × itemsPerLot units.","example":"2","type":["string","number"]},"lotPrice":{"description":"Price of one lot, invoice currency.","example":"12.50","type":["string","number"]},"lotDelivery":{"description":"Delivery of one lot (deliveryCostMode per_lot).","anyOf":[{"description":"Amount: a decimal string (\"12.3456\") or a number, up to 4 decimals, in the invoice currency.","example":"12.50","type":["string","number"]},{"type":"null"}]},"weightTotal":{"description":"Line weight, kg (deliveryCostMode total_by_weight).","anyOf":[{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]},{"type":"null"}]}},"required":["lotsQty","lotPrice"],"description":"Give `productId` or `sku`."},"PurchasePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseSummary"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"PurchasePayment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"date":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"amount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Invoice currency.","example":"1250.00"},"amountBase":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Actually paid, base currency.","example":"1250.00"},"comment":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","date","amount","amountBase","comment","createdAt"]},"PurchaseSpecialStatus":{"type":"string","enum":["refund_requested","refunded_not_received","lost"],"description":"A problem with the purchase: refund_requested, refunded_not_received (goods won’t come), lost."},"PurchaseStatus":{"type":"string","enum":["awaiting_payment","awaiting_shipment","in_transit","received"],"description":"Derived from the dates — not set directly: awaiting_payment → awaiting_shipment (paid) → in_transit (shipped) → received (goods in stock)."},"PurchaseSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Invoice number in the company."},"title":{"type":"string"},"shopId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"null = the whole company."},"supplier":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}]},"marketplace":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}],"description":"Where it was bought (GET /sales-channels)."},"warehouseId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Where the goods arrive (GET /warehouses)."},"deliveryServiceId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"GET /delivery-services."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code.","example":"UAH"},"purchaseDate":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"paidDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"shippedDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"trackingNumber":{"description":"The supplier’s tracking number.","type":["string","null"]},"status":{"$ref":"#/components/schemas/PurchaseStatus"},"specialStatus":{"anyOf":[{"$ref":"#/components/schemas/PurchaseSpecialStatus"},{"type":"null"}]},"paymentStatus":{"$ref":"#/components/schemas/PaymentStatus"},"deliveryCostMode":{"type":"string","enum":["per_lot","total_by_price","total_by_weight"],"description":"per_lot (delivery given per line), total_by_price / total_by_weight (one sum split over the lines)."},"goodsTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Invoice currency.","example":"1250.00"},"deliveryTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"total":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"paidTotal":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"remaining":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},"paidActualBase":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Actually paid, base currency."},"costBase":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Landed cost of all lines, base currency.","example":"1250.00"},"itemsCount":{"type":"integer"},"totalQty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},"daysInTransit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"transitAlert":{"anyOf":[{"type":"string","enum":["warning","critical"]},{"type":"null"}],"description":"In transit too long (the company’s «Закупівлі» settings)."},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","number","title","shopId","supplier","marketplace","warehouseId","deliveryServiceId","currency","purchaseDate","paidDate","shippedDate","receivedDate","trackingNumber","status","specialStatus","paymentStatus","deliveryCostMode","goodsTotal","deliveryTotal","total","paidTotal","remaining","paidActualBase","costBase","itemsCount","totalQty","daysInTransit","transitAlert","customFields","createdAt","updatedAt"],"description":"A purchase invoice as lists return it (no lines)."},"PurchaseUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"purchase.updated"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookPurchaseData"}},"required":["id","type","createdAt","companyId","data"]},"ReceivePurchaseRequest":{"type":"object","properties":{"date":{"description":"Default: today.","type":"string","format":"date","example":"2026-11-15"}}},"Ref":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"}},"required":["id","name"],"description":"Another resource: its id and current name."},"SalesChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"kind":{"type":"string","enum":["purchase","sales","both"],"description":"sales (orders come from it), purchase (goods are bought there), both."},"type":{"type":"string","enum":["1688","prom","rozetka","epicentr","olx","kasta","allo","ebay","aliexpress","taobao","alibaba","temu","shein","amazon","own_site","instagram","telegram","tiktok","facebook","other"],"description":"The platform (prom, rozetka, olx, own site, …); other when not recognised."},"website":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","name","kind","type","website","createdAt","updatedAt"],"description":"A sales channel / marketplace («Торгові площадки») — `salesChannelId` of orders, `marketplace` of purchases."},"SalesChannelList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SalesChannel"}}},"required":["items"],"description":"Sales channels and purchase marketplaces by name. The whole list (no paging)."},"Scope":{"type":"string","enum":["orders:read","orders:write","orders:payments","customers:read","customers:write","catalog:read","catalog:write","inventory:read","inventory:write","shipments:read","purchases:read","purchases:write","suppliers:read","suppliers:write","profit:read","webhooks:manage"]},"SetOrderTagsRequest":{"type":"object","properties":{"tags":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}},"required":["tags"]},"SetStockItemInput":{"type":"object","properties":{"productId":{"type":"string","format":"uuid"},"sku":{"description":"Find the product by its internal SKU instead of `productId`.","type":"string","minLength":1,"maxLength":100},"qty":{"description":"The new on-hand quantity (absolute, not a difference).","example":"2","type":["string","number"]},"unitCost":{"description":"Cost per unit of ADDED stock (base currency). Default: the product’s latest stock cost, else 0.","example":"1250.00","type":["string","number"]}},"required":["qty"]},"SetStockRequest":{"type":"object","properties":{"warehouseId":{"description":"Default: the main warehouse of the key’s shop / company.","type":"string","format":"uuid"},"comment":{"description":"Comment of the document. Default: «Рекс.API».","anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/SetStockItemInput"}}},"required":["items"]},"SetStockResult":{"type":"object","properties":{"adjustment":{"anyOf":[{"$ref":"#/components/schemas/StockAdjustment"},{"type":"null"}],"description":"The posted document with the differences; null when every quantity already matched (nothing is posted then)."},"changed":{"type":"integer","description":"Products whose quantity changed."},"unchanged":{"type":"array","items":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"description":"Products already at the given quantity — left alone."}},"required":["adjustment","changed","unchanged"],"description":"What setting stock did. A full sync that changes nothing posts nothing."},"Shipment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"orderId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The order shipped (GET /orders/{id}); null for a stand-alone waybill."},"orderNumber":{"description":"Its number in the company («00045»).","type":["string","null"]},"carrier":{"$ref":"#/components/schemas/Carrier"},"carrierAccountId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The company’s carrier account (integration) the waybill was created with."},"trackingNumber":{"description":"Waybill (ТТН) number.","example":"20450000000000","type":["string","null"]},"status":{"$ref":"#/components/schemas/TrackingStatus"},"carrierStatusCode":{"description":"Latest status code as the carrier reports it.","type":["string","null"]},"carrierStatusText":{"description":"Latest status text as the carrier reports it.","type":["string","null"]},"cost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Delivery price the carrier charges (UAH)."},"codMode":{"type":"string","enum":["none","cod","payment_control"],"description":"none, cod (cash on delivery — «накладений платіж»), payment_control (Nova Poshta «Контроль оплати»)."},"codAmount":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Amount collected from the recipient (UAH)."},"declaredValue":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"«Оголошена вартість» (UAH)."},"weight":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},{"type":"null"}],"description":"Total weight, kg."},"parcelsCount":{"type":"integer","description":"Number of boxes («місць»)."},"serviceType":{"anyOf":[{"type":"string","enum":["warehouse","postomat","doors"]},{"type":"null"}],"description":"warehouse (branch), postomat, doors (courier to the address)."},"payer":{"anyOf":[{"type":"string","enum":["sender","recipient"]},{"type":"null"}],"description":"Who pays for delivery: sender or recipient."},"estimatedDeliveryDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"recipient":{"anyOf":[{"$ref":"#/components/schemas/ShipmentRecipient"},{"type":"null"}]},"returnTrackingNumber":{"description":"Return waybill the carrier created (refused / not collected parcels).","type":["string","null"]},"hasLabel":{"type":"boolean","description":"A printable label is stored (print it in the app)."},"lastTrackedAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}],"description":"When the status was last checked with the carrier."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"parcels":{"type":"array","items":{"$ref":"#/components/schemas/ShipmentParcel"},"description":"The boxes as sent (empty when not recorded)."},"history":{"type":"array","items":{"$ref":"#/components/schemas/ShipmentHistoryEntry"},"description":"Tracking history, oldest first (the last 50 status changes)."}},"required":["id","orderId","orderNumber","carrier","carrierAccountId","trackingNumber","status","carrierStatusCode","carrierStatusText","cost","codMode","codAmount","declaredValue","weight","parcelsCount","serviceType","payer","estimatedDeliveryDate","recipient","returnTrackingNumber","hasLabel","lastTrackedAt","createdAt","updatedAt","parcels","history"],"description":"A shipment: the waybill (ТТН) created with a carrier and its tracking."},"ShipmentHistoryEntry":{"type":"object","properties":{"at":{"type":"string","description":"When the carrier reported it (ISO-8601 as a rule)."},"status":{"$ref":"#/components/schemas/TrackingStatus"},"code":{"description":"The carrier’s own status code.","type":["string","null"]},"text":{"description":"The carrier’s own status text.","type":["string","null"]}},"required":["at","status","code","text"]},"ShipmentPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ShipmentSummary"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"ShipmentParcel":{"type":"object","properties":{"weight":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"kg","example":"2"},"length":{"type":"integer","description":"cm"},"width":{"type":"integer","description":"cm"},"height":{"type":"integer","description":"cm"}},"required":["weight","length","width","height"],"description":"One box («місце») of the waybill."},"ShipmentRecipient":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"cityName":{"type":["string","null"]},"cityRef":{"description":"Carrier city reference (Nova Poshta CityRef, Ukrposhta city id, …).","type":["string","null"]},"area":{"type":["string","null"]},"warehouseName":{"description":"Branch / postomat.","type":["string","null"]},"warehouseRef":{"type":["string","null"]},"postcode":{"type":["string","null"]},"street":{"type":["string","null"]},"house":{"type":["string","null"]},"flat":{"type":["string","null"]},"recipientType":{"description":"private or organization.","type":["string","null"]},"edrpou":{"description":"ЄДРПОУ / РНОКПП of an organization recipient.","type":["string","null"]},"companyName":{"type":["string","null"]}},"required":["name","phone","email","cityName","cityRef","area","warehouseName","warehouseRef","postcode","street","house","flat","recipientType","edrpou","companyName"],"description":"Who the parcel is addressed to, as sent to the carrier."},"ShipmentStatus":{"type":"string","enum":["not_shipped","shipped","delivered","returned"]},"ShipmentSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"orderId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The order shipped (GET /orders/{id}); null for a stand-alone waybill."},"orderNumber":{"description":"Its number in the company («00045»).","type":["string","null"]},"carrier":{"$ref":"#/components/schemas/Carrier"},"carrierAccountId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The company’s carrier account (integration) the waybill was created with."},"trackingNumber":{"description":"Waybill (ТТН) number.","example":"20450000000000","type":["string","null"]},"status":{"$ref":"#/components/schemas/TrackingStatus"},"carrierStatusCode":{"description":"Latest status code as the carrier reports it.","type":["string","null"]},"carrierStatusText":{"description":"Latest status text as the carrier reports it.","type":["string","null"]},"cost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Delivery price the carrier charges (UAH)."},"codMode":{"type":"string","enum":["none","cod","payment_control"],"description":"none, cod (cash on delivery — «накладений платіж»), payment_control (Nova Poshta «Контроль оплати»)."},"codAmount":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Amount collected from the recipient (UAH)."},"declaredValue":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"«Оголошена вартість» (UAH)."},"weight":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},{"type":"null"}],"description":"Total weight, kg."},"parcelsCount":{"type":"integer","description":"Number of boxes («місць»)."},"serviceType":{"anyOf":[{"type":"string","enum":["warehouse","postomat","doors"]},{"type":"null"}],"description":"warehouse (branch), postomat, doors (courier to the address)."},"payer":{"anyOf":[{"type":"string","enum":["sender","recipient"]},{"type":"null"}],"description":"Who pays for delivery: sender or recipient."},"estimatedDeliveryDate":{"anyOf":[{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},{"type":"null"}]},"recipient":{"anyOf":[{"$ref":"#/components/schemas/ShipmentRecipient"},{"type":"null"}]},"returnTrackingNumber":{"description":"Return waybill the carrier created (refused / not collected parcels).","type":["string","null"]},"hasLabel":{"type":"boolean","description":"A printable label is stored (print it in the app)."},"lastTrackedAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}],"description":"When the status was last checked with the carrier."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","orderId","orderNumber","carrier","carrierAccountId","trackingNumber","status","carrierStatusCode","carrierStatusText","cost","codMode","codAmount","declaredValue","weight","parcelsCount","serviceType","payer","estimatedDeliveryDate","recipient","returnTrackingNumber","hasLabel","lastTrackedAt","createdAt","updatedAt"],"description":"A shipment (waybill / ТТН) as lists return it (no history and boxes)."},"ShipmentUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"shipment.updated"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookShipmentData"}},"required":["id","type","createdAt","companyId","data"]},"ShipOrderRequest":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"trackingNumber":{"description":"Waybill (ТТН) number.","anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"deliveryServiceId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}}},"Shop":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"code":{"type":["string","null"]},"type":{"type":"string","enum":["online","retail","marketplace"],"description":"online, retail, marketplace."},"orderPrefix":{"description":"Prefix of the order numbers customers see.","type":["string","null"]},"isActive":{"type":"boolean"},"defaultWarehouseId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"payeeId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Default «Отримувач оплати» of the shop’s orders; null = the company default."},"website":{"type":["string","null"]},"email":{"type":["string","null"]},"phones":{"type":"array","items":{"type":"string"}},"address":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","name","code","type","orderPrefix","isActive","defaultWarehouseId","payeeId","website","email","phones","address","customFields","createdAt","updatedAt"],"description":"A shop of the company (orders belong to one)."},"ShopList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Shop"}}},"required":["items"],"description":"The shops the key may use (all of the company’s, or the ones the key is limited to). The whole list (no paging)."},"StockAdjustment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Document number in «Інвентаризація / списання».","example":"СК-00012"},"date":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"warehouse":{"$ref":"#/components/schemas/Ref"},"comment":{"type":["string","null"]},"postedAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]},"items":{"type":"array","items":{"$ref":"#/components/schemas/StockAdjustmentItem"}}},"required":["id","number","date","warehouse","comment","postedAt","items"],"description":"The posted adjustment document that set the stock."},"StockAdjustmentItem":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"sku":{"type":["string","null"]},"name":{"type":"string"},"qtyBefore":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},{"type":"null"}],"description":"On hand before."},"qty":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Quantity: a decimal string in the product unit.","example":"2"},{"type":"null"}],"description":"On hand after (what you sent)."},"diff":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"qty − qtyBefore (signed).","example":"2"},"unitCost":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"Cost per unit of the added or removed stock. null without `profit:read`."}},"required":["productId","sku","name","qtyBefore","qty","diff","unitCost"]},"StockChangedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Event id = the `webhook-id` header. Deduplicate on it: a retry repeats it.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","const":"stock.changed"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"$ref":"#/components/schemas/WebhookStockData"}},"required":["id","type","createdAt","companyId","data"]},"StockLevel":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"sku":{"type":["string","null"]},"name":{"type":"string"},"unit":{"type":"string"},"warehouse":{"$ref":"#/components/schemas/Ref"},"onHand":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Physically in the warehouse (received stock).","example":"2"},"reserved":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Reserved by orders (in stock and on expected purchases).","example":"2"},"available":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Sellable from stock now: on hand − reserved in stock.","example":"2"},"expected":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"On purchases not received yet.","example":"2"},"availableWithExpected":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Sellable including pre-order: on hand + expected − all reservations.","example":"2"},"backordered":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Reserved beyond any stock (orders waiting for goods).","example":"2"},"stockValue":{"anyOf":[{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","description":"Amount: a decimal string in the currency of the document.","example":"1250.00"},{"type":"null"}],"description":"On-hand stock at FIFO cost (base currency). null without the `profit:read` scope."}},"required":["productId","sku","name","unit","warehouse","onHand","reserved","available","expected","availableWithExpected","backordered","stockValue"],"description":"Stock of one product in one warehouse. Kits have no stock of their own (their components do)."},"StockLevelPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StockLevel"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"Supplier":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"marketplace":{"anyOf":[{"$ref":"#/components/schemas/Ref"},{"type":"null"}],"description":"The marketplace / platform the supplier sells on (AliExpress, Prom, …)."},"website":{"type":["string","null"]},"contactName":{"type":["string","null"]},"phone":{"description":"E.164.","type":["string","null"]},"email":{"type":["string","null"]},"taxId":{"description":"ЄДРПОУ / РНОКПП.","type":["string","null"]},"iban":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","name","marketplace","website","contactName","phone","email","taxId","iban","address","notes","customFields","createdAt","updatedAt"],"description":"A supplier («Постачальник») — who purchase invoices are from."},"SupplierPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"TrackingStatus":{"type":"string","enum":["created","in_transit","arrived","out_for_delivery","delivered","delivery_failed","refused","returning","returned","deleted","cancelled","not_found","lost"],"description":"Normalised tracking status of the parcel (the same for every carrier): created → in_transit → arrived (at the branch / postomat) / out_for_delivery → delivered; or delivery_failed, refused → returning → returned; deleted / cancelled (waybill withdrawn), not_found (the carrier doesn’t know the number yet), lost. Final: delivered, returned, deleted, cancelled, lost — no more tracking after them."},"TransitionOrderRequest":{"type":"object","properties":{"transitionId":{"type":"string","format":"uuid","description":"From GET /orders/{id}/transitions."},"comment":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"fromStageId":{"description":"The stage you saw; a concurrent move then answers 409 instead of moving twice.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["transitionId"]},"TransitionOrderResult":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"},"outcomes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"status":{"type":"string","enum":["done","skipped","failed"]},"detail":{"type":["string","null"]},"message":{"type":["string","null"]}},"required":["type","status"]}}},"required":["order","outcomes"],"description":"The order after the move + what the stage’s automatic actions did (ТТН created, …)."},"UpdateCustomerRequest":{"type":"object","properties":{"type":{"description":"Default: person.","$ref":"#/components/schemas/CustomerType"},"name":{"type":"string","minLength":1,"maxLength":300},"phone":{"description":"Any common format; stored as E.164. A phone another customer has → 409 CUSTOMER_PHONE_TAKEN.","example":"+380671234567","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"instagram":{"description":"Handle or profile link.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"telegram":{"description":"Username, link or phone.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"requiresSalesInvoice":{"type":"boolean"},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"customFields":{"description":"Values by key (see GET /custom-fields); keys you leave out keep their values on update.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"color":"red"}}},"description":"Only the fields you send change; `tags`, when sent, is the full new list."},"UpdateOrderRequest":{"type":"object","properties":{"shopId":{"description":"Default: the company’s first shop the key may use.","type":"string","format":"uuid"},"customerId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"customer":{"description":"Customer by phone when you don’t know its id. Neither → the walk-in customer.","anyOf":[{"$ref":"#/components/schemas/OrderCustomerInput"},{"type":"null"}]},"salesChannelId":{"description":"Sales channel (GET /sales-channels).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"orderDate":{"type":"string","format":"date","description":"Calendar date (Kyiv), YYYY-MM-DD.","example":"2026-11-15"},"deliveryServiceId":{"description":"GET /delivery-services.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"delivery":{"anyOf":[{"$ref":"#/components/schemas/OrderDeliveryInput"},{"type":"null"}]},"trackingNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"paymentMethod":{"anyOf":[{"$ref":"#/components/schemas/PaymentKind"},{"type":"null"}]},"comment":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"packingNote":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tags":{"description":"Tag names; unknown ones are added to the company’s tags.","maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Custom field values by key (see GET /custom-fields).","example":{"color":"red"}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"discount":{"description":"Order-level absolute discount.","example":"1250.00","type":["string","number"]},"deliveryCharge":{"anyOf":[{"description":"Amount: a decimal string (\"1250.00\") or a number with up to 2 decimals.","example":"1250.00","type":["string","number"]},{"type":"null"}]},"items":{"description":"The FULL new list of lines (lines left out are removed). Omit to keep lines unchanged.","minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"productId":{"description":"Catalog product. Omit for a free-text line (then `name` is required).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sku":{"description":"Find the product by SKU instead of `productId`.","type":"string","minLength":1,"maxLength":100},"name":{"description":"Line name; defaults to the product’s name in the shop.","type":"string","maxLength":300},"qty":{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]},"unitPrice":{"description":"Defaults to the product’s price in the shop.","example":"1250.00","type":["string","number"]},"discount":{"description":"Absolute line discount.","example":"1250.00","type":["string","number"]},"id":{"description":"Existing line id (keep it to update the line).","type":"string","format":"uuid"}},"required":["qty"]}},"allowBackorder":{"type":"boolean"}},"description":"Only the fields you send change."},"UpdateProductRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"categoryId":{"description":"GET /categories.","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"type":{"description":"Default: goods.","$ref":"#/components/schemas/ProductType"},"unit":{"description":"A unit code of the company (default шт; 400 UNIT_NOT_FOUND otherwise).","type":"string","minLength":1,"maxLength":16},"barcode":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"uktzed":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"price":{"description":"Default sale price.","anyOf":[{"description":"Amount: a non-negative decimal string (\"1250.00\") or a number with up to 2 decimals.","example":"1250.00","type":["string","number"]},{"type":"null"}]},"weightKg":{"anyOf":[{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]},{"type":"null"}]},"warrantyMonths":{"anyOf":[{"type":"integer","minimum":0,"maximum":1200},{"type":"null"}]},"trackInventory":{"description":"Goods: count stock (default true).","type":"boolean"},"isActive":{"description":"false = archive the product (there is no DELETE).","type":"boolean"},"customFields":{"description":"Values by key (GET /custom-fields); keys you leave out keep their values on update.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"color":"red"}},"components":{"description":"A kit: its goods (at least one; replaces the whole list).","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/KitComponentInput"}},"portions":{"description":"A product sold by measure (кг / л / м): portion amounts in its unit; replaces the list.","maxItems":10,"type":"array","items":{"description":"Quantity: a decimal string or a number with up to 3 decimals.","example":"2","type":["string","number"]}},"listings":{"description":"Per-shop name / SKU / link / price. Replaces the listings of the shops the key may use; other shops’ listings are kept.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/ProductListingInput"}}},"description":"Only the fields you send change. On a variant only its own fields apply (sku, barcode, price, weightKg, isActive, customFields, listings). Variants themselves are edited by their own id."},"UpdateSupplierRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"marketplaceId":{"description":"A marketplace of the company (400 MARKETPLACE_NOT_FOUND otherwise).","anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"website":{"description":"http(s) address or a bare host; other schemes are refused.","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"description":"Any common format; stored as E.164.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"iban":{"anyOf":[{"type":"string","maxLength":34},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"customFields":{"description":"Values by key (see GET /custom-fields); keys you leave out keep their values on update.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"example":{"color":"red"}}},"description":"Only the fields you send change."},"UpdateWebhookEndpointRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/[^\\s/?#@]+(?::\\d{1,5})?(?:[/?][^\\s#]*)?$","description":"Public HTTPS URL of your receiver (no credentials, no fragment; private / local addresses are refused).","example":"https://example.com/hooks/rex"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"maxItems":14,"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isActive":{"description":"false = paused; true = on again (also after a switch-off for failures).","type":"boolean"}}},"VariantOption":{"type":"object","properties":{"name":{"type":"string","example":"Колір"},"values":{"type":"array","items":{"type":"string"},"example":["Чорний","Бежевий"]}},"required":["name","values"],"description":"An option of a product with variants and its values."},"Warehouse":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"shopId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"The shop it belongs to; null = the whole company."},"address":{"type":["string","null"]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","name","shopId","address","isDefault","isActive","createdAt","updatedAt"]},"WarehouseList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Warehouse"}}},"required":["items"],"description":"Warehouses, the default one first. The whole list (no paging)."},"WebhookCustomerData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"}},"required":["id"],"description":"The customer (GET /customers/{id})."},"WebhookCustomerDeletedData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"mergedInto":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Merged into this customer (null: deleted)."}},"required":["id","mergedInto"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"endpointId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"eventId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"event":{"type":"string","description":"A WebhookEvent or `ping`."},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer"},"lastStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"lastError":{"description":"Short reason of the last failure (status + the start of your answer, or the network error).","type":["string","null"]},"lastDurationMs":{"anyOf":[{"type":"integer"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"payload":{"$ref":"#/components/schemas/WebhookPayload"}},"required":["id","endpointId","eventId","event","status","attempts","lastStatus","lastError","lastDurationMs","nextAttemptAt","deliveredAt","createdAt","payload"]},"WebhookDeliveryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer","description":"Items matching the filters, all pages."},"hasMore":{"type":"boolean","description":"There is a next page."}},"required":["items","page","pageSize","total","hasMore"],"description":"One page of a list."},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"isActive":{"type":"boolean"},"disabledReason":{"anyOf":[{"type":"string","enum":["manual","failures","owner_inactive","key_revoked"]},{"type":"null"}],"description":"Why it is off: paused, too many failed deliveries in a row, its creator lost access, or the API key it was registered with was revoked / expired."},"failureStreak":{"type":"integer","description":"Failed attempts in a row (reset by a success)."},"lastDeliveryAt":{"anyOf":[{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},{"type":"null"}]},"lastStatus":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"HTTP status of the last attempt (null: no answer)."},"secretHint":{"type":"string","example":"whsec_…k9Qw"},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"apiKeyId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Created through the API with this key (null: in the app)."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","url","description","events","isActive","disabledReason","failureStreak","lastDeliveryAt","lastStatus","secretHint","createdBy","apiKeyId","createdAt","updatedAt"],"description":"Deliveries are filtered by the creator’s CURRENT access (role, shops) — and, when made with a key, by that key’s shops."},"WebhookEndpointCreated":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"secret":{"type":"string","description":"Signing secret `whsec_…` — shown only now. Verify `webhook-signature` with it (Standard Webhooks).","example":"whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"}},"required":["endpoint","secret"]},"WebhookEndpointList":{"type":"object","properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"allowedEvents":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"},"description":"Events this key may subscribe to (its read scopes ∩ its creator’s role)."},"max":{"type":"integer","example":10}},"required":["endpoints","allowedEvents","max"]},"WebhookEvent":{"type":"string","enum":["order.created","order.updated","order.status_changed","order.stage_changed","order.deleted","customer.created","customer.updated","customer.deleted","product.created","product.updated","product.deleted","stock.changed","shipment.updated","purchase.updated"],"description":"Event type. Each needs the matching read scope on the key (orders:read for order.*, …)."},"WebhookOrderData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Order number as shown in the app («1042»).","example":"1042"},"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"status":{"type":"string","enum":["new","awaiting_stock","ready","shipped","delivered","completed","cancelled","returned"]},"paymentStatus":{"type":"string","enum":["unpaid","partial","paid","refunded"]},"shipmentStatus":{"type":"string","enum":["not_shipped","shipped","delivered","returned"]},"stageId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}],"description":"Workflow stage (GET /order-stages)."},"externalId":{"description":"Your id of the order, when it was created with one.","type":["string","null"]}},"required":["id","number","shopId","status","paymentStatus","shipmentStatus","stageId","externalId"],"description":"The order (GET /orders/{id} for the lines, customer and payments)."},"WebhookOrderDeletedData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"anyOf":[{"type":"string","description":"Order number as shown in the app («1042»).","example":"1042"},{"type":"null"}]},"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"}},"required":["id","number","shopId"]},"WebhookOrderStageData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Order number as shown in the app («1042»).","example":"1042"},"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"fromStageId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"fromStage":{"description":"Stage name at the time of the move.","type":["string","null"]},"toStageId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"toStage":{"type":"string"},"automatic":{"type":"boolean","description":"true: moved by a fact (paid, shipped, …); false: a manager / an API call pressed a transition."},"at":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"}},"required":["id","number","shopId","fromStageId","fromStage","toStageId","toStage","automatic","at"],"description":"The order moved to another workflow stage («Етап»)."},"WebhookOrderStatusData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"number":{"type":"string","description":"Order number as shown in the app («1042»).","example":"1042"},"shopId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"from":{"anyOf":[{"type":"string","enum":["new","awaiting_stock","ready","shipped","delivered","completed","cancelled","returned"]},{"type":"null"}]},"to":{"type":"string","enum":["new","awaiting_stock","ready","shipped","delivered","completed","cancelled","returned"]}},"required":["id","number","shopId","from","to"],"description":"The order status (derived from stock, payments and shipment) changed from → to."},"WebhookPayload":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"type":{"type":"string","description":"A WebhookEvent or `ping`."},"createdAt":{"type":"string","format":"date-time","description":"Instant, ISO-8601.","example":"2026-11-15T09:30:00.000Z"},"companyId":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","createdAt","companyId","data"],"description":"What the endpoint received (see the `webhooks` section for each type’s `data`)."},"WebhookPingData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The endpoint.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"}},"required":["id"]},"WebhookProductData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"}},"required":["id"],"description":"The product (GET /products/{id})."},"WebhookPurchaseData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"change":{"type":"string","enum":["created","updated","deleted"]}},"required":["id","change"],"description":"A supplier invoice («Закупівля») was created, changed (received, paid, …) or deleted."},"WebhookShipmentData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"orderId":{"anyOf":[{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},{"type":"null"}]},"orderNumber":{"type":["string","null"]},"provider":{"type":"string","description":"nova_poshta, ukrposhta, meest, …"},"ttn":{"description":"Waybill (ТТН) number.","type":["string","null"]},"status":{"type":"string","description":"Tracking status (created, in_transit, arrived, delivered, refused, returning, returned, …)."}},"required":["id","orderId","orderNumber","provider","ttn","status"],"description":"A parcel was created, changed or got a new tracking status."},"WebhookStockData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The product whose stock changed.","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"warehouseIds":{"type":"array","items":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"description":"Warehouses where it changed."}},"required":["id","warehouseIds"],"description":"Stock of a product changed (GET /stock?productId=… for the numbers). One event per product."},"WorkflowStage":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Identifier (UUID).","example":"01936f5e-8a3b-7c4d-9e2f-1a2b3c4d5e6f"},"key":{"type":"string","description":"Stable slug of the stage."},"name":{"type":"string"},"category":{"type":"string","enum":["new","in_progress","done","cancelled"],"description":"new, in_progress, done, cancelled."},"systemKey":{"anyOf":[{"type":"string","enum":["new","shipped","delivered","completed","cancelled","returned"]},{"type":"null"}],"description":"Stage the system relies on (new, shipped, delivered, completed, cancelled, returned); null for the company’s own stages."},"position":{"type":"integer"},"color":{"type":"string","enum":["gray","slate","blue","sky","indigo","brand","purple","pink","success","warning","orange","error"]},"isInitial":{"type":"boolean","description":"New orders start here."},"locksOrder":{"type":"boolean","description":"Orders in it can’t be edited."},"description":{"type":["string","null"]}},"required":["id","key","name","category","systemKey","position","color","isInitial","locksOrder","description"],"description":"A stage of the company’s order pipeline («Етапи замовлень»). Move orders with POST /orders/{id}/transitions."},"WorkflowStageList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStage"}}},"required":["items"],"description":"Order stages in pipeline order. The whole list (no paging)."}}}}