Back to home

API Documentation

Programmatic access to menu data, orders, and restaurant settings.

Overview

MokEats API allows programmatic access to menu data, orders, and restaurant settings. The API is available on the Full Stack plan ($129/branch/mo). All endpoints use tRPC for type-safe, RPC-style communication with automatic serialization and type inference.

Authentication

The MokEats API uses session-based authentication via NextAuth. For public endpoints (menu access, order placement), no authentication is required. For tenant-specific operations (dashboard, management), you must be logged in with a valid session cookie.

API key authentication is coming soon. Contact support if you need API access before then.

Base URL

All API requests are made to your MokEats instance. The tRPC endpoint is:

https://your-instance.mokeats.com/api/trpc

Public Endpoints

These endpoints are accessible without authentication and power the customer-facing experience.

publicMenu.getMenuBySlugquery

Fetch a restaurant's full public menu with categories, items, variants, addons, and active bundles.

Input

{
  "tenantSlug": "string",
  "branchSlug": "string"
}

Output

Full menu object with tenant info, branch info, theme settings, categories, items, variants, addons, and bundles.

publicMenu.getMenuByHostquery

Fetch a restaurant's menu using the hostname (for custom domain or subdomain-based routing).

Input

{
  "host": "string (max 253 chars)"
}

Output

Same as getMenuBySlug — resolves the tenant/branch from the host header.

menu.getPublicMenuquery

Fetch a restaurant's menu by tenant slug and branch slug (alias from the dashboard router).

Input

{
  "tenantSlug": "string",
  "branchSlug": "string"
}

Output

Complete public menu data structure.

order.createmutation

Place a new order with cart items, customer details, and optional coupon.

Input

{
  "tenantId": "uuid",
  "branchId": "uuid",
  "channel": "web | qr",
  "type": "delivery | pickup | dine_in",
  "customerName": "string",
  "customerPhone": "string",
  "items": [{
    "menuItemId": "uuid",
    "quantity": "number",
    "variantId?: "uuid",
    "addonIds?": ["uuid"],
    "notes?": "string",
    "bundleId?": "uuid",
    "bundlePrice?": "number"
  }],
  "couponCode?": "string",
  "deliveryAddress?": "string",
  "tableNumber?": "string",
  "tableId?": "uuid",
  "paymentMethod?": "string",
  "notes?": "string",
  "locale?": "en | ar"
}

Output

Created order object with orderNumber, status, items, totals.

reservations.getAvailableSlotsquery

Check available reservation time slots for a given date, branch, and party size.

Input

{
  "branchId": "uuid",
  "date": "YYYY-MM-DD",
  "partySize": "number (1-100)"
}

Output

{ "slots": [{ "time": "HH:mm", "available": boolean, "remaining": number, "availableTables": [...] }] }

reservations.createReservationmutation

Create a new table reservation for a customer.

Input

{
  "branchId": "uuid",
  "partySize": "number",
  "reservationDate": "ISO datetime string",
  "customerName": "string",
  "customerPhone": "string",
  "customerEmail?": "string (email)",
  "notes?": "string (max 500)",
  "tableId?": "uuid"
}

Output

{ "reservationNumber": "string", "reservationDate": "Date", "partySize": "number", "status": "string" }

Webhooks

MokEats exposes webhook endpoints for receiving external service updates.

POST/api/webhooks/paymob

Receives payment status updates from Paymob. Used to update order payment status and trigger post-payment actions.

Payload: Paymob transaction callback payload (JSON).

POST/api/webhooks/meta

Receives WhatsApp message status updates from Meta / 360Dialog. Used to track message delivery, read receipts, and incoming customer messages.

Payload: Meta/360Dialog webhook payload (JSON).

POST/api/webhooks/telegram

Receives Telegram bot updates. Used for restaurant notification delivery and bot commands.

Payload: Telegram Update object (JSON).

Rate Limiting

Rate limits apply to protect the platform. Current limits are not publicly documented; contact support if you anticipate high-volume usage.

Getting Started

Here's how to fetch a restaurant's menu and place an order using cURL:

Fetch a public menu

curl -X POST "https://your-instance.mokeats.com/api/trpc/publicMenu.getMenuBySlug" \
  -H "Content-Type: application/json" \
  -d '{
    "0": {
      "tenantSlug": "my-restaurant",
      "branchSlug": "main"
    }
  }'

Place an order

curl -X POST "https://your-instance.mokeats.com/api/trpc/order.create" \
  -H "Content-Type: application/json" \
  -d '{
    "0": {
      "tenantId": "your-tenant-uuid",
      "branchId": "your-branch-uuid",
      "channel": "web",
      "type": "delivery",
      "customerName": "Ahmed",
      "customerPhone": "+201234567890",
      "items": [
        {
          "menuItemId": "item-uuid",
          "quantity": 2
        }
      ]
    }
  }'

Support

For API support, contact us at api@themok.company