Getting Started
Everything you need to integrate with the restaurant platform API.
Base URL
https://your-saas-domain.comAll API endpoints are relative to this base URL.
Bearer Token
Protected endpoints require a JWT token from login. Send it in the Authorization header.
Authorization: Bearer <jwt_token>API Key
Send your restaurant API key in the x-api-key header alongside the Bearer token for additional security. Generate keys from your API Keys settings page.
x-api-key: <your_api_key>About API Keys
All /api/r/ routes require a valid x-api-key header, including publicly browsable endpoints like the menu and restaurant info. Requests without a key are rejected with 401 API key required.
Key scoping: A key generated from the Restaurant Admin can only access that restaurant's data. A key generated by a SaaS Admin (no restaurantId attached) is global and works for any restaurant.
Store your API key in an environment variable (e.g. NEXT_PUBLIC_API_KEY) and include it in every request. Generate keys from the API Keys page in your restaurant dashboard.
API Client (JavaScript)
const BASE_URL = "https://your-saas-domain.com";
const API_KEY = process.env.NEXT_PUBLIC_API_KEY || "";
async function apiRequest(endpoint, options = {}) {
const token = localStorage.getItem("token");
const res = await fetch(`${BASE_URL}${endpoint}`, {
headers: {
"Content-Type": "application/json",
...(token && { Authorization: `Bearer ${token}` }),
...(API_KEY && { "x-api-key": API_KEY }),
},
...options,
});
const data = await res.json();
if (!res.ok) throw new Error(data.error || "Request failed");
return data;
}
export const api = {
get: (url) => apiRequest(url),
post: (url, body) => apiRequest(url, { method: "POST", body: JSON.stringify(body) }),
patch: (url, body) => apiRequest(url, { method: "PATCH", body: JSON.stringify(body) }),
delete: (url) => apiRequest(url, { method: "DELETE" }),
};Response Format
Success
{
"success": true,
"data": { ... }
}Error
{
"success": false,
"error": "Error message here"
}Authentication
Register, log in, and manage customer sessions.
Restaurant Info
Fetch public restaurant details and branding.
Orders
Create and manage customer orders.
Payments
Stripe payment integration and discount code validation.
Promotions
Fetch active promotions and banners for the restaurant.
Global
Platform-wide APIs for branding, restaurant listing, and static content.
Reference
Order Statuses
Endpoint Summary
/api/auth/login/api/auth/register/api/auth/me/api/r/{slug}/info/api/r/{slug}/menu/api/r/{slug}/menu/{itemId}/api/r/{slug}/promotions/api/r/{slug}/orders/api/r/{slug}/orders/api/r/{slug}/orders/{id}/api/r/{slug}/orders/{id}/confirm-payment/api/r/{slug}/orders/{id}/rider-location/api/r/{slug}/validate-coupon/api/r/{slug}/create-payment-intent/api/restaurants/api/branding/api/faqs