{"openapi":"3.1.0","info":{"title":"Command Center API","version":"v1.0","description":"Orders, quotes, machines, products, customers, invoices and webhooks for a shop on Command Center. Send a shop API key as `Authorization: Bearer cck_...` (made in Settings > API and webhooks; keys are free). Test keys (`cck_test_...`) work on a sandbox with fake machines. Every answer is JSON, snake_case, one record shape per thing. Nothing in this API starts a machine, fires a laser or moves an axis: sending a job only queues it for the person at the machine."},"servers":[{"url":"https://razer-command-center.vercel.app/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Basics"},{"name":"Orders and quotes"},{"name":"Production and machines"},{"name":"Webhooks"},{"name":"Products and stock"},{"name":"Customers, invoices and sales"},{"name":"Embedded customizer"}],"paths":{"/":{"get":{"operationId":"getKey","summary":"The key: its account, mode, scopes and rate limit","description":"Call it first to check a key works. Needs no scope.\n\nScope: none (any working key). Reads; changes nothing.","tags":["Basics"],"x-scope":null,"x-tier":"A","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"api_version":"v1","key":{"id":"key_1a2b3c","name":"Our website","mode":"test","scopes":["read","orders","machine"],"rate_limit_per_minute":120},"account":{"id":"acct_sandbox_7y8u","test_sandbox":true},"request_id":"req_Qw3Er5Ty7Ui9"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/shop":{"get":{"operationId":"getShop","summary":"The shop: name, units, currency, machines, engines online and materials","description":"Scope: read. Reads; changes nothing.","tags":["Basics"],"x-scope":"read","x-tier":"A","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"name":"Pat's Laser Shop","country":"US","units":{"length":"in","weight":"lb","currency":"USD"},"test_sandbox":false,"machines":[{"id":"mach_9q8w7e","name":"Big laser","engine":"laser","online":true,"last_heard_at":"2026-10-29T15:04:05.000Z"}],"engines_online":["laser"],"materials":[{"id":"mat_oak","name":"Oak, 1/4 in","kind":"wood","source":"own","in_stock":true}]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/holds/{id}":{"get":{"operationId":"getHoldsById","summary":"An action the watchdog held for this key: held, released, rejected, failed or expired","description":"A money, publishing or messaging call the watchdog finds unusual answers 202 with a hold id. Read it here until the owner decides in Settings > API > Watchdog.\n\nScope: none (any working key). Reads; changes nothing.","tags":["Basics"],"x-scope":null,"x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"hold_6t5r4e","action":"orders.refund","status":"released","summary":"API key \"Shopify sync\": Refund $53.48 on website order #AB12CD","reason":"It asks to refund $71.31, but only $69.72 of this order is left to refund (it was paid $87.55). If released, $53.48 goes back: the chosen lines as far as they are still unrefunded, with their tax; shipping comes back only with a full refund.","amount_cents":5348,"currency":"USD","rehearsal":false,"created_at":"2026-10-29T15:04:05.000Z","decided_at":"2026-10-29T15:04:05.000Z","result":{"refunded":true,"amount_cents":5348,"refunded_cents":5348,"full":false,"restocked":0,"website_order_id":"sord_9i8u7y"},"error":null}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/quotes":{"post":{"operationId":"postQuotes","summary":"An instant price for laser, UV, embroidery, patches, DTF or CNC, from the shop's own prices","description":"Nothing is saved or sent. The same prices the app quotes with: the Sales designer's prices, the DTF gang sheet prices and the CNC price list.\n\nScope: read. Reads; changes nothing.","tags":["Orders and quotes"],"x-scope":"read","x-tier":"A","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"process":{"type":"string","const":"laser"},"quantity":{"type":"integer","minimum":1,"maximum":100000},"width_in":{"type":"number","minimum":0.5,"maximum":14},"height_in":{"type":"number","minimum":0.5,"maximum":14},"colors":{"description":"Ink or thread colours. Default 1 for laser, 4 otherwise.","type":"integer","minimum":1,"maximum":15},"coverage":{"description":"Stitched work: how much of the box the logo covers (0-1). Default 0.45.","type":"number","minimum":0,"maximum":1},"blank_unit_cents":{"description":"The product it goes on, one piece, if the shop supplies it.","type":"integer","minimum":0,"maximum":10000000}},"required":["process","quantity","width_in","height_in"],"additionalProperties":false},{"type":"object","properties":{"process":{"type":"string","const":"uv"},"quantity":{"type":"integer","minimum":1,"maximum":100000},"width_in":{"type":"number","minimum":0.5,"maximum":14},"height_in":{"type":"number","minimum":0.5,"maximum":14},"colors":{"description":"Ink or thread colours. Default 1 for laser, 4 otherwise.","type":"integer","minimum":1,"maximum":15},"coverage":{"description":"Stitched work: how much of the box the logo covers (0-1). Default 0.45.","type":"number","minimum":0,"maximum":1},"blank_unit_cents":{"description":"The product it goes on, one piece, if the shop supplies it.","type":"integer","minimum":0,"maximum":10000000}},"required":["process","quantity","width_in","height_in"],"additionalProperties":false},{"type":"object","properties":{"process":{"type":"string","const":"embroidery"},"quantity":{"type":"integer","minimum":1,"maximum":100000},"width_in":{"type":"number","minimum":0.5,"maximum":14},"height_in":{"type":"number","minimum":0.5,"maximum":14},"colors":{"description":"Ink or thread colours. Default 1 for laser, 4 otherwise.","type":"integer","minimum":1,"maximum":15},"coverage":{"description":"Stitched work: how much of the box the logo covers (0-1). Default 0.45.","type":"number","minimum":0,"maximum":1},"blank_unit_cents":{"description":"The product it goes on, one piece, if the shop supplies it.","type":"integer","minimum":0,"maximum":10000000}},"required":["process","quantity","width_in","height_in"],"additionalProperties":false},{"type":"object","properties":{"process":{"type":"string","const":"patch"},"kind":{"default":"embroidered","type":"string","enum":["embroidered","woven","pvc","leather"]},"shape":{"type":"string","enum":["rounded","rectangle","square","circle","oval","hexagon","hex-wide","diamond","octagon","shield","badge","arch","cushion","keystone","buckle","arrowhead","mountain","scallop","banner","contour"]},"border":{"type":"string","enum":["none","solid","double","stitch","double-stitch","both","framed","dots","merrow"]},"backing":{"type":"string","enum":["iron_on","velcro","sew_on","adhesive"]},"quantity":{"type":"integer","minimum":1,"maximum":100000},"width_in":{"type":"number","minimum":0.5,"maximum":14},"height_in":{"type":"number","minimum":0.5,"maximum":14},"colors":{"description":"Ink or thread colours. Default 1 for laser, 4 otherwise.","type":"integer","minimum":1,"maximum":15},"coverage":{"description":"Stitched work: how much of the box the logo covers (0-1). Default 0.45.","type":"number","minimum":0,"maximum":1},"blank_unit_cents":{"description":"The product it goes on, one piece, if the shop supplies it.","type":"integer","minimum":0,"maximum":10000000}},"required":["process","quantity","width_in","height_in"],"additionalProperties":false},{"type":"object","properties":{"process":{"type":"string","const":"dtf"},"quantity":{"type":"integer","minimum":1,"maximum":100000},"length_in":{"type":"number","minimum":6,"maximum":240,"description":"The gang sheet's length, one the shop offers."}},"required":["process","quantity","length_in"],"additionalProperties":false},{"type":"object","properties":{"process":{"type":"string","const":"cnc"},"quantity":{"type":"integer","minimum":1,"maximum":1000000},"material":{"type":"string","minLength":1,"maxLength":120},"finish":{"type":"string","maxLength":120},"lead_time":{"type":"string","maxLength":120},"part":{"type":"object","properties":{"bbox_mm":{"type":"object","properties":{"x":{"type":"number","exclusiveMinimum":0,"maximum":5000},"y":{"type":"number","exclusiveMinimum":0,"maximum":5000},"z":{"type":"number","exclusiveMinimum":0,"maximum":5000}},"required":["x","y","z"]},"volume_cm3":{"type":"number","exclusiveMinimum":0,"maximum":1000000},"machine_minutes":{"type":"number","exclusiveMinimum":0,"maximum":100000},"setups":{"type":"integer","minimum":1,"maximum":20}}}},"required":["process","quantity","material"],"additionalProperties":false}]},"example":{"process":"patch","kind":"embroidered","quantity":50,"width_in":3,"height_in":3}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"process":"patch","currency":"USD","quantity":50,"unit_cents":731,"total_cents":41050,"lines":[{"label":"Embroidered patch, 3\" x 3\", about 15,600 stitches x 50 (20% off for 50+)","cents":34300},{"label":"Backing and border x 50","cents":2250},{"label":"Digitizing","cents":4500}],"lead_days":null,"complete":true,"warnings":[],"basis":"The shop's Sales designer prices for embroidered patch (7.31 a piece, 45.00 one-off fees).","machine_tab":"embroidery"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders":{"get":{"operationId":"getOrders","summary":"The shop's orders and quote requests (Jobs), newest first","description":"Filter with ?status= (new, quoted, paid, blanks_ordered, in_production, shipped, lost, cancelled, refunded) and ?external_id=.\n\nScope: read. Reads; changes nothing.","tags":["Orders and quotes"],"x-scope":"read","x-tier":"A","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"id":"ord_3k2j9x","external_id":"WEB-1001","status":"paid","status_label":"Paid","source":"api","customer":{"id":"cust_7f3a1b","name":"Pat Buyer","email":"pat@example.com","phone":null,"business":"Pat's Bakery"},"items":[{"name":"Logo patches","quantity":50}],"lines":[{"name":"Logo patches","quantity":50,"unit_cents":731,"total_cents":36550},{"name":"Logo patches: one-off fees","quantity":1,"unit_cents":4500,"total_cents":4500}],"total_cents":41050,"currency":"USD","note":"Navy hats","quoted_at":"2026-10-29T15:04:05.000Z","paid_at":"2026-10-29T15:04:05.000Z","due_date":"2026-11-05","shipped_at":null,"delivered_at":null,"tracking":null,"machine_tab":null,"files":[{"id":"file_2c9d4e","name":"logo.png","type":"png","size":0,"status":"linked","machine_tab":"print","kind":"link","url":"https://example.com/logo.png","download_url":null}],"created_at":"2026-10-29T15:04:05.000Z"}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}},"post":{"operationId":"postOrders","summary":"Make an order or quote request; it becomes a Job","description":"With the customer, the items (each priced by you with `unit_cents`, or by `quote` with the shop's own prices: one or the other, never both), and artwork by URL or upload link. `status` is \"new\" (a quote request, the default) or \"paid\" (your checkout took the money). A paid order whose items carry no price is taken, with a warning in `warnings`. An existing customer (by email) keeps their name.\n\nScope: orders. Changes the shop within reason (shown in the activity feed).","tags":["Orders and quotes"],"x-scope":"orders","x-tier":"B","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The person's name. An existing customer (by email) keeps the name the shop has."},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":50},"business":{"type":"string","maxLength":200},"address":{"description":"Where to ship, as one text; kept in the order's notes.","type":"string","maxLength":500}},"required":["name","email"],"additionalProperties":false},"items":{"default":[],"description":"The lines. Give items, a design, or both.","maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"What it is, as the customer sees it."},"quantity":{"type":"integer","minimum":1,"maximum":1000000},"unit_cents":{"description":"The price of one, in whole cents, as your own system sold it. Either this or `quote`, never both.","type":"integer","minimum":0,"maximum":100000000},"quote":{"description":"Price it here with the shop's own prices: the body of POST /quotes without `quantity` (for example { \"process\": \"laser\", \"width_in\": 2, \"height_in\": 2 }). Either this or `unit_cents`."},"sku":{"description":"Your own SKU, kept in the order's notes.","type":"string","maxLength":100},"notes":{"description":"Kept in the order's notes.","type":"string","maxLength":2000}},"required":["name","quantity"],"additionalProperties":false}},"design":{"description":"A design made in the shop's customizer (the embed's command-center:design event), priced by the shop's website prices.","type":"object","properties":{"design_id":{"type":"string","minLength":1,"maxLength":40},"lines":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"option_id":{"type":"string","minLength":1,"maxLength":100},"quantity":{"type":"integer","minimum":1,"maximum":10000}},"required":["option_id","quantity"],"additionalProperties":false}}},"required":["design_id","lines"],"additionalProperties":false},"status":{"default":"new","description":"\"new\" (a quote request for the shop to price; \"quote_request\" means the same) or \"paid\" (your checkout already took the money: the Job starts paid, with its due date).","type":"string","enum":["new","quote_request","paid"]},"note":{"description":"Anything the shop should know; kept on the order.","type":"string","maxLength":5000},"external_id":{"description":"Your own order number. Once per shop: a second order with it is a 409 that names the first.","type":"string","minLength":1,"maxLength":100},"artwork":{"description":"By address ({ url }) or by upload link ({ file_name, size }): POST /orders/{id}/artwork says what each does.","maxItems":10,"type":"array","items":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"name":{"type":"string","minLength":1,"maxLength":200},"machine_tab":{"type":"string","enum":["laser","cnc","print","print3d","embroidery"]}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","exclusiveMinimum":0,"maximum":104857600},"machine_tab":{"type":"string","enum":["laser","cnc","print","print3d","embroidery"]}},"required":["file_name","size"],"additionalProperties":false}]}}},"required":["customer"],"additionalProperties":false},"example":{"customer":{"name":"Pat Buyer","email":"pat@example.com","business":"Pat's Bakery"},"items":[{"name":"Logo patches","quantity":50,"quote":{"process":"patch","kind":"embroidered","width_in":3,"height_in":3}}],"status":"paid","external_id":"WEB-1001","note":"Navy hats","artwork":[{"url":"https://example.com/logo.png"}]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"ord_3k2j9x","external_id":"WEB-1001","status":"paid","status_label":"Paid","source":"api","customer":{"id":"cust_7f3a1b","name":"Pat Buyer","email":"pat@example.com","phone":null,"business":"Pat's Bakery"},"items":[{"name":"Logo patches","quantity":50}],"lines":[{"name":"Logo patches","quantity":50,"unit_cents":731,"total_cents":36550},{"name":"Logo patches: one-off fees","quantity":1,"unit_cents":4500,"total_cents":4500}],"total_cents":41050,"currency":"USD","note":"Navy hats","quoted_at":"2026-10-29T15:04:05.000Z","paid_at":"2026-10-29T15:04:05.000Z","due_date":"2026-11-05","shipped_at":null,"delivered_at":null,"tracking":null,"machine_tab":null,"files":[{"id":"file_2c9d4e","name":"logo.png","type":"png","size":0,"status":"linked","machine_tab":"print","kind":"link","url":"https://example.com/logo.png","download_url":null}],"created_at":"2026-10-29T15:04:05.000Z","artwork":[{"status":"linked","file_id":"file_2c9d4e","name":"logo.png","url":"https://example.com/logo.png","reason":"This shop keeps its files on its own Drive or computer, so the address is kept on the order as a link (nothing is copied here)."}],"warnings":[]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders/{id}":{"get":{"operationId":"getOrdersById","summary":"One order: its status, items, prices, dates, tracking and files (with download links)","description":"`files` lists every artwork: a stored file with a short-lived `download_url`, or (a shop that keeps its files on its own Drive or PC) a `link` entry with the address you gave.\n\nScope: read. Reads; changes nothing.","tags":["Orders and quotes"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"ord_3k2j9x","external_id":"WEB-1001","status":"paid","status_label":"Paid","source":"api","customer":{"id":"cust_7f3a1b","name":"Pat Buyer","email":"pat@example.com","phone":null,"business":"Pat's Bakery"},"items":[{"name":"Logo patches","quantity":50}],"lines":[{"name":"Logo patches","quantity":50,"unit_cents":731,"total_cents":36550},{"name":"Logo patches: one-off fees","quantity":1,"unit_cents":4500,"total_cents":4500}],"total_cents":41050,"currency":"USD","note":"Navy hats","quoted_at":"2026-10-29T15:04:05.000Z","paid_at":"2026-10-29T15:04:05.000Z","due_date":"2026-11-05","shipped_at":null,"delivered_at":null,"tracking":null,"machine_tab":null,"files":[{"id":"file_2c9d4e","name":"logo.png","type":"png","size":0,"status":"linked","machine_tab":"print","kind":"link","url":"https://example.com/logo.png","download_url":null},{"id":"file_5a1b2c","name":"sign.svg","type":"svg","size":18204,"status":"ready","machine_tab":"laser","kind":"artwork","url":null,"download_url":"https://app.example/api/files/download?token=..."}],"created_at":"2026-10-29T15:04:05.000Z"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders/{id}/cancel":{"post":{"operationId":"postOrdersByIdCancel","summary":"Cancel an order that hasn't shipped (it is marked Cancelled; nothing waits for a machine from it)","description":"A paid website order needs { \"refund\": true } and the \"money\" scope: it is refunded in full through the shop's Stripe (the watchdog scores that like any refund) and ends Refunded. One already refunded in full just ends Refunded. An order paid outside Command Center (made over this API with status \"paid\", or by hand) can't be refunded here: { \"refund\": true } on it is a 409; refund it where it was paid, then cancel without the flag. Takes an Idempotency-Key: a retry after a timeout gets the first answer back (a held one with the same hold id) and refunds nothing twice.\n\nScope: orders. Changes the shop within reason (shown in the activity feed).","tags":["Orders and quotes"],"x-scope":"orders","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"description":"Why, for the order's notes.","type":"string","maxLength":500},"refund":{"description":"A paid website order: refund it in full through the shop's Stripe, then cancel it (needs the money scope; the watchdog scores it like any refund). Not for an order paid outside Command Center.","type":"boolean"}},"additionalProperties":false},"example":{"reason":"Customer changed their mind"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"ord_3k2j9x","external_id":"WEB-1001","status":"cancelled","status_label":"Cancelled","source":"api","customer":{"id":"cust_7f3a1b","name":"Pat Buyer","email":"pat@example.com","phone":null,"business":"Pat's Bakery"},"items":[{"name":"Logo patches","quantity":50}],"lines":[{"name":"Logo patches","quantity":50,"unit_cents":731,"total_cents":36550},{"name":"Logo patches: one-off fees","quantity":1,"unit_cents":4500,"total_cents":4500}],"total_cents":41050,"currency":"USD","note":"Navy hats\nCancelled: Customer changed their mind","quoted_at":"2026-10-29T15:04:05.000Z","paid_at":"2026-10-29T15:04:05.000Z","due_date":"2026-11-05","shipped_at":null,"delivered_at":null,"tracking":null,"machine_tab":null,"files":[{"id":"file_2c9d4e","name":"logo.png","type":"png","size":0,"status":"linked","machine_tab":"print","kind":"link","url":"https://example.com/logo.png","download_url":null}],"created_at":"2026-10-29T15:04:05.000Z","cancelled":true,"refunded_cents":0,"already_refunded":false,"machine_sends_cancelled":1}}}}},"202":{"description":"Held by the watchdog for the owner to release or reject. Read GET /holds/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Held"},"example":{"data":{"status":"held","hold_id":"hold_6t5r4e","reason":"That would be 51 items published or re-priced in an hour, and the shop holds more than 50 an hour.","message":"Held for the owner's review. Nothing has happened yet. The owner can release or reject it in Settings > API > Watchdog; read GET /api/v1/holds/hold_6t5r4e for the answer."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders/{id}/artwork":{"post":{"operationId":"postOrdersByIdArtwork","summary":"Add artwork to an order, by URL or upload link","description":"By URL ({ url }): fetched and stored for a shop on our storage; kept as a link on the order (a `files` entry of kind \"link\") for a shop that keeps its files on its own Drive or PC. By upload link ({ file_name, size }): only for a shop on our storage; the answer says where to PUT the file.\n\nScope: orders. Changes the shop within reason (shown in the activity feed).","tags":["Orders and quotes"],"x-scope":"orders","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"artwork":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"name":{"type":"string","minLength":1,"maxLength":200},"machine_tab":{"type":"string","enum":["laser","cnc","print","print3d","embroidery"]}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","exclusiveMinimum":0,"maximum":104857600},"machine_tab":{"type":"string","enum":["laser","cnc","print","print3d","embroidery"]}},"required":["file_name","size"],"additionalProperties":false}]}}},"required":["artwork"],"additionalProperties":false},"example":{"artwork":[{"url":"https://example.com/logo.png","machine_tab":"print"}]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"order_id":"ord_3k2j9x","artwork":[{"status":"stored","file_id":"file_5a1b2c","name":"sign.svg"}]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders/{id}/artwork/{fileId}/complete":{"post":{"operationId":"postOrdersByIdArtworkByFileIdComplete","summary":"Say an uploaded artwork file has arrived; it is checked, then ready","description":"Scope: orders. Changes the shop within reason (shown in the activity feed).","tags":["Orders and quotes"],"x-scope":"orders","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"file_id":"file_5a1b2c","status":"ready"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/machines":{"get":{"operationId":"getMachines","summary":"The shop's machines: engine, online, computer, jobs waiting","description":"As the shop PC last reported. The cloud never talks to a machine.\n\nScope: read. Reads; changes nothing.","tags":["Production and machines"],"x-scope":"read","x-tier":"A","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":[{"id":"mach_9q8w7e","name":"Big laser","engine":"laser","engine_label":"Burn Engine","online":true,"last_heard_at":"2026-10-29T15:04:05.000Z","computer":"Front PC","waiting":2}]}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/machines/{id}":{"get":{"operationId":"getMachinesById","summary":"One machine: its waiting list in order, its last event and the safety note","description":"Scope: read. Reads; changes nothing.","tags":["Production and machines"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"mach_9q8w7e","name":"Big laser","engine":"laser","engine_label":"Burn Engine","online":true,"last_heard_at":"2026-10-29T15:04:05.000Z","computer":"Front PC","waiting":1,"last_event":{"order_id":"ord_3k2j9x","type":"done","note":null,"at":"2026-10-29T15:04:05.000Z"},"queue":[{"send_id":"send_2w3e4r","order_id":"ord_3k2j9x","name":"Pat's Bakery · sign.svg","status":"waiting","position":1,"sent_at":"2026-10-29T15:04:05.000Z","collected_at":null}],"safety":{"known":false,"note":"Command Center doesn't hear the machine's safety state (interlocks, e-stop, fire watch): look at the machine's own screen. Nothing in the API starts a machine; the person at the machine does."}}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders/{id}/send":{"post":{"operationId":"postOrdersByIdSend","summary":"Send an order to a machine or a machine tab's list; it waits there for the person at the machine","description":"Never starts the machine. A laser SVG, DXF or PDF (file_id) goes into that laser's waiting list; anything else goes on the tab's job list on the shop PC. A cancelled, refunded or lost order can't be sent (409). Sending the same order to the same machine while a send is still waiting gives that send back (`already_waiting`: true), never a second one; an Idempotency-Key replays the first answer too.\n\nScope: machine. Changes the shop within reason (shown in the activity feed).","tags":["Production and machines"],"x-scope":"machine","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"machine_id":{"description":"One of GET /machines' ids.","type":"string","minLength":1,"maxLength":64},"engine":{"description":"Put it on this machine tab's list (null takes it off).","anyOf":[{"type":"string","enum":["laser","print","print3d","cnc"]},{"type":"null"}]},"file_id":{"description":"One of the order's files: a laser SVG, DXF or PDF goes straight into that laser's queue.","type":"string","minLength":1,"maxLength":64}},"additionalProperties":false},"example":{"engine":"laser"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"sent":"machine_tab","engine":"laser","machine":null,"send_id":null,"status":"on_list","already_waiting":false,"offline":false,"warnings":[],"message":"On Burn Engine's job list on the shop PC. The person at the machine starts it."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/orders/{id}/production":{"get":{"operationId":"getOrdersByIdProduction","summary":"Where an order is: place in the waiting list, estimate, what the machine reported, finished-part photos","description":"Scope: read. Reads; changes nothing.","tags":["Production and machines"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"order_id":"ord_3k2j9x","status":"in_production","state":"running","machine_tab":"laser","sends":[{"send_id":"send_2w3e4r","machine":{"id":"mach_9q8w7e","name":"Big laser","engine":"laser"},"status":"collected","queue_position":null,"note":null,"sent_at":"2026-10-29T15:04:05.000Z","collected_at":"2026-10-29T15:04:05.000Z"}],"progress":{"state":"running","last_event":{"type":"started","note":null,"at":"2026-10-29T15:04:05.000Z","machine":"Big laser"},"events":[{"type":"loaded","note":null,"at":"2026-10-29T15:04:05.000Z","machine":"Big laser"},{"type":"started","note":null,"at":"2026-10-29T15:04:05.000Z","machine":"Big laser"}]},"estimate":{"minutes_per_job":30,"minutes_left":22,"ready_at":"2026-10-29T15:04:05.000Z","due_date":"2026-11-05","basis":"The machine's own pace on its last jobs (started to done), times the jobs ahead of this one."},"photos":[],"safety":"Command Center doesn't hear the machine's safety state (interlocks, e-stop, fire watch): look at the machine's own screen. Nothing in the API starts a machine; the person at the machine does."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/webhooks":{"get":{"operationId":"getWebhooks","summary":"The shop's webhook endpoints","description":"Scope: webhooks. Reads; changes nothing.","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"A","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":[{"id":"whk_4r5t6y","url":"https://your-site.example/command-center","description":"Our order system","events":["order.created","job.finished"],"enabled":true,"failures_in_a_row":0,"disabled_reason":null,"created_at":"2026-10-29T15:04:05.000Z"}]}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}},"post":{"operationId":"postWebhooks","summary":"Add an endpoint: an https address and the events it gets; its signing secret is in the answer once","description":"`events` names the events, or [\"*\"] for every event. An endpoint made with a live key gets the shop's live events; one made with a test key gets the test sandbox's events only (each has its own list).\n\nScope: webhooks. Changes the shop within reason (shown in the activity feed).","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"B","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"An https address of yours, public (not localhost or a private network)."},"events":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"string","maxLength":40},"description":"The events it gets (order.created, job.finished, ...), or [\"*\"] for every event, the ones added later too."},"description":{"description":"What it is, for Settings.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["url","events"],"additionalProperties":false},"example":{"url":"https://your-site.example/command-center","events":["order.created","job.finished"],"description":"Our order system"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"whk_4r5t6y","url":"https://your-site.example/command-center","description":"Our order system","events":["order.created","job.finished"],"enabled":true,"failures_in_a_row":0,"disabled_reason":null,"created_at":"2026-10-29T15:04:05.000Z","secret":"whsec_<shown once>"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/webhooks/{id}":{"get":{"operationId":"getWebhooksById","summary":"One endpoint","description":"Scope: webhooks. Reads; changes nothing.","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"whk_4r5t6y","url":"https://your-site.example/command-center","description":"Our order system","events":["order.created","job.finished"],"enabled":true,"failures_in_a_row":0,"disabled_reason":null,"created_at":"2026-10-29T15:04:05.000Z"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}},"patch":{"operationId":"patchWebhooksById","summary":"Change an endpoint's address, events or description, switch it on or off, or make a new secret","description":"Scope: webhooks. Changes the shop within reason (shown in the activity feed).","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"events":{"description":"The whole list, or [\"*\"].","minItems":1,"maxItems":30,"type":"array","items":{"type":"string","maxLength":40}},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"enabled":{"description":"Switch it off (no events are sent) or back on (its failure count starts again).","type":"boolean"},"rotate_secret":{"description":"Make a new signing secret: it is in the answer once, and the old one stops at once.","type":"boolean","const":true}},"additionalProperties":false},"example":{"events":["*"],"enabled":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"whk_4r5t6y","url":"https://your-site.example/command-center","description":"Our order system","events":["*"],"enabled":true,"failures_in_a_row":0,"disabled_reason":null,"created_at":"2026-10-29T15:04:05.000Z"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}},"delete":{"operationId":"deleteWebhooksById","summary":"Remove an endpoint and its delivery log","description":"Scope: webhooks. Changes the shop within reason (shown in the activity feed).","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"whk_4r5t6y","deleted":true}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"postWebhooksByIdTest","summary":"Send a test.ping event to an endpoint now and say how it answered","description":"Scope: webhooks. Changes the shop within reason (shown in the activity feed).","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"dlv_1q2w3e","endpoint_id":"whk_4r5t6y","event_id":"evt_Ab1Cd2Ef3Gh4","event":"test.ping","status":"delivered","attempts":1,"next_attempt_at":null,"last_status":200,"last_error":null,"last_ms":184,"delivered_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/webhooks/{id}/deliveries":{"get":{"operationId":"getWebhooksByIdDeliveries","summary":"An endpoint's delivery log, newest first: event, status, tries, its answer","description":"Scope: webhooks. Reads; changes nothing.","tags":["Webhooks"],"x-scope":"webhooks","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"id":"dlv_1q2w3e","endpoint_id":"whk_4r5t6y","event_id":"evt_Zx9Y8w7V6u5T","event":"order.created","status":"delivered","attempts":1,"next_attempt_at":null,"last_status":200,"last_error":null,"last_ms":184,"delivered_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z"},{"id":"dlv_4r5t6y","endpoint_id":"whk_4r5t6y","event_id":"evt_Zx9Y8w7V6u5T","event":"job.finished","status":"failed","attempts":7,"next_attempt_at":null,"last_status":405,"last_error":"Answered 405 Method Not Allowed: the receiver answered with a web page, not an API answer.","last_ms":96,"delivered_at":null,"created_at":"2026-10-29T15:04:05.000Z"}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/products":{"get":{"operationId":"getProducts","summary":"The shop's own products with their variants, prices and stock","description":"Filter with ?status= (live: on sale; draft: never on sale yet; archived: taken off sale) and ?q=. The same product record everywhere: `status` is one of those three.\n\nScope: read. Reads; changes nothing.","tags":["Products and stock"],"x-scope":"read","x-tier":"A","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"id":"prod_8f3k2m","name":"Walnut sign","status":"live","review_status":null,"changes_waiting_for_review":false,"group":"product","photo":null,"currency":"USD","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4500,"stock":10}]}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}},"post":{"operationId":"postProducts","summary":"Make a product as a draft (customers don't see it until it's published)","description":"Answers the product record, status \"draft\". Variants carry `price_cents` and `stock` (null: not counted).\n\nScope: write. Changes the shop within reason (shown in the activity feed).","tags":["Products and stock"],"x-scope":"write","x-tier":"B","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"description":"Plain text or simple HTML.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"group":{"description":"What it is in the catalog; default \"product\".","type":"string","enum":["product","material","supply","tool"]},"variants":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"description":"A variant's id (GET /products/{id}) to change that one; leave it out for a new variant.","type":"string","maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Like \"Small\", \"Black / 20 oz\", or \"Default\"."},"price_cents":{"type":"integer","minimum":1,"maximum":100000000,"description":"What customers pay for one, in whole cents of the shop's currency."},"stock":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000},{"type":"null"}],"description":"Units on hand; null: not counted (always available)."}},"required":["name","price_cents","stock"],"additionalProperties":false}},"photos":{"description":"Photo addresses (https); the first is the main one. The list replaces the old one.","maxItems":20,"type":"array","items":{"type":"string","maxLength":1000,"format":"uri"}}},"required":["name","variants"],"additionalProperties":false},"example":{"name":"Walnut sign","description":"Laser-engraved walnut, 12 inches wide.","variants":[{"name":"12 in","price_cents":4500,"stock":10}],"photos":["https://example.com/walnut-sign.jpg"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"prod_8f3k2m","name":"Walnut sign","status":"draft","review_status":null,"changes_waiting_for_review":false,"group":"product","photo":null,"currency":"USD","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4500,"stock":10}],"saved":"applied"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/products/{id}":{"get":{"operationId":"getProductsById","summary":"One product with its description, photos, variants and any change waiting for review","description":"Scope: read. Reads; changes nothing.","tags":["Products and stock"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"prod_8f3k2m","name":"Walnut sign","status":"live","review_status":null,"changes_waiting_for_review":false,"group":"product","photo":null,"currency":"USD","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4500,"stock":10}],"description":"Laser-engraved walnut, 12 inches wide.","photos":["https://example.com/walnut-sign.jpg"],"waiting_for_review":null}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}},"patch":{"operationId":"patchProductsById","summary":"Change a product: name, description, variants, prices, stock, photos","description":"A product customers can see also needs the publish scope, and the watchdog scores the change (202 with a hold id if it finds it unusual). Answers the product record.\n\nScope: write. Changes the shop within reason (shown in the activity feed).","tags":["Products and stock"],"x-scope":"write","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The product's name.","type":"string","minLength":1,"maxLength":200},"description":{"description":"Plain text or simple HTML.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"group":{"description":"What it is in the catalog; default \"product\".","type":"string","enum":["product","material","supply","tool"]},"variants":{"description":"Every variant with its price and stock. Variants left out are removed.","minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"description":"A variant's id (GET /products/{id}) to change that one; leave it out for a new variant.","type":"string","maxLength":100},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Like \"Small\", \"Black / 20 oz\", or \"Default\"."},"price_cents":{"type":"integer","minimum":1,"maximum":100000000,"description":"What customers pay for one, in whole cents of the shop's currency."},"stock":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000},{"type":"null"}],"description":"Units on hand; null: not counted (always available)."}},"required":["name","price_cents","stock"],"additionalProperties":false}},"photos":{"description":"Photo addresses (https); the first is the main one. The list replaces the old one.","maxItems":20,"type":"array","items":{"type":"string","maxLength":1000,"format":"uri"}}},"additionalProperties":false},"example":{"name":"Walnut sign, large","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4900,"stock":10}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"prod_8f3k2m","name":"Walnut sign, large","status":"draft","review_status":null,"changes_waiting_for_review":false,"group":"product","photo":null,"currency":"USD","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4900,"stock":10}],"saved":"applied"}}}}},"202":{"description":"Held by the watchdog for the owner to release or reject. Read GET /holds/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Held"},"example":{"data":{"status":"held","hold_id":"hold_6t5r4e","reason":"That would be 51 items published or re-priced in an hour, and the shop holds more than 50 an hour.","message":"Held for the owner's review. Nothing has happened yet. The owner can release or reject it in Settings > API > Watchdog; read GET /api/v1/holds/hold_6t5r4e for the answer."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/products/{id}/publish":{"post":{"operationId":"postProductsByIdPublish","summary":"Put a product on sale on the shop's website (the watchdog scores it: 202 with a hold id if it finds it unusual)","description":"A product already on sale with no change waiting is answered as it is (`already_live`: true): nothing is scored or counted. Takes an Idempotency-Key: a retry gets the first answer back (a held one with the same hold id), never a second hold.\n\nScope: publish. Money, publishing or messaging: the watchdog scores it, and holds it for the owner (202 with a hold id) only when something looks unusual.","tags":["Products and stock"],"x-scope":"publish","x-tier":"C","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."},{"name":"X-Watchdog-Rehearse","in":"header","schema":{"type":"string","enum":["hold"]},"description":"Test keys only: hold this call in the sandbox as the watchdog would live (202 with a hold id), to rehearse how your code handles a hold. The owner releases or rejects it in Settings > API > Test sandbox."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"prod_8f3k2m","name":"Walnut sign","status":"live","review_status":null,"changes_waiting_for_review":false,"group":"product","photo":null,"currency":"USD","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4500,"stock":10}],"saved":"applied"}}}}},"202":{"description":"Held by the watchdog for the owner to release or reject. Read GET /holds/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Held"},"example":{"data":{"status":"held","hold_id":"hold_6t5r4e","reason":"That would be 51 items published or re-priced in an hour, and the shop holds more than 50 an hour.","message":"Held for the owner's review. Nothing has happened yet. The owner can release or reject it in Settings > API > Watchdog; read GET /api/v1/holds/hold_6t5r4e for the answer."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/products/{id}/archive":{"post":{"operationId":"postProductsByIdArchive","summary":"Hide a product from customers; nothing is deleted","description":"Answers the product record, status \"archived\". POST /products/{id}/publish puts it back on sale.\n\nScope: write. Changes the shop within reason (shown in the activity feed).","tags":["Products and stock"],"x-scope":"write","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"prod_8f3k2m","name":"Walnut sign","status":"archived","review_status":null,"changes_waiting_for_review":false,"group":"product","photo":null,"currency":"USD","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4500,"stock":10}]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/products/{id}/stock":{"put":{"operationId":"putProductsByIdStock","summary":"Set how many of one variant are on hand (null: not counted)","description":"Answers the variant's stock row, as GET /stock lists it, with `stock_before`.\n\nScope: write. Changes the shop within reason (shown in the activity feed).","tags":["Products and stock"],"x-scope":"write","x-tier":"B","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variant":{"type":"string","minLength":1,"maxLength":200,"description":"The variant's id (or its exact name)."},"stock":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000},{"type":"null"}],"description":"Units on hand; null: not counted (always available)."}},"required":["variant","stock"],"additionalProperties":false},"example":{"variant":"var_1a2b3c","stock":25}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"product":{"id":"prod_8f3k2m","name":"Walnut sign","live":true},"variant":{"id":"var_1a2b3c","name":"12 in"},"stock":25,"counted":true,"low":false,"low_stock_at":3,"stock_before":10}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/price-breaks":{"put":{"operationId":"putPriceBreaks","summary":"The shop's quantity price breaks (like 12+ 5% off), at most 8 (the watchdog scores it: 202 with a hold id if it finds it unusual)","description":"Body: { breaks: [{ min_quantity, percent_off }] }. Takes an Idempotency-Key: a retry gets the first answer back, never a second hold.\n\nScope: publish. Money, publishing or messaging: the watchdog scores it, and holds it for the owner (202 with a hold id) only when something looks unusual.","tags":["Products and stock"],"x-scope":"publish","x-tier":"C","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."},{"name":"X-Watchdog-Rehearse","in":"header","schema":{"type":"string","enum":["hold"]},"description":"Test keys only: hold this call in the sandbox as the watchdog would live (202 with a hold id), to rehearse how your code handles a hold. The owner releases or rejects it in Settings > API > Test sandbox."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"breaks":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"min_quantity":{"type":"integer","minimum":2,"maximum":100000,"description":"From this many of one design."},"percent_off":{"type":"number","minimum":1,"maximum":90}},"required":["min_quantity","percent_off"],"additionalProperties":false},"description":"The whole list (at most 8); an empty list removes every break."}},"required":["breaks"],"additionalProperties":false},"example":{"breaks":[{"min_quantity":12,"percent_off":5},{"min_quantity":24,"percent_off":10}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"breaks":[{"min_quantity":12,"percent_off":5},{"min_quantity":24,"percent_off":10}],"before":[]}}}}},"202":{"description":"Held by the watchdog for the owner to release or reject. Read GET /holds/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Held"},"example":{"data":{"status":"held","hold_id":"hold_6t5r4e","reason":"That would be 51 items published or re-priced in an hour, and the shop holds more than 50 an hour.","message":"Held for the owner's review. Nothing has happened yet. The owner can release or reject it in Settings > API > Watchdog; read GET /api/v1/holds/hold_6t5r4e for the answer."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/stock":{"get":{"operationId":"getStock","summary":"Every variant's stock, what is low and what is out","description":"?low=true lists only what is at or under the shop's low-stock number.\n\nScope: read. Reads; changes nothing.","tags":["Products and stock"],"x-scope":"read","x-tier":"A","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"product":{"id":"prod_8f3k2m","name":"Walnut sign","live":true},"variant":{"id":"var_1a2b3c","name":"12 in"},"stock":25,"counted":true,"low":false,"low_stock_at":3},{"product":{"id":"prod_8f3k2m","name":"Walnut sign","live":true},"variant":{"id":"var_4d5e6f","name":"18 in"},"stock":2,"counted":true,"low":true,"low_stock_at":3}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/materials":{"get":{"operationId":"getMaterials","summary":"The shop's materials: sheet stock (in stock, size, cost, sheets used) and CNC bar stock","description":"?q= narrows it by name.\n\nScope: read. Reads; changes nothing.","tags":["Products and stock"],"x-scope":"read","x-tier":"A","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"materials":[{"id":"mat_oak","name":"Oak, 1/4 in","kind":"wood","source":"own","in_stock":true,"sheet":{"width_in":24,"height_in":12,"cost_cents":1800},"sheets_used":14,"sheets_restocked":20}],"cnc_stock":[{"id":"cnc_6061","name":"Aluminium 6061","price_per_kg_cents":1200,"density_g_cm3":2.7}],"notes":[]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/customers":{"get":{"operationId":"getCustomers","summary":"The shop's customers (everyone who ordered or asked for a quote), newest first","description":"?q= searches name, email and phone; ?tag= filters by the shop's own tags.\n\nScope: read. Reads; changes nothing.","tags":["Customers, invoices and sales"],"x-scope":"read","x-tier":"A","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"id":"cust_7f3a1b","email":"pat@example.com","name":"Pat Buyer","phone":null,"source":"job","tags":["wholesale"],"last_order_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z"}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/customers/{id}":{"get":{"operationId":"getCustomersById","summary":"One customer with their orders, website orders and files","description":"Scope: read. Reads; changes nothing.","tags":["Customers, invoices and sales"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"cust_7f3a1b","email":"pat@example.com","name":"Pat Buyer","phone":null,"source":"job","tags":["wholesale"],"notes":null,"last_order_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z","orders":[{"id":"ord_3k2j9x","status":"paid","total_cents":41050,"quoted_at":"2026-10-29T15:04:05.000Z","paid_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z","website_order_id":null}],"website_orders":[],"files":[]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/invoices":{"get":{"operationId":"getInvoices","summary":"Every priced order as an invoice: lines, total, open, paid or void, and its pay link","description":"?status=open|paid|refunded|void (void: lost or cancelled, never paid).\n\nScope: read. Reads; changes nothing.","tags":["Customers, invoices and sales"],"x-scope":"read","x-tier":"A","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"id":"ord_3k2j9x","order_id":"ord_3k2j9x","external_id":"WEB-1001","customer":{"name":"Pat Buyer","email":"pat@example.com","business":"Pat's Bakery"},"status":"paid","net_cents":41050,"lines":[{"name":"Logo patches","quantity":50,"unit_cents":731,"total_cents":36550},{"name":"Logo patches: one-off fees","quantity":1,"unit_cents":4500,"total_cents":4500}],"total_cents":41050,"currency":"USD","website_order":null,"issued_at":"2026-10-29T15:04:05.000Z","paid_at":"2026-10-29T15:04:05.000Z","pay_url":null}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/sales":{"get":{"operationId":"getSales","summary":"The shop's paid website orders with tax, shipping and refunds, for accounting","description":"?from=YYYY-MM-DD&to=YYYY-MM-DD (UTC days).\n\nScope: read. Reads; changes nothing.","tags":["Customers, invoices and sales"],"x-scope":"read","x-tier":"A","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next_cursor from the page before."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/List"},"example":{"data":[{"id":"sord_9i8u7y","number":"AB12CD","status":"paid","customer":{"name":"Pat Buyer","email":"pat@example.com"},"items":[{"name":"Golf balls / White","quantity":12,"unit_cents":525}],"subtotal_cents":6300,"discount_cents":0,"shipping_cents":1500,"tax_cents":955,"taxes":null,"total_cents":8755,"refunded_cents":0,"net_cents":8755,"currency":"USD","order_ids":["ord_3k2j9x"],"paid_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z"}],"has_more":false,"next_cursor":null}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/sales/summary":{"get":{"operationId":"getSalesSummary","summary":"Totals by currency for a range: orders, gross, tax, shipping, refunds and net","description":"Scope: read. Reads; changes nothing.","tags":["Customers, invoices and sales"],"x-scope":"read","x-tier":"A","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"from":"2026-10-01","to":"2026-10-31","through":"2026-10-29","currencies":[{"currency":"USD","orders":18,"subtotal_cents":148200,"discount_cents":0,"shipping_cents":21500,"tax_cents":12340,"total_cents":182040,"refunded_cents":5348,"net_cents":176692}]}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/sales/{id}":{"get":{"operationId":"getSalesById","summary":"One paid website order","description":"Scope: read. Reads; changes nothing.","tags":["Customers, invoices and sales"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"sord_9i8u7y","number":"AB12CD","status":"paid","customer":{"name":"Pat Buyer","email":"pat@example.com"},"items":[{"name":"Golf balls / White","quantity":12,"unit_cents":525}],"subtotal_cents":6300,"discount_cents":0,"shipping_cents":1500,"tax_cents":955,"taxes":null,"total_cents":8755,"refunded_cents":0,"net_cents":8755,"currency":"USD","order_ids":["ord_3k2j9x"],"paid_at":"2026-10-29T15:04:05.000Z","created_at":"2026-10-29T15:04:05.000Z"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/designs/{id}":{"get":{"operationId":"getDesignsById","summary":"A design made in the shop's customizer: product, colour, size, mockups and its production files","description":"Scope: read. Reads; changes nothing.","tags":["Embedded customizer"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"id":"dsgn_3e4r5t","kind":"apparel","product":{"id":"prod_tee_black","name":"Crew tee"},"color":"Black","size_mm":{"width":120,"height":80},"print":{"spot":"front","process":"dtf","width_in":4.7,"height_in":3.1,"all":null},"extra_patches":null,"mockup_url":"https://files.example/mockups/dsgn_3e4r5t.png","back_mockup_url":null,"files":{"art_url":"https://files.example/art/dsgn_3e4r5t.png","original_url":"https://files.example/uploads/logo.png","patch_url":null},"created_at":"2026-10-29T15:04:05.000Z"}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/designs/{id}/price":{"post":{"operationId":"postDesignsByIdPrice","summary":"A design priced for options and quantities, as the shop's website prices it","description":"Body: { lines: [{ option_id, quantity }] }. Make the order with POST /orders and `design`.\n\nScope: read. Reads; changes nothing.","tags":["Embedded customizer"],"x-scope":"read","x-tier":"A","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lines":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"option_id":{"type":"string","minLength":1,"maxLength":100},"quantity":{"type":"integer","minimum":1,"maximum":10000}},"required":["option_id","quantity"],"additionalProperties":false}}},"required":["lines"],"additionalProperties":false},"example":{"lines":[{"option_id":"opt_black_l","quantity":2}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"design_id":"dsgn_3e4r5t","currency":"USD","lines":[{"option_id":"opt_black_l","name":"Crew tee (Black / L), front print","quantity":2,"unit_cents":2800,"setup_cents":0}],"subtotal_cents":5600,"shipping_cents":900,"total_cents":6500,"basis":"The shop's website prices for this design, today (shipping as its website charges it)."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}},"/sales/{id}/refund":{"post":{"operationId":"postSalesByIdRefund","summary":"Refund a website order, all of it or chosen lines, through the shop's Stripe (the watchdog scores it: 202 with a hold id if it finds it unusual)","description":"Takes an Idempotency-Key: a retry after a timeout gets the first answer back (a held one with the same hold id) and refunds nothing twice.\n\nScope: money. Money, publishing or messaging: the watchdog scores it, and holds it for the owner (202 with a hold id) only when something looks unusual.","tags":["Customers, invoices and sales"],"x-scope":"money","x-tier":"C","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Send the same key again (within 24 hours) and you get the first answer back (a held one with the same hold id included); nothing is made, refunded, held or queued twice."},{"name":"X-Watchdog-Rehearse","in":"header","schema":{"type":"string","enum":["hold"]},"description":"Test keys only: hold this call in the sandbox as the watchdog would live (202 with a hold id), to rehearse how your code handles a hold. The owner releases or rejects it in Settings > API > Test sandbox."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["full","lines"]},"lines":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"quantity":{"type":"integer","minimum":1,"maximum":100000}},"required":["index","quantity"]}},"note":{"type":"string","maxLength":1000},"restock":{"type":"boolean"}},"required":["mode"]},"example":{"mode":"lines","lines":[{"index":0,"quantity":1}],"note":"One came back damaged","restock":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Data"},"example":{"data":{"refunded":true,"amount_cents":597,"refunded_cents":597,"full":false,"restocked":1,"website_order_id":"sord_9i8u7y"}}}}},"202":{"description":"Held by the watchdog for the owner to release or reject. Read GET /holds/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Held"},"example":{"data":{"status":"held","hold_id":"hold_6t5r4e","reason":"That would be 51 items published or re-priced in an hour, and the shop holds more than 50 an hour.","message":"Held for the owner's review. Nothing has happened yet. The owner can release or reject it in Settings > API > Watchdog; read GET /api/v1/holds/hold_6t5r4e for the answer."}}}}},"default":{"description":"An error (see the error codes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"items.0.unit_cents: Give unit_cents or quote, not both.","request_id":"req_Qw3Er5Ty7Ui9","param":"items.0.unit_cents"}}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A shop API key. Scopes: read (Read the shop: orders, machines, products, stock, materials, customers, invoices, sales, designs; and get instant quotes (POST /quotes).); write (Make and change draft products, archive products, and set stock. Nothing customers see changes.); money (Refund website orders through the shop's Stripe, and cancel paid website orders with a refund. The watchdog holds anything unusual for the owner; Max's tools still ask with a card.); publish (What customers see: put a product on sale, change a live product, set the price breaks. The watchdog holds anything unusual for the owner; Max's tools still ask with a card.); machine (Send an order to a machine's list or a machine tab (POST /orders/{id}/send). Never starts it; the person at the machine does.); orders (Make orders and quote requests (POST /orders), add artwork, and cancel orders.); webhooks (Add, change, test and remove the shop's webhook endpoints.). Other scopes a key may carry (design, queue, order, messaging) are Max's tools' only, over the MCP server; no REST endpoint uses them."}},"schemas":{"Data":{"type":"object","properties":{"data":{}},"required":["data"]},"List":{"type":"object","properties":{"data":{"type":"array","items":{}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"]},"Held":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"const":"held"},"hold_id":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"}}}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"enum":["invalid_request","unauthorized","insufficient_scope","api_off","key_suspended","not_found","method_not_allowed","conflict","idempotency_in_progress","payload_too_large","unprocessable","idempotency_key_reused","rate_limited","server_error"]},"message":{"type":"string"},"request_id":{"type":"string"},"param":{"type":["string","null"]},"scope":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]}}},"webhooks":{"order.created":{"post":{"summary":"Order created","description":"A new order or quote request: from the API, the website, Etsy, Shopify or a quote. data.order is the order (GET /orders/{id}).\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.created"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"order.approved":{"post":{"summary":"Order approved","description":"An order was paid or approved to make: it is ready for production. data.order.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.approved"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"order.shipped":{"post":{"summary":"Order shipped","description":"An order was marked shipped, with its tracking when given. data.order.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.shipped"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"order.cancelled":{"post":{"summary":"Order cancelled","description":"An order was cancelled (marked Cancelled, or a quote marked Lost). data.order.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.cancelled"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"order.refunded":{"post":{"summary":"Order refunded","description":"A website order was refunded, all or in part. data.refund: website_order_id (GET /sales/{id}), order_number, order_ids, amount_cents, refunded_cents, full, currency, note.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"order.refunded"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"job.started":{"post":{"summary":"Job started","description":"A machine started an order (the person at the machine pressed go). data.order_id, data.machine, data.at.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"job.started"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"job.finished":{"post":{"summary":"Job finished","description":"A machine finished an order. data.order_id, data.machine, data.at.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"job.finished"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"job.failed":{"post":{"summary":"Job failed","description":"A machine reported an order failed. data.order_id, data.machine, data.note, data.at.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"job.failed"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}},"stock.low":{"post":{"summary":"Stock low","description":"A product's stock fell to the shop's low-stock level. data is the variant's stock row, as GET /stock shows it: data.product, data.variant, data.stock, data.low_stock_at.\n\nSigned: header Command-Center-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint's secret>. Answer 2xx within 10 seconds; anything else is tried again after 1 min, 5 min, 30 min, 2 h, 8 h, 24 h. An endpoint may pick \"*\" to get every event. Events a test key makes go to the endpoints made for test mode (test_mode: true).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"stock.low"},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"test_mode":{"type":"boolean"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Received."}}}}}}