Orders
Orders are the core resource of the Meykt API: your system sends an order with its items, personalization and files, and Meykt turns it into work in the workshop. Order creation is idempotent on your own order number, all-or-nothing per request, and never overwrites an order that already exists. This page covers creation, reads, explicit pre-start changes/cancellation, and durable command results.
Manual order drafts belong to the order studio and the shared MCP/Meyki tools. They are saved separately until someone explicitly creates the order, so they do not appear in order lists, start work, or emit API order events. The public API creates orders directly and only exposes orders belonging to its own connection; its existing scopes do not grant access to manual drafts.
#Create an order
POST https://api.meykt.com/v1/orders — requires the scope orders:write.
curl -X POST https://api.meykt.com/v1/orders \
-H "Authorization: Bearer mk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_order_id": "ORDER-2026-1044",
"currency": "EUR",
"total_amount": 47.60,
"ordered_at": "2026-08-07T09:12:00+02:00",
"customer": {
"name": "Anna Beispiel",
"email": "anna@beispiel.test"
},
"shipping_address": {
"name": "Anna Beispiel",
"line1": "Musterweg 5",
"postal_code": "12345",
"city": "Musterstadt",
"country": "DE"
},
"items": [{
"external_line_id": "line-1",
"sku": "BECHER-GROSS",
"name": "Becher gross",
"quantity": 2,
"price": 20.00,
"personalization": {
"print_text": "Alles Gute",
"name": "Anna"
},
"files": [{ "upload_id": "0f2a6b3c-9d41-4a77-b0f1-2b7c9a5e4d10", "role": "print" }]
}]
}'Request fields:
| Field | Type | Required | Notes |
|---|---|---|---|
external_order_id | string | yes | Your order number. Basis of idempotency. |
order_number | string | no | Human-facing number. Defaults to external_order_id. |
currency | string | conditional | ISO-4217, three letters. Required as soon as total_amount is set. |
total_amount | number | no | Gross amount paid, display only. |
ordered_at | string | no | ISO-8601 with timezone. Defaults to the time of receipt. |
customer | object | no | name, email, phone. |
shipping_address, billing_address | object or null | no | Independent addresses; name, company, phone, email, line1, line2, postal_code, city, state, country. |
items | array | yes | 1–200 entries. |
items[].external_line_id | string | no | Stable line identifier, unique in this order; required when replacing items in a change command. |
items[].sku | string | no | Your article number. Without it, no product matching is possible. |
items[].name | string | yes | Item name shown in the workshop. |
items[].quantity | integer | yes | 1–10000. |
items[].group | object | no | Optional packing association { "key": "gift-1", "title": "Gift 1" }; keys are order-local (1–128 characters), titles optional (1–300). This does not change stock demand, item quantities or parcel rules. |
items[].price | number | no | Net unit price in currency. |
items[].personalization | object | no | Named string fields, see Personalization. |
items[].files | array | no | { "upload_id": "…", "role": "…" }, see Files. |
status | string | no | Status from your own system, 1–50 characters. The connection maps it to a Meykt start status; see Start status and payment status. Creation only. |
payment_status | string | no | paid, unpaid, pending, partially_paid, refunded or failed. Without it the payment state is unknown. |
priority, note, warehouse_note | string | no | Handling instructions; see Order-wide data and typed fields. |
personalization, fields, files | object / object / array | no | Order-wide inputs; the same input families are available per item. |
items[].fields | object | no | Registered typed variable inputs. |
metadata | object | no | Free-form. Stored with the raw order, not interpreted. |
A newly created order responds with 201. Every successful response wraps its payload in data:
{
"data": {
"order": {
"id": "8c4d2f9a-5b71-4e6c-9a03-1f7d8e2b6c45",
"external_order_id": "ORDER-2026-1044",
"order_number": "ORDER-2026-1044",
"status": "processing",
"payment_status": "unknown",
"revision": "2026-08-07T07:12:04.512Z",
"priority": "normal",
"note": null,
"warehouse_note": null,
"personalization": {},
"fields": {},
"files": [],
"is_test": true,
"currency": "EUR",
"total_amount": 47.6,
"ordered_at": "2026-08-07T09:12:00+02:00",
"created_at": "2026-08-07T07:12:04.512Z",
"updated_at": "2026-08-07T07:12:04.512Z",
"customer": { "name": "Anna Beispiel", "email": "anna@beispiel.test", "phone": null },
"shipping_address": { "name": "Anna Beispiel", "company": null, "phone": null, "email": null, "line1": "Musterweg 5", "line2": null, "postal_code": "12345", "city": "Musterstadt", "state": null, "country": "DE" },
"billing_address": null,
"items": [{
"id": "b1e77c30-2a48-4c19-8f55-9d0a3e6b1742",
"external_line_id": "line-1",
"sku": "BECHER-GROSS",
"name": "Becher gross",
"quantity": 2,
"price": 20,
"product_linked": false,
"production_status": null,
"personalization": { "print_text": "Alles Gute", "name": "Anna" },
"fields": {},
"files": [{ "id": "0f2a6b3c-9d41-4a77-b0f1-2b7c9a5e4d10", "name": "druck-logo.svg", "role": "print", "download_path": "/v1/orders/8c4d2f9a-5b71-4e6c-9a03-1f7d8e2b6c45/files/0f2a6b3c-9d41-4a77-b0f1-2b7c9a5e4d10" }]
}]
},
"warnings": [{
"code": "item_product_unmatched",
"field": "items[0].sku",
"value": "BECHER-GROSS",
"message": "SKU \"BECHER-GROSS\" is not linked to any product yet. The order was accepted; link it in the dashboard under Products → assignment queue."
}]
}
}is_test is true for keys starting with mk_test_. Test orders appear in the order list with a test badge, but never start production, never count towards statistics and never trigger webhooks.
#Status values
Two independent status fields exist. Map the values you know and treat anything else as unknown — new values can be added without a new API version.
status describes the order as a whole:
| Value | Meaning |
|---|---|
pending | Accepted, not yet picked up for production |
processing | Being prepared |
in_production | Work has started |
production_complete | All production work finished |
shipped | Marked as shipped inside Meykt |
completed | Closed |
cancelled | Cancelled |
failed | Production failed |
production_status sits on each item and starts as null. It is set only when production on that item is started, finished or reported as failed — pausing, cancelling and restarting do not update it. Most items therefore stay null for their whole life, and a value you read may be older than the order's real state. Use it as a hint, never as the sole basis for your own logic; read /v1/orders/{id}/progress for separate current picking, production and shipping evidence. The order’s status is a summary and never grants permission to change already-started work.
Do not hardcode either list. Treat a value you do not know as unknown rather than as an error.
#Start status and payment status
Both fields are optional on creation. The start status is the status the order has when it enters Meykt; the payment status says whether it is paid.
statusis a free text from your own system (1–50 characters, for examplereleasedorawaiting payment). Meykt compares it without regard to letter case and surrounding or repeated spaces. The business assigns each value to one Meykt status in the dashboard (see below); the possible targets arepending,processing,shipped,completed,cancelledandfailed. Neverin_productionorproduction_complete: only Meykt sets those.- Default status. Without
status, or with a value nobody has assigned, the order starts with the default status of the API connection. Unless the business changes it, that isprocessing. Before 2026-11-13 every API order started aspending, so existing integrations now seeprocessingin their responses. The start status does not start production by itself. - Unassigned values never reject an order. The order is accepted with the default status, and the value is listed as "not yet assigned" in the connection settings so the business can assign it for future orders.
payment_statusis one ofpaid,unpaid,pending(payment started but not confirmed),partially_paid,refundedorfailed. Without it the payment state isunknown, which never holds an order back. A fulfillment partnership that holds back unpaid orders waits until the state ispaid. Every order response containspayment_status(unknownplus the six values above).- After creation.
statusis not changeable through the API: PATCH rejects it like any unknown field, and repeating the creation with anotherstatusreturns the existing order unchanged. The Meykt status is managed in Meykt from then on.payment_statuscan be changed withPATCH, but only as the only change of its command, for example"changes": { "payment_status": "paid" }; sending it together with other fields is rejected with422validation_failed. It also arrives while work on the order has already started and after the order was cancelled, and a held-back fulfillment handover continues once the order is paid. - Where the business assigns values. In the dashboard under Shops → the API connection → Settings → tab "Order import" → section "Order status" (also reachable from Integrations → API access). The assignment applies to new orders only.
#Idempotency
For creation, external_order_id identifies the request within this API connection and environment. There is no separate creation idempotency header. Explicit change/cancellation commands use their own idempotency_key in the body.
If a request times out, resend the same complete request, including the same upload references. Meykt returns the existing order and resumes unfinished product matching and preparation. Accepted orders retain their unfinished preparation even when the request process stops. Completed preparation and the original automation handoff are not restarted by ordinary retries.
If the order was accepted but its current details cannot be read, creation returns 503 service_unavailable. Keep external_order_id and the complete original body unchanged and retry that request. A successful 200 or 201 always includes the order object; a read failure does not authorize creating a replacement order.
order_processing_pending means that the order is accepted and its preparation or automation handoff is still being retried. order_processing_review_required means that work changed before unfinished preparation could safely resume; review the existing order in Meykt. Neither warning asks you to create a replacement. A 503 command_outcome_unknown is also not a rejection: keep the original identifiers and retry exactly. Test orders never trigger production automations or external media fetching.
Order automations configured in Meykt can start on receipt, independently of order status, or when a selected status is reached. The latter also matches an order that already has that status when first accepted. It can run once per selected status, or once in total at the first matching status. Ordinary retries and returning to a previously used status do not add executions. Activating an automation does not backfill existing orders.
Inside an order automation, {{trigger.order_status}} identifies the triggering status; {{order.status}} is the current status and can differ when processing is delayed. Payment, production and dispatch have separate meanings. Closed orders cannot commission new production or warehouse work: use a separate observation or notification automation for those statuses. These settings add no API status values, permissions or request fields.
- Same
external_order_id, same content →200with the existing order and"warnings": []. Nothing is created twice. - Same
external_order_id, different content →409order_already_exists_with_different_content. Nothing is changed. Creation never overwrites an order. Explicit pre-start changes use the revisioned PATCH command. - Test and live are separate number spaces.
ORDER-2026-1044sent with amk_test_key does not block the same number sent later with amk_live_key.
After a connection failure, network timeout or a 500, resend the exact same request. That is the intended recovery path: either the first attempt never arrived (you get 201) or it did (you get 200 with the same order id). You never risk a duplicate.
If files are involved, reuse the same upload_id values in the retry. The content comparison is computed over the upload_ids, not over stored file paths — uploading the file again under a new upload_id makes the request look like different content and produces a 409.
The comparison covers all accepted order inputs after normalization: identity and displayed number, customer and addresses, amounts/currency, date, priority, both notes, order/item personalization and typed fields, metadata, line identities and the file references including their roles. Keep the original body and upload IDs for recovery. A creation retry does not apply any changes to the current order.
Use the explicit pre-start change command for an intended correction. Do not invent a new external_order_id to "update" an order: that creates a second, independent order. A new number is only correct for a new order.
// Safe retry pattern: identical body, identical upload_ids.
async function sendOrder(order) {
const res = await fetch('https://api.meykt.com/v1/orders', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MEYKT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(order),
});
const body = await res.json();
if (res.status === 201) return { order: body.data.order, created: true };
if (res.status === 200) return { order: body.data.order, created: false }; // retry, already there
throw new Error(body.error.code); // 409, 422, 429, 5xx — see /developers/errors
}#All or nothing
The order header, every line and the order.received messages for active endpoints of that connection commit in one database transaction. Test orders create no webhook messages. One invalid item rejects the whole request; a failed insert or outbox write cannot expose a partial order. Uploading bytes is a separate step: an upload slot may still exist after a failed order request. Keep its original upload_id for the retry. Product matching and compilation follow acceptance; their progress is read separately.
A rejected request answers 422 with error.code validation_failed and lists the parsed field problems it found, so you can fix everything in one pass:
{
"error": {
"code": "validation_failed",
"message": "The order was rejected. No part of it was accepted — fix the listed fields and resend the complete order.",
"doc_url": "https://www.meykt.com/en/developers/errors/validation_failed",
"errors": [
{ "code": "validation_failed", "message": "Number must be greater than or equal to 1", "field": "items.0.quantity" },
{ "code": "validation_failed", "message": "String must contain at least 1 character(s)", "field": "items.1.name" },
{ "code": "validation_failed", "message": "currency is required when total_amount is set", "field": "currency" }
]
}
}field uses dot notation with numeric array indexes as produced by schema validation: items.0.quantity, items.1.name. File-related rejections (file_not_found, file_type_not_allowed) point at the reference with bracket indexes instead: items[0].files[0].upload_id.
Fix the listed fields and resend the complete order under the same external_order_id — since nothing was stored, this is a first attempt, not a change.
#Unknown SKUs
An unknown sku never rejects an order and is never guessed at. The order is accepted, the item is stored with "product_linked": false, and the response reports a warning. Warnings live in data.warnings and always accompany a 2xx response:
| Warning code | Meaning |
|---|---|
item_product_unmatched | The sku does not match any product in your Meykt organization yet. value contains the SKU. |
item_missing_sku | The item has no sku at all, so it can never be matched to a product automatically. Meykt treats it as a free line: it stays on the order and in packing, but it gets no product structure part, no stock reservation and no product workflow, and it does not hold up the rest of the order. |
You link the SKU once in the dashboard under Products → assignment queue. The assignment applies retroactively to orders that already arrived and automatically to every future order with that SKU. There is nothing to change in your integration afterwards — keep sending the same SKU.
Matching runs through the same path as the shop connections: an established link is stable, and Meykt never rewires or overwrites it based on later SKU changes.
#Personalization
Personalization is a flat object of named string fields per item. The key is the label the workshop sees, the value is the text to apply:
"personalization": {
"engraving": "Alles Gute",
"name": "Anna",
"font": "Serif"
}Rules:
- Keys are free-form, 1–80 characters. Choose stable, human-readable names — they appear on the order in the dashboard exactly as sent.
- Values are strings only. Send numbers and dates as strings (
"12","2026-08-07"). - Empty strings remain explicit input values; omitting a value and sending an empty value are different intentions. Do not infer field deletion from an empty value.
- At most 50 fields per order or item, each value at most 2000 characters.
- Personalization is part of the idempotency comparison. Changing a value makes a retry a different order and produces
409. - Artwork and print files are not personalization fields. Upload them first and reference the
upload_idinitems[].files— see Files.
The response echoes personalization per item under items[].personalization.
#Packing associations
Give related actual order items the same optional group.key. A title is optional; all supplied titles for one key must agree. Identical titles with different keys remain separate groups. For example, a cup and a separately ordered gift box may share group: {"key":"gift-1","title":"Gift 1"}. Meykt applies the gift-box article's own bill of materials independently of that association.
Order reads retain the association. In a change command, changes.items replaces the complete item list: omit group from a replacement item to remove its explicit association. A command without items preserves all associations. Existing requests without groups keep their prior idempotency behavior. Group text is customer data; it does not create production instructions or additional stock.
Packing associations and parent_external_line_id serve different purposes. The latter declares supplied set components and participates in the acceptance rules below. A packing group alone never turns its first item into a virtual heading, never distributes personalization and never invents missing components. If your system has no grouping information, send ordinary items; native recipes still apply. Known source set relationships remain available as default pack context.
#Sets and bills of materials
Your system may not know bills of materials. Then send the parts of a set as their own lines and point each part at the set line with parent_external_line_id, like a Shopify line group:
"items": [
{ "external_line_id": "1", "sku": "MUG-A-GIFT-SET", "name": "Mug A gift set", "quantity": 2 },
{ "external_line_id": "1.1", "parent_external_line_id": "1", "sku": "MUG-A", "name": "Mug A", "quantity": 2 },
{ "external_line_id": "1.2", "parent_external_line_id": "1", "sku": "GIFT-BOX", "name": "Gift box", "quantity": 2 },
{ "external_line_id": "1.3", "parent_external_line_id": "1", "sku": "BOX-INSERT", "name": "Box insert", "quantity": 2 }
]The quantity of a part is its total in the order (2 sets × 1 mug = 2), not the quantity per set. Meykt decides when the order arrives; there is no switch:
| The set line … | What Meykt does |
|---|---|
| is set up as a bill of materials in Meykt (its SKU leads to a product with a stock structure) | Meykt packs the set by its own list. The set line becomes the order item; the parts are only compared and do not become items, so nothing is packed twice. If they differ from the list (a part missing, an extra part, another quantity, an unknown SKU), the whole order is rejected with 422 set_not_accepted and the message names what Meykt expects. Nothing is guessed. |
| is not set up (unknown SKU, or a product without a list) | The parts become normal order items and go to packing and to the fulfiller like any other line. The set line is only a heading and does not become an item. |
| has no parts | Nothing changes: a set line whose SKU is a bill of materials in Meykt is packed by that list, anything else is one item. |
Rules:
- One level only. A part cannot be a set line of its own (
Sets inside sets are not supported). Set up a gift box made of box and insert as two parts of the set, or as a pre-assembled kit in Meykt. - Every part needs its own
external_line_id;parent_external_line_idnames a line of the same order. - Personalization, typed fields and files belong where they are used. For a set packed by Meykt's list, put them on the set line; Meykt passes them on by its set rules. For delivered parts, put them on the part (the mug that is engraved). Details on a line that does not become an item are rejected with
422set_not_accepted, never dropped. - The decision is stored with the order.
GET /v1/orders/{id}lists it insets[](handling:meykt_structureorcomponents, with the set line and its parts). A change command decides again with the new content; lines that did not become items come back automatically if you leaveitemsout. - How many complete sets can be packed:
GET /v1/articles/{id}/stock-structure/availabilityunder Sets, kits and production recipes (available_sets, the smallest part decides).
#Limits
| Limit | Value |
|---|---|
| Items per order | 1–200 |
| Quantity per item | 1–10000 |
| Personalization fields per order/item | max. 50 |
| Personalization key length | 1–80 characters |
| Personalization value length | max. 2000 characters |
| Files per item | max. 10 |
| File size per upload | max. 50 MB |
external_order_id length | 1–128 characters |
items[].name length | 1–300 characters |
items[].sku length | 1–120 characters |
items[].price | 0–1000000 |
total_amount | 0–100000000 |
customer.name / .email / .phone | 200 / 320 / 80 characters |
| Validation errors reported per response | Creation reports all parsed field errors; commands report up to 50 |
List page size (limit) | 1–100, default 25 |
| Requests per API key | 120 per minute |
| Requests per organization, all keys together | 300 per minute |
| Writes per organization | 1,000 at once, refilling at 60 per minute |
Unfiltered list pages per organization (GET /v1/orders without updated_since) | 300 at once, refilling at 10 per minute |
Exceeding a request limit answers 429 rate_limited with a Retry-After header; X-RateLimit-Scope names the limit (key, organization, write or list). Sending 500 orders at once stays within the write allowance. Details and examples: Rate limits. The X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers accompany responses that reach the per-key limiter. Temporary overload can return 503 service_unavailable earlier; honor Retry-After and retry with backoff, jitter and the original request identity.
#Money and time
items[].priceis a net unit price — the price of one piece, excluding tax, in the order currency. Do not send a line total.total_amountis the gross amount the customer paid. It is display information only: Meykt does not calculate tax, does not convert currencies and does not derive item prices from it.currencyis mandatory as soon astotal_amountis set. ISO-4217, three letters, case-insensitive (euris stored asEUR). Amounts without an explicit currency are rejected withvalidation_failedonfieldcurrency— the currency is never guessed.- Timestamps are ISO-8601 with a timezone, either an offset (
2026-08-07T09:12:00+02:00) orZ. This applies toordered_atin requests and toordered_at,created_at,updated_atin responses. A timestamp without timezone is rejected. - If
ordered_atis omitted, the time of receipt is used.
#Read an order
GET https://api.meykt.com/v1/orders/{id} — requires the scope orders:read. {id} is the id from a create or list response, not your external_order_id.
curl https://api.meykt.com/v1/orders/8c4d2f9a-5b71-4e6c-9a03-1f7d8e2b6c45 \
-H "Authorization: Bearer mk_test_YOUR_KEY"The complete order has the same fields as the creation response. This abbreviated excerpt highlights item matching and the legacy item-status hint:
{
"data": {
"order": {
"id": "8c4d2f9a-5b71-4e6c-9a03-1f7d8e2b6c45",
"external_order_id": "ORDER-2026-1044",
"status": "processing",
"payment_status": "paid",
"items": [{
"id": "b1e77c30-2a48-4c19-8f55-9d0a3e6b1742",
"sku": "BECHER-GROSS",
"quantity": 2,
"product_linked": true,
"production_status": "in_production"
}]
}
}
}Orders with sets also list sets[] — see Sets and bills of materials.
If you work with a fulfillment partner, every order also carries partner_handover (null until a handover ran): which of your lines did not reach the fulfiller and why. See Fulfillment via API.
A key only sees orders that came in through its own API connection — not the orders of other channels in the same organization. An id that does not exist, belongs to another channel, or is not a well-formed id all answer the same way: 404 not_found, never 403. A 403 would confirm that the id exists, so the API deliberately does not distinguish these cases. Never derive "this order belongs to someone else" from a 404; treat it as "unknown to this key".
#List orders
GET https://api.meykt.com/v1/orders — requires the scope orders:read. Orders are returned newest first.
| Query parameter | Meaning |
|---|---|
limit | Page size, 1–100. Default 25. Values outside the range are clamped. |
starting_after | Cursor: the id of the last order of the previous page. |
updated_since | ISO-8601 timestamp. Returns only orders changed at or after that moment. |
status | Only orders whose current status is one of these values: pending, processing, in_production, production_complete, shipped, completed, cancelled, failed. Separate several values with commas (status=shipped,completed) or repeat the parameter; letter case and spaces are ignored. Omitted = all statuses. |
curl "https://api.meykt.com/v1/orders?limit=50&updated_since=2026-08-07T06:00:00Z" \
-H "Authorization: Bearer mk_test_YOUR_KEY"Only interested in shipped orders? Combine both filters:
curl "https://api.meykt.com/v1/orders?updated_since=2026-08-07T06:00:00Z&status=shipped,completed" \
-H "Authorization: Bearer mk_test_YOUR_KEY"status matches the status at the time of your request. An order that was shipped and has since been marked completed is only found with completed, so ask for shipped,completed to catch every shipped order. For shipment details (tracking numbers, partial deliveries) read /v1/orders/{id}/shipments or subscribe to the order.shipped webhook.
{
"data": {
"orders": [{ "id": "8c4d2f9a-5b71-4e6c-9a03-1f7d8e2b6c45", "external_order_id": "ORDER-2026-1044", "status": "processing", "payment_status": "paid", "items": [] }],
"has_more": true,
"next_cursor": "8c4d2f9a-5b71-4e6c-9a03-1f7d8e2b6c45"
}
}Paginate with the cursor, not with page numbers — it stays correct while new orders arrive:
async function listAll(params = '') {
let cursor = null;
const all = [];
do {
const url = `https://api.meykt.com/v1/orders?limit=100${params}` +
(cursor ? `&starting_after=${cursor}` : '');
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MEYKT_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(body.error.code);
all.push(...body.data.orders);
cursor = body.data.next_cursor;
} while (cursor);
return all;
}starting_after must be the id of an order visible to this key; anything else answers 422 validation_failed with field starting_after. An unparsable updated_since answers 422 with field updated_since. An empty or unknown status value answers 422 validation_failed with field status — never every order.
updated_since finds changed source orders; it is not a journal of every pick, production step or package change. Keep one unchanged timestamp filter while following all pages, apply results idempotently and overlap successive polling windows. The list is not a frozen transaction snapshot. Reconcile active orders periodically through /progress and /shipments, including when no order-status event arrived. An item’s legacy production_status remains a hint only.
Poll no more often than you need — one list call with updated_since costs a single request, while one call per order burns the rate limit. If your system can accept inbound HTTPS, webhooks announce supported events so you can reconcile sooner. They do not replace reads for states with no dedicated event.
#Forward compatibility
Write your integration so that it survives additive changes:
- Ignore unknown response fields. Fields are added over time without a new API version.
- Treat unknown
statusandproduction_statusvalues as unknown, not as an error, and never match on them exhaustively. - Fields are never removed or re-interpreted without a new version in the path (
/v2). - Error codes are permanent. Branch on
error.code, never onerror.message— messages are written for humans and may change at any time. Each error also carries adoc_urlpointing at its reference page, for example /developers/errors/order_already_exists_with_different_content.
#Order-wide data and typed fields
The order body accepts priority (low, normal, high, urgent, default normal), note (customer/order note), and a separate warehouse_note for the executing team. Both notes allow 10000 characters. Neither note implies a change in payment or workflow state.
Order-based templates use {{order.note}} for the customer note and {{order.warehouse_note}} for warehouse instructions. Both are available in workflow, print and shipping templates; a missing note stays empty rather than falling back to the other. The source preserves line breaks, while shipping references normalize them to one line. Compiler mappings use warehouse_note at order scope, or order.warehouse_note for an item-level order fallback. Received fulfillment orders carry the same instructions.
personalization is available on the order and on each item. It contains up to 50 named string values at each level, with names of 1–80 characters and values of at most 2000 characters. A string does not grant file access: upload files and reference them through files. Registered typed fields have their own validation and limits. Both the order and each item may have 10 {upload_id,role?} file references, with at most 100 across the whole order. File contents are validated during acceptance. Accepted files count toward the storage allowance of your organization, except for orders placed with a test key (see Files). Read responses return file IDs and download_path where available; GET /v1/orders/{id}/files/{fileId} returns a 300-second download URL. URLs are temporary; store IDs, not signed URLs.
fields is a distinct object for registered typed variables, also available at both levels. Discover valid keys, types, choices and writability using GET /v1/orders/fields (orders:read); follow next_cursor as starting_after until has_more:false. Keys are the published variable keys, not display labels, JSON paths or invented IDs. Boolean, number, text, choice and text-list values must match the definition; unknown/unwritable fields are rejected. A field with fetch_as_file: true (a link variable that downloads its file) takes an http/https link without credentials; Meykt downloads it the same way as a file link from a shop and treats the result as a file. File/image fields use the upload route, not fields. Valid compiler results can replace manually supplied typed values according to the same studio rules.
Use a unique external_line_id for each item if your ERP has stable line identifiers. The shipment response refers back to those identifiers. This is distinct from a SKU: two positions may have the same SKU and still be different lines. Item identifiers must be unique within an order.
Both shipping_address and billing_address support name, company, phone, email, line1, line2, postal_code, city, state and a two-letter country. Addresses are independent: a missing billing address is never copied from the shipping address. Explicit null clears an address in a change command. Do not use a warehouse note as an address or shipping instruction field.
JSON bodies allow at most 32 nesting levels and 25000 values with finite numbers, and have a complete UTF-8 size limit of 256 KiB; this includes metadata. Use signed upload slots for file bytes. The standard API accepts up to 200 order items for creation and replacement; the order editor also supports 200. Manual creation in the studio accepts 100. Integration profiles have their own lower JSON-array limit.
#Change an order
PATCH /v1/orders/{id} requires orders:change, without an additional orders:write requirement. First read the order and retain its revision verbatim. It is a concurrency token, not a clock value to compute yourself. Send a new UUID idempotency_key for one intended change:
{
"idempotency_key": "33333333-3333-4333-8333-333333333333",
"expected_revision": "2026-10-18T10:00:00.000Z",
"changes": {
"priority": "high",
"warehouse_note": "Protect the printed surface.",
"personalization": {"occasion":"Anniversary"}
}
}Only supplied sections are changed. Collection sections (items, personalization, fields, files) replace that section rather than appending to it; include everything you intend to retain in a replaced section. Supplying items replaces the item list as a whole; do not send only one changed item out of a larger order. Changes cannot replace the external order identity, metadata or the displayed order number. All typed fields and files are validated before an execution copy is cancelled or replaced.
Omission and clearing have different meanings:
- Omit a top-level section to retain it. A supplied
customeror address object replaces that section; include all contact/address fields you want to keep.customer: {}clears its fields;customer: nullis invalid. shipping_address: nullandbilling_address: nullexplicitly clear those addresses.- Empty strings clear
noteorwarehouse_note;nullis not accepted for those inputs. Empty input can read back asnullin the normalized order view. - Empty
personalization: {}orfields: {}replaces the corresponding supplied inputs. Computed values still follow the current field definitions and compiler rules; a typednullis not a universal instruction to delete computed data. files: []removes current references at that level.items: []is invalid: an order must retain at least one item.
The source order and its current execution generations are coordinated through a durable command. Actual picking or production on your own order prevents a change/cancellation even if someone later resets a display status (order_work_started). Work that has started at a fulfillment partner no longer blocks: the command asks the partner instead (see After work has started at the partner). A partner order that is already completed or shipped still blocks. A stale revision or work-start rejection is recorded as a terminal command result. A partner may need to approve replacing or cancelling its unstarted assignment; an API key cannot override that decision. Changing the source does not silently mutate the partner's existing execution order. One exception applies to changes made inside Meykt (shop sync, “Fetch from shop again”, the order editor) that only change the shipping address: Meykt applies the new shipping address to each open execution order of a partner that has no shipping label yet and has not shipped, and notifies the partner; otherwise both sides get a “Needs attention” item instead. A PATCH through this API stays a full change and follows the replacement rules above. An integration reading partner execution orders sees such an address change on its next read; updated_at changes, no separate push message is sent.
An accepted command returns 202 while processing or decision_required; this is not confirmation that the change is complete. A terminal result is returned with 200:
{"data":{"command":{
"command_id":"33333333-3333-4333-8333-333333333333",
"order_id":"11111111-1111-4111-8111-111111111111",
"kind":"change","state":"completed","revision":"2026-10-18T10:00:01.000Z","code":null,
"created_at":"2026-10-18T10:00:00.000Z","updated_at":"2026-10-18T10:00:00.000Z"
}}}Keep command_id and poll GET /v1/orders/{id}/commands/{commandId} using orders:read, until completed or rejected. A successful journal lookup can contain a rejected command: inspect state and code, not only HTTP status. decision_required means a human/partner decision is outstanding. The read itself never resumes or executes work. A background worker recovers accepted interrupted commands after rechecking their current authorization. The terminal transition and its order.updated, order.update_rejected, order.cancelled or order.cancel_rejected messages for this connection commit atomically. A delivery failure after enqueue does not undo the command. Only cancellation of the commercial source order produces order.cancelled; cancelling a replaced execution copy does not.
After a connection failure, retry the exact same order ID, command kind, body, original expected_revision and idempotency UUID on the same connection and environment. Do not refresh the revision inside an already accepted command: that changes its identity. Do not reuse the UUID in another environment. Reusing it for another order, kind or content conflicts; use a new UUID only for a new intention. After a terminal rejection such as revision_conflict, reread the order and submit a new intention if it is still appropriate. Creation idempotency (external_order_id) is separate. An exact retry of the original creation request still identifies that creation after later explicit changes.
A temporary failure to read an accepted command returns 503 / service_unavailable, not a claim that the command disappeared. Keep its command URL and retry that read; unknown or inaccessible commands still return 404. Resuming interrupted processing preserves product assignments already chosen for current order lines.
These outcomes need particular attention:
| Command code | Meaning and next step |
|---|---|
partner_forwarded | A partner has passed work onward. The normal command is rejected; clarify the forwarding chain with the involved partners before submitting another intention. The API does not silently cancel further partners. |
partner_orders_parallel | A partner holds more than one execution order for this order that is not cancelled (a deliberate second production). A change would produce only one new version, so the command waits as decision_required until someone cancels the orders no longer needed in Meykt; the background worker then continues it. A cancellation command affects every open execution order. |
authorization_required | An accepted command is held because its current grant is unusable. Restore an active connection if appropriate and repeat the original command using a valid replacement key for the same organization, connection and environment, with the command’s own change/cancel scope. This expressly authorizes continuation of that command; retain its original UUID and revision. |
order_work_started | Picking or production started on your own order, or the partner's execution order is already completed or shipped (or was cancelled without your request after work had started). The command is rejected. |
partner_approval_required | The partner is asked (decision_required). Keep reading the command; it continues by itself after the partner's answer, or ends as rejected with partner_declined. |
set_parts_mismatch, set_part_details_not_supported, set_heading_details_not_supported | The changed order breaks a set rule (see Sets and bills of materials): the parts differ from the bill of materials in Meykt, or personalization sits on a line that does not become an item. The command is rejected; nothing changed. |
order_revision_superseded | A newer edit superseded the accepted change. The old command is rejected and does not overwrite or release that newer edit. Inspect the current order and any remaining approvals before deciding whether a new intention is needed; do not change the revision inside the old command. |
#After work has started at the partner
If the fulfillment partner has already started producing, the change (or cancellation) becomes a request to the partner. It lists the changed lines of that partner (old → new) and your optional message (up to 4000 characters):
{
"idempotency_key": "55555555-5555-4555-8555-555555555555",
"expected_revision": "2026-10-18T10:00:00.000Z",
"message": "Name typo: Keller, not Keler.",
"changes": { "items": [ { "external_line_id": "line-1", "name": "Board", "quantity": 1, "personalization": { "Name": "Familie Keller" } } ] }
}The command answers 202 with decision_required / partner_approval_required. The partner is never stopped or cancelled without its decision:
- The partner agrees: it stops its running production and chooses whether services already booked stay billed. Meykt then applies your change and hands the new version over; the command ends
completed(order.updated). - The partner declines: nothing changes; the command ends
rejectedwithpartner_declined(order.update_rejected).
While the request is open, the partner's work is not paused by Meykt. Your own order is held for the command as usual. A cancellation (POST /v1/orders/{id}/cancel) after work started follows the same path; its message goes to the partner. To only correct the shipping address, use POST /v1/orders/{id}/shipping-address instead — it needs no approval. To ask something without changing the order, use POST /v1/orders/{id}/messages (Fulfillment).
#Cancel an order
POST /v1/orders/{id}/cancel requires orders:cancel, without an additional orders:write requirement, and uses the same revision, start protection, partner decisions (also after work has started at the partner) and durable result model:
{
"idempotency_key":"44444444-4444-4444-8444-444444444444",
"expected_revision":"2026-10-18T10:00:00.000Z",
"message":"The customer withdrew this order.",
"billing_choice":"preserve"
}Choose billing_choice explicitly: preserve keeps existing service charges; reverse uses Meykt's existing credit/reversal process. This does not refund an external marketplace payment. Read the current result instead of treating a timeout, partner request or 202 as a completed cancellation. A completed cancellation stops the order; it does not delete its records.
#Synchronize both ways
Your system pushes new orders and explicit commands to Meykt. Meykt pushes signed order events only to webhook targets you registered. A webhook is a prompt to reconcile the canonical order, progress and shipment endpoints; handle duplicates using the event ID. Systems without an inbound server poll instead. For inventory use the dedicated delta cursor, never derive inventory from order quantities. Details: Inventory, Shipping, Webhooks, Integration profiles.
#Complete field reference
- Orders: field reference — all request, response and parameter fields, including required values and conditional alternatives.
Machine-readable version of this page: https://www.meykt.com/developers/orders.md