OrderAI API Reference
The OrderAI API allows Enterprise customers to programmatically manage orders, menu items, and integrate with external systems. All API endpoints use JSON and require authentication via API key.
Base URL: https://app.orderai.com/api
Authentication
All API requests must include your API key in the Authorization header.
GET /api/orders HTTP/1.1
Host: app.orderai.com
Authorization: Bearer your_api_key_here
Content-Type: application/jsonYou can find your API key in Settings → API in your dashboard. Keep your API key secret — do not expose it in client-side code.
Webhooks
OrderAI receives webhooks from Retell AI when a call completes. The webhook payload contains call details and the extracted order.
Retell Webhook Payload
{
"event": "call_ended",
"call_id": "call_abc123",
"caller_phone": "+15551234567",
"duration_seconds": 142,
"transcript": "AI: Hi, thanks for calling...\nCustomer: I'd like...",
"extracted_data": {
"customer_name": "John Smith",
"items": [
{
"name": "Large Pepperoni Pizza",
"quantity": 1,
"price": 18.99,
"modifications": ["Extra Cheese"]
}
],
"special_instructions": "Ring doorbell"
}
}Orders API
/api/ordersList all orders for your restaurant. Supports pagination and filtering.
Query Parameters
| Param | Type | Description |
|---|---|---|
status | string | Filter: new, preparing, ready, completed |
limit | number | Results per page (default: 50) |
offset | number | Pagination offset |
/api/ordersCreate a new order programmatically.
{
"customer_name": "Jane Doe",
"customer_phone": "+15559876543",
"items": [
{ "name": "Margherita Pizza", "quantity": 2, "price": 16.99, "modifications": [] }
],
"notes": "Pickup in 20 minutes"
}/api/orders/:idUpdate an order's status or notes.
{
"status": "preparing",
"notes": "Customer requested extra napkins"
}Rate Limits
| Plan | Rate Limit | Burst |
|---|---|---|
| Pro | 100 req/min | 20 req/sec |
| Enterprise | 1000 req/min | 100 req/sec |
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset
Code Examples
cURL
# List orders
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://app.orderai.com/api/orders
# Create order
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"customer_name":"John","items":[{"name":"Pizza","quantity":1,"price":18.99}]}' \
https://app.orderai.com/api/orders
# Update order status
curl -X PATCH \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"preparing"}' \
https://app.orderai.com/api/orders/ORDER_IDJavaScript / Node.js
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://app.orderai.com/api';
// List orders
const response = await fetch(`${BASE_URL}/orders`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
const orders = await response.json();
// Create an order
const newOrder = await fetch(`${BASE_URL}/orders`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_name: 'Jane Doe',
customer_phone: '+15551234567',
items: [
{ name: 'Large Pepperoni Pizza', quantity: 1, price: 18.99, modifications: ['Extra Cheese'] }
]
})
});Python
import requests
API_KEY = 'your_api_key_here'
BASE_URL = 'https://app.orderai.com/api'
headers = {'Authorization': f'Bearer {API_KEY}'}
# List orders
orders = requests.get(f'{BASE_URL}/orders', headers=headers).json()
# Create an order
new_order = requests.post(f'{BASE_URL}/orders',
headers={**headers, 'Content-Type': 'application/json'},
json={
'customer_name': 'Jane Doe',
'customer_phone': '+15551234567',
'items': [
{'name': 'Large Pepperoni Pizza', 'quantity': 1, 'price': 18.99, 'modifications': ['Extra Cheese']}
]
}
).json()
# Update status
requests.patch(f'{BASE_URL}/orders/{order_id}',
headers={**headers, 'Content-Type': 'application/json'},
json={'status': 'preparing'}
)Need help? Email api@orderai.com or visit our dashboard.