Download OpenAPI specification:
REST API for AI-powered pizza ordering system, designed for integration with Eleven Labs conversational AI agents.
This API enables voice-based pizza ordering through an AI assistant. It supports:
POST /cart - Create cart with phone number at conversation startGET /menu?order_type=pickup - Fetch available menus and categoriesGET /menu/{menu_id}/categories - Get items in each categoryGET /menu/{menu_id}/{item_id} - Get full item details (sizes, toppings, etc.) before adding to cartPOST /cart/{orderId}/items - Add items with selected optionsPOST /orders - Submit order with customer infoselection_id values from menuAll error responses follow a consistent format with:
success: falseerror.code: Machine-readable error codeerror.message: Human-readable message for AI agenterror.field: The field that caused the errorerror.details: Additional context (optional)Browse the restaurant menu and fetch item details.
/menu: Get all menus and categories (requires order_type)/menu/{menu_id}/categories: Get categories with items for browsing/menu/{menu_id}/{item_id}: Get full item details with customization optionsReturns a list of available menus with their category names. Use this at conversation start to help customers browse.
IMPORTANT: The order_type query parameter is required.
Typical workflow:
/menu/{menu_id}/categories to get items in each category/menu/{menu_id}/{item_id} for full details| order_type required | string Enum: "pickup" "delivery" Example: order_type=pickup The type of order (pickup or delivery) |
[- {
- "menu_id": "menu_874",
- "categories": [
- {
- "category_id": "menu_874_categories_476",
- "category_name": "Build Your Own Pizza"
}, - {
- "category_id": "menu_874_categories_521",
- "category_name": "Specialty Pizzas"
}, - {
- "category_id": "menu_874_categories_586",
- "category_name": "Sides & Dips"
}, - {
- "category_id": "menu_874_categories_612",
- "category_name": "Drinks"
}
]
}
]Returns all categories with their items for browsing. Use this to show customers what's available in each category.
Note: This returns item summaries only (no options). You MUST call /menu/{menu_id}/{item_id} before adding any item to cart.
| menu_id required | string Example: menu_874 The menu ID from the menus list (e.g., "menu_874") |
[- {
- "category_id": "menu_874_categories_476",
- "category_name": "Build Your Own Pizza",
- "items": [
- {
- "item_id": "menu_874_categories_476_items_176",
- "item_name": "Build Your Own Pizza",
- "description": "Create your perfect pizza with your choice of crust, sauce, cheese, and toppings"
}
]
}, - {
- "category_id": "menu_874_categories_521",
- "category_name": "Specialty Pizzas",
- "items": [
- {
- "item_id": "menu_874_categories_521_items_847",
- "item_name": "Pepperoni Pizza",
- "description": "Classic pepperoni with mozzarella cheese on zesty tomato sauce"
}, - {
- "item_id": "menu_874_categories_521_items_892",
- "item_name": "Hawaiian Pizza",
- "description": "Ham and pineapple with mozzarella cheese"
}
]
}
]Returns complete details for a menu item including all customization options.
CRITICAL: You must call this endpoint before adding any item to the cart to get:
Option types:
single_select: Customer chooses exactly ONE (e.g., size, base sauce)multi_select_quantity: Customer can choose multiple with quantities (e.g., toppings)Note: Simple items like drinks or dips may not have options - they can be added directly to cart.
| menu_id required | string Example: menu_874 The menu ID (e.g., "menu_874") |
| item_id required | string Example: menu_874_categories_521_items_847 The item ID from categories endpoint (e.g., "menu_874_categories_521_items_847") |
{- "item_id": "menu_874_categories_521_items_847",
- "item_name": "Pepperoni Pizza",
- "description": "Classic pepperoni with mozzarella cheese on zesty tomato sauce",
- "base_price": 0,
- "options": [
- {
- "option_id": "menu_874_categories_521_items_847_itemAttributes_428",
- "option_name": "Size",
- "option_type": "single_select",
- "required": true,
- "min_total_quantity": 1,
- "max_total_quantity": 1,
- "selections": [
- {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_286",
- "selection_name": "Small 10\"",
- "selection_price": 12.99
}, - {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_612",
- "selection_name": "Medium 12\"",
- "selection_price": 15.99
}, - {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_831",
- "selection_name": "Large 14\"",
- "selection_price": 18.99
}
]
}, - {
- "option_id": "menu_874_categories_521_items_847_itemAttributes_592",
- "option_name": "Extra Toppings",
- "option_type": "multi_select_quantity",
- "required": false,
- "min_total_quantity": 0,
- "max_total_quantity": 10,
- "selections": [
- {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_592_values_291",
- "selection_name": "Extra Pepperoni",
- "per_selection_price": 2.5,
- "min_selection_qty": 1,
- "max_selection_qty": 3
}, - {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_592_values_445",
- "selection_name": "Extra Cheese",
- "per_selection_price": 2,
- "min_selection_qty": 1,
- "max_selection_qty": 2
}
]
}
]
}Manage the shopping cart for the current session.
Creates a new shopping cart for the customer's session. Call this first at the start of every conversation.
The returned orderId must be stored and used for all subsequent cart operations.
Requirements:
phone_number: Customer's 10-digit phone number (formats accepted: 6045551234, 604-555-1234, (604) 555-1234)Typical workflow:
| phone_number required | string Customer's 10-digit phone number |
{- "phone_number": "6045551234"
}{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "phone_number": "6045551234",
- "items": [ ],
- "subtotal": 0,
- "tax": 0,
- "total": 0,
- "item_count": 0,
- "created_at": "2024-01-15T10:30:00.000Z",
- "updated_at": "2024-01-15T10:30:00.000Z"
}, - "message": "Your cart is ready! What pizza would you like to order?"
}Returns the current cart with all items, quantities, and calculated totals.
Use this to:
line_id values for updating/removing items| orderId required | string Example: ORD-A1B2C3 The orderId returned from create cart |
{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "phone_number": "6045551234",
- "items": [
- {
- "line_id": "line_x8j3p2",
- "item_id": "menu_874_categories_521_items_847",
- "item_name": "Pepperoni Pizza",
- "selected_options": {
- "menu_874_categories_521_items_847_itemAttributes_428": {
- "name": "Size",
- "selection": {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_831",
- "name": "Large 14\"",
- "price": 18.99
}
}
}, - "quantity": 1,
- "line_total": 18.99
}
], - "subtotal": 18.99,
- "tax": 1.52,
- "total": 20.51,
- "item_count": 1,
- "created_at": "2024-01-15T10:30:00.000Z",
- "updated_at": "2024-01-15T10:32:00.000Z"
}, - "message": "Your cart has 1 item totaling $20.51."
}Adds a menu item to the cart with selected options.
Before calling this endpoint:
GET /menu/{menu_id}/{item_id}selected_options format:
Array of objects with option_id and selections:
[
{
"option_id": "menu_874_categories_521_items_847_itemAttributes_428",
"selections": [
{
"selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_831",
"name": "Large 14\"",
"quantity": 1
}
]
}
]
CRITICAL: Use exact selection_id values from the menu API - never simplify to names like "large" or "pepperoni"
For items WITHOUT options (drinks, dips):
selected_options to empty array [] or omit it| orderId required | string Example: ORD-A1B2C3 The orderId from create cart |
| item_id required | string The menu item ID from get menu categories |
| quantity | integer >= 1 Default: 1 Number of this item to add (default 1) |
Array of objects (OptionSelection) Array of option selections for this item.
|
{- "item_id": "menu_874_categories_521_items_847",
- "quantity": 1,
- "selected_options": [
- {
- "option_id": "menu_874_categories_521_items_847_itemAttributes_428",
- "selections": [
- {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_831",
- "name": "Large 14\"",
- "quantity": 1
}
]
}
]
}{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "items": [
- {
- "line_id": "line_x8j3p2",
- "item_id": "menu_874_categories_521_items_847",
- "item_name": "Pepperoni Pizza",
- "quantity": 1,
- "line_total": 18.99
}
], - "subtotal": 18.99,
- "tax": 1.52,
- "total": 20.51,
- "item_count": 1
}, - "message": "Added 1 Pepperoni Pizza to your cart. Your total is now $20.51. Would you like to add anything else or proceed to checkout?"
}Adds multiple items to the cart in a single API call. More efficient than calling add_cart_item multiple times.
Use cases:
Partial success: Some items may succeed while others fail. Check added_count and error_count in response.
| orderId required | string Example: ORD-A1B2C3 The orderId from create cart |
required | Array of objects (AddItemRequest) Array of items to add (each follows AddItemRequest format) |
{- "items": [
- {
- "item_id": "menu_874_categories_521_items_847",
- "quantity": 2,
- "selected_options": [
- {
- "option_id": "menu_874_categories_521_items_847_itemAttributes_428",
- "selections": [
- {
- "selection_id": "menu_874_categories_521_items_847_itemAttributes_428_values_831",
- "name": "Large 14\"",
- "quantity": 1
}
]
}
]
}, - {
- "item_id": "menu_874_categories_521_items_892",
- "quantity": 1,
- "selected_options": [
- {
- "option_id": "menu_874_categories_521_items_892_itemAttributes_428",
- "selections": [
- {
- "selection_id": "menu_874_categories_521_items_892_itemAttributes_428_values_612",
- "name": "Medium 12\"",
- "quantity": 1
}
]
}
]
}
]
}{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "items": [
- {
- "line_id": "line_x8j3p2",
- "item_name": "Pepperoni Pizza",
- "quantity": 2,
- "line_total": 37.98
}, - {
- "line_id": "line_y9k4q3",
- "item_name": "Hawaiian Pizza",
- "quantity": 1,
- "line_total": 15.99
}
], - "subtotal": 53.97,
- "tax": 4.32,
- "total": 58.29,
- "item_count": 3
}, - "added_count": 2,
- "error_count": 0,
- "message": "Added 2 Pepperoni Pizza, 1 Hawaiian Pizza to your cart. Your total is now $58.29. Would you like to add anything else or proceed to checkout?"
}Updates an existing item in the cart. Use this when customer wants to:
To get the line_id: Call GET /cart/{orderId} and find the item in the items array.
Partial updates: You can update just quantity, just selected_options, or both.
If selected_options is provided, it replaces ALL existing options.
| orderId required | string Example: ORD-A1B2C3 The orderId from create cart |
| lineId required | string Example: line_x8j3p2 The line_id of the cart item to update (from cart items array) |
| quantity | integer >= 1 New quantity (must be > 0; use DELETE to remove item) |
Array of objects (OptionSelection) New options (replaces all existing options if provided) |
{- "quantity": 3
}{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "items": [
- {
- "line_id": "line_x8j3p2",
- "item_name": "Pepperoni Pizza",
- "quantity": 3,
- "line_total": 56.97
}
], - "subtotal": 56.97,
- "tax": 4.56,
- "total": 61.53
}, - "message": "Updated Pepperoni Pizza in your cart. Your total is now $61.53."
}Removes an item from the cart entirely.
To get the line_id: Call GET /cart/{orderId} and find the item in the items array.
Note: To change quantity to 0, use this endpoint instead of PATCH.
| orderId required | string Example: ORD-A1B2C3 The orderId from create cart |
| lineId required | string Example: line_x8j3p2 The line_id of the cart item to remove |
{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "items": [
- {
- "line_id": "line_y9k4q3",
- "item_name": "Hawaiian Pizza",
- "quantity": 1,
- "line_total": 15.99
}
], - "subtotal": 15.99,
- "tax": 1.28,
- "total": 17.27,
- "item_count": 1
}, - "message": "Removed Pepperoni Pizza from your cart. Your total is now $17.27. Would you like to add anything else or proceed to checkout?"
}Place and track orders.
Creates an order from the cart contents and submits it for preparation.
Required information:
orderId: Cart must have at least one itemcustomer.name: Customer's name for the ordercustomer.phone: Contact phone numberorder_type: "pickup" (default) or "delivery"delivery_address.street: Required for delivery orders onlyOrder details:
After successful submission:
| orderId required | string The orderId from the cart |
| order_type | string Default: "pickup" Enum: "pickup" "delivery" How the customer will receive the order |
required | object (Customer) Customer information for the order |
object (DeliveryAddress) Delivery address details (required for delivery orders) | |
| special_instructions | string Special requests for the order (e.g., "extra napkins") |
{- "orderId": "ORD-A1B2C3",
- "order_type": "pickup",
- "customer": {
- "name": "John Doe",
- "phone": "604-555-1234"
}
}{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "phone_number": "6045551234",
- "status": "confirmed",
- "order_type": "pickup",
- "customer": {
- "name": "John Doe",
- "phone": "604-555-1234"
}, - "items": [
- {
- "line_id": "line_x8j3p2",
- "item_name": "Pepperoni Pizza",
- "quantity": 1,
- "line_total": 18.99
}
], - "subtotal": 18.99,
- "tax": 1.52,
- "total": 20.51,
- "payment_method": "cash_on_pickup",
- "estimated_ready_minutes": 25,
- "estimated_ready_time": "2024-01-15T11:00:00.000Z",
- "pickup_instructions": "Order will be ready at the front counter. Please mention order #ORD-A1B2C3.",
- "created_at": "2024-01-15T10:35:00.000Z"
}, - "message": "Your order #ORD-A1B2C3 has been confirmed for pickup! Your Pepperoni Pizza will be ready in approximately 25 minutes. The total is $20.51, payable in cash when you arrive. Just mention order number ORD-A1B2C3 at the counter. Thank you for ordering with us!"
}Returns the current status and details of an order.
Order statuses:
confirmed: Order received and being preparedpreparing: Kitchen is making the orderready: Order is ready (for pickup) or being dispatched (for delivery)out_for_delivery: Driver is on the way (delivery only)completed: Order has been picked up or deliveredcancelled: Order was cancelledResponse includes:
minutes_remaining: Time until estimated ready time (0 if past)| orderId required | string Example: ORD-A1B2C3 The orderId from order submission |
{- "success": true,
- "data": {
- "orderId": "ORD-A1B2C3",
- "phone_number": "6045551234",
- "status": "confirmed",
- "order_type": "pickup",
- "customer": {
- "name": "John Doe",
- "phone": "604-555-1234"
}, - "items": [
- {
- "item_name": "Pepperoni Pizza",
- "quantity": 1,
- "line_total": 18.99
}
], - "subtotal": 18.99,
- "tax": 1.52,
- "total": 20.51,
- "payment_method": "cash_on_pickup",
- "estimated_ready_minutes": 25,
- "estimated_ready_time": "2024-01-15T11:00:00.000Z",
- "minutes_remaining": 18,
- "created_at": "2024-01-15T10:35:00.000Z"
}, - "message": "Your order #ORD-A1B2C3 is being prepared. It will be ready in approximately 18 minutes."
}