Documentation

How it works, and how to build against it.

The API and webhook reference, plus the pages that explain how AtTable runs day to day.

Verify a webhook
import crypto from 'node:crypto';

// AtTable-Signature: t=<unix>,v1=<hex>
export function verify(rawBody, header, secret) {
  const { t, v1 = '' } = Object.fromEntries(
    String(header ?? '').split(',').map((kv) => kv.split('='))
  );
  const ts = Number(t);
  if (!ts || Math.abs(Date.now() / 1000 - ts) > 300) return false;

  const mac = crypto
    .createHmac('sha256', secret)
    .update(`${t}.${rawBody}`) // the raw bytes, not re-serialised JSON
    .digest('hex');
  const a = Buffer.from(v1);
  const b = Buffer.from(mac);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
HMAC-SHA256 · every planLive
A guest paying by card at a counter
Every event starts somewhere on the floor.order.settled

Not covered here? Ask us directly.

The written documentation is still growing. If what you need isn't here, a person will answer — and the question usually becomes the next page.