Склад · Чувствительное действие
Склад · Списание · Создание
inventory_writeoff_create
Попробуйте три запроса
Подготовить
- Вы указываетеОбъект
- ПомощникПодготовка
- Вы получаетеПредпросмотр
Запрос в чат
Подготовь «Склад / Списание / Создание». Для изменения нужны изменяемые поля. Покажи объект и ожидаемый эффект до выполнения.
- values
- Изменяемые поля
Применить
- Вы указываетеСогласованные значения
- ПомощникОдин вызов
- Вы получаетеОтвет операции
Запрос в чат
На учебной записи подготовь «Склад / Списание / Создание» с параметром values.reasonId = DEMO-101. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
- values.reasonId
- DEMO-101
- values.comment
- Проверено на учебной записи
Проверить итог
- Вы указываетеИсходный ответ
- ПомощникСверка результата
- Вы получаетеПодтверждение
Запрос в чат
Проверь результат «Склад / Списание / Создание» по исходному ответу. Покажи ID записи, версия записи. Объясни, чем подтвердить эффект для выбранного объекта.
- ЗапросСохранить исходный ключ
- ОтветПроверить статус
- ПроверкаСверить эффект операции
Как работает действие
Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения.
Описание разработчика
Create one native physical write-off with current OAuth scope and employee permission. Requires a verified storage, reason, distinct products and an exact posted-stock snapshot; insufficient or changed stock conflicts. The installed write_offs trigger decrements product_stock in the same SQL commit. No transfer, Order, payment, reservation or physical count is inferred. Recover uncertain results with the original requestId.
Параметры запроса
- values
- Значения для записи. Состав и вложенность указаны в схеме. обязательно по схеме · object
- requestId
- Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
Что вернёт команда
- recordId
- Created native write-off ID. обязательно по схеме · string
- revision
- Native revision at commit time. обязательно по схеме · string
- lineCount
- Number of committed write-off lines. обязательно по схеме · integer · минимум 1 · максимум 100
- amount
- Sum of explicit line values; no finance transaction is created. обязательно по схеме · number · минимум 0 · максимум 1000000000000000
- stockEffect
- The installed native trigger decremented posted stock in the same SQL transaction. обязательно по схеме · string
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"values": {
"type": "object",
"properties": {
"storage": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Exact existing inventory storage ID in the connected company and location scope."
},
"reasonId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Existing write-off reason ID from inventory_list_writeoff_reasons."
},
"comment": {
"type": "string",
"minLength": 1,
"maxLength": 1000,
"description": "Why this physical write-off occurred."
},
"items": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"Product": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Distinct existing product ID. One line per product in this write-off."
},
"Gross": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000000000,
"description": "Quantity removed from posted stock in the native product unit."
},
"Price": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000000,
"description": "Explicit unit cost in the native currency; no valuation is inferred."
},
"amount": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000000,
"description": "Explicit line value. No finance transaction or payment is created."
},
"postedStockBefore": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000,
"description": "Exact posted quantity for this product and storage from inventory_get_stock. A changed or insufficient quantity conflicts."
}
},
"required": [
"Product",
"Gross",
"Price",
"amount",
"postedStockBefore"
],
"additionalProperties": false
},
"description": "One to 100 distinct product lines in the same storage."
}
},
"required": [
"storage",
"reasonId",
"comment",
"items"
],
"additionalProperties": false,
"description": "Pure physical write-off; server controls identity, timestamp, actor and native Type."
},
"requestId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{8,128}$",
"description": "Stable ID for these exact arguments; reuse after an uncertain response."
}
},
"required": [
"values",
"requestId"
],
"additionalProperties": false
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"recordId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Created native write-off ID."
},
"revision": {
"type": "string",
"pattern": "^[a-f0-9]{32}$",
"description": "Native revision at commit time."
},
"lineCount": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"description": "Number of committed write-off lines."
},
"amount": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000000,
"description": "Sum of explicit line values; no finance transaction is created."
},
"stockEffect": {
"type": "string",
"const": "decremented_by_native_trigger",
"description": "The installed native trigger decremented posted stock in the same SQL transaction."
}
},
"required": [
"recordId",
"revision",
"lineCount",
"amount",
"stockEffect"
],
"additionalProperties": false
}