Касса · Сессии · Сторнирование · Коллекции
cash_sessions_reverse_collection
Попробуйте три запроса
- Вы указываетеCashshiftid
- ПомощникПодготовка
- Вы получаетеПредпросмотр
Подготовь «Касса / Сессии / Сторнирование / Коллекции». Для изменения нужны cashShiftId, collectionId. Покажи объект и ожидаемый эффект до выполнения.
- cashShiftId
- Параметр
- collectionId
- Параметр
- alreadyReturnedAmount
- Параметр
- Вы указываетеСогласованные значения
- ПомощникОдин вызов
- Вы получаетеОтвет операции
На учебной записи подготовь «Касса / Сессии / Сторнирование / Коллекции» с параметром cashShiftId = DEMO-101. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
- cashShiftId
- DEMO-101
- collectionId
- DEMO-101
- returnMode
- partial
- Вы указываетеИсходный ответ
- ПомощникСверка результата
- Вы получаетеПодтверждение
Проверь результат «Касса / Сессии / Сторнирование / Коллекции» по исходному ответу. Покажи reversalId, collectionId. Объясни, чем подтвердить эффект для выбранного объекта.
- До измененияПрочитать версию
- При записиПередать выбранную версию
- После ответаПеречитать объект
Как работает действие
Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения. Прочитайте актуальную версию записи перед подготовкой запроса.
Описание разработчика
Record a completed physical cash return from the original safe to the original till for one protected MCP-created collection. Omit returnMode for the original one-time full-original-amount correction. Explicit returnMode=partial records one partial return or the final remainder, with a new requestId and current revision for each distinct return. Verifies company/location permissions, original receipt and ledger entries, current account configuration/currency and the latest protected remainder. Atomically records one inverse debit/credit pair plus immutable receipt and updates only the collected remainder. Preserves physical opening/closing observations. Requires current OAuth and employee permissions; does not move cash, call a provider/bank, compute balances, settle Orders, reassign accounts or edit arbitrary transactions. Recover uncertain responses using the exact original arguments.
Параметры запроса
- cashShiftId
- Session ID from the original successful cash_sessions_record_collection receipt. Only that exact unchanged session is supported. обязательно по схеме · string · до символов 128
- collectionId
- Original collection identifier returned by cash_sessions_record_collection; other manual financial movements and legacy collections are not accepted. обязательно по схеме · string · до символов 128
- expectedRevision
- Версия, прочитанная перед изменением. обязательно по схеме · string
- alreadyReturnedAmount
- Cash already physically returned from the original safe to the original till, in the original currency units. Without returnMode this must equal the entire original collection, exactly as before. With returnMode=partial this is the amount of this distinct completed return, not a cumulative total, and must not exceed the remaining collected amount. Does not move cash or call a bank. обязательно по схеме · number · максимум 1000000000000
- returnMode
- Explicitly opt into recording a partial physical return. Omit to retain the original one-time full-original-amount correction. Each subsequent partial return requires a new requestId and the latest cashShiftRevision; retain this field unchanged for retry/recovery. Partial mode also accepts the exact final remainder. необязательно · string
- reason
- Reason for reversing this already returned collection. The original receipt and financial effects remain as immutable history. обязательно по схеме · string · до символов 1000
- requestId
- Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string · до символов 128
Что вернёт команда
- reversalId
- Server-assigned identifier of the committed correction receipt. обязательно по схеме · string · до символов 128
- collectionId
- Original protected MCP collection associated with this immutable return receipt. обязательно по схеме · string · до символов 128
- cashShiftId
- Original native cash session whose collected remainder was updated. обязательно по схеме · string · до символов 128
- locationId
- Server-verified current establishment within the authenticated company and location scope. обязательно по схеме · string · до символов 128
- state
- The inverse pair and collected remainder committed atomically: reversed means no amount remains; partially_reversed means a positive amount still remains collected. обязательно по схеме · string · варианты reversed, partially_reversed
- returnedAmount
- Amount of this distinct physical return recorded by this receipt. It is not a cumulative return total. обязательно по схеме · number · максимум 1000000000000
- remainingCollectedAmount
- Native collected remainder at this commit: zero for a full return, positive after a partial return. Physical opening and closing observations remain unchanged. Recovery returns this historical committed value. обязательно по схеме · number · минимум 0 · максимум 1000000000000
- currency
- Original currency verified against both current company-owned accounts. No conversion is supported. обязательно по схеме · string · до символов 32
- recordedAt
- Server timestamp of the atomic correction. обязательно по схеме · string
- cashShiftRevision
- Native revision after this committed return. Use it for the next distinct partial return. Original and inverse ledger entries remain protected. обязательно по схеме · string
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cashShiftId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_~:@+.-]+$",
"description": "Session ID from the original successful cash_sessions_record_collection receipt. Only that exact unchanged session is supported."
},
"collectionId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_~:@+.-]+$",
"description": "Original collection identifier returned by cash_sessions_record_collection; other manual financial movements and legacy collections are not accepted."
},
"expectedRevision": {
"type": "string",
"pattern": "^[a-f0-9]{32}$",
"description": "Current session revision returned by the original collection or cash_shifts_get. Concurrent changes reject the correction."
},
"alreadyReturnedAmount": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"description": "Cash already physically returned from the original safe to the original till, in the original currency units. Without returnMode this must equal the entire original collection, exactly as before. With returnMode=partial this is the amount of this distinct completed return, not a cumulative total, and must not exceed the remaining collected amount. Does not move cash or call a bank."
},
"returnMode": {
"description": "Explicitly opt into recording a partial physical return. Omit to retain the original one-time full-original-amount correction. Each subsequent partial return requires a new requestId and the latest cashShiftRevision; retain this field unchanged for retry/recovery. Partial mode also accepts the exact final remainder.",
"type": "string",
"const": "partial"
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 1000,
"description": "Reason for reversing this already returned collection. The original receipt and financial effects remain as immutable history."
},
"requestId": {
"type": "string",
"minLength": 8,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_-]+$",
"description": "Stable identifier for this exact correction. Retain all original arguments for retries and recovery after an uncertain response."
}
},
"required": [
"cashShiftId",
"collectionId",
"expectedRevision",
"alreadyReturnedAmount",
"reason",
"requestId"
],
"additionalProperties": false
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"reversalId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_~:@+.-]+$",
"description": "Server-assigned identifier of the committed correction receipt."
},
"collectionId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_~:@+.-]+$",
"description": "Original protected MCP collection associated with this immutable return receipt."
},
"cashShiftId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_~:@+.-]+$",
"description": "Original native cash session whose collected remainder was updated."
},
"locationId": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_~:@+.-]+$",
"description": "Server-verified current establishment within the authenticated company and location scope."
},
"state": {
"type": "string",
"enum": [
"reversed",
"partially_reversed"
],
"description": "The inverse pair and collected remainder committed atomically: reversed means no amount remains; partially_reversed means a positive amount still remains collected."
},
"returnedAmount": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"description": "Amount of this distinct physical return recorded by this receipt. It is not a cumulative return total."
},
"remainingCollectedAmount": {
"type": "number",
"minimum": 0,
"maximum": 1000000000000,
"description": "Native collected remainder at this commit: zero for a full return, positive after a partial return. Physical opening and closing observations remain unchanged. Recovery returns this historical committed value."
},
"currency": {
"type": "string",
"minLength": 1,
"maxLength": 32,
"description": "Original currency verified against both current company-owned accounts. No conversion is supported."
},
"recordedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"description": "Server timestamp of the atomic correction."
},
"cashShiftRevision": {
"type": "string",
"pattern": "^[a-f0-9]{32}$",
"description": "Native revision after this committed return. Use it for the next distinct partial return. Original and inverse ledger entries remain protected."
}
},
"required": [
"reversalId",
"collectionId",
"cashShiftId",
"locationId",
"state",
"returnedAmount",
"remainingCollectedAmount",
"currency",
"recordedAt",
"cashShiftRevision"
],
"additionalProperties": false
}