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.

http
GET /api/orders HTTP/1.1
Host: app.orderai.com
Authorization: Bearer your_api_key_here
Content-Type: application/json

You 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

json
{
  "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

GET/api/orders

List all orders for your restaurant. Supports pagination and filtering.

Query Parameters

ParamTypeDescription
statusstringFilter: new, preparing, ready, completed
limitnumberResults per page (default: 50)
offsetnumberPagination offset
POST/api/orders

Create a new order programmatically.

json
{
  "customer_name": "Jane Doe",
  "customer_phone": "+15559876543",
  "items": [
    { "name": "Margherita Pizza", "quantity": 2, "price": 16.99, "modifications": [] }
  ],
  "notes": "Pickup in 20 minutes"
}
PATCH/api/orders/:id

Update an order's status or notes.

json
{
  "status": "preparing",
  "notes": "Customer requested extra napkins"
}

Rate Limits

PlanRate LimitBurst
Pro100 req/min20 req/sec
Enterprise1000 req/min100 req/sec

Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset

Code Examples

cURL

bash
# 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_ID

JavaScript / Node.js

javascript
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

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.