Developers

Build commerce on CogniChat.

One headless API for catalog, cart, checkout, bookings, customers and webhooks. Checkout is money-blind: you send ids and quantities, we price every line and hand back a pay link.

bash
curl "https://cognichat-api.vendyi.com/api/public/v1/catalog/" \
  -H "Authorization: Bearer pk_live_YOUR_KEY"

Base URL · https://cognichat-api.vendyi.com/api/public/v1

Authentication

Two keys, the Stripe model.

Send your key as Authorization: Bearer <key> or X-Api-Key: <key>. Mint and revoke keys in your dashboard.

Publishable
pk_live_

Browser-safe. Read the catalog and services, build a cart, check out, and read order status. Ship it in client code.

Secret
sk_live_

Server-only. Everything publishable can do, plus customer records and webhook config. Never expose it in a browser.

Quickstart

Your first request.

  1. 1
    Create a key
    In the dashboard, open Developers and mint a publishable key.
  2. 2
    Call the catalog
    Send it as a Bearer token to the catalog endpoint.
  3. 3
    Build checkout
    Create a cart, add lines, and check out for a pay link.
bash
curl "https://cognichat-api.vendyi.com/api/public/v1/catalog/" \
  -H "Authorization: Bearer pk_live_YOUR_KEY"
Checkout

Money-blind by design.

Your client never sends prices. It sends ids and quantities; the server prices every line against the live catalog, applies coupons, and returns an order number and a pay link. Prices can't be tampered with from the browser, and the same engine powers WhatsApp and the hosted store.

Works for products and bookings alike.
bash
# 1. Create a cart
curl -X POST "https://cognichat-api.vendyi.com/api/public/v1/cart/" \
  -H "Authorization: Bearer pk_live_YOUR_KEY"

# 2. Add a product line (ids + quantity only — never a price)
curl -X POST "https://cognichat-api.vendyi.com/api/public/v1/cart/CART_TOKEN/items/" \
  -H "Authorization: Bearer pk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "menu_item_id": 42, "qty": 2 }'

# 3. Checkout — the server prices every line and returns a pay link
curl -X POST "https://cognichat-api.vendyi.com/api/public/v1/checkout/" \
  -H "Authorization: Bearer pk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "cart_token": "CART_TOKEN", "customer": { "name": "Ada", "phone": "+233..." } }'
Reference

Endpoints.

Full machine-readable schema at https://cognichat-api.vendyi.com/api/public/v1/openapi.json.

GET/catalog/Product catalog tree
GET/services/Bookable services
GET/services/{id}/availability/Open dates / slots
POST/cart/Create a cart
GET/PATCH/cart/{token}/Priced cart / set coupon
POST/cart/{token}/items/Add a line
POST/checkout/Place an order/booking, returns a pay link
GET/orders/{token}/Order status by token
GET/POST/customers/Identify / look up a customer (sk_)
GET/POST/webhooks/List / register webhook endpoints (sk_)
Webhooks

Know the moment you're paid.

Register a URL and we POST a signed event on order.paid, booking.paid, and order.status_changed. Every delivery carries an X-Webhook-Signature header; verify it over the raw body before you trust it. Failed deliveries retry with backoff.

Signature = sha256=HMAC_SHA256(secret, raw_body)
javascript
import crypto from "node:crypto";

function verify(rawBody, signature, secret) {
  const expected =
    "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}

// signature = req.headers["x-webhook-signature"]
Errors

Predictable shapes.

Every error is a 4xx with a stable body you can branch on.

json
{
  "error": {
    "code": "not_entitled",
    "message": "The headless commerce API is not enabled on this plan."
  }
}
Rate limits

Per key, not per IP.

Each key has its own bucket, so one integration can't starve another. Over the limit returns 429 with a Retry-After header. The headless API is available on the Business plan.

Setup coach

Stuck? Ask.

An assistant that knows this exact API. Tell it your stack and what you're building, and it writes the code to wire it up.

cURL · Node · Python · PHP · Next.js
Setup coachcURL

Ask how to integrate the CogniChat Commerce API in your stack. I answer with runnable code for the language you pick above.

Get your keys and start building.

Keys, the playground, and webhooks live in your workspace under Developers.