Overview
The QueChains API lets you programmatically manage global supply chain operations for your organization. All resources are scoped by tenant, your JWT includes an organization identifier enforced on every request.
- Versioned paths under
/api/v1/ - Paginated list endpoints with
page,limit, and filters - Idempotent writes where noted in endpoint guides
- Zod-validated request bodies with structured error responses
Authentication
Authenticate with email/password or complete OAuth flows via the web app. Include the access token on every request:
Authorization: Bearer <access_token> Access tokens expire in 15 minutes. Use the refresh token at POST /api/v1/auth/refresh to obtain a new pair. Sessions are stored in Redis and can be revoked on logout.
Example: login
curl -X POST https://api.quechains.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"••••••••"}'Roles
adminFull organization accessoperations_managerShipments, carriers, warehouseslogistics_coordinatorCreate and update shipmentscustoms_agentCustoms declarations and documentsviewerRead-only accessapi_userProgrammatic API accessRate limits
Limits are enforced per user and per organization using Redis:
Responses include rate-limit headers. Exceeded limits return 429 Too Many Requests.
Errors
Errors use consistent JSON with an HTTP status code and error object:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": [ … ]
}
}| Status | Meaning |
|---|---|
400 | Validation or malformed request |
401 | Missing or invalid token |
403 | Insufficient role permissions |
404 | Resource not found (or wrong tenant) |
429 | Rate limit exceeded |
500 | Unexpected server error |
Authentication
Register users, obtain tokens, manage profile and MFA.
/api/v1/auth/registerCreate account & organization/api/v1/auth/loginObtain access and refresh tokens/api/v1/auth/refreshRefresh access token/api/v1/auth/logoutInvalidate session/api/v1/auth/profileGet current user profile/api/v1/auth/profileUpdate profile/api/v1/auth/change-passwordChange password/api/v1/auth/mfa/setupBegin MFA setup/api/v1/auth/mfa/verifyVerify and enable MFA/api/v1/auth/mfa/disableDisable MFAShipments
Create and track multi-modal shipments, events, documents, and alerts.
Example: create shipment
curl -X POST https://api.quechains.com/api/v1/shipments \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"origin": { "city": "Shanghai", "country": "CN" },
"destination": { "city": "Los Angeles", "country": "US" },
"mode": "sea",
"incoterms": "FOB"
}'/api/v1/shipmentsList shipments (paginated, filterable)/api/v1/shipmentsCreate shipment/api/v1/shipments/:idGet shipment by ID/api/v1/shipments/:idUpdate shipment/api/v1/shipments/:idDelete shipment/api/v1/shipments/statsShipment statistics/api/v1/shipments/:id/eventsAdd tracking event/api/v1/shipments/:id/documentsUpload document/api/v1/shipments/:id/alerts/:alertId/acknowledgeAcknowledge alertPurchase orders
Procurement lines linked to suppliers and downstream logistics.
/api/v1/purchase-ordersList purchase orders/api/v1/purchase-ordersCreate purchase order/api/v1/purchase-orders/:idGet purchase order/api/v1/purchase-orders/:idUpdate purchase order/api/v1/purchase-orders/:idDelete purchase order/api/v1/purchase-orders/:id/approveApprove purchase orderCarriers
Carrier master data, performance scores, and rate cards.
/api/v1/carriersList carriers/api/v1/carriersCreate carrier/api/v1/carriers/:idGet carrier/api/v1/carriers/:idUpdate carrier/api/v1/carriers/:idDelete carrier/api/v1/carriers/:id/performanceUpdate performance metrics/api/v1/carriers/:id/rate-cardsList rate cards/api/v1/carriers/:id/rate-cardsCreate rate cardWarehouses
Warehouse locations and inventory positions.
/api/v1/warehousesList warehouses/api/v1/warehousesCreate warehouse/api/v1/warehouses/:idGet warehouse/api/v1/warehouses/:idUpdate warehouse/api/v1/warehouses/:idDelete warehouse/api/v1/warehouses/:id/inventoryList inventory/api/v1/warehouses/:id/inventoryAdd inventory item/api/v1/warehouses/:id/inventory/:itemIdUpdate inventory item/api/v1/warehouses/:id/inventory/:itemIdRemove inventory itemSuppliers
Supplier onboarding, approval, and performance tracking.
/api/v1/suppliersList suppliers/api/v1/suppliersCreate supplier/api/v1/suppliers/:idGet supplier/api/v1/suppliers/:idUpdate supplier/api/v1/suppliers/:idDelete supplier/api/v1/suppliers/:id/approveApprove supplier/api/v1/suppliers/:id/performanceUpdate performanceCustoms
Declarations, HS lookup, submission, and clearance.
/api/v1/customsList declarations/api/v1/customsCreate declaration/api/v1/customs/:idGet declaration/api/v1/customs/:idUpdate declaration/api/v1/customs/:id/submitSubmit for review/api/v1/customs/:id/clearMark as cleared/api/v1/customs/hscode/:codeHS code lookupAnalytics
Dashboards, cost analysis, performance metrics, and reports.
/api/v1/analytics/dashboardDashboard summary/api/v1/analytics/shipments/performanceShipment performance/api/v1/analytics/shipments/trendsShipment trends/api/v1/analytics/costs/overviewCost overview/api/v1/analytics/suppliers/performanceSupplier performance/api/v1/analytics/carriers/performanceCarrier performance/api/v1/analytics/carbon-footprintCarbon footprint/api/v1/analytics/reports/generateGenerate reportDisruptions
Risk events, affected shipments, and alternative routes.
/api/v1/disruptionsList disruptions/api/v1/disruptions/activeActive disruptions/api/v1/disruptions/:idGet disruption/api/v1/disruptionsCreate disruption/api/v1/disruptions/:idUpdate disruption/api/v1/disruptions/:id/resolveResolve disruption/api/v1/disruptions/:id/affected-shipmentsAffected shipments/api/v1/disruptions/:id/alternative-routesAlternative routesWebhooks
Register HTTPS endpoints to receive signed event payloads when resources change. Configure webhooks in your organization settings or via the integrations workspace.
- Payloads are JSON with event type, timestamp, and resource snapshot
- HMAC signature in
X-QueChains-Signatureheader - Retry with exponential backoff on non-2xx responses
Event types
Real-time (WebSocket)
Connect via Socket.IO for live shipment tracking, alerts, and organization notifications. Authenticate with the same JWT used for REST requests.
wss://api.quechains.com/socket.io/?token=ACCESS_TOKENClients join organization-scoped rooms. Events mirror key webhook types for low-latency dashboards.
Get API access
Sandbox credentials and OpenAPI specs are available for enterprise pilots. Self-serve keys for Growth plans roll out soon.