Errors
Errors use standard HTTP status codes and always have this shape:
{ "error": { "type": "unprocessable", "code": "coupon_invalid", "message": "This coupon has expired.", "requestId": "req_3B91l8N4Ja2w", "details": { "reason": "expired" } }}codeis stable: use it in your code.messageis plain English you can show or log.detailsis present for some errors (for example the invalid fields, or the new quote forprice_changed).- Every response, success or error, has an
X-Request-Idheader. Include it when you email restro@alws.in.
| Status | code |
Meaning |
|---|---|---|
| 400 | invalid_request |
The body or query is invalid. details.fields lists each problem. |
| 400 | invalid_request |
The body is not JSON (send Content-Type: application/json). |
| 400 | invalid_idempotency_key |
Idempotency-Key must be 8 to 100 characters: letters, digits, . _ : -. |
| 401 | missing_api_key |
No Authorization: Bearer … header. |
| 401 | invalid_api_key |
The key is wrong or malformed. |
| 401 | api_key_revoked |
The key was revoked in ALWS RESTRO. |
| 403 | origin_not_allowed |
A publishable key was used on a website not in its allowed list. |
| 403 | secret_key_in_browser |
A secret key was sent from a browser. Use it only on your server. |
| 403 | secret_key_required |
This action or field needs a secret key: listing orders, marking an order paid, or sending extraCharges or externalRef. |
| 403 | business_suspended |
The restaurant’s ALWS RESTRO account is suspended. |
| 403 | business_not_found |
The business this key belongs to no longer exists. |
| 404 | not_found |
No such order or booking for this business, or the access token is missing or wrong. |
| 404 | route_not_found |
No such endpoint. |
| 405 | method_not_allowed |
Wrong HTTP method for this endpoint. |
| 409 | price_changed |
expectedTotal no longer matches; details.quote has the new prices. |
| 409 | duplicate_external_ref |
An order with this externalRef already exists for the business; details.orderId is its id. |
| 409 | cannot_cancel |
The order has already been started, delivered or cancelled, or the booking has started. |
| 409 | amount_mismatch |
The paid amount is not the order total. |
| 409 | not_awaiting_payment |
The order is not waiting for an online payment. |
| 409 | order_cancelled_refund_required |
The order was cancelled before the payment was confirmed. The payment is recorded; refund the customer. |
| 409 | table_unavailable / no_table_available |
The table, or every table, is booked for that time. |
| 409 | idempotency_conflict |
The Idempotency-Key was used before with a different request. |
| 409 | request_in_progress |
A request with this Idempotency-Key is still running. Retry in a few seconds. |
| 409 | busy |
Another booking for the same table, or another order with the same externalRef, was being saved. Retry. |
| 413 | body_too_large |
The body is over 64 KB. |
| 422 | item_unavailable |
Some items are not on the menu or are switched off. details.itemIds lists them. |
| 422 | coupon_invalid |
See details.reason: not_found, inactive, expired, not_applicable. |
| 422 | invalid_schedule |
scheduledFor is in the past, or more than 7 days ahead (publishable key) or 30 days ahead (secret key). |
| 422 | slot_in_past / slot_too_far |
Booking time has passed, or is more than 60 days ahead. |
| 422 | slot_too_long |
A booking can last up to 4 hours. |
| 422 | too_many_bookings |
This phone number already has 2 upcoming bookings (publishable keys). |
| 422 | no_tables / table_not_found |
The restaurant has no tables set up, or the tableId does not exist. |
| 422 | invalid_phone |
Not a 10-digit Indian mobile number (one-time codes). |
| 422 | otp_invalid / otp_expired |
Wrong code (details.attemptsLeft), or the code expired, was used, or does not exist. |
| 429 | otp_rate_limited / otp_too_many_attempts |
Too many codes for this number, or too many wrong tries. |
| 502 | otp_send_failed |
WhatsApp did not accept the code message. |
| 429 | rate_limited |
Too many requests (per key, per visitor IP, or after repeated wrong keys). Wait for Retry-After seconds. |
| 500 | internal_error |
Something failed on our side. Retry with the same Idempotency-Key. |
