Skip to content
KABAIDO
Log in

API and webhooks

Call the REST API with a scoped key, receive signed events at your own URL and give another system a URL to post to.

REST over HTTPS at https://kabaido.ai/api/v1, scoped to your workspace by the key, with money in integer minor units. The machine readable description is the OpenAPI document at https://kabaido.ai/api/v1/openapi.json (version 1.0.0).

Keys#

  1. Create

    In Settings, open Integrations, then Kabaido API. Choose New key, name it after the system that will use it and tick its scopes. It needs the Admin role or above.

  2. Copy

    Copy the key. This is the only time the full key is shown: Kabaido stores a hash of it.

  3. Send

    Send it as a Bearer token.

    bash
    curl "https://kabaido.ai/api/v1/products?search=blade&limit=50" \
      -H "Authorization: Bearer kbd_your_key_here"

A key begins kbd_, belongs to one workspace and works on the REST API only. The connector refuses a key: a person signs in to it.

Scopes#

ScopeAllows
products:readList and search products
products:writeBulk upsert products by SKU
quotes:readList quotes and read one with its lines
quotes:writeUsed by the connector only. No REST route writes a quote
orders:readList orders and read one with its lines
customers:readList customers and read one with its contacts
customers:writeUpsert customers
stock:readRead stock lines, locations and the movement ledger
stock:writeRecord a stock movement through the ledger
suppliers:readRead suppliers and their contacts
purchase_orders:readRead purchase orders with their lines and receipts

Resources#

MethodPathScopeWhat it does
GET/api/v1/productsproducts:readList products
POST/api/v1/products/bulkproducts:writeBulk upsert products
GET/api/v1/quotesquotes:readList quotes
GET/api/v1/quotes/{id}quotes:readGet a quote with lines
GET/api/v1/ordersorders:readList orders
GET/api/v1/orders/{id}orders:readGet an order with lines
GET/api/v1/stock/linesstock:readList stock lines
GET/api/v1/stock/lines/{id}stock:readGet a stock line with its movements
GET/api/v1/stock/locationsstock:readList stock locations
GET/api/v1/stock/movementsstock:readList stock movements
POST/api/v1/stock/movementsstock:writeRecord a stock movement
GET/api/v1/supplierssuppliers:readList suppliers
GET/api/v1/suppliers/{id}suppliers:readGet a supplier with contacts
GET/api/v1/purchase-orderspurchase_orders:readList purchase orders
GET/api/v1/purchase-orders/{id}purchase_orders:readGet a purchase order with lines and receipts
GET/api/v1/customerscustomers:readList customers
POST/api/v1/customerscustomers:writeUpsert customers
GET/api/v1/customers/{id}customers:readGet a customer with contacts

A list returns its rows and next_cursor. Pass that back as cursor for the next page. Null means you have everything.

Errors#

StatusMeans
400The query, the body or the cursor is not valid
401The key is missing, unknown or revoked
403The key lacks the scope
404Not in your workspace or the product the route needs is off
409A stock movement would take a balance below zero
429The key's rate limit. Wait and retry
500A fault on our side. Retry with a backoff

Webhooks#

Kabaido posts a signed JSON event to each endpoint that subscribes to it. Add an endpoint in Settings, under Integrations, then Custom outbound webhook. The URL must be https and the signing secret is shown once.

EventFires when
quote.createdA quote is created
quote.sentA quote is sent to the customer
quote.acceptedA quote is accepted
quote.declinedA quote is declined
order.createdAn order is created
order.updatedAn order changes status, is edited or is emailed
order.cancelledAn order is cancelled
design.savedA design is saved
design.exportedA design is exported
quote.supersededA quote is replaced by a new version
quote.expiredA quote passes its valid until date
quote.viewedThe customer opens the quote
order.invoiceableAn order is fulfilled, so an invoice can be raised
purchase_order.sentA purchase order is sent to the supplier
purchase_order.receivedGoods are received against a purchase order
A payload
{
  "event": "quote.accepted",
  "data": {
    "quote_id": "7f0c0000-0000-0000-0000-000000000000",
    "number": "Q-1042",
    "customer_id": "3a1e0000-0000-0000-0000-000000000000",
    "total_minor": 58200,
    "currency": "GBP"
  },
  "org_id": "00000000-0000-0000-0000-000000000000"
}

X-Kabaido-Event carries the event name. X-Kabaido-Signature is t=<unix seconds>,v1=<hex>, where the hex is an HMAC SHA-256 of the timestamp, a full stop and the raw body, keyed by the signing secret.

typescript
import { createHmac, timingSafeEqual } from "node:crypto";

// header: the X-Kabaido-Signature value, "t=<unix seconds>,v1=<hex>"
// rawBody: the request body exactly as received, before any JSON parsing
export function verify(secret: string, header: string, rawBody: string): boolean {
  const match = /^t=(\d+),v1=([0-9a-f]+)$/.exec(header.trim());
  if (!match) return false;
  const [, t, v1] = match;
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // five minutes
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
  const received = Buffer.from(v1, "hex");
  return received.length === expected.length && timingSafeEqual(received, expected);
}

A delivery succeeds on any 2xx answer. A failed one is tried again and Recent deliveries on the endpoint shows each status, with Retry to send one now. Answer fast and do the work after.

Inbound endpoints#

An inbound endpoint is a URL another system posts JSON to. You choose what each post does when you create it, under Custom inbound endpoint.

ActionWhat a post does
Upsert customersCreate or update customers matched by external id or email domain.
Upsert productsCreate or update catalogue products by SKU, with the same validation as the import wizard.
ERP order statusAn ERP such as EFACS posts an order status update; the matched order moves with it.
Order invoiceYour accounting system posts the invoice it raised. Wire it from Xero, QuickBooks or Sage through the automation you already run; Kabaido records the reference, it never issues an invoice.
Purchase order acknowledgementA supplier or a broker posts our purchase order number, their reference and confirmed dates; the order moves to acknowledged.
Supplier invoiceYour accounting system posts the supplier's invoice against our purchase order number; the three way match runs and a variance is raised where it does not agree.

The URL carries a long random token. Pausing or deleting the endpoint revokes it at once.

Updated Something missing or unclear? Tell us