# Food

Search restaurants, grocery stores and shops, read a menu, price a basket, and place an order. There is no server-side cart: you send the items you want with the quote, and the quote you were given is the order you place.

Search restaurants, grocery stores and shops, read a menu, price a basket, and place an order. There is no server-side cart: you send the items you want with the quote, and the quote you were given is the order you place.

## Lifecycle

```
  QUOTED
     |
  PLACED
     |
  MERCHANT ACCEPTED  ----> rejected
     |
  PREPARING
     |
  READY FOR PICKUP
     |
  COURIER ASSIGNED        (skipped when the customer collects it)
     |
  PICKED UP
     |
  DELIVERING
     |
  DELIVERED                (or CANCELLED, before pickup)
```

## Operations

### `GET /v1/food/merchants`

Find open restaurants, grocery stores and shops near a point.

- operation: `search_restaurants`
- scope: `food.read`
- entitlement: none
- creates a transaction: no
- idempotency key: not required
- MCP tool: `search_restaurants`
- status: planned

```bash
curl -s 'https://sandbox-api.ryde.us.com/v1/food/merchants' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN"
```

### `GET /v1/food/merchants/{merchant_id}/menu`

The public catalogue for one merchant. Cost, stock, barcodes and supplier ids are the merchant's own business and are never returned here.

- operation: `get_restaurant_menu`
- scope: `food.read`
- entitlement: none
- creates a transaction: no
- idempotency key: not required
- MCP tool: `get_restaurant_menu`
- status: planned

```bash
curl -s 'https://sandbox-api.ryde.us.com/v1/food/merchants/$merchant_id/menu' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN"
```

### `POST /v1/food/orders/quote`

Price a basket exactly as checkout would: items, fees, taxes, any member discount, and the total. Returns the quote_id place_food_order requires.

- operation: `quote_food_order`
- scope: `food.read`
- entitlement: none
- creates a transaction: no
- idempotency key: not required
- MCP tool: `quote_food_order`
- status: planned

```bash
curl -sX POST 'https://sandbox-api.ryde.us.com/v1/food/orders/quote' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ … }'
```

### `POST /v1/food/orders`

Place the order the customer confirmed, from a quote_id they were shown.

- operation: `place_food_order`
- scope: `food.order`
- entitlement: ryde_one
- creates a transaction: yes
- idempotency key: required
- MCP tool: `place_food_order`
- status: planned

```bash
curl -sX POST 'https://sandbox-api.ryde.us.com/v1/food/orders' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H 'Content-Type: application/json' \
  -d '{ … }'
```

### `GET /v1/food/orders/{order_id}`

Live state of one order, including courier progress. Deliberately NOT membership-gated: an order that exists stays trackable whatever happens to the membership.

- operation: `get_food_order`
- scope: `food.read`
- entitlement: none
- creates a transaction: no
- idempotency key: not required
- MCP tool: `get_food_order`
- status: planned

```bash
curl -s 'https://sandbox-api.ryde.us.com/v1/food/orders/$order_id' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN"
```

### `GET /v1/food/orders`

The customer's own order history, newest first.

- operation: `list_food_orders`
- scope: `food.read`
- entitlement: none
- creates a transaction: no
- idempotency key: not required
- MCP tool: `list_food_orders`
- status: planned

```bash
curl -s 'https://sandbox-api.ryde.us.com/v1/food/orders' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN"
```

### `POST /v1/food/orders/{order_id}/cancel`

Cancel an order, where its current state still allows it. Never membership-gated — getting OUT of a transaction must not require an entitlement.

- operation: `cancel_food_order`
- scope: `food.read`
- entitlement: none
- creates a transaction: no
- idempotency key: supported
- MCP tool: `cancel_food_order`
- status: planned

```bash
curl -sX POST 'https://sandbox-api.ryde.us.com/v1/food/orders/$order_id/cancel' \
  -H "Authorization: Bearer $RYDE_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ … }'
```
