Partner API
Show your menu, check serviceability and delivery fees, let customers sign in, place and pay for orders, and track them — straight from your Fravolo account. One signed API, your branding.
pk_… and a secret sk_… — the secret is shown once, store it safely.Keys are per-restaurant: :rid in every path is your restaurant id (ten_…, shown next to your keys). You can keep up to 5 live keys and revoke any at any time. Call the API from your server only: keep the secret and the key id server-side, never in a browser.
Every request carries four headers. The signature proves the request came from you and hasn't been tampered with or replayed.
X-Fravolo-KeyYour pk_… key id
X-Fravolo-TimestampUnix seconds (±5 min of server time)
X-Fravolo-NonceRandom, single-use, 16–128 characters (e.g. 16 random bytes as hex)
X-Fravolo-Signaturehex(HMAC-SHA256(secret, stringToSign))
Five lines joined by a newline (\n). The path is the request-target exactly as you send it — starting /api/v1/… when you call https://fravolo.com/api, with the query string percent-encoded the same way it goes on the wire. Sign the exact body bytes you send.
UPPERCASE(METHOD)
PATH?QUERY ← exactly as sent, percent-encoded, e.g.
/api/v1/partner/restaurants/ten_x/places?q=main%20street
TIMESTAMP ← same as X-Fravolo-Timestamp
NONCE ← same as X-Fravolo-Nonce
hex(sha256(rawBody)) ← sha256 of "" for GET / no bodyAny language works — HMAC-SHA256 with your secret. The Postman collection does this for you automatically.
// Save as fravolo.mjs and run with Node 18+ (ES module: top-level await, global fetch).
import crypto from 'node:crypto';
const ORIGIN = 'https://fravolo.com';
const PREFIX = '/api'; // base URL = https://fravolo.com/api
// Sign a Fravolo Partner API request with your website key.
// path is the request-target exactly as you send it: /api/v1/…?query
function fravoloHeaders({ method, path, body = '', keyId, secret }) {
const ts = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomBytes(16).toString('hex'); // 32 chars (16–128 allowed)
const bodyHash = crypto.createHash('sha256').update(body).digest('hex');
const stringToSign = [method.toUpperCase(), path, ts, nonce, bodyHash].join('\n');
const signature = crypto.createHmac('sha256', secret)
.update(stringToSign).digest('hex');
return {
'X-Fravolo-Key': keyId,
'X-Fravolo-Timestamp': ts,
'X-Fravolo-Nonce': nonce,
'X-Fravolo-Signature': signature,
};
}
// Example — fetch the menu
const rid = 'ten_xxxxxxxx'; // your restaurant id
const path = `${PREFIX}/v1/partner/restaurants/${rid}/menu`; // sent and signed
const headers = fravoloHeaders({
method: 'GET', path, keyId: 'pk_xxxx', secret: 'sk_xxxx',
});
const res = await fetch(ORIGIN + path, { headers });
const menu = await res.json();
// Example — a quote (send the exact bytes you signed)
const body = JSON.stringify({
items: [{ item_id: 'itm_xxxx', qty: 1, modifiers: [] }],
fulfillment: 'pickup', date: '2026-12-01', time: '13:00',
payment_method: 'cod', name: 'Sam', phone: '+447700900123',
});
const qpath = `${PREFIX}/v1/partner/restaurants/${rid}/orders/quote`;
const quote = await fetch(ORIGIN + qpath, {
method: 'POST', body,
headers: { 'Content-Type': 'application/json',
...fravoloHeaders({ method: 'POST', path: qpath, body, keyId: 'pk_xxxx', secret: 'sk_xxxx' }) },
});Diner-scoped calls (customers/me, create order, pay, list and track orders) also send X-Fravolo-Customer — the signed-in diner's access token from otp/verify. It lasts 15 minutes: refresh it with customers/refresh (refresh tokens rotate, so store the new one) and end the session with customers/logout.
Send the shopper's IP asX-Fravolo-Client-IP on customers/otp/send and every places call. Those limits are per key + shopper IP; without the header all your shoppers share one bucket, and after 10 sign-in codes in an hour every diner is refused.
All paths are relative to https://fravolo.com/api, so the menu is https://fravolo.com/api/v1/partner/restaurants/:rid/menu. :rid is your restaurant id. Calls marked diner need X-Fravolo-Customer.
/v1/partner/restaurants/:rid/menuThe live menu of the restaurant’s main (HQ) outlet.
Returns: { restaurant: {id, name}, categories: [{id, name, slug, sort}], items: [{id, category_id, name, description, base_price, tax_percent, modifiers: [{name, required, min_pick, max_pick, options: [{name, price_diff}]}], available, is_veg, spice, image_url}] }
/v1/partner/restaurants/:rid/places?q=&session=Address autocomplete for the delivery address field (q is 3–120 characters; session groups one search). Send X-Fravolo-Client-IP. Address search covers India only today.
Returns: { suggestions: [{id, main, secondary}] }
/v1/partner/restaurants/:rid/places/:id?session=Resolve a picked suggestion to a full address with lat/lng.
Returns: { id, formatted, line1, line2, city, pincode, lat, lng }
/v1/partner/restaurants/:rid/places/reverse?lat=&lng=Turn a map pin into an address (“use my location”).
Returns: { formatted, line1, line2, city, pincode, lat, lng }
/v1/partner/restaurants/:rid/orders/quotePrice a cart server-side. Same body as create order (name, phone and payment_method are not checked here). For delivery with an address it returns the live courier fee, or a flat fee when the restaurant has no courier partner; not serviceable → 422 not_deliverable.
Body: order body (below)
Returns: { items, subtotal, discount, delivery_fee, taxable, cgst, sgst, tax, round_off, total, tax_inclusive, tax_name, same_day, shortages }
/v1/partner/restaurants/:rid/customers/otp/sendEmail a one-time code to the shopper. Send X-Fravolo-Client-IP. Phone sign-in is off (403 phone_sign_in_off).
Body: { email }
Returns: { channel, expires_in, retry_after }
/v1/partner/restaurants/:rid/customers/otp/verifyCheck the code and sign the diner in.
Body: { email, code }
Returns: { tokens: {access_token, refresh_token, expires_in, token_type}, customer: {id, email, phone, name} }
/v1/partner/restaurants/:rid/customers/refreshSwap a refresh token for a new pair. Refresh tokens rotate: keep the new one.
Body: { refresh_token }
Returns: { access_token, refresh_token, expires_in, token_type }
/v1/partner/restaurants/:rid/customers/logoutEnd the diner’s session on Fravolo. Also send X-Fravolo-Customer to revoke the access token at once.
Body: { refresh_token }
Returns: 204 No Content
/v1/partner/restaurants/:rid/customers/meThe signed-in diner’s profile.
Returns: { id, email, phone, name }
/v1/partner/restaurants/:rid/ordersCreate an order. The server re-prices from scratch; client totals are never trusted. Online payment returns a Razorpay order to open checkout with; cash on delivery is confirmed at once.
Body: order body (below)
Returns: 201 { order, razorpay_order_id?, razorpay_key_id? }
/v1/partner/restaurants/:rid/orders/:id/payConfirm the Razorpay checkout handshake. Unpaid online orders expire after 15 minutes.
Body: { razorpay_order_id, razorpay_payment_id, razorpay_signature }
Returns: { ok: true, code }
/v1/partner/restaurants/:rid/orders?limit=20The diner’s recent orders at this restaurant.
Returns: { orders: [order] }
/v1/partner/restaurants/:rid/orders/:codeOne order by its code: live status and status history. Poll this for updates.
Returns: order
date and time are required, in the restaurant's time zone. An order for today needs at least 3 hours' notice and is checked against today's stock; a later date (up to 60 days ahead) is a pre-order. Modifiers name the menu's group and option; prices always come from the menu, so any price you send is ignored. Every order goes to the restaurant's main (HQ) outlet — branches don't take website orders yet.
{
"items": [
{ "item_id": "itm_…", "qty": 2,
"modifiers": [ { "group": "Size", "option": "Large" } ],
"notes": "no onions" }
],
"fulfillment": "delivery", // delivery | pickup
"address": { // delivery only; line1 + pincode required
"line1": "1 Example Street", "line2": "", "city": "Example City",
"pincode": "12345", "lat": 0, "lng": 0, "landmark": ""
},
"date": "2026-12-01", // YYYY-MM-DD, restaurant's time zone
"time": "13:00", // HH:MM, restaurant's time zone
"payment_method": "online", // online | cod
"name": "Sam",
"phone": "+447700900123", // read with the restaurant's country code
"notes": "Ring the bell"
}<PREFIX>-YYYYMMDD-XXXXXX, e.g. FV-20261123-7K3Q9M: the restaurant's invoice prefix (FV until it sets one), the date, and six random characters.razorpay_order_id and razorpay_key_id, then send the handshake to orders/:id/pay. An unpaid order expires after 15 minutes and gives its stock back.status_history.GET orders/:code for status (every 30–60 seconds is plenty).Over a limit you get 429 rate_limited. Request bodies are capped at 64 KB.
Errors are JSON: {"error": "<code>", "message": "…", "request_id": "…"}. Branch on error; message is safe to show the diner. Quote request_id when you contact us.
401 unauthorizedAny signing problem: a missing header, a timestamp outside ±5 min, a nonce shorter than 16 or longer than 128 characters or already used, an unknown or revoked key, or a bad signature. Deliberately the same answer for all.403 restaurant_mismatchThe key belongs to another restaurant than :rid.401 diner_signed_outX-Fravolo-Customer is missing, expired or for another restaurant. Refresh, or sign the diner in again.429 rate_limitedA limit above was hit. The body carries retry_in (seconds, the window length). X-RateLimit-Limit / X-RateLimit-Remaining headers come only from the per-IP, per-key and per-shopper limiters; the restaurant plan-limit 429 has none.400 invalid_bodyThe JSON did not parse.413 body_too_largeThe request body is over 64 KB.403 restaurant_unavailableThe key is valid but its restaurant could not be loaded (for example, it was removed).503 restaurant_unavailableThe restaurant’s data cannot be reached right now; retry later.503 movingThe restaurant is moving to a new database: writes are refused for a few minutes (reads still work). The body carries retry_in and the response a Retry-After header.422 invalid_email · invalid_phone · invalidA field is wrong (payment method, missing name or phone, fulfillment, delivery address without line1 or pincode, empty cart).400 invalid_code · code_expired, 429 too_many_attemptsSign-in code problems on otp/verify.429 cooldown_activeA code was sent moments ago; retry_after says when the next may go.503 email_unavailable · 403 phone_sign_in_offSign-in by that channel is not available.422 bad_scheduledate/time missing, in the past, under 3 hours ahead for today, or more than 60 days ahead.422 invalid_cart · 409 sold_out_today · 409 out_of_stockUnknown item or option, a required choice missing, or not enough of today’s stock (out_of_stock carries shortages).422 not_deliverableThe courier partner cannot deliver to that address; offer pickup.409 online_payment_offThe restaurant has not connected Razorpay; use cod.403 restaurant_pendingThe restaurant is not approved to take orders yet.400 bad_signature · 409 payment_mismatch · 404 order_not_foundPay: the Razorpay signature failed, the payment does not match the order, or the order is not this diner’s.503 places_off · 502 places_unavailable · 404 not_foundAddress search is not set up, its provider failed, or the place is unknown.Example bodies and a ready-to-run flow are in the Postman collection. Questions? hello@fravolo.com.