Authentication
Every call carries one API key in the X-Api-Key header. Keys belong to a brand, are shown once, and never leave your server.
The header
curl https://api.tavoloplus.com/v1/programme -H "X-Api-Key: $TAVOLO_KEY"Use X-Api-Key, not Authorization. A missing, unknown or revoked key answers 401 INVALID_API_KEY.
Server-side only
A key in a web page or a mobile app can be copied by anyone and used to credit stamps. Requests that carry an Origin header (sent by browsers) are refused with 403 BROWSER_NOT_ALLOWED, and the API sends no CORS headers. Your app talks to your server; your server talks to us.
Test and live keys
| Prefix | Works on | Billing |
|---|---|---|
tp_test_ | Test brands only | Free, never billed |
tp_live_ | Live brands only (after Go live) | Accepted purchases and redemptions count as tokens |
A live key writes only while the account has a running plan (402 SUBSCRIPTION_INACTIVE otherwise). Reads, and deleting a customer, keep working.
Scopes
| Scope | Allows |
|---|---|
| Read | GET: programme, customers, activity, locations |
| Read and write | Everything: purchases, redemptions, reversals, locations, customer deletion, sandbox reset |
A read-only key that writes gets 403 INSUFFICIENT_SCOPE. Give a read-only key to anything that only displays balances.
Rotation and revocation
- Each brand can have 2 active keys: create the new one, deploy it, then revoke the old one. No downtime.
- Revoking works at once.
- We store only a SHA-256 hash of each key. A lost key cannot be shown again: create a new one.