Saltar al contenido

Quickstart

Create your first order in three calls.

By the end of this page you will have authenticated, listed menu items, and placed a real takeout order against your sandbox restaurant.

1. Grab an API key

In the dashboard, open Settings → API and click Create API key. Mark it as a sandbox key while you're testing — sandbox events fire webhooks but won't print to kitchen printers or charge cards.

Your full key is shown once. It looks like sk_test_8b2… or sk_live_…. Treat it like a password — never commit it to source control.

2. List your menu items

Every order references existing menu_item IDs. Let's fetch a few:

curl https://api.tablezio.com/v1/menu_items \
  -H 'X-API-Key: tbz_…' \
  -G --data-urlencode 'is_available=true' \
       --data-urlencode 'limit=5'

IDs are prefixed: orders are ord_…, menu items mi_…, customers cus_…. Always pass the prefixed form back.

3. Place an order

POST to /v1/orders. The Idempotency-Key header makes the call safely retryable — if the network drops, you can replay the exact same body and get the same order back, not a duplicate.

curl -X POST https://api.tablezio.com/v1/orders \
  -H 'X-API-Key: tbz_…' \
  -H 'Idempotency-Key: order_2026-05-26_carlos_1' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "takeout",
    "customer_name": "Carlos",
    "customer_phone": "+34 600 000 000",
    "items": [
      { "menu_item": "mi_507f1f77bcf86cd799439011", "quantity": 2 },
      { "menu_item": "mi_5a1b2c3d4e5f6a7b8c9d0e1f", "quantity": 1, "notes": "No onion" }
    ]
  }'

Response:

201 Created
{
  "id": "ord_6b2c3d4e5f6a7b8c9d0e1f20",
  "object": "order",
  "created": 1716730000,
  "order_number": "ORD-042",
  "type": "takeout",
  "status": "draft",
  "items": [ /* … */ ],
  "subtotal": 4290,
  "tax_amount": 0,
  "total": 4290,
  "currency": "usd",
  "livemode": false
}

What's next?

  • Subscribe to webhooks so your system reacts to status changes.
  • Make every mutation idempotent before going live.
  • See the full Orders reference for advanced flows (kitchen routing, splits, cancellations).