# Check return processing

[All field references](/en/developers/field-reference) · [Returns](/en/developers/fields-group-returns)

`POST /v1/returns/processing-commands/preview`

Checks the same action and then fully rolls it back. saved=false is not a booking. Also requires the read scope; the preview cannot read real warehouse stock through a test key.

Required scopes: `"returns:process"`, `"returns:read"`.

[How to read these tables](/en/developers/field-reference#reading-the-field-tables)

## Request body

Request body required.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | Additional properties are not allowed. |
| idempotency_key | string | Required when parent is present | Not allowed | New client UUID per command; after unclear outcomes retry the same UUID and arguments. format: `"uuid"`. |
| operation | alternative (anyOf) | Required when parent is present | Not allowed | Action to perform. Select kind first; only that variant determines which fields are required. |
| operation | object | Conditional: anyOf 1/10 | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Kind selects required fields. const: `"attach_inspection_evidence"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.evidence_id | string | Required when parent is present | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Identifier of a prepared evidence file; use the same identifier returned by evidence preparation. format: `"uuid"`. |
| operation.inspection_id | string | Required when parent is present | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Inspection ID; retain for owner decisions and execution. format: `"uuid"`. |
| operation.label | string | Required when parent is present | Not allowed | anyOf 1/10: At least one alternative must match. Applies to kind = `"attach_inspection_evidence"`. Display label explaining this attachment or entry to the user. minLength: `1`. maxLength: `200`. |
| operation | object | Conditional: anyOf 2/10 | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. Kind selects required fields. const: `"handoff_recovery"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.quarantine_condition_id | string | Required when parent is present | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. Quarantine condition selected for goods that are not yet released for use. format: `"uuid"`. |
| operation.reason | string | Required when parent is present | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. Recorded reason. minLength: `1`. maxLength: `500`. |
| operation.physically_confirmed | boolean | Required when parent is present | Not allowed | anyOf 2/10: At least one alternative must match. Applies to kind = `"handoff_recovery"`, physically_confirmed = `true`. true only after this physical work was performed. const: `true`. |
| operation | object | Conditional: anyOf 3/10 | Not allowed | anyOf 3/10: At least one alternative must match. Applies to kind = `"report_unknown"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 3/10: At least one alternative must match. Applies to kind = `"report_unknown"`. Kind selects required fields. const: `"report_unknown"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 3/10: At least one alternative must match. Applies to kind = `"report_unknown"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.reference | string | Required when parent is present | Not allowed | anyOf 3/10: At least one alternative must match. Applies to kind = `"report_unknown"`. Displayed source-system reference. minLength: `1`. maxLength: `200`. |
| operation.description | string | Required when parent is present | Not allowed | anyOf 3/10: At least one alternative must match. Applies to kind = `"report_unknown"`. Human-readable description of the record or goods being reported. minLength: `1`. maxLength: `2000`. |
| operation.quantity | string | Required when parent is present | Not allowed | anyOf 3/10: At least one alternative must match. Applies to kind = `"report_unknown"`. Exact decimal-string quantity in the stated unit; no floats. pattern: `"^(?=.*[1-9])(0\|[1-9]\\d{0,8})(\\.\\d{1,6})?$"`. |
| operation | object | Conditional: anyOf 4/10 | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Kind selects required fields. const: `"identify"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.owner_organization_id | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Goods owner from current authorized options. format: `"uuid"`. |
| operation.line | object | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. The specific shipment line being assigned to an unidentified return. Additional properties are not allowed. |
| operation.line.id | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Stable entry identifier. format: `"uuid"`. |
| operation.line.shipment_id | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Identifier of the documented shipment that proves the returned or dispatched quantity. format: `"uuid"`. |
| operation.line.order_item_id | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Line identifier from the current order read. format: `"uuid"`. |
| operation.line.component_id | alternative (anyOf) | Optional | Allowed by schema | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Component identifier within this order, shipment or dispatch section. Default: `null`. |
| operation.line.component_id | string | Conditional: anyOf 1/2 | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`.; anyOf 1/2: At least one alternative must match. Component identifier within this order, shipment or dispatch section. format: `"uuid"`. |
| operation.line.component_id | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`.; anyOf 2/2: At least one alternative must match. Component identifier within this order, shipment or dispatch section. |
| operation.line.quantity | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Exact decimal-string quantity in the stated unit; no floats. pattern: `"^(?=.*[1-9])(0\|[1-9]\\d{0,8})(\\.\\d{1,6})?$"`. |
| operation.line.reason | string | Required when parent is present | Not allowed | anyOf 4/10: At least one alternative must match. Applies to kind = `"identify"`. Recorded reason. minLength: `1`. maxLength: `500`. |
| operation | object | Conditional: anyOf 5/10 | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Kind selects required fields. const: `"receive"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.line_id | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Line identifier in this delivery/return/dispatch section. format: `"uuid"`. |
| operation.stock_item_id | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Offered stock item ID for this owner/warehouse; not a SKU. format: `"uuid"`. |
| operation.quantity | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Exact decimal-string quantity in the stated unit; no floats. pattern: `"^(?=.*[1-9])(0\|[1-9]\\d{0,8})(\\.\\d{1,6})?$"`. |
| operation.location_id | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Storage location identifier in the selected warehouse. format: `"uuid"`. |
| operation.quarantine_condition_id | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Quarantine or fixed Damaged/Used/Personalized ID. Held until disposition. format: `"uuid"`. |
| operation.received_at | string | Required when parent is present | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Time the physical receipt occurred, including UTC Z or a numeric time-zone offset. format: `"date-time"`. |
| operation.batch | alternative (anyOf) | Optional | Allowed by schema | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Goods batch label; null = none supplied. Default: `null`. |
| operation.batch | string | Conditional: anyOf 1/2 | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`.; anyOf 1/2: At least one alternative must match. Goods batch label; null = none supplied. minLength: `1`. maxLength: `200`. |
| operation.batch | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`.; anyOf 2/2: At least one alternative must match. Goods batch label; null = none supplied. |
| operation.expires_on | alternative (anyOf) | Optional | Allowed by schema | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. Actual best-before date as YYYY-MM-DD; null or omission means unknown. It does not itself release goods for use. |
| operation.expires_on | string | Conditional: anyOf 1/2 | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`.; anyOf 1/2: At least one alternative must match. Actual best-before date as YYYY-MM-DD; null or omission means unknown. It does not itself release goods for use. format: `"date"`. |
| operation.expires_on | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`.; anyOf 2/2: At least one alternative must match. Actual best-before date as YYYY-MM-DD; null or omission means unknown. It does not itself release goods for use. |
| operation.personalized | boolean | Optional | Not allowed | anyOf 5/10: At least one alternative must match. Applies to kind = `"receive"`. True marks this receipt personalized. Omitted means false. It cannot be restocked as free. |
| operation | object | Conditional: anyOf 6/10 | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Books onto a storage place in one step when the rule is direct. Not a clarification place; not Personalized. const: `"receive_direct"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.line_id | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Line identifier in this delivery/return/dispatch section. format: `"uuid"`. |
| operation.stock_item_id | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Offered stock item ID for this owner/warehouse; not a SKU. format: `"uuid"`. |
| operation.quantity | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Exact decimal-string quantity in the stated unit; no floats. pattern: `"^(?=.*[1-9])(0\|[1-9]\\d{0,8})(\\.\\d{1,6})?$"`. |
| operation.location_id | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Storage location identifier in the selected warehouse. format: `"uuid"`. |
| operation.condition_id | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Released condition, not Personalized. format: `"uuid"`. |
| operation.received_at | string | Required when parent is present | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Time the physical receipt occurred, including UTC Z or a numeric time-zone offset. format: `"date-time"`. |
| operation.batch | alternative (anyOf) | Optional | Allowed by schema | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Goods batch label; null = none supplied. |
| operation.batch | string | Conditional: anyOf 1/2 | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`.; anyOf 1/2: At least one alternative must match. Goods batch label; null = none supplied. minLength: `1`. maxLength: `200`. |
| operation.batch | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`.; anyOf 2/2: At least one alternative must match. Goods batch label; null = none supplied. |
| operation.expires_on | alternative (anyOf) | Optional | Allowed by schema | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Actual best-before date as YYYY-MM-DD; null or omission means unknown. It does not itself release goods for use. |
| operation.expires_on | string | Conditional: anyOf 1/2 | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`.; anyOf 1/2: At least one alternative must match. Actual best-before date as YYYY-MM-DD; null or omission means unknown. It does not itself release goods for use. format: `"date"`. |
| operation.expires_on | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`.; anyOf 2/2: At least one alternative must match. Actual best-before date as YYYY-MM-DD; null or omission means unknown. It does not itself release goods for use. |
| operation.personalized | boolean | Optional | Not allowed | anyOf 6/10: At least one alternative must match. Applies to kind = `"receive_direct"`. Omit or false. True is rejected. |
| operation | object | Conditional: anyOf 7/10 | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Kind selects required fields. const: `"inspect"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.line_id | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Line identifier in this delivery/return/dispatch section. format: `"uuid"`. |
| operation.receipt_id | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Identifier of the physical receipt being inspected. format: `"uuid"`. |
| operation.inspection_id | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Inspection ID; retain for owner decisions and execution. format: `"uuid"`. |
| operation.quantity | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Exact decimal-string quantity in the stated unit; no floats. pattern: `"^(?=.*[1-9])(0\|[1-9]\\d{0,8})(\\.\\d{1,6})?$"`. |
| operation.observed_condition_id | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Condition actually observed during inspection, selected from the condition catalog. format: `"uuid"`. |
| operation.offered_condition_ids | array | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Condition identifiers the operator offers as possible destinations for the owner's disposition decision. maxItems: `100`. |
| operation.offered_condition_ids[] | string | Every array item | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. format: `"uuid"`. |
| operation.notes | string | Required when parent is present | Not allowed | anyOf 7/10: At least one alternative must match. Applies to kind = `"inspect"`. Observations and explanatory notes for the inspection or operation. minLength: `1`. maxLength: `2000`. |
| operation | object | Conditional: anyOf 8/10 | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Kind selects required fields. const: `"execute_disposition"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.inspection_id | string | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Inspection ID; retain for owner decisions and execution. format: `"uuid"`. |
| operation.source_balance_id | string | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Exact stock balance from which goods are consumed or moved. format: `"uuid"`. |
| operation.expected_balance_version | integer | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Current version of the selected stock balance from the latest warehouse read. minimum: `1`. maximum: `2147483647`. |
| operation.target_location_id | alternative (anyOf) | Required when parent is present | Allowed by schema | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Actual destination storage location for the moved or recovered goods; null only where the selected action permits no destination. |
| operation.target_location_id | string | Conditional: anyOf 1/2 | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`.; anyOf 1/2: At least one alternative must match. Actual destination storage location for the moved or recovered goods; null only where the selected action permits no destination. format: `"uuid"`. |
| operation.target_location_id | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`.; anyOf 2/2: At least one alternative must match. Actual destination storage location for the moved or recovered goods; null only where the selected action permits no destination. |
| operation.reason | string | Required when parent is present | Not allowed | anyOf 8/10: At least one alternative must match. Applies to kind = `"execute_disposition"`. Recorded reason. minLength: `1`. maxLength: `500`. |
| operation | object | Conditional: anyOf 9/10 | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Kind selects required fields. const: `"reinspect"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.inspection_id | string | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Inspection ID; retain for owner decisions and execution. format: `"uuid"`. |
| operation.observed_condition_id | string | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Condition actually observed during inspection, selected from the condition catalog. format: `"uuid"`. |
| operation.offered_condition_ids | array | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Condition identifiers the operator offers as possible destinations for the owner's disposition decision. maxItems: `100`. |
| operation.offered_condition_ids[] | string | Every array item | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. format: `"uuid"`. |
| operation.notes | string | Required when parent is present | Not allowed | anyOf 9/10: At least one alternative must match. Applies to kind = `"reinspect"`. Observations and explanatory notes for the inspection or operation. minLength: `1`. maxLength: `2000`. |
| operation | object | Conditional: anyOf 10/10 | Not allowed | anyOf 10/10: At least one alternative must match. Applies to kind = `"close"`. Action to perform. Select kind first; only that variant determines which fields are required. Additional properties are not allowed. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 10/10: At least one alternative must match. Applies to kind = `"close"`. Kind selects required fields. const: `"close"`. |
| operation.return_id | string | Required when parent is present | Not allowed | anyOf 10/10: At least one alternative must match. Applies to kind = `"close"`. Return UUID: new on announce; reuse for reads/changes/retries. format: `"uuid"`. |
| operation.expected_version | integer | Required when parent is present | Not allowed | anyOf 10/10: At least one alternative must match. Applies to kind = `"close"`. Latest-read version; stale versions rejected. minimum: `1`. maximum: `2147483647`. |
| operation.accept_shortage | boolean | Required when parent is present | Not allowed | anyOf 10/10: At least one alternative must match. Applies to kind = `"close"`. Explicit acknowledgement of remaining unreceived quantities when closing the case. |
| operation.reason | string | Required when parent is present | Not allowed | anyOf 10/10: At least one alternative must match. Applies to kind = `"close"`. Recorded reason. minLength: `1`. maxLength: `500`. |

## Response 200

200: Success

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | Additional properties are not allowed. |
| data | object | Required when parent is present | Not allowed | Authorized response payload or documented event data. Additional properties are not allowed. |
| data.saved | boolean | Required when parent is present | Not allowed | Whether this operation persisted a change; false identifies a preview rather than a booking. const: `false`. |
| data.already_applied | boolean | Required when parent is present | Not allowed | Whether the same intended operation was already applied and this response is its replay. |
| data.entity_id | string | Required when parent is present | Not allowed | Identifier of the specific inbound or return case selected for this recovery view. format: `"uuid"`. |
| data.before_fingerprint | string | Required when parent is present | Not allowed | Opaque fingerprint of the state inspected by the preview. pattern: `"^[0-9a-f]{64}$"`. |
| data.before | alternative (anyOf) | Required when parent is present | Allowed by schema | Business state before the proposed action; null when the action would create the record. |
| data.before | object | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Business state before the proposed action; null when the action would create the record. |
| data.before.{key} | any JSON value | Every additional entry | Allowed by schema | anyOf 1/2: At least one alternative must match. Operation-specific current field; the concrete fields follow the selected case and action. |
| data.before | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Business state before the proposed action; null when the action would create the record. |
| data.after | alternative (anyOf) | Required when parent is present | Allowed by schema | Prospective case state after this action; a preview does not persist it. |
| data.after | object | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Prospective case state after this action; a preview does not persist it. |
| data.after.{key} | any JSON value | Every additional entry | Allowed by schema | anyOf 1/2: At least one alternative must match. Operation-specific prospective field; the concrete fields follow the selected case and action. |
| data.after | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Prospective case state after this action; a preview does not persist it. |
| data.expected_version | alternative (anyOf) | Required when parent is present | Allowed by schema | Current version from the latest read; an outdated version rejects the operation instead of overwriting concurrent changes. |
| data.expected_version | integer | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Current version from the latest read; an outdated version rejects the operation instead of overwriting concurrent changes. minimum: `0`. |
| data.expected_version | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Current version from the latest read; an outdated version rejects the operation instead of overwriting concurrent changes. |

## Response 401, 403, 404, 409, 422, 429, 500, 503

401: The key is missing, unknown, revoked or expired. 403: The key lacks a required scope, or the operation requires a live key. 404: Not found. Also applies to IDs that belong to another organization — we deliberately do not distinguish between "does not exist" and "does not belong to you". 409: The same ID already exists with different content. It is never overwritten. 422: Content validation failed. The response lists all affected locations at once. 429: A rate limit was reached and the request did not run. Wait for Retry-After, then repeat it unchanged. X-RateLimit-Scope names the limit: key (120 requests per minute), organization (300 per minute across all keys), write (1,000 at once, refilling at 60 per minute) or list (300 unfiltered list pages at once, refilling at 10 per minute). 500: Unexpected error on our side. 503: Temporarily unavailable. Repeat the same request with the same business identity.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | — |
| error | object | Required when parent is present | Not allowed | Machine-readable error code; use it to select the documented recovery path. |
| error.code | string | Required when parent is present | Not allowed | Machine-readable, permanently stable error code. Program against it, not against message. |
| error.message | string | Required when parent is present | Not allowed | Explanation for humans. May change at any time. |
| error.field | string | Optional | Not allowed | Affected location in the request, if it can be determined. |
| error.doc_url | string | Required when parent is present | Not allowed | Documentation link explaining this API error. format: `"uri"`. |
