---
# System prepended metadata

title: Food Slotting APIs

---

## Driver App Api
# Food Slotting APIs

## PRD link
https://docs.google.com/document/d/1kAQlcyQFwwy8EKKUHxmz0ZiqiRGN6l1tB5RpP_JvAeY/edit

## Driver App APIs
### Book time slots
- API: `/api/v1/users/<users_id>/time-slots`
- Kong-gateway: `/v1/me/foods/time-slots`
- Method: `POST`
- Headers:
  - `Authorization`: Required.
- Query Param: n/a
- note:
  - it will book all slots or give an error
- Request Body: Required.
  ```json
  {
    "ids": [
      "f0cdac35-ca3d-4181-afc4-6231736b6c9d",
      "422c9e43-4861-422b-8e06-c884bb98e22c"
    ]
  }
  ```
- Response:
  - code: `404` [New response case]
  ```json
  {
    "success": false,
    "code": "FOOD_0011",
    "message": "Slots Unavailable"
  }
  ```

### List time slots by subzone and date for driver
- API: `/api/v1/users/<user_id>/subzones/<subzone-id>/time-slots`
- Kong-gateway: `/v1/me/foods/subzones/<subzone-id>/time-slots`
- Method: `GET`
- Headers:
  - `City-ID`: Required.
  - `Authorization`: Required.
- Query Param:
  - `date`: Required. Format: `yyyy-mm-dd`
- note:
  - only show the slots that are not booked/requested and not filled
  - show empty list if driver booking limit crosses
- Request Body: 
- Response:
  - code: `404` [New response case]
  ```json
  {
    "success": false,
    "code": "FOOD_0011",
    "message": "Slots Unavailable"
  }
  ```

