Webhooks

Subscribe to real-time events from ATIS POS. Every delivery is signed with your endpoint's secret so you can verify authenticity.

Create an endpoint

POST /v1/webhooks
{
  "url": "https://your-app.co.ug/hooks/atis",
  "events": ["sale.completed", "inventory.low"]
}

→ 201 Created
{ "id": "wh_...", "secret": "whsec_9f2b...", "events": [...] }

Verify signatures

Every delivery includes an ATIS-Signature header of the form t=<timestamp>,v1=<hex_hmac_sha256>. Compute the HMAC of <timestamp>.<raw_body> using your endpoint secret and compare with a timing-safe equal.

import { createHmac, timingSafeEqual } from "crypto";

function verify(rawBody: string, header: string, secret: string) {
  const [tPart, vPart] = header.split(",");
  const t = tPart.split("=")[1];
  const v1 = vPart.split("=")[1];
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

Delivery, retries & replay

  • Endpoints must respond with a 2xx status within 10 seconds.
  • Failed deliveries retry with exponential backoff for up to 24 hours.
  • The dashboard shows every delivery with headers, body and response, and lets you replay individual events.

Event types

sale.completed

A checkout finalised successfully.

{ "id":"evt_...","type":"sale.completed","data":{ "sale_id":"sa_...","total":15000,"branch_id":"br_..." } }
sale.refunded

A sale was refunded (full or partial).

{ "type":"sale.refunded","data":{ "sale_id":"sa_...","amount":5000 } }
stock.updated

Stock on hand changed for a product.

{ "type":"stock.updated","data":{ "product_id":"pr_...","qty":18 } }
inventory.low

A product crossed its reorder threshold.

{ "type":"inventory.low","data":{ "product_id":"pr_...","qty":2,"reorder_level":5 } }
purchase.received

Goods were received against a purchase order.

{ "type":"purchase.received","data":{ "grn_id":"grn_..." } }
customer.created

A new customer was created.

{ "type":"customer.created","data":{ "customer_id":"cu_..." } }
supplier.created

A new supplier was created.

{ "type":"supplier.created","data":{ "supplier_id":"su_..." } }
branch.created

A branch was created.

{ "type":"branch.created","data":{ "branch_id":"br_..." } }
cash_session.closed

A cash session was closed at end of shift.

{ "type":"cash_session.closed","data":{ "session_id":"cs_...","variance":0 } }
store.balanced

End-of-day store balance was posted.

{ "type":"store.balanced","data":{ "date":"2026-07-15" } }