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, "note": null },
{ "itemId": "-O4AKS1xqQn2YtqzA0b9", "name": "Masala Chai", "category": "Drinks", "foodType": "veg", "unitPrice": 30, "quantity": 1, "lineTotal": 30, "note": null }
],
"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,
"extraCharges": [],
"extraChargesTotal": 0,
"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;
  • extra charges = fixed amounts sent by your server in extraCharges (secret key only, see below);
  • total = subtotal − discount + charges + extra charges, rounded to the nearest rupee (roundOff shows the difference).

Lines with the same itemId and the same note are merged into one line. Quantities are whole numbers from 1 to 999, and an order can have up to 100 lines.

Each line may have a note (1 to 160 characters, trimmed), for example "Less spicy", with any key type. The same item with different notes stays on separate lines. Each quote line and each item of an order has note (null when there is none). The note is shown under the item name on the order in ALWS RESTRO.

{ "items": [{ "itemId": "-O4AKRdeH6tptn8IvuDh", "quantity": 1, "note": "Less spicy" }] }

Your server can add up to 5 fixed-amount charges, such as a delivery fee, to a quote and to an order:

{
"items": [{ "itemId": "-O4AKRdeH6tptn8IvuDh", "quantity": 2 }],
"extraCharges": [{ "name": "Delivery fee", "amount": 40 }]
}

name is 1 to 40 characters and amount is a number from 0 to 10000 (rupees, rounded to 2 decimal places). A publishable key that sends extraCharges gets 403 secret_key_required. The quote returns them in extraCharges and their sum in extraChargesTotal; charges and chargesTotal stay the percentage charges only. On the order, the extra charges are listed in charges after the percentage charges. The API does not work out these amounts; it adds what your server sends.

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 },
"distanceKm": 4.2
},
"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, including the optional note per line.
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), location and distanceKm are optional.
deliveryAddress.distanceKm No Distance from the restaurant in km, 0 to 200, any key type. Saved rounded to 1 decimal, shown on the order in ALWS RESTRO and returned in deliveryAddress.distanceKm (null when not sent). The API does not calculate or check it.
scheduledFor No ISO date-time with offset, in the future (up to 5 minutes of clock difference is allowed) and within 7 days (publishable key) or 30 days (secret key). Shown to staff as India time, for example “17 Nov, 6:00 PM”; it does not delay the order. The API returns the ISO value you sent.
notes No Up to 500 characters.
couponCode No
extraCharges No Secret key only. See extra charges.
externalRef No Secret key only. Your own order number, see below.
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, "note": null }],
"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 }, "distanceKm": 4.2 },
"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.

Your own order number (externalRef, secret key only)

Section titled “Your own order number (externalRef, secret key only)”

If your website has its own order numbers, send one as externalRef (1 to 64 characters: letters, digits, . _ : -). A publishable key that sends it gets 403 secret_key_required.

  • It becomes the order’s orderNumber, and it is the order number shown in ALWS RESTRO.
  • It must be unique for the business. If an order with the same externalRef already exists (in any status), you get 409 duplicate_external_ref with the existing order’s id in details.orderId. Two requests with the same new externalRef at the same time create only one order.
  • Find an order by it with GET /orders?externalRef=WEB-1001.

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.

If the customer cancelled the order before the payment was confirmed, the payment is recorded on the order with refundRequired, the order stays cancelled, and you get 409 order_cancelled_refund_required: refund the customer through your gateway.

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. With a publishable key, an order that was paid online cannot be cancelled online; the customer should call the restaurant. Once the restaurant has started it (or it is already cancelled or delivered), 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, since and externalRef (exact match) are optional. The list includes all website orders of the business, including those not created through the API. Those orders may have other status values from older website integrations; for them statusText is the raw status.