API & AI assistants

Everything the Backroom screens can do, an assistant or integration can do too. Two doors into the same store: an MCP server for AI assistants and a JSON API for everything else. Both use a per-store API key that the merchant generates in Backroom → Settings → API & AI assistants.

MCP server

Endpointhttps://restocker-production-2027.up.railway.app/mcp
TransportStreamable HTTP (JSON-RPC 2.0 over POST), stateless
AuthAuthorization: Bearer <api key>

Connecting from Claude

Settings → Connectors → Add custom connector → URL https://restocker-production-2027.up.railway.app/mcp. When asked for authentication, choose bearer token / API key and paste the store's key. Then ask things like "what should I reorder from Northwind this week?", "create the purchase orders for everything that's low" or "receive PO-12 in full, invoice 4471".

Connecting from other assistants

Any MCP client that supports remote servers with a bearer token works the same way. For clients that only run local servers, point mcp-remote (or an equivalent bridge) at the URL with the header Authorization: Bearer <key>.

Tools

ToolWhat it does
get_store_infoStore name, currency, locations, reorder settings and when stock was last synced. Call first to learn location gids.
get_stock_summaryHow many items are out of stock or below their reorder point, how many suppliers need an order, and the suggested spend.
get_reorder_suggestionsWhat to reorder and how much, grouped by supplier, based on sales velocity, lead time and days of cover. Each item has suggested_qty, days_left, on_hand, on_order and the reason.
list_suppliersSuppliers with their lead times and contact emails.
search_productsFind products/variants by name, SKU, barcode or vendor. Returns variant_gid, sku and stock on hand.
list_purchase_ordersPurchase orders. status: open (default), all, draft, ordered, partial, received, closed, cancelled.
get_purchase_orderOne purchase order with its lines (line_id, sku, qty_ordered, qty_received, unit_cost).
create_purchase_orderCreate a purchase order. Lines identify products by variant_gid, sku or barcode. Created as a draft unless mark_ordered is true. Supplier is inferred from the products' vendor when supplier_id is omitted.
create_purchase_orders_from_suggestionsCreate one purchase order per supplier from the current reorder suggestions (same as the app's 'Create POs for all suppliers'). Pass supplier_id to do a single supplier. Orders are drafts unless mark_ordered is true.
set_purchase_order_statusChange a purchase order's status. action: order (draft→ordered), close, cancel, reopen, delete (drafts only).
receive_deliveryRecord a delivery against an ordered purchase order and add the units to Shopify inventory at the location. Either pass lines (line_id/sku/variant_gid + qty, optional unit_cost) or receive_all=true for everything outstanding. Pass a nonce to make the call idempotent.

Tools that create orders or receive deliveries change real data in Backroom and, for receiving, in Shopify inventory. The server's instructions tell assistants to confirm with the user before those calls.

JSON API

Base URLhttps://restocker-production-2027.up.railway.app/api/v1
AuthAuthorization: Bearer <api key>
OpenAPIhttps://restocker-production-2027.up.railway.app/api/v1/openapi.json
Method & pathPurpose
GET /meStore, locations, reorder settings
GET /locationsActive inventory locations
GET /suppliersSuppliers with lead times
GET /stock/summary?location=Out-of-stock and to-reorder counts, suggested spend
GET /suggestions?location=&supplier_id=&all=1Reorder suggestions grouped by supplier
GET /products/search?q=Find variants by name, SKU, barcode, vendor
GET /purchase-orders?status=openList purchase orders
POST /purchase-ordersCreate a purchase order from lines (variant_gid / sku / barcode + qty)
POST /purchase-orders/from-suggestionsOne PO per supplier from the current suggestions
GET /purchase-orders/{id}Purchase order with lines
POST /purchase-orders/{id}/status{"action": "order" | "close" | "cancel" | "reopen" | "delete"}
POST /purchase-orders/{id}/receiveReceive a delivery; updates Shopify inventory. Supports receive_all, update_costs, idempotent nonce

Example

curl -H "Authorization: Bearer bk_…" "https://restocker-production-2027.up.railway.app/api/v1/suggestions"

curl -X POST -H "Authorization: Bearer bk_…" -H "Content-Type: application/json" \
  -d '{"lines":[{"sku":"BLU-1001","qty":12}],"mark_ordered":true,"reference":"Sept restock"}' \
  "https://restocker-production-2027.up.railway.app/api/v1/purchase-orders"

curl -X POST -H "Authorization: Bearer bk_…" -H "Content-Type: application/json" \
  -d '{"receive_all":true,"reference":"INV-4471","nonce":"delivery-2026-10-03"}' \
  "https://restocker-production-2027.up.railway.app/api/v1/purchase-orders/12/receive"

Errors come back as {"error": "…"} with 400 (bad input), 401 (bad key or no subscription), 404 (not found), 409 (wrong state) or 502 (receipt recorded but Shopify update failed — retry from the app).

Machine-readable