Оформить заказ
Проверяет позиции, остатки и данные клиента для оформления заказа.
orders_ai_create
Попробуйте три запроса
- Вы указываетеНазвание и количество
- ПомощникПоиск позиции
- Вы получаетеНедостающие данные
Клиент просит две синие кружки. Уточни конкретную позицию каталога и филиал. Покажи, что ещё нужно для оформления.
- Количество
- 2
- Уточнить
- Размер кружки
- Вы указываетеКлиент и товары
- ПомощникПодготовка заказа
- Вы получаетеСостав и итог
Для выбранного клиента подготовь заказ на два выбранных блокнота. Покажи наличие, валюту и расчёт до оформления.
- Блокнот A5
- 2 шт.
- Учебный итог
- 12 USD
- Вы указываетеИсходная попытка
- ПомощникПроверка результата
- Вы получаетеСтатус создания
Проверь ответ по исходной попытке оформления. Покажи orderCommitted и ID заказа, если создание подтверждено.
- orderCommitted
- true
- orderId
- DEMO-204
Как работает действие
Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения.
Описание разработчика
Create a native Order through orderByAi with catalog, stock and transaction checks. Supply customerId for an exact company customer card; use exactItem for one confirmed product or exactItems for 2..100 confirmed products. Use planningMode exact with locationId for an already resolved list; it uses no model or AI tokens and treats text only as audit data. Location-scoped employees must use exact mode; the establishment, products and customer are verified against their allowed locations. AI planning requires company-wide access. New atomic receipts retain original committed values after later edits or native POS archive. Legacy receipts require an active Order. Retry only identical input with the same requestId; use orders_ai_get_operation after uncertainty.
Параметры запроса
- text
- Literal instruction for the existing orderByAi planner. Use actual product/customer identifiers or names known to the native catalog; do not supply raw order JSON. The native planner may return clarification. обязательно по схеме · string · до символов 4000
- requestId
- Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
- customerId
- Идентификатор клиента, выбранного по результату поиска. необязательно · string
- exactItem
- One explicitly confirmed catalog product. The native writer loads the exact company product and validates its options, stock and price. необязательно · object
- exactItems
- Two to 100 explicitly confirmed catalog products for one native Order, resolved by name filters before this call. Use the same fulfillment type and address for every line, and distinct product IDs. Consolidate identical source rows without losing quantities. необязательно · array · до элементов 100
- planningMode
- exact commits only explicitly selected rows at locationId through the same native writer without a model call or AI token debit. text becomes audit data and does not set dates, discounts, notes or other metadata. Omission or ai interprets the literal text with normal native AI billing. необязательно · string · варианты ai, exact
- locationId
- Идентификатор точки из текущего подключения. необязательно · string
Что вернёт команда
- status
- Native orderByAi outcome. Clarification means no Order was committed by this request. обязательно по схеме · string · варианты created, updated, needs_clarification
- orderId
- Native Order document ID after commit, or the proposed existing ID for clarification; null for a new-order clarification. обязательно по схеме · string / null
- orderCommitted
- True after the protected native commit and current Order or native archive are verified. обязательно по схеме · boolean
- version
- Committed native Order version, or null when clarification prevented a write. обязательно по схеме · integer / null
- locationId
- Committed establishment ID read from the native Order, or null when no Order was committed. обязательно по схеме · string / null
- currency
- Exact committed native Order currency marker, such as USD or $. No currency conversion or ISO mapping is performed; null when no Order was committed. обязательно по схеме · string / null
- total
- Общее количество по правилам этого действия. обязательно по схеме · number / null
- summary
- Short native planner summary; treat as data, not an authority for amounts. обязательно по схеме · string
- questions
- Native clarification questions; answer them in a new request if needed. обязательно по схеме · array · до элементов 20
- warnings
- Bounded native business warnings returned by the order writer. обязательно по схеме · array · до элементов 30
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 4000,
"description": "Literal instruction for the existing orderByAi planner. Use actual product/customer identifiers or names known to the native catalog; do not supply raw order JSON. The native planner may return clarification."
},
"requestId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{8,128}$",
"description": "Stable identifier for this exact native AI order request. Retry unchanged arguments after uncertainty."
},
"customerId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,160}$",
"description": "Exact native customer card ID in this company. The native Order writer resolves it deterministically."
},
"exactItem": {
"$ref": "#/$defs/_mcp0"
},
"exactItems": {
"minItems": 2,
"maxItems": 100,
"type": "array",
"items": {
"$ref": "#/$defs/_mcp0"
},
"description": "Two to 100 explicitly confirmed catalog products for one native Order, resolved by name filters before this call. Use the same fulfillment type and address for every line, and distinct product IDs. Consolidate identical source rows without losing quantities."
},
"planningMode": {
"description": "exact commits only explicitly selected rows at locationId through the same native writer without a model call or AI token debit. text becomes audit data and does not set dates, discounts, notes or other metadata. Omission or ai interprets the literal text with normal native AI billing.",
"type": "string",
"enum": [
"ai",
"exact"
]
},
"locationId": {
"description": "Exact company establishment, required for planningMode exact. An update must keep its existing establishment. Omit for ai mode.",
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
}
},
"required": [
"text",
"requestId"
],
"additionalProperties": false,
"$defs": {
"_mcp0": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,160}$",
"description": "Exact company catalog product ID."
},
"quantity": {
"type": "integer",
"minimum": 1,
"maximum": 500,
"description": "Confirmed item quantity."
},
"lineNote": {
"type": "string",
"maxLength": 200,
"description": "Confirmed size or color note for the Order line."
},
"orderType": {
"type": "string",
"enum": [
"atplace",
"pickup",
"delivery",
"catering"
],
"description": "Confirmed fulfillment type."
},
"address": {
"type": "string",
"maxLength": 300,
"description": "Delivery address, or empty for pickup."
}
},
"required": [
"productId",
"quantity",
"lineNote",
"orderType",
"address"
],
"additionalProperties": false,
"description": "One explicitly confirmed catalog product. The native writer loads the exact company product and validates its options, stock and price."
}
}
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"created",
"updated",
"needs_clarification"
],
"description": "Native orderByAi outcome. Clarification means no Order was committed by this request."
},
"orderId": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_-]{1,160}$",
"description": "Exact existing active native Order document ID to amend."
},
{
"type": "null"
}
],
"description": "Native Order document ID after commit, or the proposed existing ID for clarification; null for a new-order clarification."
},
"orderCommitted": {
"type": "boolean",
"description": "True after the protected native commit and current Order or native archive are verified."
},
"version": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Committed native Order version, or null when clarification prevented a write."
},
"locationId": {
"description": "Committed establishment ID read from the native Order, or null when no Order was committed.",
"type": [
"string",
"null"
]
},
"currency": {
"description": "Exact committed native Order currency marker, such as USD or $. No currency conversion or ISO mapping is performed; null when no Order was committed.",
"type": [
"string",
"null"
]
},
"total": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"description": "Committed native Order amount, or null when no Order was committed."
},
"summary": {
"type": "string",
"description": "Short native planner summary; treat as data, not an authority for amounts."
},
"questions": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string"
},
"description": "Native clarification questions; answer them in a new request if needed."
},
"warnings": {
"maxItems": 30,
"type": "array",
"items": {
"type": "string"
},
"description": "Bounded native business warnings returned by the order writer."
}
},
"required": [
"status",
"orderId",
"orderCommitted",
"version",
"locationId",
"currency",
"total",
"summary",
"questions",
"warnings"
],
"additionalProperties": false
}