The KhajaGo Partner API
Manage a restaurant's products, orders and payments from any external ERP or POS — with API keys, granular scopes and real-time webhooks.
Scoped API keys
Per-restaurant, revocable, read or read-write.
Signed webhooks
order.created / updated, HMAC-SHA256.
Rate limited
Fair-use limits keep the API fast for all.
OpenAPI 3.0
Import into Postman, Insomnia or codegen.
Live in three steps
From zero to your first authenticated request and real-time events.
Create an API key
In your Restaurant dashboard, open Developer settings and generate a key. Pick the scopes the integration needs — it's shown once, so store it server-side.
Make your first call
Send the key as a Bearer token (or x-api-key) to any endpoint. GET /me confirms which restaurant the key is bound to.
Listen for events
Register a webhook to receive order.created / updated the moment they happen — each delivery is HMAC-signed so you can trust the payload.
Your first request
curl https://api.khajago.com/api/public/v1/me \
-H "Authorization: Bearer ksk_live_xxx"Authentication
Create an API key from your Restaurant dashboard → Developer settings. Each key is scoped to a single restaurant and shown only once — store it securely, server-side. Send it as a Bearer token or an x-api-key header.
https://api.khajago.com/api/public/v1Scopes
Assign only what each integration needs. Keys missing a scope are rejected with 403.
orders:readorders:writeproducts:readproducts:writepayments:readanalytics:readEndpoints
| Method | Endpoint | Description | Scope |
|---|---|---|---|
| GET | /me | The restaurant this key belongs to | — |
| GET | /products | List products | products:read |
| POST | /products | Create a product | products:write |
| GET | /products/{id} | Get a product | products:read |
| PATCH | /products/{id} | Update a product | products:write |
| GET | /orders | List orders (filter by status, date) | orders:read |
| GET | /orders/{id} | Get an order | orders:read |
| PATCH | /orders/{id}/status | Update order status | orders:write |
| GET | /payments | List payments | payments:read |
| GET | /analytics/summary | Revenue & order summary | analytics:read |
List today's orders
curl "https://api.khajago.com/api/public/v1/orders?status=placed&limit=20" \
-H "Authorization: Bearer ksk_live_xxx"Accept an order
curl -X PATCH https://api.khajago.com/api/public/v1/orders/ORDER_ID/status \
-H "Authorization: Bearer ksk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"status":"accepted"}'Real-time events
Register a webhook in your dashboard to receive events the moment they happen. Each delivery is signed with your endpoint secret using HMAC-SHA256 — always verify the signature before trusting a payload.
order.createdorder.updatedorder.cancelledX-KhajaGo-Event— the event nameX-KhajaGo-Delivery— unique delivery idX-KhajaGo-Signature—sha256=…
Verify a webhook signature (Node.js)
import crypto from "crypto";
export function verify(req, secret) {
const sig = req.headers["x-khajago-signature"];
const expected =
"sha256=" +
crypto.createHmac("sha256", secret)
.update(JSON.stringify(req.body))
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(sig), Buffer.from(expected)
);
}Conventions
Predictable, REST-style responses. Every payload is JSON with a top-level status boolean, so success and failure are trivial to branch on.
| 200 | OK — request succeeded |
| 201 | Created — resource created |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — key lacks the required scope |
| 404 | Not Found — resource not in your restaurant |
| 422 | Unprocessable — validation failed |
| 429 | Too Many Requests — rate limited |
| 500 | Server error — try again later |
Errors & pagination
// 403 — missing scope
{
"status": false,
"message": "This API key is missing the
required scope: orders:write"
}Rate limits
Fair-use limits per key. Exceeding them returns 429 — back off and retry.
Versioning
All routes live under /v1. Breaking changes ship as a new version — never in place.
Already using ScanSewa or LSKhata?
Connect them in a few clicks — no code required. See all integrations on the Resources page.
Build with KhajaGo.
Become a City Partner to launch a city, or wire up a restaurant integration with the Partner API.