Restaurants API
The Restaurants API connects a restaurant’s own website to ALWS RESTRO, the restaurant billing and POS software.
With it, a website can:
- show the restaurant’s live menu and prices;
- price a cart exactly as the counter would (charges, coupons, rounding);
- place pickup or delivery orders, which arrive in ALWS RESTRO under Website Orders with a sound alert;
- let the customer check or cancel their order;
- show free tables and book a table, which appears in ALWS RESTRO under Reservations.
Base URL: https://restro.alws.in/api/v1
All requests and responses are JSON. Amounts are in Indian rupees (INR). Dates and times are India Standard Time.
Quickstart
Section titled “Quickstart”-
Create a key in ALWS RESTRO. The business owner signs in to ALWS RESTRO and opens Account Setting → API Keys → Create key. For a website, create a publishable key and list the website’s address (for example
https://www.yourrestaurant.com). The full key is shown once; copy it. -
Load the menu.
const API = 'https://restro.alws.in/api/v1';const KEY = 'pk_live_...'; // publishable key: safe in website codeconst res = await fetch(`${API}/menu`, { headers: { Authorization: `Bearer ${KEY}` } });const menu = await res.json(); // { currency, categories: [...], items: [{ id, name, category, price, foodType }] } -
Price the cart, then place the order.
const cart = { items: [{ itemId: menu.items[0].id, quantity: 2 }] };const quote = await (await fetch(`${API}/orders/quote`, {method: 'POST',headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },body: JSON.stringify(cart)})).json();const order = await (await fetch(`${API}/orders`, {method: 'POST',headers: {Authorization: `Bearer ${KEY}`,'Content-Type': 'application/json','Idempotency-Key': crypto.randomUUID() // the same key on a retry never creates a second order},body: JSON.stringify({...cart,orderType: 'pickup',customer: { name: 'Asha Verma', phone: '+91 98765 43210' },expectedTotal: quote.total // refused with 409 if the price changed})})).json();// Keep order.id and order.accessToken to show the customer their order status. -
Show the status.
GET /orders/{id}with the headerX-Order-Token: <accessToken>returns the current status, which the restaurant updates in ALWS RESTRO.
What happens in ALWS RESTRO
Section titled “What happens in ALWS RESTRO”| On the website | In ALWS RESTRO |
|---|---|
| Order placed (cash) | Appears in Website Orders as pending, with a sound alert. Staff accept and update it. |
| Order placed (online payment) | Stays hidden until your server confirms the payment with a secret key, then appears as pending. |
| Table booked | Appears in Reservations and blocks that table for the time slot. |
| Booking cancelled | Removed from Reservations; the table is free again. |
Endpoints
Section titled “Endpoints”| Method | Path | Key | Purpose |
|---|---|---|---|
| GET | /restaurant |
pk, sk | Restaurant name, address and phone |
| GET | /menu |
pk, sk | Categories and available items |
| POST | /orders/quote |
pk, sk | Price a cart |
| POST | /orders |
pk, sk | Place an order |
| GET | /orders/{id} |
pk + order token, sk | Order status |
| POST | /orders/{id}/cancel |
pk + order token, sk | Cancel while still pending |
| POST | /orders/{id}/payment |
sk | Mark an online order as paid |
| GET | /orders |
sk | List orders |
| GET | /tables |
pk, sk | Floors and tables |
| GET | /reservations/availability |
pk, sk | Free tables for a time slot |
| POST | /reservations |
pk, sk | Book a table |
| GET | /reservations/{id} |
pk + booking token, sk | Booking details |
| POST | /reservations/{id}/cancel |
pk + booking token, sk | Cancel a booking |
| GET | /health |
none | Service check |
