Skip to content

Authentication & keys

Every request (except GET /health) sends an API key in the Authorization header:

Authorization: Bearer pk_live_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys are created only inside ALWS RESTRO, by the business owner: Account Setting → API Keys → Create key. The full key is shown once, right after it is created. ALWS stores only a fingerprint (SHA-256 hash) of it, so a lost key cannot be shown again; create a new one and revoke the old one.

The same screen lists each key’s name, type, allowed websites, when it was created and roughly when it was last used, and lets the owner edit or revoke a key. A revoked key stops working within a few seconds.

A business can have up to 20 active keys.

Publishable pk_live_… Secret sk_live_…
Where to use Website JavaScript (browser) Your website’s server only
Allowed websites Required. Browser requests from any other website are refused. Not used. Requests from a browser are refused.
Read menu, price carts, place orders, book tables Yes Yes
Read or cancel an order or booking Only with its access token Any order or booking of the business
Mark an online order as paid No Yes
List orders No Yes
Rate limit 120 requests / minute, 20 orders or bookings / minute 600 requests / minute, 120 orders or bookings / minute

A publishable key is meant to be visible in your page’s source code. To limit misuse:

  • When a browser calls the API, it sends an Origin header. If that origin is not in the key’s allowed websites list, the request is refused with 403 origin_not_allowed.
  • Orders created with a publishable key always start unpaid: as cash on delivery or pickup, or waiting for payment. Only your server, with a secret key, can mark an order as paid.
  • A publishable key can read an order or booking only with the access token returned when it was created.

List every address your site uses, including both https://www.example.com and https://example.com if both work. Use the origin only: scheme, host and optional port, with no path or trailing slash.

Use secret keys only from server code (Node.js, PHP, Python…). If a request with a secret key carries a browser Origin header, it is refused with 403 secret_key_in_browser, so a secret key pasted into website code fails immediately instead of leaking quietly.

Never commit a secret key to a code repository. Keep it in an environment variable or your host’s secret settings.

POST /orders and POST /reservations return an accessToken. It lets the customer’s browser (with the publishable key) read and cancel that one order or booking:

GET /orders/{id}
X-Order-Token: <accessToken>
GET /reservations/{id}
X-Reservation-Token: <accessToken>

Store the token with the order on the customer’s device (for example in localStorage) or in your own database. ALWS keeps only its fingerprint, so it cannot be shown again.

The API is served only over HTTPS. Browser requests are supported (CORS). The response headers your code can read are X-Request-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After and Idempotent-Replayed.