Skip to content
Get API key

API reference

Customers API

The business’s guest book, newest first. Use it for CRM and marketing syncs.

List customers

GET/api-v1-customers
Paginated
cursor

Returns guests newest first by created_at, optionally filtered by a search term.

Query parameters

NameTypeRequiredDescription
searchstringOptionalMatches name, phone, phone digits, email or member number, case-insensitively.At most 120 characters.
cursorstringOptionalThe next_cursor from the previous page. Opaque; send it back unchanged.
limitintegerOptionalRows per page.Default 50. At least 1; values above 100 are capped at 100.

Response fields (200)

NameTypeDescription
data[].member_numberstring | nullThe loyalty member number.
data[].member_sincedate | nullWhen they joined the programme.
data[].tierstring | nullThe loyalty tier’s name.
data[].points_balanceintegerPoints available.

Errors

Every error answers { "error": { "code", "message", "request_id" } }. Branch on code; see Errors for retrying.

HTTPCodeWhen
400validation_failedA query parameter did not parse; the message names it. Also returned when from/to span more than 400 days.
401invalid_keyThe Authorization header is missing, malformed, or the key is revoked or inactive.
402payment_requiredThe business’s plan does not include API access (Sansflow Premium). The key itself is fine.
403insufficient_scopeThe key does not carry the scope this endpoint needs, or it is pinned to a different outlet.
429rate_limitedOver the key’s per-minute limit (60 for sf_test_, 300 for sf_live_). Wait the seconds in Retry-After.
500internal_errorSomething failed on our side. Quote the request_id when you report it.
Request
curl -G "https://ewpuclvmnygoddunkyrb.supabase.co/functions/v1/api-v1-customers" \
  -H "Authorization: Bearer $SANSFLOW_API_KEY" \
  --data-urlencode "search=0812"
Response200 OK
{
  "data": [
    {
      "id": "c4e8a2f1-6b9d-4e3a-8f72-1d5c9b0a3e24",
      "name": "Rina",
      "phone": "081200000000",
      "email": null,
      "address": null,
      "member_number": "M-0042",
      "member_since": "2026-03-14",
      "tier": "Gold",
      "points_balance": 120,
      "created_at": "2026-03-14T09:02:11+00:00",
      "updated_at": "2026-10-30T13:45:00+00:00"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "request_id": "5d0c7e2a-91f4-4b3e-a8c6-0f2e4b6d8a1c"
}

Example values. Run replays this response here; nothing is sent.

Retrieve a customer

GET/api-v1-customers/{customer_id}

One guest with lifetime stats: order count, net spend, last order and reservation visits.

Path parameters

NameTypeRequiredDescription
customer_iduuidRequiredThe customer’s id.

Response fields (200)

NameTypeDescription
notesstring | nullStaff notes on the guest.
stats.ordersintegerOrders linked to the guest.
stats.lifetime_netintegerNet spend in rupiah.
stats.last_order_attimestamp | nullTheir latest order.
stats.reservation_visitsintegerReservations on record.

Errors

Every error answers { "error": { "code", "message", "request_id" } }. Branch on code; see Errors for retrying.

HTTPCodeWhen
400invalid_requestThe id in the path is not a UUID.
401invalid_keyThe Authorization header is missing, malformed, or the key is revoked or inactive.
402payment_requiredThe business’s plan does not include API access (Sansflow Premium). The key itself is fine.
403insufficient_scopeThe key does not carry the scope this endpoint needs, or it is pinned to a different outlet.
429rate_limitedOver the key’s per-minute limit (60 for sf_test_, 300 for sf_live_). Wait the seconds in Retry-After.
404customer_not_foundNo such customer in this business’s guest book.
500internal_errorSomething failed on our side. Quote the request_id when you report it.
Request
curl "https://ewpuclvmnygoddunkyrb.supabase.co/functions/v1/api-v1-customers/c4e8a2f1-6b9d-4e3a-8f72-1d5c9b0a3e24" \
  -H "Authorization: Bearer $SANSFLOW_API_KEY"
Response200 OK
{
  "data": {
    "id": "c4e8a2f1-6b9d-4e3a-8f72-1d5c9b0a3e24",
    "name": "Rina",
    "phone": "081200000000",
    "email": null,
    "address": null,
    "notes": null,
    "member_number": "M-0042",
    "member_since": "2026-03-14",
    "tier": "Gold",
    "points_balance": 120,
    "stats": {
      "orders": 14,
      "lifetime_net": 2450000,
      "last_order_at": "2026-10-30T13:44:51+00:00",
      "reservation_visits": 3
    },
    "created_at": "2026-03-14T09:02:11+00:00",
    "updated_at": "2026-10-30T13:45:00+00:00"
  },
  "request_id": "5d0c7e2a-91f4-4b3e-a8c6-0f2e4b6d8a1c"
}

Example values. Run replays this response here; nothing is sent.

Base URL, keys and conventions: API reference overview.

Stuck? Quote the request_id from the response and write toSansflow support.Checked against API v1 on .