KhajaGo
Developers

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.

Quickstart

Live in three steps

From zero to your first authenticated request and real-time events.

1

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.

2

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.

3

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.

Keys are scoped to one restaurant's data.
Revoke any key instantly from your dashboard.
Never expose a key in client-side code.
BASEhttps://api.khajago.com/api/public/v1

Scopes

Assign only what each integration needs. Keys missing a scope are rejected with 403.

orders:readorders:writeproducts:readproducts:writepayments:readanalytics:read

Endpoints

MethodEndpointScope
GET/me
GET/productsproducts:read
POST/productsproducts:write
GET/products/{id}products:read
PATCH/products/{id}products:write
GET/ordersorders:read
GET/orders/{id}orders:read
PATCH/orders/{id}/statusorders:write
GET/paymentspayments:read
GET/analytics/summaryanalytics: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"}'
Webhooks

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.cancelled
  • X-KhajaGo-Event — the event name
  • X-KhajaGo-Delivery — unique delivery id
  • X-KhajaGo-Signaturesha256=…

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.

HTTP status codes
200OK — request succeeded
201Created — resource created
401Unauthorized — missing or invalid API key
403Forbidden — key lacks the required scope
404Not Found — resource not in your restaurant
422Unprocessable — validation failed
429Too Many Requests — rate limited
500Server 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.

Browse Resources

Build with KhajaGo.

Become a City Partner to launch a city, or wire up a restaurant integration with the Partner API.