Developers
Command Center API
Connect your own website, store or system to your shop on Command Center: take orders that become Jobs, quote instantly from your own prices, send work to your machines and follow it, keep products and stock in step, read customers, invoices and sales, and hear about everything with webhooks. API keys are free.
Base address: https://razer-command-center.vercel.app/api/v1 · OpenAPI file · Your keys and webhooks
Your first hour
- In Command Center, open Settings › API and webhooks and make a test key with the scopes
read,ordersandmachine. API keys are free for every shop, live or test. The key is shown once, right under the button: copy it. Keep it on your server, never in a web page or an app people download. - Check it works. This answers with the key, its account (a test sandbox), its mode and its scopes:
curl https://razer-command-center.vercel.app/api/v1 -H "Authorization: Bearer $CC_KEY"
- Price something with the shop's own prices (POST /quotes), then make an order from it (POST /orders): it becomes a Job in the sandbox, with its customer. Each endpoint below lists every body field and shows an answer.
- Send the order to a fake machine (POST /orders/{id}/send with
{ "engine": "laser" }) and watch it go through GET /orders/{id}/production: collected after 10 seconds, started after 20, finished after 60. - Add a test webhook endpoint in Settings (or POST /webhooks with the test key) and make another order: it gets
order.createdwith"test_mode": true. - When it all works, make a live key with the same scopes and point your code at it. The answers are the same; the records are the shop's own.
Every answer is JSON: a record is { "data": { ... } }, a list is { "data": [ ... ], "has_more": true, "next_cursor": "..." }. Money is always whole cents with its currency.
Keys and scopes
Send Authorization: Bearer cck_... with every call. A key belongs to the shop, works only on that shop's records, and can do only what its scopes allow. The owner and managers make and revoke keys; a revoked key stops at once (401, "That key isn't valid") and stays listed in Settings, greyed, for 30 days. Keys are free: no seat or plan is needed to make or use one. The same keys also work with the Build Engine's MCP server for Max, which has its own seat.
| Scope | What it allows on this API |
|---|---|
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. |
Settings also offers design, queue, messaging: those are Max's tools only (the Build Engine's MCP server, where each is an approval card). No REST endpoint uses them; a key for this API doesn't need them.
Test mode
A test key starts cck_test_. It works on a sandbox of your shop, never on your real orders, customers or machines. The sandbox has four fake machines (a laser, a UV printer, a 3D printer and a CNC) on a fake computer, always online. Send an order to one and it moves by itself: collected after 10 seconds, started after 20, finished after 60, with a photo of the finished part, and the webhooks fire as they will live (with "test_mode": true). The sandbox's records show nowhere in the app but Settings › API › Test sandbox, which lists what is there and has a Reset button.
Webhooks in test mode go to the endpoints made for test mode: the ones you add in Settings as "Test", or with POST /webhooks using a test key. Live endpoints never get test events, and the other way round.
Rehearse a hold. Nothing is scored by the watchdog in test mode, so to try how your code handles a 202 send the header X-Watchdog-Rehearse: hold with a test key on a call the watchdog checks (a publish, the price breaks). It is held in the sandbox exactly as it would be live: you get the 202 with a hold id, GET /holds/{id} says held, and the owner releases or rejects it in Settings › API › Test sandbox. Three rehearsed holds in an hour switch the test key off, as live.
One shape per thing
A record has the same fields wherever it shows: an order from GET /orders, POST /orders, GET /orders/{id} and a webhook's data.order is one shape; a product from a list, a make, a change, a publish or a released hold's result is one shape. Names are snake_case; the record itself is under data; a field that is an id ends in _id and is a string; a field that is the thing is an object (product: { id, name }). Dates are ISO 8601, UTC.
An order
{
"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"
}A product
{
"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
}Errors
An error answers { "error": { "code": "not_found", "message": "...", "request_id": "req_...", "param": "..." } }, on every address under /api/v1, an unknown one too (never an HTML page). The message says what to fix, in plain words, and param names the field. Send the request id if you ask us for help. A record of another shop is never shown: it is not_found.
{
"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"
}
}| Code | Status | Means |
|---|---|---|
invalid_request | 400 | The body or the query isn't valid. message says what to fix, and param names the field. |
unauthorized | 401 | No key, a wrong key, a revoked key, or a key of a closed account. The message says which. |
insufficient_scope | 403 | The key doesn't have the scope this endpoint needs. |
api_off | 403 | The API is switched off for this account. |
key_suspended | 403 | The key is switched off: by the watchdog after unusual activity (too many held actions in an hour, or too many the owner rejected; the owner sets the numbers, the defaults are 3 and 5), or by the owner in Settings > API. The owner switches it back on there. |
not_found | 404 | No such record in this shop, or no such address under /api/v1. Another shop's record is never shown: it reads as not found. |
method_not_allowed | 405 | That method isn't served at this address. The Allow header lists the ones that are. |
conflict | 409 | The record is in a state that doesn't allow this (already cancelled, already shipped...). |
idempotency_in_progress | 409 | A request with this Idempotency-Key is still running. Try again in a moment. |
payload_too_large | 413 | The body is over 1 MB. Send artwork by its upload link or a URL. |
unprocessable | 422 | The request is valid but can't be done (the shop doesn't offer that, the machine is offline...). |
idempotency_key_reused | 422 | This Idempotency-Key was used with a different request. |
rate_limited | 429 | Too many calls. Wait for the seconds in Retry-After. |
server_error | 500 | Something went wrong on our side. Try again; send the request_id if it keeps happening. |
Limits, pages and retries
- 120 calls a minute per key (the owner can set a key between 10 and 600). Every answer says
X-RateLimit-LimitandX-RateLimit-Remaining; over the limit is429withRetry-After. - Lists come newest first, 25 at a time (
?limit=up to 100). For the next page send?cursor=with thenext_cursoryou got, untilhas_moreis false. - Calls that make something, the ones that move money (a refund, a cancel with a refund), a publish, the price breaks and a send take an
Idempotency-Keyheader. Send the same key again within 24 hours (after a timeout, say) and you get the first answer back, markedIdempotent-Replayed: true, a held one with the same hold id included; nothing is made, refunded, held or queued twice. A send without the header is safe to repeat too: the same order to the same machine gives the send it already has. - A body is JSON, at most 1 MB. Send artwork by its address or the upload link the API gives you. A trailing slash on an address is fine.
Watchdog
Nobody approves each call. Calls that move money or change what customers see (a refund, a cancel with a refund, putting a product on sale or changing a live one, the price breaks) run at once, unless the shop's watchdog finds something unusual. The watchdog scores each one against rules the owner sets in Settings › API › Watchdog: a refund for more than is left on the order, a refund on an order paid more than 90 days ago, more than 10 refunds or $1,000 (or 20 % of the last 30 days' sales, whichever is higher) refunded in a day, more than 50 products published in an hour, a key suddenly 10 times as busy as its 7-day average, a key used from a new country or network for the first time, or a key's first action between 1 am and 5 am shop time. (Messages to customers are Max's tools' only; no REST endpoint sends one.)
When a rule trips the call is held, not run. The API answers 202:
{
"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."
}
}The owner is told by email and on their phone, and GET /holds/{id} tells you when it is released (it ran, with its result in the record shape above), rejected, failed or expired (a hold waits 7 days). Do not retry a held call without its Idempotency-Key: with it you get the same hold back; without it you make a second one. A key that gets too many held actions in an hour, or too many the owner rejected (the owner sets the numbers; the defaults are 3 and 5), is switched off (403 key_suspended) until the owner switches it back on; the owner can switch a key off in Settings too. The shop gets a note each day on what the API did and what was held. A refund's hold says the one amount that goes back if it is released; the card and the email say the same.
Endpoints
Basics
GET/api/v1
The key: its account, mode, scopes and rate limit.
Call it first to check a key works. Needs no scope.
Scope: none · Reads
curl https://razer-command-center.vercel.app/api/v1 \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
}GET/api/v1/shop
The shop: name, units, currency, machines, engines online and materials.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/shop \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}
]
}
}GET/api/v1/holds/{id}
An action the watchdog held for this key: held, released, rejected, failed or expired.
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.
Scope: none · Reads
curl https://razer-command-center.vercel.app/api/v1/holds/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}
}Orders and quotes
POST/api/v1/quotes
An instant price for laser, UV, embroidery, patches, DTF or CNC, from the shop's own prices.
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.
Scope: read · Reads
Body fields
process = "laser"
| Field | Type | What it is |
|---|---|---|
quantity* | whole number | |
width_in* | number | |
height_in* | number | |
colors | whole number | Ink or thread colours. Default 1 for laser, 4 otherwise. |
coverage | number | Stitched work: how much of the box the logo covers (0-1). Default 0.45. |
blank_unit_cents | whole number | The product it goes on, one piece, if the shop supplies it. |
process = "uv"
| Field | Type | What it is |
|---|---|---|
quantity* | whole number | |
width_in* | number | |
height_in* | number | |
colors | whole number | Ink or thread colours. Default 1 for laser, 4 otherwise. |
coverage | number | Stitched work: how much of the box the logo covers (0-1). Default 0.45. |
blank_unit_cents | whole number | The product it goes on, one piece, if the shop supplies it. |
process = "embroidery"
| Field | Type | What it is |
|---|---|---|
quantity* | whole number | |
width_in* | number | |
height_in* | number | |
colors | whole number | Ink or thread colours. Default 1 for laser, 4 otherwise. |
coverage | number | Stitched work: how much of the box the logo covers (0-1). Default 0.45. |
blank_unit_cents | whole number | The product it goes on, one piece, if the shop supplies it. |
process = "patch"
| Field | Type | What it is |
|---|---|---|
kind | string | One of "embroidered", "woven", "pvc", "leather".Default "embroidered". |
shape | string | One of "rounded", "rectangle", "square", "circle", "oval", "hexagon", "hex-wide", "diamond", "octagon", "shield", "badge", "arch", "cushion", "keystone", "buckle", "arrowhead", "mountain", "scallop", "banner", "contour". |
border | string | One of "none", "solid", "double", "stitch", "double-stitch", "both", "framed", "dots", "merrow". |
backing | string | One of "iron_on", "velcro", "sew_on", "adhesive". |
quantity* | whole number | |
width_in* | number | |
height_in* | number | |
colors | whole number | Ink or thread colours. Default 1 for laser, 4 otherwise. |
coverage | number | Stitched work: how much of the box the logo covers (0-1). Default 0.45. |
blank_unit_cents | whole number | The product it goes on, one piece, if the shop supplies it. |
process = "dtf"
| Field | Type | What it is |
|---|---|---|
quantity* | whole number | |
length_in* | number | The gang sheet's length, one the shop offers. |
process = "cnc"
| Field | Type | What it is |
|---|---|---|
quantity* | whole number | |
material* | string | |
finish | string | |
lead_time | string | |
part | object | |
part.bbox_mm | object | |
part.bbox_mm.x | number | |
part.bbox_mm.y | number | |
part.bbox_mm.z | number | |
part.volume_cm3 | number | |
part.machine_minutes | number | |
part.setups | whole number |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/quotes \
-H "Authorization: Bearer $CC_KEY" \
-H "Content-Type: application/json" \
-d '{"process":"patch","kind":"embroidered","quantity":50,"width_in":3,"height_in":3}'Example answer
{
"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"
}
}GET/api/v1/orders
The shop's orders and quote requests (Jobs), newest first.
Filter with ?status= (new, quoted, paid, blanks_ordered, in_production, shipped, lost, cancelled, refunded) and ?external_id=.
Scope: read · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/orders \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}POST/api/v1/orders
Make an order or quote request; it becomes a Job.
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.
Scope: orders · Changes · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
customer* | object | |
customer.name* | string | The person's name. An existing customer (by email) keeps the name the shop has. |
customer.email* | string | |
customer.phone | string | |
customer.business | string | |
customer.address | string | Where to ship, as one text; kept in the order's notes. |
items | list of objects | The lines. Give items, a design, or both.Default []. |
items[].name | string | What it is, as the customer sees it. |
items[].quantity | whole number | |
items[].unit_cents | whole number | The price of one, in whole cents, as your own system sold it. Either this or quote, never both. |
items[].quote | any | 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. |
items[].sku | string | Your own SKU, kept in the order's notes. |
items[].notes | string | Kept in the order's notes. |
design | object | A design made in the shop's customizer (the embed's command-center:design event), priced by the shop's website prices. |
design.design_id | string | |
design.lines | list of objects | |
design.lines[].option_id | string | |
design.lines[].quantity | whole number | |
status | string | "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).One of "new", "quote_request", "paid".Default "new". |
note | string | Anything the shop should know; kept on the order. |
external_id | string | Your own order number. Once per shop: a second order with it is a 409 that names the first. |
artwork | list of object or objects | By address ({ url }) or by upload link ({ file_name, size }): POST /orders/{id}/artwork says what each does. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/orders \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"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"}]}'Example answer
{
"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": []
}
}GET/api/v1/orders/{id}
One order: its status, items, prices, dates, tracking and files (with download links).
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.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/orders/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
}POST/api/v1/orders/{id}/cancel
Cancel an order that hasn't shipped (it is marked Cancelled; nothing waits for a machine from it).
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.
Scope: orders · Changes · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
reason | string | Why, for the order's notes. |
refund | boolean | 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. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/orders/ID/cancel \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"reason":"Customer changed their mind"}'Example answer
{
"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
}
}POST/api/v1/orders/{id}/artwork
Add artwork to an order, by URL or upload link.
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.
Scope: orders · Changes · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
artwork* | list of object or objects |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/orders/ID/artwork \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"artwork":[{"url":"https://example.com/logo.png","machine_tab":"print"}]}'Example answer
{
"data": {
"order_id": "ord_3k2j9x",
"artwork": [
{
"status": "stored",
"file_id": "file_5a1b2c",
"name": "sign.svg"
}
]
}
}POST/api/v1/orders/{id}/artwork/{fileId}/complete
Say an uploaded artwork file has arrived; it is checked, then ready.
Scope: orders · Changes
curl -X POST https://razer-command-center.vercel.app/api/v1/orders/ID/artwork/FILEID/complete \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"data": {
"file_id": "file_5a1b2c",
"status": "ready"
}
}Production and machines
GET/api/v1/machines
The shop's machines: engine, online, computer, jobs waiting.
As the shop PC last reported. The cloud never talks to a machine.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/machines \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}
]
}GET/api/v1/machines/{id}
One machine: its waiting list in order, its last event and the safety note.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/machines/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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."
}
}
}POST/api/v1/orders/{id}/send
Send an order to a machine or a machine tab's list; it waits there for the person at the machine.
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.
Scope: machine · Changes · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
machine_id | string | One of GET /machines' ids. |
engine | string or null | Put it on this machine tab's list (null takes it off). |
file_id | string | One of the order's files: a laser SVG, DXF or PDF goes straight into that laser's queue. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/orders/ID/send \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"engine":"laser"}'Example answer
{
"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."
}
}GET/api/v1/orders/{id}/production
Where an order is: place in the waiting list, estimate, what the machine reported, finished-part photos.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/orders/ID/production \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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."
}
}Webhooks
GET/api/v1/webhooks
The shop's webhook endpoints.
Scope: webhooks · Reads
curl https://razer-command-center.vercel.app/api/v1/webhooks \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
]
}POST/api/v1/webhooks
Add an endpoint: an https address and the events it gets; its signing secret is in the answer once.
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).
Scope: webhooks · Changes · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
url* | string | An https address of yours, public (not localhost or a private network). |
events* | list of strings | The events it gets (order.created, job.finished, ...), or ["*"] for every event, the ones added later too. |
description | string or null | What it is, for Settings. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/webhooks \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-site.example/command-center","events":["order.created","job.finished"],"description":"Our order system"}'Example answer
{
"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>"
}
}GET/api/v1/webhooks/{id}
One endpoint.
Scope: webhooks · Reads
curl https://razer-command-center.vercel.app/api/v1/webhooks/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
}PATCH/api/v1/webhooks/{id}
Change an endpoint's address, events or description, switch it on or off, or make a new secret.
Scope: webhooks · Changes
Body fields
| Field | Type | What it is |
|---|---|---|
url | string | |
events | list of strings | The whole list, or ["*"]. |
description | string or null | |
enabled | boolean | Switch it off (no events are sent) or back on (its failure count starts again). |
rotate_secret | true | Make a new signing secret: it is in the answer once, and the old one stops at once. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X PATCH https://razer-command-center.vercel.app/api/v1/webhooks/ID \
-H "Authorization: Bearer $CC_KEY" \
-H "Content-Type: application/json" \
-d '{"events":["*"],"enabled":true}'Example answer
{
"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"
}
}DELETE/api/v1/webhooks/{id}
Remove an endpoint and its delivery log.
Scope: webhooks · Changes
curl -X DELETE https://razer-command-center.vercel.app/api/v1/webhooks/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"data": {
"id": "whk_4r5t6y",
"deleted": true
}
}POST/api/v1/webhooks/{id}/test
Send a test.ping event to an endpoint now and say how it answered.
Scope: webhooks · Changes
curl -X POST https://razer-command-center.vercel.app/api/v1/webhooks/ID/test \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
}GET/api/v1/webhooks/{id}/deliveries
An endpoint's delivery log, newest first: event, status, tries, its answer.
Scope: webhooks · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/webhooks/ID/deliveries \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}Products and stock
GET/api/v1/products
The shop's own products with their variants, prices and stock.
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.
Scope: read · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/products \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}POST/api/v1/products
Make a product as a draft (customers don't see it until it's published).
Answers the product record, status "draft". Variants carry price_cents and stock (null: not counted).
Scope: write · Changes · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
name* | string | |
description | string or null | Plain text or simple HTML. |
group | string | What it is in the catalog; default "product".One of "product", "material", "supply", "tool". |
variants* | list of objects | |
variants[].id | string | A variant's id (GET /products/{id}) to change that one; leave it out for a new variant. |
variants[].name* | string | Like "Small", "Black / 20 oz", or "Default". |
variants[].price_cents* | whole number | What customers pay for one, in whole cents of the shop's currency. |
variants[].stock* | whole number or null | Units on hand; null: not counted (always available). |
photos | list of strings | Photo addresses (https); the first is the main one. The list replaces the old one. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/products \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"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"]}'Example answer
{
"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"
}
}GET/api/v1/products/{id}
One product with its description, photos, variants and any change waiting for review.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/products/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}
}PATCH/api/v1/products/{id}
Change a product: name, description, variants, prices, stock, photos.
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.
Scope: write · Changes
Body fields
| Field | Type | What it is |
|---|---|---|
name | string | The product's name. |
description | string or null | Plain text or simple HTML. |
group | string | What it is in the catalog; default "product".One of "product", "material", "supply", "tool". |
variants | list of objects | Every variant with its price and stock. Variants left out are removed. |
variants[].id | string | A variant's id (GET /products/{id}) to change that one; leave it out for a new variant. |
variants[].name | string | Like "Small", "Black / 20 oz", or "Default". |
variants[].price_cents | whole number | What customers pay for one, in whole cents of the shop's currency. |
variants[].stock | whole number or null | Units on hand; null: not counted (always available). |
photos | list of strings | Photo addresses (https); the first is the main one. The list replaces the old one. |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X PATCH https://razer-command-center.vercel.app/api/v1/products/ID \
-H "Authorization: Bearer $CC_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Walnut sign, large","variants":[{"id":"var_1a2b3c","name":"12 in","price_cents":4900,"stock":10}]}'Example answer
{
"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"
}
}POST/api/v1/products/{id}/publish
Put a product on sale on the shop's website (the watchdog scores it: 202 with a hold id if it finds it unusual).
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.
Scope: publish · Checked by the watchdog · takes an Idempotency-Key
curl -X POST https://razer-command-center.vercel.app/api/v1/products/ID/publish \ -H "Authorization: Bearer $CC_KEY" \ -H "Idempotency-Key: $(uuidgen)"
Example answer
{
"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"
}
}POST/api/v1/products/{id}/archive
Hide a product from customers; nothing is deleted.
Answers the product record, status "archived". POST /products/{id}/publish puts it back on sale.
Scope: write · Changes
curl -X POST https://razer-command-center.vercel.app/api/v1/products/ID/archive \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}
]
}
}PUT/api/v1/products/{id}/stock
Set how many of one variant are on hand (null: not counted).
Answers the variant's stock row, as GET /stock lists it, with stock_before.
Scope: write · Changes
Body fields
| Field | Type | What it is |
|---|---|---|
variant* | string | The variant's id (or its exact name). |
stock* | whole number or null | Units on hand; null: not counted (always available). |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X PUT https://razer-command-center.vercel.app/api/v1/products/ID/stock \
-H "Authorization: Bearer $CC_KEY" \
-H "Content-Type: application/json" \
-d '{"variant":"var_1a2b3c","stock":25}'Example answer
{
"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
}
}PUT/api/v1/price-breaks
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).
Body: { breaks: [{ min_quantity, percent_off }] }. Takes an Idempotency-Key: a retry gets the first answer back, never a second hold.
Scope: publish · Checked by the watchdog · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
breaks* | list of objects | The whole list (at most 8); an empty list removes every break. |
breaks[].min_quantity* | whole number | From this many of one design. |
breaks[].percent_off* | number |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X PUT https://razer-command-center.vercel.app/api/v1/price-breaks \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"breaks":[{"min_quantity":12,"percent_off":5},{"min_quantity":24,"percent_off":10}]}'Example answer
{
"data": {
"breaks": [
{
"min_quantity": 12,
"percent_off": 5
},
{
"min_quantity": 24,
"percent_off": 10
}
],
"before": []
}
}GET/api/v1/stock
Every variant's stock, what is low and what is out.
?low=true lists only what is at or under the shop's low-stock number.
Scope: read · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/stock \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}GET/api/v1/materials
The shop's materials: sheet stock (in stock, size, cost, sheets used) and CNC bar stock.
?q= narrows it by name.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/materials \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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": []
}
}Customers, invoices and sales
GET/api/v1/customers
The shop's customers (everyone who ordered or asked for a quote), newest first.
?q= searches name, email and phone; ?tag= filters by the shop's own tags.
Scope: read · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/customers \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}GET/api/v1/customers/{id}
One customer with their orders, website orders and files.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/customers/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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": []
}
}GET/api/v1/invoices
Every priced order as an invoice: lines, total, open, paid or void, and its pay link.
?status=open|paid|refunded|void (void: lost or cancelled, never paid).
Scope: read · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/invoices \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}GET/api/v1/sales
The shop's paid website orders with tax, shipping and refunds, for accounting.
?from=YYYY-MM-DD&to=YYYY-MM-DD (UTC days).
Scope: read · Reads · a page at a time
curl https://razer-command-center.vercel.app/api/v1/sales \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}GET/api/v1/sales/summary
Totals by currency for a range: orders, gross, tax, shipping, refunds and net.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/sales/summary \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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
}
]
}
}GET/api/v1/sales/{id}
One paid website order.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/sales/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
}POST/api/v1/sales/{id}/refund
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).
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.
Scope: money · Checked by the watchdog · takes an Idempotency-Key
Body fields
| Field | Type | What it is |
|---|---|---|
mode* | string | One of "full", "lines". |
lines | list of objects | |
lines[].index | whole number | |
lines[].quantity | whole number | |
note | string | |
restock | boolean |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/sales/ID/refund \
-H "Authorization: Bearer $CC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"mode":"lines","lines":[{"index":0,"quantity":1}],"note":"One came back damaged","restock":true}'Example answer
{
"data": {
"refunded": true,
"amount_cents": 597,
"refunded_cents": 597,
"full": false,
"restocked": 1,
"website_order_id": "sord_9i8u7y"
}
}Embedded customizer
GET/api/v1/designs/{id}
A design made in the shop's customizer: product, colour, size, mockups and its production files.
Scope: read · Reads
curl https://razer-command-center.vercel.app/api/v1/designs/ID \ -H "Authorization: Bearer $CC_KEY"
Example answer
{
"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"
}
}POST/api/v1/designs/{id}/price
A design priced for options and quantities, as the shop's website prices it.
Body: { lines: [{ option_id, quantity }] }. Make the order with POST /orders and design.
Scope: read · Reads
Body fields
| Field | Type | What it is |
|---|---|---|
lines* | list of objects | |
lines[].option_id* | string | |
lines[].quantity* | whole number |
* required. Field names are snake_case; a field that isn't listed is refused (400) and named.
curl -X POST https://razer-command-center.vercel.app/api/v1/designs/ID/price \
-H "Authorization: Bearer $CC_KEY" \
-H "Content-Type: application/json" \
-d '{"lines":[{"option_id":"opt_black_l","quantity":2}]}'Example answer
{
"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)."
}
}Webhooks
Add an https address of yours in Settings › API and webhooks (or with POST /webhooks) and pick its events, or "*" for every event (the ones added later too). A live endpoint gets your shop's events; a test endpoint (made as "Test" in Settings, or with a test key) gets the events your test keys make. Each event is a POST with a JSON body: { "id": "evt_...", "type": "order.created", "api_version": "v1", "created_at": "...", "test_mode": false, "data": { ... } }. The id is the same for every endpoint it goes to, so you can skip one you have seen. Answer 2xx within 10 seconds; anything else is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 8 hours and a day. An endpoint that fails 20 deliveries in a row is switched off (switch it back on in Settings). Redirects are not followed. The delivery log (Settings, and GET /webhooks/{id}/deliveries) says in one line how a receiver answered ("Answered 405 Method Not Allowed"), never a copy of its web page.
| Event | When, and what data holds |
|---|---|
order.created | A new order or quote request: from the API, the website, Etsy, Shopify or a quote. data.order is the order (GET /orders/{id}). |
order.approved | An order was paid or approved to make: it is ready for production. data.order. |
order.shipped | An order was marked shipped, with its tracking when given. data.order. |
order.cancelled | An order was cancelled (marked Cancelled, or a quote marked Lost). data.order. |
order.refunded | 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. |
job.started | A machine started an order (the person at the machine pressed go). data.order_id, data.machine, data.at. |
job.finished | A machine finished an order. data.order_id, data.machine, data.at. |
job.failed | A machine reported an order failed. data.order_id, data.machine, data.note, data.at. |
stock.low | 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. |
* | Every event above, and any added later. Pick it instead of a list. |
Check every delivery is ours: the Command-Center-Signature header is t=<unix seconds>,v1=<signature>, the HMAC-SHA256 (hex) of <t>.<the raw body> with the endpoint's secret (whsec_..., shown once when made).
import { createHmac, timingSafeEqual } from "node:crypto";
// raw: the request body exactly as it came (a string), header: the Command-Center-Signature header.
export function fromCommandCenter(raw, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // older than 5 minutes: refuse
const expected = createHmac("sha256", secret).update(`${t}.${raw}`).digest("hex");
return parts.v1?.length === expected.length && timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}Embed the customizer
Put your customizer and its 3D preview on another website of yours. List the website in Settings › API and webhooks › Embed the customizer (while you build it, http://localhost:PORT works too), then paste:
<div data-command-center-customizer data-shop="your-shop" data-product="PRODUCT_ID"></div> <script src="https://razer-command-center.vercel.app/embed/v1/customizer.js" async></script>
When the shopper presses Add to cart, the page gets a command-center:design event with the design (designId, productId, the mockup, the sizes and quantities). Send it to your server; your server makes the order with POST /orders and "design": { "design_id": ..., "lines": [{ "option_id": ..., "quantity": ... }] }, priced by your own website prices. GET /designs/{id} gives the design's production files. The script is /embed/v1/customizer.js; nothing loads until the button is pressed. If the frame can't open (the website isn't listed, no such product, nothing to customize), it says so in plain words inside the frame. On Shopify, use the Command Center app's Customize button instead.
Machines and safety
Nothing in this API starts a machine, fires a laser or moves an axis. Sending an order to a machine only puts it on that machine's list; the person at the machine starts it on the shop PC, after the machine's own checks. Machine status is what the shop PC last reported: Command Center doesn't hear a machine's safety state (interlocks, e-stop, fire watch), so look at the machine itself.