Change an order
PATCH /v1/orders/{id}
Submits a durable change command. expected_revision comes from the order you last read; idempotency_key is a new UUID per business command. After a connection error, repeat exactly the same command. Rejected once picking or production has started on your own order (order_work_started), and also when the order is completed or shipped at the fulfiller. If the fulfiller has already started, the fulfiller is asked (decision_required, partner_approval_required): they see the changed items and message; if they agree, they stop their production and choose the billing, and then Meykt applies the change. A fulfillment decision may be pending; 202 does not mean the change is complete. Check the status via /commands/{commandId}.
Required scopes: "orders:change".
#Parameters
#path: id
Required. Meykt ID of an order of this API channel and this environment.
| Field | Type | Presence | null | Meaning, limits and examples |
|---|---|---|---|---|
| $ (whole value) | string | Whole value | Not allowed | format: "uuid". |
#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 UUID for this intended command. Retry the identical command with the same UUID after an unclear response. format: "uuid". |
| expected_revision | string | Required when parent is present | Not allowed | Unchanged revision from the latest order response; a stale revision rejects the command. format: "date-time". |
| message | string | Optional | Not allowed | Explanation for the fulfillment partner when the change needs their decision. minLength: 1. maxLength: 4000. |
| changes | object | Required when parent is present | Not allowed | Partial order change: omitted top-level fields keep their current values. Supplied customer and address objects replace their entire sections; omitted members are cleared. Supplied collections replace their corresponding values. At least one field is required; supplied items all require external_line_id. payment_status is sent as the only change of its command. status is not accepted here. Additional properties are not allowed. minProperties: 1. |
| changes.customer | object | Optional | Not allowed | End-customer contact details, independent of customer master data and addresses. On creation, omitted members are empty. On PATCH, omit customer to retain all contact details; a supplied object replaces the entire section, and omitted members are cleared. An empty object clears all contact details; customer: null is invalid. Additional properties are not allowed. |
| changes.customer.name | alternative (anyOf) | Optional | Allowed by schema | Recipient or contact display name. |
| changes.customer.name | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Recipient or contact display name. maxLength: 200. |
| changes.customer.name | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Recipient or contact display name. |
| changes.customer.email | alternative (anyOf) | Optional | Allowed by schema | Contact email address. |
| changes.customer.email | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Contact email address. format: "email". maxLength: 320. |
| changes.customer.email | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Contact email address. |
| changes.customer.phone | alternative (anyOf) | Optional | Allowed by schema | Contact telephone number including international prefix where applicable. |
| changes.customer.phone | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Contact telephone number including international prefix where applicable. maxLength: 80. |
| changes.customer.phone | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Contact telephone number including international prefix where applicable. |
| changes.currency | string | Optional | Not allowed | Three-letter currency code, for example EUR; normalized to uppercase. Required on creation when total_amount is supplied. pattern: "^[A-Za-z]{3}$". |
| changes.total_amount | number | Optional | Not allowed | Total order amount in major currency units, for example 24.90 EUR. Supplied by your source system; not recalculated from line prices. minimum: 0. maximum: 100000000. |
| changes.ordered_at | string | Optional | Not allowed | Time the order was placed, including UTC Z or a numeric time-zone offset. format: "date-time". |
| changes.shipping_address | alternative (anyOf) | Optional | Allowed by schema | Shipping address supplied by the source. Omit on change to preserve it; null clears it. Never filled from billing_address. |
| changes.shipping_address | object | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Shipping address supplied by the source. Omit on change to preserve it; null clears it. Never filled from billing_address. Additional properties are not allowed. |
| changes.shipping_address.name | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Recipient or contact display name. |
| changes.shipping_address.name | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Recipient or contact display name. maxLength: 200. |
| changes.shipping_address.name | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Recipient or contact display name. |
| changes.shipping_address.company | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Company or organization name. |
| changes.shipping_address.company | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Company or organization name. maxLength: 200. |
| changes.shipping_address.company | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Company or organization name. |
| changes.shipping_address.line1 | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Street, house number and primary address line. |
| changes.shipping_address.line1 | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Street, house number and primary address line. maxLength: 200. |
| changes.shipping_address.line1 | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Street, house number and primary address line. |
| changes.shipping_address.line2 | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Additional delivery or address information. |
| changes.shipping_address.line2 | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Additional delivery or address information. maxLength: 200. |
| changes.shipping_address.line2 | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Additional delivery or address information. |
| changes.shipping_address.postal_code | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Postal code as text, preserving leading zeroes. |
| changes.shipping_address.postal_code | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Postal code as text, preserving leading zeroes. maxLength: 20. |
| changes.shipping_address.postal_code | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Postal code as text, preserving leading zeroes. |
| changes.shipping_address.city | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. City or locality. |
| changes.shipping_address.city | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. City or locality. maxLength: 120. |
| changes.shipping_address.city | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. City or locality. |
| changes.shipping_address.state | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Region, state or province. |
| changes.shipping_address.state | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Region, state or province. maxLength: 120. |
| changes.shipping_address.state | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Region, state or province. |
| changes.shipping_address.country | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Two-letter country code such as DE. The existing contract accepts up to two characters. |
| changes.shipping_address.country | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Two-letter country code such as DE. The existing contract accepts up to two characters. maxLength: 2. |
| changes.shipping_address.country | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Two-letter country code such as DE. The existing contract accepts up to two characters. |
| changes.shipping_address.phone | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Contact telephone number including international prefix where applicable. |
| changes.shipping_address.phone | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Contact telephone number including international prefix where applicable. maxLength: 80. |
| changes.shipping_address.phone | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Contact telephone number including international prefix where applicable. |
| changes.shipping_address.email | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Contact email address. |
| changes.shipping_address.email | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Contact email address. format: "email". maxLength: 320. |
| changes.shipping_address.email | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Contact email address. |
| changes.shipping_address | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Shipping address supplied by the source. Omit on change to preserve it; null clears it. Never filled from billing_address. |
| changes.billing_address | alternative (anyOf) | Optional | Allowed by schema | Billing address supplied by the source. Omit on change to preserve it; null clears it. Never filled from shipping_address. |
| changes.billing_address | object | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match. Billing address supplied by the source. Omit on change to preserve it; null clears it. Never filled from shipping_address. Additional properties are not allowed. |
| changes.billing_address.name | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Recipient or contact display name. |
| changes.billing_address.name | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Recipient or contact display name. maxLength: 200. |
| changes.billing_address.name | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Recipient or contact display name. |
| changes.billing_address.company | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Company or organization name. |
| changes.billing_address.company | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Company or organization name. maxLength: 200. |
| changes.billing_address.company | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Company or organization name. |
| changes.billing_address.line1 | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Street, house number and primary address line. |
| changes.billing_address.line1 | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Street, house number and primary address line. maxLength: 200. |
| changes.billing_address.line1 | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Street, house number and primary address line. |
| changes.billing_address.line2 | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Additional delivery or address information. |
| changes.billing_address.line2 | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Additional delivery or address information. maxLength: 200. |
| changes.billing_address.line2 | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Additional delivery or address information. |
| changes.billing_address.postal_code | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Postal code as text, preserving leading zeroes. |
| changes.billing_address.postal_code | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Postal code as text, preserving leading zeroes. maxLength: 20. |
| changes.billing_address.postal_code | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Postal code as text, preserving leading zeroes. |
| changes.billing_address.city | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. City or locality. |
| changes.billing_address.city | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. City or locality. maxLength: 120. |
| changes.billing_address.city | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. City or locality. |
| changes.billing_address.state | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Region, state or province. |
| changes.billing_address.state | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Region, state or province. maxLength: 120. |
| changes.billing_address.state | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Region, state or province. |
| changes.billing_address.country | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Two-letter country code such as DE. The existing contract accepts up to two characters. |
| changes.billing_address.country | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Two-letter country code such as DE. The existing contract accepts up to two characters. maxLength: 2. |
| changes.billing_address.country | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Two-letter country code such as DE. The existing contract accepts up to two characters. |
| changes.billing_address.phone | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Contact telephone number including international prefix where applicable. |
| changes.billing_address.phone | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Contact telephone number including international prefix where applicable. maxLength: 80. |
| changes.billing_address.phone | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Contact telephone number including international prefix where applicable. |
| changes.billing_address.email | alternative (anyOf) | Optional | Allowed by schema | anyOf 1/2: At least one alternative must match. Contact email address. |
| changes.billing_address.email | string | Conditional: anyOf 1/2 | Not allowed | anyOf 1/2: At least one alternative must match.; anyOf 1/2: At least one alternative must match. Contact email address. format: "email". maxLength: 320. |
| changes.billing_address.email | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 1/2: At least one alternative must match.; anyOf 2/2: At least one alternative must match. Contact email address. |
| changes.billing_address | null | Conditional: anyOf 2/2 | Allowed by schema | anyOf 2/2: At least one alternative must match. Billing address supplied by the source. Omit on change to preserve it; null clears it. Never filled from shipping_address. |
| changes.priority | string | Optional | Not allowed | Processing priority; defaults to normal on creation. enum: ["low","normal","high","urgent"]. |
| changes.note | string | Optional | Not allowed | Order note. Omit on change to preserve it; an empty string clears it. maxLength: 10000. |
| changes.warehouse_note | string | Optional | Not allowed | Handling instructions for the warehouse. Omit on change to preserve them; an empty string clears them. maxLength: 10000. |
| changes.personalization | object | Optional | Not allowed | Free text personalization by label. At most 50 entries. A label also present in fields must carry the same value. propertyNames: {"minLength":1,"maxLength":80}. maxProperties: 50. |
| changes.personalization.{key} | string | Every additional entry | Not allowed | Personalization text for this label; an empty string is accepted. maxLength: 2000. |
| changes.fields | object | Optional | Not allowed | Values keyed by configured input-field identifiers. Use GET /v1/orders/fields for allowed keys, types and choices; computed fields are not writable. Values must agree with personalization when keys overlap. maxProperties: 200. |
| changes.fields.{key} | alternative (anyOf) | Every additional entry | Allowed by schema | Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.fields.{key} | string | Conditional: anyOf 1/5 | Not allowed | anyOf 1/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. maxLength: 10000. |
| changes.fields.{key} | number | Conditional: anyOf 2/5 | Not allowed | anyOf 2/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.fields.{key} | boolean | Conditional: anyOf 3/5 | Not allowed | anyOf 3/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.fields.{key} | array | Conditional: anyOf 4/5 | Not allowed | anyOf 4/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. maxItems: 200. |
| changes.fields.{key}[] | string | Every array item | Not allowed | anyOf 4/5: At least one alternative must match. maxLength: 10000. |
| changes.fields.{key} | null | Conditional: anyOf 5/5 | Allowed by schema | anyOf 5/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.files | array | Optional | Not allowed | Uploaded file references for this order or line; at most 10 here and 100 across the entire order. maxItems: 10. |
| changes.files[] | object | Every array item | Not allowed | Additional properties are not allowed. |
| changes.files[].upload_id | string | Required when parent is present | Not allowed | Your completed upload from POST /v1/uploads; each file must belong to this connection and be unused. format: "uuid". |
| changes.files[].role | string | Optional | Not allowed | Purpose of the file, such as artwork or engraving. Omit for an unnamed file attachment. minLength: 1. maxLength: 80. |
| changes.items | array | Optional | Not allowed | Complete list of order lines. On change this replaces the line selection; send stable external_line_id values from the current order. Omit on change to keep all lines. minItems: 1. maxItems: 200. |
| changes.items[] | object | Every array item | Not allowed | If "parent_external_line_id" is present, also provide "external_line_id". Additional properties are not allowed. |
| changes.items[].group | object | Optional | Not allowed | Display-only grouping of order lines; does not create a stock set or change quantities. Additional properties are not allowed. |
| changes.items[].group.key | string | Required when parent is present | Not allowed | Stable grouping key shared by lines in the same display group. minLength: 1. maxLength: 128. |
| changes.items[].group.title | string | Optional | Not allowed | Display heading for this group; all lines with the same group key must use the same title. minLength: 1. maxLength: 300. |
| changes.items[].external_line_id | string | Optional | Not allowed | Stable line identifier in your system, unique within this order. Required for set parts and for every line supplied in a change. minLength: 1. maxLength: 128. |
| changes.items[].parent_external_line_id | string | Optional | Not allowed | external_line_id of the set heading in this same order, not this part's own identifier. Requires this part to have its own external_line_id. One nesting level; at most 100 parts per set. minLength: 1. maxLength: 128. |
| changes.items[].sku | string | Optional | Not allowed | SKU used to match the sold line to a Meykt article. Unknown or omitted SKUs are accepted with a warning; no match is guessed. minLength: 1. maxLength: 120. |
| changes.items[].name | string | Required when parent is present | Not allowed | Name of the sold item as it should appear on this order. minLength: 1. maxLength: 300. |
| changes.items[].quantity | integer | Required when parent is present | Not allowed | Whole number of ordered items, from 1 to 10000. A set part carries its total quantity for this order, not a quantity per parent set. There is no separate unit field. minimum: 1. maximum: 10000. |
| changes.items[].price | number | Optional | Not allowed | Unit price supplied by your source system in the order currency; Meykt does not calculate tax or derive the order total from it. minimum: 0. maximum: 1000000. |
| changes.items[].personalization | object | Optional | Not allowed | Free text personalization by label. At most 50 entries. A label also present in fields must carry the same value. propertyNames: {"minLength":1,"maxLength":80}. maxProperties: 50. |
| changes.items[].personalization.{key} | string | Every additional entry | Not allowed | Personalization text for this label; an empty string is accepted. maxLength: 2000. |
| changes.items[].fields | object | Optional | Not allowed | Values keyed by configured input-field identifiers. Use GET /v1/orders/fields for allowed keys, types and choices; computed fields are not writable. Values must agree with personalization when keys overlap. maxProperties: 200. |
| changes.items[].fields.{key} | alternative (anyOf) | Every additional entry | Allowed by schema | Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.items[].fields.{key} | string | Conditional: anyOf 1/5 | Not allowed | anyOf 1/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. maxLength: 10000. |
| changes.items[].fields.{key} | number | Conditional: anyOf 2/5 | Not allowed | anyOf 2/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.items[].fields.{key} | boolean | Conditional: anyOf 3/5 | Not allowed | anyOf 3/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.items[].fields.{key} | array | Conditional: anyOf 4/5 | Not allowed | anyOf 4/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. maxItems: 200. |
| changes.items[].fields.{key}[] | string | Every array item | Not allowed | anyOf 4/5: At least one alternative must match. maxLength: 10000. |
| changes.items[].fields.{key} | null | Conditional: anyOf 5/5 | Allowed by schema | anyOf 5/5: At least one alternative must match. Value matching the type and choices of this configured input; read GET /v1/orders/fields. Computed fields and arbitrary object paths are not writable. |
| changes.items[].files | array | Optional | Not allowed | Uploaded file references for this order or line; at most 10 here and 100 across the entire order. maxItems: 10. |
| changes.items[].files[] | object | Every array item | Not allowed | Additional properties are not allowed. |
| changes.items[].files[].upload_id | string | Required when parent is present | Not allowed | Your completed upload from POST /v1/uploads; each file must belong to this connection and be unused. format: "uuid". |
| changes.items[].files[].role | string | Optional | Not allowed | Purpose of the file, such as artwork or engraving. Omit for an unnamed file attachment. minLength: 1. maxLength: 80. |
| changes.payment_status | string | Optional | Not allowed | Optional payment state of the order: paid, unpaid, pending (payment started but not confirmed), partially_paid, refunded or failed. When omitted on creation the payment state is unknown, which never holds the order back. A fulfillment partnership that holds back unpaid orders waits until the state is paid. On PATCH send it as the only change; Meykt then updates the payment state without changing the order content, and a held-back handover continues automatically once the order is paid. enum: ["paid","unpaid","pending","partially_paid","refunded","failed"]. |
| changes | object | Conditional: allOf 1/2 | Allowed by schema | allOf 1/2: All rules must match. Partial order change: omitted top-level fields keep their current values. Supplied customer and address objects replace their entire sections; omitted members are cleared. Supplied collections replace their corresponding values. At least one field is required; supplied items all require external_line_id. payment_status is sent as the only change of its command. status is not accepted here. |
| changes.items | array | Optional | Allowed by schema | allOf 1/2: All rules must match. |
| changes.items[] | any JSON value | Every array item | Allowed by schema | allOf 1/2: All rules must match. |
| changes.items[] | requirement | Required: external_line_id | See field type | allOf 1/2: All rules must match. |
| changes | any JSON value | Conditional: allOf 2/2 | Allowed by schema | allOf 2/2: All rules must match. Partial order change: omitted top-level fields keep their current values. Supplied customer and address objects replace their entire sections; omitted members are cleared. Supplied collections replace their corresponding values. At least one field is required; supplied items all require external_line_id. payment_status is sent as the only change of its command. status is not accepted here. When {"required":["payment_status"]} matches, the then rules apply; otherwise the else rules apply. |
| changes | any JSON value | Conditional: then | Allowed by schema | allOf 2/2: All rules must match. When {"required":["payment_status"]} matches. maxProperties: 1. |
#Response 200, 202
200: Success; see the status meaning of the operation. 202: 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.command | object | Required when parent is present | Not allowed | Stored command outcome. processing and decision_required are provisional; completed and rejected are final. Additional properties are not allowed. |
| data.command.command_id | string | Required when parent is present | Not allowed | Identifier of the durable command whose outcome can be read again. format: "uuid". |
| data.command.order_id | string | Required when parent is present | Not allowed | Meykt order ID from authorized reads; not order number/external reference. format: "uuid". |
| data.command.kind | string | Required when parent is present | Not allowed | Kind selects required fields. enum: ["change","cancel"]. |
| data.command.state | string | Required when parent is present | Not allowed | Operation state; processing/decision states do not prove completion. enum: ["processing","decision_required","completed","rejected"]. |
| data.command.revision | string or null | Required when parent is present | Allowed by schema | Revision token; reuse unchanged for the next change. |
| data.command.code | string or null | Required when parent is present | Allowed by schema | Code of this condition, record or business result. |
| data.command.created_at | string | Required when parent is present | Not allowed | Created at, with time-zone offset. |
| data.command.updated_at | string | Required when parent is present | Not allowed | Last changed at, with time-zone offset. |
#Response 400, 401, 403, 404, 409, 413, 422, 429, 500, 503
400: The request is not valid JSON. 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. 413: The JSON request exceeds 256 KiB. 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-change-order.md