Authenticated API
This endpoint requires a valid JWT Bearer token. Accessible via the API gateway at /v1/commerce/*.
Order Hub API
Unified order aggregation and routing for multi-channel restaurant operations.
Overview
The Order Hub is the central command center for all incoming orders across channels. It aggregates orders from POS, online ordering, kiosks, and third-party delivery platforms into a single queue with intelligent routing and prioritization.
| Feature | Description |
|---|---|
| Multi-Channel Aggregation | Unified view of all order sources |
| Intelligent Routing | Auto-route to KDS stations |
| Priority Management | Rush, VIP, and time-based priority |
| Third-Party Integration | DoorDash, UberEats, Grubhub |
| Real-Time Updates | WebSocket for live order flow |
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ ORDER HUB │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ POS │ │ Online │ │ Kiosk │ │ 3P Apps │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │ │
│ └────────────┴────────────┴────────────┘ │
│ │ │
│ ┌─────┴─────┐ │
│ │ Aggregator│ │
│ └─────┬─────┘ │
│ │ │
│ ┌───────────┼───────────┐ │
│ │ │ │ │
│ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐ │
│ │ Grill │ │ Fryer │ │ Expo │ │
│ │ Station │ │ Station │ │ Station │ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Endpoints
Get Order Hub Summary
GET /v1/order-hub/summary
Authorization: Bearer {access_token}
X-Location-ID: {location_id}
Response:
{
"location_id": "loc_001",
"summary": {
"total_active": 24,
"by_channel": {
"pos": 8,
"online": 6,
"kiosk": 4,
"doordash": 3,
"ubereats": 2,
"grubhub": 1
},
"by_status": {
"pending": 5,
"preparing": 12,
"ready": 4,
"completed": 3
},
"avg_prep_time_min": 11.5,
"rush_orders": 2,
"delayed_orders": 1
},
"updated_at": "2026-01-18T15:30:00Z"
}
List Aggregated Orders
GET /v1/order-hub/orders?status=active&channel=all&limit=50
Authorization: Bearer {access_token}
X-Location-ID: {location_id}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | Filter: active, pending, preparing, ready, completed |
channel | string | Filter: pos, online, kiosk, doordash, ubereats, grubhub, all |
priority | string | Filter: rush, vip, normal |
station_id | string | Filter by KDS station |
limit | integer | Max results (default: 50) |
Response:
{
"orders": [
{
"id": "ord_001",
"order_number": "A-1234",
"channel": "online",
"channel_order_id": "ONLINE-1234",
"status": "preparing",
"priority": "normal",
"order_type": "pickup",
"customer": {
"name": "John D.",
"phone": "***-***-1234"
},
"items_count": 3,
"total": 24.99,
"promised_time": "2026-01-18T15:45:00Z",
"created_at": "2026-01-18T15:20:00Z",
"prep_started_at": "2026-01-18T15:25:00Z",
"estimated_ready": "2026-01-18T15:40:00Z",
"stations": ["grill", "expo"],
"tickets_completed": 1,
"tickets_total": 2
},
{
"id": "ord_002",
"order_number": "D-5678",
"channel": "doordash",
"channel_order_id": "DD-ABC123",
"status": "pending",
"priority": "rush",
"order_type": "delivery",
"customer": {
"name": "DoorDash Customer"
},
"items_count": 5,
"total": 42.50,
"promised_time": "2026-01-18T15:35:00Z",
"created_at": "2026-01-18T15:15:00Z",
"driver_eta": "2026-01-18T15:40:00Z"
}
],
"pagination": {
"total": 24,
"limit": 50,
"offset": 0
}
}
Get Order Details (Hub View)
GET /v1/order-hub/orders/{order_id}
Authorization: Bearer {access_token}
Response:
{
"id": "ord_001",
"order_number": "A-1234",
"channel": "online",
"channel_details": {
"source": "web",
"channel_order_id": "ONLINE-1234",
"channel_status": "confirmed"
},
"status": "preparing",
"priority": "normal",
"order_type": "pickup",
"customer": {
"id": "cust_abc",
"name": "John Doe",
"phone": "+1-555-123-4567",
"email": "john@example.com",
"loyalty_member": true,
"tier": "gold"
},
"items": [
{
"id": "item_001",
"name": "Signature Burger",
"quantity": 1,
"modifiers": ["No onions", "Extra cheese"],
"price": 14.99,
"station": "grill",
"status": "preparing"
},
{
"id": "item_002",
"name": "French Fries",
"quantity": 1,
"modifiers": ["Large"],
"price": 4.99,
"station": "fryer",
"status": "completed"
}
],
"tickets": [
{
"ticket_id": "tkt_001",
"station": "grill",
"status": "preparing",
"items": ["item_001"],
"started_at": "2026-01-18T15:25:00Z"
},
{
"ticket_id": "tkt_002",
"station": "fryer",
"status": "completed",
"items": ["item_002"],
"completed_at": "2026-01-18T15:30:00Z"
}
],
"timeline": [
{"event": "created", "timestamp": "2026-01-18T15:20:00Z"},
{"event": "accepted", "timestamp": "2026-01-18T15:21:00Z"},
{"event": "prep_started", "timestamp": "2026-01-18T15:25:00Z"}
],
"totals": {
"subtotal": 19.98,
"tax": 1.80,
"tip": 3.00,
"total": 24.78
},
"promised_time": "2026-01-18T15:45:00Z",
"estimated_ready": "2026-01-18T15:40:00Z"
}
Update Order Priority
PATCH /v1/order-hub/orders/{order_id}/priority
Authorization: Bearer {access_token}
Content-Type: application/json
Request:
{
"priority": "rush",
"reason": "VIP customer request"
}
Response:
{
"id": "ord_001",
"priority": "rush",
"priority_updated_at": "2026-01-18T15:32:00Z",
"reason": "VIP customer request"
}
Reassign Order Station
POST /v1/order-hub/orders/{order_id}/reassign
Authorization: Bearer {access_token}
Content-Type: application/json
Request:
{
"from_station": "grill_1",
"to_station": "grill_2",
"reason": "Station 1 backed up"
}
Response:
{
"success": true,
"order_id": "ord_001",
"reassigned_tickets": ["tkt_001"],
"from_station": "grill_1",
"to_station": "grill_2"
}
Third-Party Order Integration
Accept Third-Party Order
POST /v1/order-hub/third-party/{order_id}/accept
Authorization: Bearer {access_token}
Content-Type: application/json
Request:
{
"prep_time_minutes": 15
}
Response:
{
"order_id": "ord_dd_001",
"channel": "doordash",
"status": "accepted",
"prep_time_minutes": 15,
"estimated_ready": "2026-01-18T15:45:00Z"
}
Reject Third-Party Order
POST /v1/order-hub/third-party/{order_id}/reject
Authorization: Bearer {access_token}
Content-Type: application/json
Request:
{
"reason": "out_of_stock",
"items": ["item_003"]
}
Adjust Third-Party Prep Time
PATCH /v1/order-hub/third-party/{order_id}/prep-time
Authorization: Bearer {access_token}
Content-Type: application/json
Request:
{
"prep_time_minutes": 25,
"reason": "High volume"
}
Mark Ready for Pickup (Delivery)
POST /v1/order-hub/third-party/{order_id}/ready
Authorization: Bearer {access_token}
Response:
{
"order_id": "ord_dd_001",
"channel": "doordash",
"status": "ready_for_pickup",
"marked_ready_at": "2026-01-18T15:42:00Z",
"driver_notified": true
}
Routing Rules
Get Routing Rules
GET /v1/order-hub/routing-rules
Authorization: Bearer {access_token}
X-Location-ID: {location_id}
Response:
{
"rules": [
{
"id": "rule_001",
"name": "Grill Items",
"conditions": {
"item_categories": ["burgers", "steaks", "grilled_items"]
},
"actions": {
"route_to_station": "grill",
"priority_boost": 0
},
"enabled": true
},
{
"id": "rule_002",
"name": "Delivery Rush",
"conditions": {
"channels": ["doordash", "ubereats", "grubhub"],
"time_to_promised": {"less_than_minutes": 10}
},
"actions": {
"priority_boost": 1,
"alert": true
},
"enabled": true
}
]
}
Create Routing Rule
POST /v1/order-hub/routing-rules
Authorization: Bearer {access_token}
Content-Type: application/json
Request:
{
"name": "VIP Express",
"conditions": {
"customer_tier": ["gold", "platinum"],
"order_total": {"greater_than": 50}
},
"actions": {
"priority": "rush",
"alert_manager": true
}
}
WebSocket Events
Subscribe to Order Hub
const ws = new WebSocket('wss://api.olympuscloud.ai/ws/order-hub');
ws.onopen = () => {
ws.send(JSON.stringify({
type: 'subscribe',
channel: 'order_hub',
location_id: 'loc_001'
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
// Handle order hub events
};
Event Types
| Event | Description |
|---|---|
order.created | New order received |
order.accepted | Order accepted (3P) |
order.status_changed | Status update |
order.priority_changed | Priority updated |
order.ticket_completed | KDS ticket bumped |
order.ready | Order ready for pickup |
order.completed | Order fulfilled |
driver.arrived | Delivery driver at location |
Metrics & Analytics
Get Hub Metrics
GET /v1/order-hub/metrics?period=today
Authorization: Bearer {access_token}
X-Location-ID: {location_id}
Response:
{
"period": "today",
"metrics": {
"orders_processed": 156,
"avg_prep_time_min": 11.2,
"avg_wait_time_min": 8.5,
"on_time_rate": 0.94,
"channel_breakdown": {
"pos": {"count": 78, "avg_prep": 9.5},
"online": {"count": 42, "avg_prep": 12.1},
"doordash": {"count": 24, "avg_prep": 11.8},
"ubereats": {"count": 12, "avg_prep": 10.9}
},
"peak_hour": "12:00-13:00",
"peak_volume": 32
}
}
Error Codes
| Code | Message | Description |
|---|---|---|
ORDER_NOT_FOUND | Order not found | Invalid order ID |
CHANNEL_ERROR | Third-party error | Error from delivery platform |
STATION_UNAVAILABLE | Station offline | Target station not available |
ALREADY_ACCEPTED | Order already accepted | Duplicate accept attempt |
CANNOT_REJECT | Order in progress | Cannot reject started order |
Related Documentation
- Orders API - Order management
- KDS API - Kitchen Display System
- Delivery Integration - Third-party delivery
- WebSocket Events - Real-time updates