Introduction
The Kllivo API lets approved developers connect their products to a restaurant's Kllivo account with the owner's permission. Use the live menu, storefront choices, coupon checks, order submission and status endpoints as building blocks in products your customers already use.
Base URL
https://kllivoapp.com/api/v1 All requests use HTTPS and JSON. The API is meant for servers and SDKs, and sends no CORS headers, so do not call it from a browser.
What you can build
The API is for developers building products around restaurant operations. Combine it with your own interface, software and customer experience.
These are product ideas, not prebuilt Kllivo modules. Your product owns its interface and customer experience; Kllivo handles restaurant-side menu validation, order creation and hosted payment. The API does not expose restaurant customer databases, payment credentials or general sales analytics.
Build with AI
Give your coding assistant a clear brief for a real Kllivo integration, with secure auth, sandbox-first development and accurate order flows built in.
Quickstart
- Create a developer accountSign up at Get API access. It is free and needs no restaurant. If approval is switched on, we review your application (usually within two business days) before your sandbox opens.
- Open your sandbox and create an appYour private demo restaurant is created automatically. In your developer dashboard, create a sandbox app to get a client ID and secret.
- Make a test requestGenerate a test token with one click and call the API against the demo menu. No redirect is needed.
- Build the connect flowAdd "Connect with Kllivo" with OAuth and PKCE. In the sandbox you approve your own demo restaurant.
- Go liveSend a short go-live request. Once approved, create live apps that real restaurant owners can connect.
Sandbox
Every developer gets a private demo restaurant with a realistic menu: size variants, extras, a sold-out item, a hidden item, two branches and delivery options. It behaves like a real restaurant, so what works here works live.
- Sandbox apps have client IDs starting with
kll_test_and tokens starting withkat_test_. Responses carryX-Kllivo-Mode: sandbox. - Only you can connect your sandbox apps, and only to your own demo restaurant. Real restaurants are never involved.
- Orders send no emails or phone alerts and only offer cash payment methods. Nothing is ever charged.
- In your dashboard you can see test orders, move them through statuses and payment states to send subscribed webhook events, and reset demo data at any time.
Test tokens
Open Apps in your developer dashboard and choose "Test token" on a sandbox app. You get a one-hour access token for your demo restaurant and can call the API immediately.
curl https://kllivoapp.com/api/v1/menu \
-H "Authorization: Bearer kat_test_…"Going live
When your integration works, send a go-live request from your dashboard: describe your use case, link your privacy policy and confirm a short checklist. Submit a sandbox order or complete an order link before requesting live access.
- Kllivo reviews the request and emails you the decision.
- After approval you can create live apps, with client IDs starting with
kll_. Real restaurant owners connect them on the connect screen and can disconnect them at any time. - Sandbox and live are fully separate: apps, tokens and data never cross between them.
Connect with Kllivo
Kllivo uses the OAuth 2.0 authorization-code flow. PKCE with S256 is required for every app, including apps that have a client secret. Redirect URIs must match a registered URI exactly and use https (http is accepted only for localhost while testing).
1. Send the owner to Kllivo
import crypto from 'node:crypto';
const verifier = crypto.randomBytes(48).toString('base64url'); // keep this server-side
const challenge = crypto.createHash('sha256').update(verifier).digest('base64url');
const state = crypto.randomBytes(16).toString('hex'); // verify it on return
const url = new URL('https://kllivoapp.com/connect');
url.search = new URLSearchParams({
client_id: process.env.KLLIVO_CLIENT_ID,
redirect_uri: 'https://yourapp.com/kllivo/callback',
response_type: 'code',
scope: 'menu:read store:read orders:link orders:submit',
state,
code_challenge: challenge,
code_challenge_method: 'S256',
});
// redirect the owner's browser to url.toString()$verifier = rtrim(strtr(base64_encode(random_bytes(48)), '+/', '-_'), '='); // keep this server-side
$challenge = rtrim(strtr(base64_encode(hash('sha256', $verifier, true)), '+/', '-_'), '=');
$state = bin2hex(random_bytes(16)); // verify it on return
$url = 'https://kllivoapp.com/connect?' . http_build_query([
'client_id' => getenv('KLLIVO_CLIENT_ID'),
'redirect_uri' => 'https://yourapp.com/kllivo/callback',
'response_type' => 'code',
'scope' => 'menu:read store:read orders:link orders:submit',
'state' => $state,
'code_challenge' => $challenge,
'code_challenge_method' => 'S256',
]);
header('Location: ' . $url);import base64, hashlib, os, secrets
from urllib.parse import urlencode
verifier = base64.urlsafe_b64encode(os.urandom(48)).rstrip(b"=").decode() # keep this server-side
challenge = base64.urlsafe_b64encode(hashlib.sha256(verifier.encode()).digest()).rstrip(b"=").decode()
state = secrets.token_hex(16) # verify it on return
url = "https://kllivoapp.com/connect?" + urlencode({
"client_id": os.environ["KLLIVO_CLIENT_ID"],
"redirect_uri": "https://yourapp.com/kllivo/callback",
"response_type": "code",
"scope": "menu:read store:read orders:link orders:submit",
"state": state,
"code_challenge": challenge,
"code_challenge_method": "S256",
})The owner chooses the restaurant, the branches (all or some) and which permissions to allow. They can allow fewer scopes than you asked for, so always check what you were granted.
2. Receive the redirect
GET https://yourapp.com/kllivo/callback?code=kac_…&state=<your state>&iss=https://kllivoapp.com
# declined:
GET https://yourapp.com/kllivo/callback?error=access_denied&state=<your state>&iss=https://kllivoapp.comCheck that state matches what you sent before using the code. The code works once and expires after 60 seconds.
3. Exchange the code
curl https://kllivoapp.com/api/v1/oauth/token \
-d grant_type=authorization_code \
-d client_id=$KLLIVO_CLIENT_ID \
-d client_secret=$KLLIVO_CLIENT_SECRET \
-d code=$CODE \
-d redirect_uri=https://yourapp.com/kllivo/callback \
-d code_verifier=$CODE_VERIFIERconst res = await fetch('https://kllivoapp.com/api/v1/oauth/token', {
method: 'POST',
body: new URLSearchParams({
grant_type: 'authorization_code',
client_id: process.env.KLLIVO_CLIENT_ID,
client_secret: process.env.KLLIVO_CLIENT_SECRET,
code,
redirect_uri: 'https://yourapp.com/kllivo/callback',
code_verifier: verifier,
}),
});
const tokens = await res.json();$ch = curl_init('https://kllivoapp.com/api/v1/oauth/token');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'grant_type' => 'authorization_code',
'client_id' => getenv('KLLIVO_CLIENT_ID'),
'client_secret' => getenv('KLLIVO_CLIENT_SECRET'),
'code' => $code,
'redirect_uri' => 'https://yourapp.com/kllivo/callback',
'code_verifier' => $verifier,
]),
]);
$tokens = json_decode(curl_exec($ch), true);import os, requests
tokens = requests.post("https://kllivoapp.com/api/v1/oauth/token", data={
"grant_type": "authorization_code",
"client_id": os.environ["KLLIVO_CLIENT_ID"],
"client_secret": os.environ["KLLIVO_CLIENT_SECRET"],
"code": code,
"redirect_uri": "https://yourapp.com/kllivo/callback",
"code_verifier": verifier,
}).json(){
"access_token": "kat_…",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "krt_…",
"refresh_expires_in": 2592000,
"restaurant_id": 4,
"branch_ids": null,
"scope": "menu:read store:read orders:link orders:submit"
}Tokens & refresh
Send the access token on every request: Authorization: Bearer kat_…. Access tokens last one hour. Refresh tokens last 30 days.
curl https://kllivoapp.com/api/v1/oauth/token \
-d grant_type=refresh_token \
-d client_id=$KLLIVO_CLIENT_ID \
-d client_secret=$KLLIVO_CLIENT_SECRET \
-d refresh_token=$REFRESH_TOKENRefresh tokens rotate: every refresh returns a new pair and the old pair stops working. Presenting an already-used refresh token is treated as theft and revokes the whole connection, so save the new refresh token before you use the new access token.
To disconnect, call POST /oauth/revoke with the token and your client credentials. Owners can also disconnect your app at any time, and every request re-checks that the connection, your app, your developer account, the owner and their plan are all still valid.
Scopes
| Scope | Allows |
|---|---|
menu:read | Read the menu: categories, items, prices, variants and extras. |
store:read | Read public store details, approved branch locations and payment choices; validate coupons and request delivery quotes. |
orders:link | Create order links and check the status of links your app created. |
orders:submit | Submit real orders and check orders created by your app. |
Access is limited to the connected restaurant, approved branches and granted scopes. The API never returns gateway credentials, restaurant settings, customer lists, team, billing or dashboard data. Use orders:submit to place orders directly; payment links are returned only for online gateways when requested.
Storefront choices
store:readReturns public restaurant details, currency, minimum order amount, hours and only the branch locations approved for this connection. Phone numbers, email addresses and private settings are omitted.
store:readReturns enabled payment choices and, for delivery, available delivery options, minimums and quote-based courier choices. Send branch_id when this grant covers multiple branches; subtotal is only a preview for delivery minimums. Order submission and order-link creation price and check the cart again. For distance-priced delivery, collect the address and request a short-lived quote from POST /delivery-quotes/logix or POST /delivery-quotes/courier, then send its quote_token with the order. Quote tokens are bound to the address and branch and can be used once. Gateway credentials and manual payment instructions are never returned.
store:readRequest: {"code":"SAVE10","items":[{"menu_item_id":19,"quantity":2}],"order_type":"pickup","channel":"whatsapp","branch_id":3}. Kllivo prices the cart and checks active dates, use limits, minimum and item/category restrictions. The result is an estimate; Kllivo rechecks the code when the app submits the order or the customer completes checkout.
Connection
Returns the restaurant, the branches this token may use and the scopes the owner granted.
{
"data": {
"restaurant": { "id": 4, "name": "DNGN's", "slug": "dngn" },
"branches": [{ "id": 3, "name": "Main Branch" }],
"scopes": ["menu:read", "store:read", "orders:link"],
"app": "Voice Agent"
}
}Submit an order
orders:submitCreates the restaurant order immediately after your app confirms the customer's order. Kllivo reprices the live menu, checks coupons and store rules, and validates the selected branch, delivery and payment options. The customer does not need to re-enter the order on a form.
Direct API submission accepts menu variant_id and extra_ids, discount_code, fixed-fee delivery_option_id or quoted delivery_quote_token, and an enabled payment method ID. Delivery requires customer.address; pickup does not. For all required fields, response properties and complete flow examples, download the Markdown guide or OpenAPI v1 specification.
curl https://kllivoapp.com/api/v1/orders \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: call-8841-attempt-1" \
-H "Content-Type: application/json" \
-d '{
"order_type": "pickup",
"items": [{ "menu_item_id": 19, "quantity": 2, "note": "no onions" }],
"customer": { "name": "Sam", "phone": "+355691234567" },
"payment_method": "stripe",
"return_payment_url": true,
"channel": "whatsapp",
"source": "ai_call",
"external_ref": "call-8841"
}'Use a payment method id from GET /payment-options. Set return_payment_url to true only when you want Kllivo to return the online gateway payment URL. Offline methods submit without a payment link. Kllivo never returns gateway secrets.
For quote-based courier delivery, use POST /delivery-quotes/logix with dropoff_address, or POST /delivery-quotes/courier with the partner_id from a courier-* entry and dropoff_address. Include an Idempotency-Key; pass the returned quote_token into the order request.
orders:submitCheck status only for orders submitted by this app. The response omits customer contact/address information and payment references.
{
"data": {
"order_number": "ORD-91136C18",
"status": "received",
"payment_status": "pending",
"total": 17.98,
"payment_url": "https://kllivoapp.com/restaurant/order/ORD-91136C18/makepayment"
}
}Create an order link
orders:linkCreates a hosted checkout for the customer. Kllivo prices the cart from the live menu, checks store and delivery minimums, and revalidates any coupon. The customer reviews the order, provides any required details, chooses an enabled payment method and pays on Kllivo checkout. This does not create an unpaid order first.
curl https://kllivoapp.com/api/v1/order-links \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: call-8841-attempt-1" \
-H "Content-Type: application/json" \
-d '{
"order_type": "pickup",
"items": [{ "menu_item_id": 19, "quantity": 2, "note": "no onions" }],
"customer": { "name": "Sam", "phone": "+1691234567" },
"external_ref": "call-8841",
"source": "ai_call"
}'const res = await fetch('https://kllivoapp.com/api/v1/order-links', {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'Idempotency-Key': 'call-8841-attempt-1',
'Content-Type': 'application/json',
},
body: JSON.stringify({
order_type: 'pickup',
items: [{ menu_item_id: 19, quantity: 2, note: 'no onions' }],
customer: { name: 'Sam', phone: '+1691234567' },
external_ref: 'call-8841',
source: 'ai_call',
}),
});
const { data } = await res.json();
console.log(data.url); // send this link to the customer$ch = curl_init('https://kllivoapp.com/api/v1/order-links');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $accessToken,
'Idempotency-Key: call-8841-attempt-1',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'order_type' => 'pickup',
'items' => [['menu_item_id' => 19, 'quantity' => 2, 'note' => 'no onions']],
'customer' => ['name' => 'Sam', 'phone' => '+1691234567'],
'external_ref' => 'call-8841',
'source' => 'ai_call',
]),
]);
$data = json_decode(curl_exec($ch), true)['data'];
echo $data['url']; // send this link to the customerimport requests
res = requests.post(
"https://kllivoapp.com/api/v1/order-links",
headers={
"Authorization": f"Bearer {access_token}",
"Idempotency-Key": "call-8841-attempt-1",
},
json={
"order_type": "pickup",
"items": [{"menu_item_id": 19, "quantity": 2, "note": "no onions"}],
"customer": {"name": "Sam", "phone": "+355691234567"},
"external_ref": "call-8841",
"source": "ai_call",
},
)
print(res.json()["data"]["url"]) # send this link to the customerRequest body
| Field | Description |
|---|---|
order_type | delivery or pickup. Required. |
items[] | Up to 40 lines of menu_item_id, quantity (1-99), optional variant_id, extra_ids and a note (200 characters). Required. |
branch_id | Required when the restaurant has several branches (or the connection covers several). |
customer | Optional name, phone, email, address. Used to prefill checkout. |
discount_code | Optional coupon code. Kllivo validates it against the cart and checks it again during checkout. |
channel | Optional web, whatsapp or qr; used for channel-specific coupons. |
external_ref | Your own identifier (up to 100 characters), shown on the order. |
source | Lowercase label such as ai_call. Shown on the order. Default api. |
locale | Language for checkout: en or sq. |
expires_in_minutes | 5 to 4320. Default 1440 (24 hours). |
Response
{
"data": {
"id": "cs_9f2c1a7b3d5e8f0a1b2c",
"status": "open",
"url": "https://kllivoapp.com/dngn?kllivo_checkout=…",
"order_type": "pickup",
"subtotal": 17.98,
"expires_at": "2026-11-06T19:00:00+00:00",
"items": [{ "menu_item_id": 19, "name": "Bruschetta", "quantity": 2, "unit_price": 8.99, "total_price": 17.98 }],
"payment_methods": [
{ "type": "online", "id": "stripe", "name": "Card" },
{ "type": "offline", "id": "pay_on_pickup", "name": "Pay on pickup" }
],
"delivery": null
}
}The url is a secret that grants one checkout. It is shown only in this response, works once and expires. Keep it out of logs.
Order link status
orders:linkStatus of a link your app created: open, completed, expired or cancelled. Once the customer has ordered, the response includes only the order number, order status, payment status, chosen payment method and total. Customer contact/address data, payment references, credentials and links created by other apps are not returned.
{
"data": {
"id": "cs_9f2c1a7b3d5e8f0a1b2c",
"status": "completed",
"order": { "number": "ORD-91136C18", "status": "received", "payment_status": "pending", "payment_method": "cash", "total": 17.98 }
}
}Idempotency & limits
Order creation, order links and delivery quote requests require an Idempotency-Key header (8-64 characters: letters, digits, _ - : .). Retrying with the same key and body replays the original response, so a network retry never creates a second order or quote. The same key with a different body is rejected. AI agents retry, so always send one.
Each connection can make 120 requests per minute by default. When you exceed it you get 429 with a Retry-After header. X-RateLimit-Limit and X-RateLimit-Remaining are on every response. An app may hold up to 500 unexpired order links per restaurant.
Errors
Errors look like { "error": { "code": "...", "message": "..." }, "request_id": "..." }. Branch on code, which never changes; message is for people and follows the request language. Quote request_id when you contact support.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_json · idempotency_key_required | The body or a required header is missing or malformed. |
| 401 | invalid_token | The access token is missing, expired or revoked. Refresh it or ask the owner to reconnect. |
| 403 | insufficient_scope · branch_not_permitted | The owner did not grant this permission or branch. |
| 404 | not_found | Unknown endpoint, or a link that belongs to another app. |
| 409 | request_in_progress | The same Idempotency-Key is still being processed. |
| 422 | item_unavailable · variant_required · extra_required · idempotency_key_reuse | The request is well formed but cannot be fulfilled, for example an item is sold out. |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. |
| 5xx | internal_error | Something went wrong on our side. Retry with the same Idempotency-Key. |
The OAuth endpoints return the standard shape instead: { "error": "invalid_grant", "error_description": "..." }.
Languages
Human-readable text follows the language of the request: add ?lang=sq or send Accept-Language: sq. English (en) and Albanian (sq) are supported, and every response includes a Content-Language header. Machine fields (code, scope ids, statuses) are always English.
This covers error messages, the permission descriptions owners see on the approval screen, payment method names and developer emails. The approval screen and the developer pages follow the visitor's Kllivo language.
Webhooks
Configure a public HTTPS endpoint from your app in the developer dashboard. Kllivo sends signed order and payment events in the background. The full event payload, HMAC verification, retry behavior and secure endpoint requirements are in the downloadable API guide.
Security
- OAuth tokens and client secrets are stored as hashes. Webhook signing secrets and stored API responses are encrypted.
- Only restaurant owners can connect apps, and approval needs a recent sign-in. Support sessions cannot.
- Owners can revoke your app at any time. Suspending a developer or an app stops all of its tokens immediately.
- Keep your client secret and refresh tokens on your server. Rotate the secret from your developer page if it may have leaked.
- Every approval, token issue, refresh-reuse detection and revocation is written to the audit log.
- A grant can access only the connected restaurant, approved branches and scopes. It cannot sign in as the owner or open Kllivo account or dashboard features.
Found a vulnerability? Write to [email protected]. We respond quickly and credit responsible reports.