Developer reference

    Tenant API

    A small, tenant-scoped REST surface for reading and creating your parlour's clients, policies, claims and payments — plus outgoing webhooks for real-time events.

    Authentication

    All requests require an API key issued from Developer API. Every call is automatically scoped to your tenant — you can only see and write your own data.

    Header (recommended)

    X-API-Key: fss_live_xxxxxxxxxxxxxxxxxxxxxxxx

    Or as a bearer token

    Authorization: Bearer fss_live_xxxxxxxxxxxxxxxxxxxxxxxx
    Scope: read
    Scope: write
    Scope: * (all)

    Base URL

    https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/{resource}

    Where {resource} is one of: clients, policies, claims, payments.

    Endpoints

    GET/tenant-api/clients

    List clients belonging to your tenant.

    Query parameters

    • limit — max rows (default 50, max 200)
    • offset — pagination offset (default 0)
    curl "https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/clients?limit=25" \
      -H "X-API-Key: fss_live_..."
    {
      "data": [
        { "id": "…", "full_name": "Jane Doe", "id_number": "…", "phone": "…", "email": "…", ... }
      ]
    }
    POST/tenant-api/clients

    Create one client (object) or many (array). tenant_id is added automatically — do not send it.

    curl -X POST "https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/clients" \
      -H "X-API-Key: fss_live_..." \
      -H "Content-Type: application/json" \
      -d '{ "full_name": "Jane Doe", "id_number": "8501015800088", "phone": "+27...", "email": "jane@example.com" }'
    GET/tenant-api/policies

    List policies for your tenant. Supports the same limit/offset pagination.

    curl "https://dfnwctrhhbgqlmnqbsrd.supabase.co/functions/v1/tenant-api/policies?limit=100&offset=0" -H "X-API-Key: fss_live_..."
    POST/tenant-api/policies

    Create a policy. client_id must belong to your tenant; the API rejects cross-tenant references.

    GET/tenant-api/claims

    List claims for your tenant.

    POST/tenant-api/claims

    Create a claim linked to one of your policies.

    GET/tenant-api/payments

    List payments for your tenant.

    POST/tenant-api/payments

    Record a payment. Useful for reconciling external EFT or POS transactions.

    Webhooks

    Receive events at any HTTPS endpoint you control.

    Signature verification

    Every delivery includes an X-Signature header computed as HMAC-SHA256 of the raw request body using your webhook's signing secret.

    X-Signature: sha256=8f4a9b…c02
    Content-Type: application/json

    Node.js verification example

    import crypto from "node:crypto";
    
    function verify(rawBody, header, secret) {
      const [, sig] = (header || "").split("=");
      const mac = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
      return crypto.timingSafeEqual(Buffer.from(sig, "hex"), Buffer.from(mac, "hex"));
    }

    Standard events

    • client.created, client.updated
    • policy.created, policy.status_changed
    • claim.created, claim.status_changed
    • payment.received, payment.failed
    • * — subscribe to everything

    Delivery & retries

    Non-2xx responses are marked failed and retried with backoff. Repeated failures are surfaced in the Developer API dashboard.

    Rate limits & responses

    200 / 201
    Success. Response is { "data": ... }.

    401
    Missing or invalid API key.

    403
    Key is missing the required scope (e.g. write).

    404
    Unknown resource. Supported: clients, policies, claims, payments.

    500
    Server error — response body contains the message.

    Fair-use limit: ~120 requests / minute per key. Contact support if you need more.

    Get started

    Three steps to your first request.

    1. Open Developer API in your dashboard.
    2. Create a new API key with the scopes you need and copy it (shown once).
    3. Call the base URL above with your X-API-Key header.