API

This API lets external systems (your website, app or ERP) automatically create orders in your KambaChat account. Orders

# KambaChat API — for developers

This API lets external systems (your website, app or ERP) automatically create orders in your KambaChat account. Orders land in your dashboard and follow the normal flow: confirm and complete.

> Availability (GEO) — Storefronts are exclusive to Angola. This API creates orders in your digital storefront, so it applies to Angola sellers. International users: KambaChat focuses on WhatsApp, Facebook and Instagram AI automation — the storefront and orders API are not available outside Angola.

1. Authentication

Authentication uses a secret key in the header of every request.

1. Create a key in Dashboard → Settings → API Keys: give it a name and (optional) expiry, then click Create Key.

2. The key (af_...) is shown only once. It's stored hashed (SHA-256) — never recoverable. Keep it secret.

3. Send it on every request in the header: Authorization: Bearer af_...

Security

  • The key is never stored in plaintext — only its hash.
  • You can set an expiry (30/90/365 days) and delete a key any time (revokes instantly).
  • Rate limits: 60/min per IP and 120/min per key.
  • Never expose the key in the frontend/browser — use it server-side only.

2. Create an order

POST /api/webhooks/orders

Creates an order in your account (status Pending) and sends you a dashboard notification.

FieldTypeRequiredDescription
customerNamestringCustomer name
customerPhonestringCustomer phone
customerEmailstringCustomer email
addressstringCustomer address (optional)
notesstringOrder notes
channelstringSource channel (e.g. WHATSAPP, default WHATSAPP)
itemsarrayItems: list of { productId, quantity } (total is computed from products)
totalnumberTotal (used only if you don't send items)

Example

```bash

curl -X POST https://kambachat.com/api/webhooks/orders \

-H "Authorization: Bearer af_xxxxxxxx..." \

-H "Content-Type: application/json" \

-d '{

"customerName": "Ana Silva",

"customerPhone": "+244923000000",

"customerEmail": "ana@exemplo.com",

"address": "Kilamba, Luanda",

"channel": "WHATSAPP",

"notes": "Cliente VIP — contactar por WhatsApp",

"items": [

{ "productId": "PRODUCT_ID_1", "quantity": 2 },

{ "productId": "PRODUCT_ID_2", "quantity": 1 }

]

}'

```

Response (201)

```json

{ "success": true, "orderNumber": "WA12345678", "orderId": "ckx...", "total": 7500 }

```

The productIds must belong to your account. If you send items, the total is recomputed from the real product prices.

3. Get the public catalog

GET /api/webhooks/orders?store=SLUG

Returns the storefront's public data (name, active products, AI config) by *slug*. No key needed (public).

```bash

curl "https://kambachat.com/api/webhooks/orders?store=a-minha-loja"

```

4. Status codes

CodeMeaning
401Missing, invalid or expired key
404Storefront not found (none → see GEO rule)
429Too many requests (rate limit)
201Order created successfully

KambaChat Suporte

Online agora

👋 Olá! Como podemos ajudar?

Estamos disponíveis para responder as suas questões sobre o KambaChat.