Pizza AI Ordering API (2.0.0)

Download OpenAPI specification:

REST API for AI-powered pizza ordering system, designed for integration with Eleven Labs conversational AI agents.

Overview

This API enables voice-based pizza ordering through an AI assistant. It supports:

  • Menu browsing: Categories, items, and detailed customization options
  • Cart management: Create cart, add/update/remove items with full option validation
  • Order placement: Pickup or delivery with customer info collection

Typical Workflow

  1. POST /cart - Create cart with phone number at conversation start
  2. GET /menu?order_type=pickup - Fetch available menus and categories
  3. GET /menu/{menu_id}/categories - Get items in each category
  4. GET /menu/{menu_id}/{item_id} - Get full item details (sizes, toppings, etc.) before adding to cart
  5. POST /cart/{orderId}/items - Add items with selected options
  6. POST /orders - Submit order with customer info

Key Concepts

  • phone_number: Customer's 10-digit phone number to create cart
  • orderId: Unique cart/order identifier returned from cart creation
  • menu_id: Menu identifier (e.g., "menu_874")
  • item_id: Menu item identifier from categories endpoint
  • selected_options: Array of option selections using exact selection_id values from menu
  • line_id: Cart item identifier for updates/removal

Error Handling

All error responses follow a consistent format with:

  • success: false
  • error.code: Machine-readable error code
  • error.message: Human-readable message for AI agent
  • error.field: The field that caused the error
  • error.details: Additional context (optional)

Menu

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 options

Get available menus and categories

Returns 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:

  1. Call this endpoint with order_type at conversation start
  2. Use menu_id and category info to help customer browse
  3. Call /menu/{menu_id}/categories to get items in each category
  4. When customer selects an item, call /menu/{menu_id}/{item_id} for full details
query Parameters
order_type
required
string
Enum: "pickup" "delivery"
Example: order_type=pickup

The type of order (pickup or delivery)

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

Get categories with items for a specific menu

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.

path Parameters
menu_id
required
string
Example: menu_874

The menu ID from the menus list (e.g., "menu_874")

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

Get full item details with options

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:

  • Available sizes and their prices
  • Crust options
  • Sauce options
  • Cheese options
  • Topping options with min/max quantities

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.

path Parameters
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")

Responses

Response samples

Content type
application/json
Example
{
  • "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": [
    ]
}

Cart

Manage the shopping cart for the current session.

  • Create cart with phone_number at conversation start
  • Add items with selected options (size, crust, toppings)
  • Update quantities or options, remove items
  • Cart persists for the session duration

Create a new cart

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:

  1. Create cart with phone_number
  2. Fetch menu and categories
  3. Add items as customer orders
  4. Submit order when ready
Request Body schema: application/json
required
phone_number
required
string

Customer's 10-digit phone number

Responses

Request samples

Content type
application/json
Example
{
  • "phone_number": "6045551234"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    },
  • "message": "Your cart is ready! What pizza would you like to order?"
}

Get cart contents

Returns the current cart with all items, quantities, and calculated totals.

Use this to:

  • Show the customer their current order
  • Get line_id values for updating/removing items
  • Verify cart contents before checkout
path Parameters
orderId
required
string
Example: ORD-A1B2C3

The orderId returned from create cart

Responses

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "data": {
    },
  • "message": "Your cart has 1 item totaling $20.51."
}

Add item to cart

Adds a menu item to the cart with selected options.

Before calling this endpoint:

  1. Get full item details from GET /menu/{menu_id}/{item_id}
  2. Collect all required options from the customer (size, crust, etc.)

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):

  • Set selected_options to empty array [] or omit it
path Parameters
orderId
required
string
Example: ORD-A1B2C3

The orderId from create cart

Request Body schema: application/json
required
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.

  • Required for items with options (pizzas with size/toppings)
  • Optional/empty for simple items without options (drinks, dips)

Responses

Request samples

Content type
application/json
Example
{
  • "item_id": "menu_874_categories_521_items_847",
  • "quantity": 1,
  • "selected_options": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    },
  • "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?"
}

Add multiple items to cart

Adds multiple items to the cart in a single API call. More efficient than calling add_cart_item multiple times.

Use cases:

  • Customer orders multiple pizzas at once ("3 large pepperoni pizzas")
  • Customer orders different items ("a pepperoni and a hawaiian")
  • Bulk add with drinks and sides

Partial success: Some items may succeed while others fail. Check added_count and error_count in response.

path Parameters
orderId
required
string
Example: ORD-A1B2C3

The orderId from create cart

Request Body schema: application/json
required
required
Array of objects (AddItemRequest)

Array of items to add (each follows AddItemRequest format)

Responses

Request samples

Content type
application/json
Example
{
  • "items": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "data": {
    },
  • "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?"
}

Update cart item (quantity or options)

Updates an existing item in the cart. Use this when customer wants to:

  • Change quantity ("make that 2 pizzas instead of 1")
  • Change size ("actually, make it a large")
  • Change toppings or other options

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.

path Parameters
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)

Request Body schema: application/json
required
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)

Responses

Request samples

Content type
application/json
Example
{
  • "quantity": 3
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    },
  • "message": "Updated Pepperoni Pizza in your cart. Your total is now $61.53."
}

Remove item from cart

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.

path Parameters
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

Responses

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "data": {
    },
  • "message": "Removed Pepperoni Pizza from your cart. Your total is now $17.27. Would you like to add anything else or proceed to checkout?"
}

Orders

Place and track orders.

  • Submit order with customer info and delivery/pickup preference
  • Pickup: Ready in 20-40 min, pay cash at counter
  • Delivery: Ready in 35-55 min, $4.99 fee, pay cash on delivery

Submit order for processing

Creates an order from the cart contents and submits it for preparation.

Required information:

  • orderId: Cart must have at least one item
  • customer.name: Customer's name for the order
  • customer.phone: Contact phone number
  • order_type: "pickup" (default) or "delivery"
  • delivery_address.street: Required for delivery orders only

Order details:

  • Pickup: Ready in 20-40 minutes, pay cash at counter
  • Delivery: Ready in 35-55 minutes, $4.99 delivery fee, pay cash on delivery

After successful submission:

  • Cart items are cleared automatically
  • Order number (orderId) is used for tracking
  • Estimated ready time is provided
Request Body schema: application/json
required
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")

Responses

Request samples

Content type
application/json
Example
{
  • "orderId": "ORD-A1B2C3",
  • "order_type": "pickup",
  • "customer": {
    }
}

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "data": {
    },
  • "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!"
}

Get order status and details

Returns the current status and details of an order.

Order statuses:

  • confirmed: Order received and being prepared
  • preparing: Kitchen is making the order
  • ready: 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 delivered
  • cancelled: Order was cancelled

Response includes:

  • Current status with human-readable message
  • minutes_remaining: Time until estimated ready time (0 if past)
  • Full order details (items, totals, customer info)
path Parameters
orderId
required
string
Example: ORD-A1B2C3

The orderId from order submission

Responses

Response samples

Content type
application/json
Example
{
  • "success": true,
  • "data": {
    },
  • "message": "Your order #ORD-A1B2C3 is being prepared. It will be ready in approximately 18 minutes."
}