The /v1 reference.
Every resource below is org-scoped by the API key and follows the same success/error envelope. Send Authorization: Bearer trk_live_XXXX on every request.
Products
| Endpoint | Scope | Behavior |
|---|---|---|
| GET /v1/products | products:read | List active products with stock quantity and status. |
| GET /v1/products/:sku | products:read | One product by SKU (case-insensitive). |
| POST /v1/products | products:write | Create a product — sku and name required. |
| PATCH /v1/products/:sku | products:write | Update name, description, status, stock_qty, bin_location. |
Setting stock_qty derives stock_status from the org's configurable threshold rules (default: ≤0 backorder, ≤8 low_stock, otherwise in_stock).
curl https://middleware.treadready.com/v1/products/TR-265-70R17 \
-H "Authorization: Bearer trk_live_XXXX"{
"ok": true,
"product": {
"sku": "TR-265-70R17",
"name": "OTR All-Terrain 265/70R17",
"status": "active",
"stock_qty": 12,
"stock_status": "in_stock",
"bin_location": "A-14"
}
}Orders
| Endpoint | Scope | Behavior |
|---|---|---|
| GET /v1/orders?status= | orders:read | Last 50 sales orders with lines; optional status filter. |
| GET /v1/orders/:idOrPoNumber | orders:read | Order detail (lines + totals) by id or PO number. |
| POST /v1/orders | orders:write | Create an order → 201 { ok, order }. Lines resolve against the catalog by SKU. |
| POST /v1/orders/:idOrPoNumber/ack | orders:write | Acknowledge: submitted → confirmed. |
| PATCH /v1/orders/:idOrPoNumber/status | orders:write | Body { status }: confirmed, processing, shipped, delivered, cancelled. |
curl -X POST https://middleware.treadready.com/v1/orders \
-H "Authorization: Bearer trk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"po_number": "PO-1001",
"ship_to": "123 Main St …",
"notes": "optional",
"lines": [{ "sku": "TR-265-70R17", "quantity": 8, "unit_price": 189.99 }]
}'Inventory
| Endpoint | Scope | Behavior |
|---|---|---|
| POST /v1/inventory | inventory:write | Bulk set stock quantities. Returns 202 with queued: true when delivery to the hub is queued. |
{ "rows": [{ "sku": "TR-265-70R17", "qty": 12 }] }Warranty claims
| Endpoint | Scope | Behavior |
|---|---|---|
| GET /v1/warranty-claims?status= | warranty:read | List claims. Statuses: submitted, under_review, approved, denied, closed. |
| GET /v1/warranty-claims/:idOrNumber | warranty:read | Track one claim by id or claim number. |
| POST /v1/warranty-claims | warranty:write | File a claim → 201 { ok, claim } with claim number. description required; sku, dot_number, quantity, customer_ref optional. |
| PATCH /v1/warranty-claims/:idOrNumber | warranty:write | Update { status?, resolution? }. |
curl -X POST https://middleware.treadready.com/v1/warranty-claims \
-H "Authorization: Bearer trk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"description": "Sidewall separation at 40% tread remaining",
"sku": "TR-265-70R17",
"dot_number": "DOT XXXX XXX 2325",
"quantity": 1,
"customer_ref": "WO-88213"
}'Telematics
Read-only health for the org's machine-data connections, plus on-demand runs. Credentials are never returned — only a masked hint.
| Endpoint | Scope | Behavior |
|---|---|---|
| GET /v1/telematics/connections | telematics:read | Connections with health: provider, status, poll interval, cursors, circuit-breaker state, last run/error, last hub rejections. |
| GET /v1/telematics/connections/:connectionId | telematics:read | One connection's health detail. |
| POST /v1/telematics/connections/:id/run | telematics:write | Poll now instead of waiting for the schedule; returns events enqueued and resulting cursors. |
| POST /v1/telematics/connections/:id/replay | telematics:write | Body { from, to } ISO timestamps, window ≤ 31 days. Re-ingests a range; cursors never move and the hub dedupes. |
EDI
| Endpoint | Scope | Behavior |
|---|---|---|
| POST /v1/edi | edi:write | Submit a raw X12 interchange as the request body (must start with ISA). |
The Gateway stores the message, resolves the trading partner from ISA identity, processes it (850 → purchase order + lines), and generates a 997 acknowledgment. Returns 400 if the body is not X12, or 422 with details if parsing fails. Outbound documents generated by the platform: 855, 856, 810, 997.
curl -X POST https://middleware.treadready.com/v1/edi \
-H "Authorization: Bearer trk_live_XXXX" \
-H "Content-Type: text/plain" \
--data-binary @purchase-order-850.ediDynamic objects
Operator-configured resources, each declaring its own read/write scopes and fields. Which objects exist is org-specific configuration — ask your platform contact which objects are enabled for your key.
| Endpoint | Scope | Behavior |
|---|---|---|
| GET /v1/objects/:key?field=value | per-object | Filterable per object configuration. |
| POST /v1/objects/:key | per-object | Body { rows: [{ … }] }. Writable only if the object is configured writable. |
