Skip to content

Online orders

POST /orders/quote · publishable or secret key

{
"items": [
{ "itemId": "-O4AKRdeH6tptn8IvuDh", "quantity": 2 },
{ "itemId": "-O4AKS1xqQn2YtqzA0b9", "quantity": 1 }
],
"couponCode": "CHAI10"
}

Response:

{
"currency": "INR",
"items": [
{ "itemId": "-O4AKRdeH6tptn8IvuDh", "name": "Paneer Tikka", "category": "Starters", "foodType": "veg", "unitPrice": 220, "quantity": 2, "lineTotal": 440 },
{ "itemId": "-O4AKS1xqQn2YtqzA0b9", "name": "Masala Chai", "category": "Drinks", "foodType": "veg", "unitPrice": 30, "quantity": 1, "lineTotal": 30 }
],
"subtotal": 470,
"discount": { "couponCode": "CHAI10", "type": "percentage", "value": 10, "amount": 3 },
"charges": [
{ "name": "CGST", "percentage": 2.5, "amount": 11.75 },
{ "name": "SGST", "percentage": 2.5, "amount": 11.75 }
],
"chargesTotal": 23.5,
"roundOff": 0.5,
"total": 491
}

The total is worked out the same way as at the ALWS RESTRO counter:

  • subtotal = price × quantity, added up;
  • charges = each charge set up in ALWS RESTRO (for example GST), as a percentage of the subtotal;
  • coupon discount = applies only to the coupon’s items (or every item, for coupons set to “ALL”), per unit: a percentage of the item price, or a fixed amount per unit;
  • total = subtotal − discount + charges, rounded to the nearest rupee (roundOff shows the difference).

The same item listed twice is merged into one line. Quantities are whole numbers from 1 to 999, and an order can have up to 100 lines.

A coupon is accepted when it exists for this restaurant, is active, has not passed its validity date, and matches at least one item in the cart. Otherwise you get 422 coupon_invalid with details.reason: not_found, inactive, expired or not_applicable.

POST /orders · publishable or secret key · send an Idempotency-Key header (see safe retries)

{
"items": [{ "itemId": "-O4AKRdeH6tptn8IvuDh", "quantity": 2 }],
"orderType": "delivery",
"customer": { "name": "Asha Verma", "phone": "+91 98765 43210", "email": "asha@example.com" },
"deliveryAddress": {
"line": "Flat 4B, Green Residency, Gomti Nagar",
"landmark": "Near City Mall",
"city": "Lucknow",
"pincode": "226010",
"location": { "lat": 26.8505, "lng": 80.9995 }
},
"scheduledFor": "2026-12-01T19:30:00+05:30",
"notes": "Less spicy, please",
"payment": { "method": "cash" },
"expectedTotal": 462
}
Field Required Notes
items Yes Same as for a quote.
orderType Yes pickup or delivery.
customer.name Yes Up to 80 characters.
customer.phone Yes 6 to 20 digits, may start with +.
customer.email No
deliveryAddress For delivery line is required; landmark, city, pincode (6 digits) and location are optional.
scheduledFor No ISO date-time with offset, in the future and within 7 days. Shown to staff; it does not delay the order.
notes No Up to 500 characters.
couponCode No
payment.method No cash (default) or online. See below.
expectedTotal Recommended The total you showed the customer. If the price has changed, the order is refused with 409 price_changed and the new quote in details.quote.

Unknown fields are refused with 400. Prices from your website are never used; the API always prices the order itself.

Response 201:

{
"id": "-OCx7hqGwnvR3kY1TzQp",
"orderNumber": "R7KQ2M9X",
"status": "pending",
"statusText": "Received by the restaurant",
"paymentStatus": "not_applicable",
"paymentMethod": "Cash on delivery",
"orderType": "delivery",
"createdAt": "2026-12-01T18:42:10+05:30",
"scheduledFor": "2026-12-01T19:30:00+05:30",
"items": [{ "itemId": "-O4AKRdeH6tptn8IvuDh", "name": "Paneer Tikka", "category": "Starters", "unitPrice": 220, "quantity": 2, "lineTotal": 440 }],
"subtotal": 440,
"discount": null,
"charges": [{ "name": "CGST (2.5%)", "amount": 11 }, { "name": "SGST (2.5%)", "amount": 11 }],
"roundOff": 0,
"total": 462,
"customer": { "name": "Asha Verma", "phone": "+91 98765 43210", "email": "asha@example.com" },
"deliveryAddress": { "line": "Flat 4B, Green Residency, Gomti Nagar, Near City Mall, Lucknow, 226010", "location": { "lat": 26.8505, "lng": 80.9995 } },
"notes": "Less spicy, please",
"accessToken": "q3b0V1t9…"
}

Show the customer the orderNumber. Keep id and accessToken to show them the order status later. The accessToken is returned only in this response.

Cash (payment.method: "cash"): the order goes straight to the restaurant as pending, with payment “Cash on delivery” (delivery) or “Pay at pickup” (pickup).

Online (payment.method: "online"): the order is created as pending_payment and is not shown to the restaurant yet.

  1. Create the order with the publishable key and take the payment with your own payment gateway (for example Razorpay).

  2. On your server, verify the payment with your gateway.

  3. Then call, with the secret key:

    POST /orders/{id}/payment

    { "provider": "Razorpay", "reference": "pay_NXq7Y2abc123", "amount": 462 }

    amount must equal the order total, otherwise you get 409 amount_mismatch. The order changes to pending and paid, and appears in ALWS RESTRO with “Paid online (Razorpay)”. Calling it again for an order that is already paid returns the order unchanged, so retries are safe.

ALWS does not process payments and does not check payments with your gateway; your server must do that before calling this endpoint. Orders that are never paid stay hidden from the restaurant.

GET /orders/{id} · secret key, or publishable key with X-Order-Token: <accessToken>

The restaurant moves the order through these statuses in ALWS RESTRO:

status statusText
pending_payment Waiting for payment (online orders only)
pending Received by the restaurant
processing Being prepared
shipped Ready for pickup (pickup) / Out for delivery (delivery)
delivered Completed
cancelled Cancelled

The API does not send status updates to your site yet. Check the status when the customer opens the order page, and, while the page is open, repeat at a gentle interval, such as every 30 seconds.

POST /orders/{id}/cancel · secret key, or publishable key with X-Order-Token

Works only while the order is pending or pending_payment. Once the restaurant has started it, you get 409 cannot_cancel; the customer should call the restaurant. If the order was paid online, arrange any refund through your payment gateway; ALWS does not refund payments.

GET /orders?status=pending&since=2026-12-01T00:00:00%2B05:30&limit=50 · secret key only

Returns { "data": [orders, newest first], "hasMore": true|false }. limit is 1 to 100 (default 50). status and since are optional. The list includes all website orders of the business, including those not created through the API.