API-översikt
Trackbay har ett publikt integrations-API för kundsystem (ERP, WMS) som autentiseras med en API-nyckel i headern X-API-Key. Nycklar skapas av en TenantAdmin (se API-nycklar).
- Fältapp (Produktion): https://trackbay.grafokett.se
- Interaktiv dokumentation med "prova själv": https://trackbay-api-jyee.onrender.com/api/public/docs
Publika endpoints
| Metod | Sökväg | Roller | Beskrivning |
|---|---|---|---|
GET | /api/public/v1/deliveries/{id} | API-nyckel | A single delivery with its full tracking history. 404 if it does not exist or belongs to a different tenant (indistinguishable by design). |
PATCH | /api/public/v1/deliveries/{id}/status | API-nyckel | Updates a delivery's status. 400 on an invalid transition, 404 if the delivery doesn't exist/belongs to another tenant. |
GET | /api/public/v1/orders | API-nyckel | Lists every order for the key's tenant, newest first. Product lines are omitted here - fetch a single order for those. |
POST | /api/public/v1/orders | API-nyckel | Creates an order for the key's tenant. 409 if the order number is already used within that tenant. |
GET | /api/public/v1/orders/{id} | API-nyckel | A single order, including its product lines with picked/remaining quantities. 404 if it does not exist or belongs to a different tenant (indistinguishable by design). |
PATCH | /api/public/v1/orders/{id}/status | API-nyckel | Updates an order's status. 400 on an invalid transition, 404 if the order doesn't exist/belongs to another tenant, 409 if the order is currently blocked or archived. |
GET | /api/public/v1/orders/{orderId}/delivery | API-nyckel | The delivery for a given order (orders and deliveries are 1:1). 404 if the order has no delivery, doesn't exist, or belongs to a different tenant (all indistinguishable by design). |
Genererad tabell
Tabellen skapas av yarn generate från API:ts OpenAPI-specifikation. Redigera den inte för hand.