Check a condition change authoritatively without saving it
All field references · Conditions
POST /v1/conditions/commands/preview
Runs the same validation and then fully rolls it back. saved=false is not a saved change; do not reuse preview identifiers as existing conditions.
Required scopes: "conditions:write", "conditions:read", "inventory:read".
#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 | Select kind, then supply its required fields. |
| operation | object | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Select kind, then supply its required fields. Additional properties are not allowed. |
| operation.code | string | Required when parent is present | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Custom code; system definitions are fixed. pattern: "^[a-z][a-z0-9_-]{0,63}$". |
| operation.name | string | Required when parent is present | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Display name. minLength: 1. maxLength: 120. |
| operation.quality_grade | alternative (anyOf) | Required when parent is present | Allowed by schema | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Optional quality grade assigned to this stock condition. |
| operation.quality_grade | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define".; anyOf 1/2: At least one alternative must match. Optional quality grade assigned to this stock condition. pattern: "^[a-z][a-z0-9_-]{0,63}$". |
| operation.quality_grade | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match. Applies to kind = "define".; anyOf 2/2: At least one alternative must match. Optional quality grade assigned to this stock condition. |
| operation.disposition | string | Required when parent is present | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Listed disposition; follow-up depends on the current case and rights. enum: ["quarantine","released","blocked"]. |
| operation.expected_catalog_version | integer | Required when parent is present | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Current condition catalog version; use 0 only where the catalog has not yet been created. minimum: 0. maximum: 2147483646. |
| operation.reason | string | Required when parent is present | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Recorded reason. minLength: 1. maxLength: 500. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 1/2: At least one alternative must match. Applies to kind = "define". Kind selects required fields. const: "define". |
| operation | object | Conditional: anyOf 2/2 | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Select kind, then supply its required fields. Additional properties are not allowed. |
| operation.provider | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Provider code for this external condition mapping or source field. pattern: "^[a-z][a-z0-9_-]{0,63}$". |
| operation.market | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Market name used to scope the external condition mapping. minLength: 1. maxLength: 80. |
| operation.category | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Category used to scope this catalog entry or condition mapping. minLength: 1. maxLength: 160. |
| operation.external_code | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Condition code supplied by the external provider. minLength: 1. maxLength: 120. |
| operation.condition_id | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Condition identifier from current choices. format: "uuid". |
| operation.expected_mapping_version | integer | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Current condition mapping version; use 0 when creating a previously absent mapping. minimum: 0. maximum: 2147483646. |
| operation.reason | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Recorded reason. minLength: 1. maxLength: 500. |
| operation.kind | string | Required when parent is present | Not allowed | anyOf 2/2: At least one alternative must match. Applies to kind = "map". Kind selects required fields. const: "map". |
#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.receipt | object | Required when parent is present | Not allowed | Stored command receipt, or the prospective receipt returned by a preview. Additional properties are not allowed. |
| data.receipt.id | string | Required when parent is present | Not allowed | Stable entry identifier. format: "uuid". |
| data.receipt.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". |
| data.receipt.kind | string | Required when parent is present | Not allowed | Kind selects required fields. enum: ["define","map","reclassify"]. |
| data.receipt.condition_id | string | Required when parent is present | Not allowed | Condition identifier from current choices. format: "uuid". |
| data.receipt.catalog_version | integer | Required when parent is present | Not allowed | Version of the selected stock-condition catalog entry. exclusiveMinimum: 0. maximum: 2147483647. |
| data.receipt.quantity | alternative (anyOf) | Required when parent is present | Allowed by schema | Exact decimal-string quantity in the stated unit; no floats. |
| data.receipt.quantity | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Exact decimal-string quantity in the stated unit; no floats. pattern: "^(0|[1-9]\\d{0,8})(\\.\\d{1,6})?$". |
| data.receipt.quantity | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Exact decimal-string quantity in the stated unit; no floats. |
| data.receipt.source_position_id | alternative (anyOf) | Required when parent is present | Allowed by schema | Stock position from which quantity was reclassified. |
| data.receipt.source_position_id | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Stock position from which quantity was reclassified. format: "uuid". |
| data.receipt.source_position_id | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Stock position from which quantity was reclassified. |
| data.receipt.target_position_id | alternative (anyOf) | Required when parent is present | Allowed by schema | Stock position receiving the reclassified quantity. |
| data.receipt.target_position_id | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Stock position receiving the reclassified quantity. format: "uuid". |
| data.receipt.target_position_id | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Stock position receiving the reclassified quantity. |
| data.receipt.source_revision | alternative (anyOf) | Required when parent is present | Allowed by schema | Revision of the source stock position after the recorded action. |
| data.receipt.source_revision | integer | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Revision of the source stock position after the recorded action. exclusiveMinimum: 0. maximum: 2147483647. |
| data.receipt.source_revision | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Revision of the source stock position after the recorded action. |
| data.receipt.target_revision | alternative (anyOf) | Required when parent is present | Allowed by schema | Revision of the destination stock position after the recorded action. |
| data.receipt.target_revision | integer | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Revision of the destination stock position after the recorded action. exclusiveMinimum: 0. maximum: 2147483647. |
| data.receipt.target_revision | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Revision of the destination stock position after the recorded action. |
| data.receipt.created_at | string | Required when parent is present | Not allowed | Created at, with time-zone offset. format: "date-time". |
#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". |
Machine-readable version of this page: https://www.meykt.com/developers/fields-preview-stock-conditions.md