API reference
Locations API
The outlets this key may read. Call it first: most other endpoints take a location_id.
List locations
/api-v1-locationsReturns every outlet the key may read, default outlet first. A key pinned to one outlet sees only that outlet. Not paginated.
No parameters.
Response fields (200)
| Name | Type | Description |
|---|---|---|
data[].type | string | The outlet type. |
data[].is_default | boolean | The business’s default outlet. |
data[].is_active | boolean | Inactive outlets are listed too. |
data[].receipt_name | string | null | The name printed on receipts. |
data[].address | string | null | The receipt address. |
data[].phone | string | null | The receipt phone. |
data[].tax | object | enabled, rate, label. |
data[].operating_hours | object | null | Opening hours as set in the app. |
Errors
Every error answers { "error": { "code", "message", "request_id" } }. Branch on code; see Errors for retrying.
| HTTP | Code | When |
|---|---|---|
| 401 | invalid_key | The Authorization header is missing, malformed, or the key is revoked or inactive. |
| 402 | payment_required | The business’s plan does not include API access (Sansflow Premium). The key itself is fine. |
| 403 | insufficient_scope | The key does not carry the scope this endpoint needs, or it is pinned to a different outlet. |
| 429 | rate_limited | Over the key’s per-minute limit (60 for sf_test_, 300 for sf_live_). Wait the seconds in Retry-After. |
| 500 | internal_error | Something failed on our side. Quote the request_id when you report it. |
curl "https://ewpuclvmnygoddunkyrb.supabase.co/functions/v1/api-v1-locations" \
-H "Authorization: Bearer $SANSFLOW_API_KEY"const res = await fetch(
"https://ewpuclvmnygoddunkyrb.supabase.co/functions/v1/api-v1-locations",
{
headers: {
Authorization: `Bearer ${process.env.SANSFLOW_API_KEY}`,
},
},
);
const json = await res.json();
if (!res.ok) throw new Error(`${json.error.code} (${json.error.request_id})`);
console.log(json);import os
import requests
res = requests.get(
"https://ewpuclvmnygoddunkyrb.supabase.co/functions/v1/api-v1-locations",
headers={
"Authorization": f"Bearer {os.environ['SANSFLOW_API_KEY']}",
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']} ({data['error']['request_id']})")
print(data)GET /api-v1-locations
{
"data": [
{
"id": "3f6c2a1e-8b4d-4c2a-9e51-7a0d2b6c9f10",
"name": "Main",
"type": "storefront",
"is_default": true,
"is_active": true,
"receipt_name": "Kopi Contoh",
"address": "Jl. Contoh No. 1, Jambi",
"phone": "0741000000",
"tax": {
"enabled": false,
"rate": null,
"label": null
},
"operating_hours": null
}
],
"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 .