# Food Discovery 6.1 Food API's
## API End Point List
* [Filter And Cuisine](#Filter-And-Cuisine)
* [Promo Visibility](#Promo-Visibility)
* [Item Image in Search](#Item-Image-in-Search)
* [Featured Icon APIs](#Featured-Icon-APIs)
### Filter And Cuisine
**Old:** `/v1/foods/filters-and-cuisine`
**New:** `/v1/foods/v2/cuisines/filters-and-cuisine`
- Method: `GET`
- Query Param: value is 1 or 0 . cuisine_top default: 6
- cuisines=1
- cuisine_top=10
- group_filters=1
- flat_filters=1
- all query params are optional
- Request Body: null
- Response:
- code: `200` without any query param
```json
{
"success": true,
"message": "request is successful",
"data": {}
}
```
- code: `200` with all query params
```json
{
"success": true,
"message": "request is successful",
"data": {
"cuisines": [
{
"id": "1aa07b35-dd3b-4f37-8caa-59cfe51d51c0",
"name": "Burger",
"image": "http://food-m.p-stageenv.xyz/food/cuisine_burger.jpg",
"priority": 1
},
{
"id": "611d287c-786a-4971-93d6-f8b173f84989",
"name": "Fast Food",
"image": "http://food-m.p-stageenv.xyz/food/cuisine_App%20card.jpg",
"priority": 1
},
{
"id": "f7c939d0-4384-401e-8da1-20a5d418cf51",
"name": "Japanese",
"image": "http://food-m.p-stageenv.xyz/food/cuisine_basbusa.jpg",
"priority": 1
},
{
"id": "641406bf-f8e9-42a3-994b-09a07d6bd066",
"name": "Asian",
"image": "http://food-m.p-stageenv.xyz/food/cuisine_asian%20food.jpg",
"priority": 2
},
{
"id": "45299590-58d5-415c-a3dd-8e0da1e0d6dd",
"name": "Biryani",
"image": "http://food-m.p-stageenv.xyz/food/cuisine_biryani.jpg",
"priority": 2
},
{
"id": "87398027-2cee-49a9-ab43-ae3283067a57",
"name": "Steak",
"image": "http://food-m.p-stageenv.xyz/food/cuisine_steak.jpg",
"priority": 3
}
],
"group_filters": {
"sorting": {
"name": "Sort by",
"property_type": "sort",
"options": [
{
"name": "Nearest",
"value": 1,
"selected_icon": "",
"unselected_icon": "",
"priority": 1
},
{
"name": "Rating",
"value": 2,
"selected_icon": "",
"unselected_icon": "",
"priority": 2
},
{
"name": "Popularity",
"value": 3,
"selected_icon": "",
"unselected_icon": "",
"priority": 3
},
{
"name": "Delivery Charge",
"value": 5,
"selected_icon": "",
"unselected_icon": "",
"priority": 5
}
]
},
"filter": {
"name": "Filter by",
"property_type": "filter",
"options": [
{
"name": "Currently Open Restaurants",
"value": 1,
"selected_icon": "",
"unselected_icon": "",
"priority": 1
},
{
"name": "Restaurants offering Discounts",
"value": 2,
"selected_icon": "",
"unselected_icon": "",
"priority": 2
}
]
},
"rating": {
"name": "Rating",
"property_type": "rating",
"options": [
{
"name": "Above 4.5",
"value": 4.5,
"selected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-star-select.png",
"unselected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-star-default.png",
"priority": 1
},
{
"name": "Above 4",
"value": 4,
"selected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-star-select.png",
"unselected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-star-default.png",
"priority": 2
}
]
},
"delivery": {
"name": "Delivery charge",
"property_type": "delivery",
"options": [
{
"name": "Free",
"value": 0,
"selected_icon": "",
"unselected_icon": "",
"priority": 1
},
{
"name": "৳20",
"value": 20,
"selected_icon": "",
"unselected_icon": "",
"priority": 2
},
{
"name": "৳40",
"value": 40,
"selected_icon": "",
"unselected_icon": "",
"priority": 3
},
{
"name": "৳60",
"value": 60,
"selected_icon": "",
"unselected_icon": "",
"priority": 4
}
]
}
},
"flat_filters": [
{
"name": "Sort by",
"property_type": "sort",
"value": 0,
"selected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-sort-select.png",
"unselected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-sort-default.png",
"priority": 1,
"options": [
{
"name": "Nearest",
"value": 1,
"selected_icon": "",
"unselected_icon": "",
"priority": 1
},
{
"name": "Rating",
"value": 2,
"selected_icon": "",
"unselected_icon": "",
"priority": 2
},
{
"name": "Popularity",
"value": 3,
"selected_icon": "",
"unselected_icon": "",
"priority": 3
},
{
"name": "Delivery Charge",
"value": 5,
"selected_icon": "",
"unselected_icon": "",
"priority": 4
}
]
},
{
"name": "Above 4",
"property_type": "rating",
"value": 4,
"selected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-star-select.png",
"unselected_icon": "https://food-m.p-stageenv.xyz/food/v2f-ic-star-default.png",
"priority": 2,
"options": null
},
{
"name": "Offering Discounts",
"property_type": "filter",
"value": 2,
"selected_icon": "",
"unselected_icon": "",
"priority": 3,
"options": null
},
{
"name": "Free Delivery",
"property_type": "filter",
"value": 3,
"selected_icon": "",
"unselected_icon": "",
"priority": 4,
"options": null
}
]
}
}
```
### Promo Visibility
**New:** `/v1/me/foods/promo-visibility`
- Method: `GET`
- Query param:
* `restaurant_id`: **Required**
* `city_id`: **Required** if `lat` and `lon` params are not provided otherwise optional.
* `lat`: **Optional** if `city_id` is provided otherwise required. This param should be provided with `lon` param. Ignored if `city_id` is provided.
* `lon`: **Optional** if `city_id` is provided otherwise required. This param should be provided with `lat` param. Ignored if `city_id` is provided.
- Example API call:
- https://api.p-stageenv.xyz/v1/me/foods/promo-visibility?city_id=1&restaurant_id=bdcf9f50-dee9-4bf3-a84d-b8f8fe903dcd
- Response:
- code: 200
```json
[
{
"promo_code": "ALARABIAN150",
"promo_message": "BDT 150 Discount on your food order for minimum order of BDT 500",
"expire_message": "Valid till June 23, 2022",
"added": true
},
{
"promo_code": "CAKETWNPLBL",
"promo_message": "10% Discount on your food order (up to BDT 125) for minimum order of BDT 200 (Available between 11AM - 7PM)",
"expire_message": "Valid till June 02, 2022",
"added": true
},
{
"promo_code": "PAGLA100",
"promo_message": "BDT 100 Discount on your food order for minimum order of BDT 300 (Available between 12PM - 10PM)",
"expire_message": "Valid till August 04, 2022",
"added": false
},
{
"promo_code": "DAYTIMEPLBL",
"promo_message": "BDT 100 Discount on your food order for minimum order of BDT 350 (Available between 7:35AM - 7PM)",
"expire_message": "Valid till December 29, 2022",
"added": false
},
{
"promo_code": "TESTPLBL",
"promo_message": "30% Discount on your food order (up to BDT 80) for minimum order of BDT 250 (Available between 7AM - 7:20PM)",
"expire_message": "Valid till June 30, 2022",
"added": false
}
]
```
- code: 400
```json
{
"message": "valid city or city_id required"
}
```
### Item Image in Search
**API:** `/v1/foods/v4/search/dishes`
- Method: `GET`
- Query Param: all required
- q=burger
- lat=23.75336640201234
- lon=90.3773300210014
- Request Body: null
- Response:
- add new 2 keys `featured_icon` & `image` nullable
-
```json
{
"count": 96,
"page_size": 96,
"next": null,
"previous": null,
"results": [
{
"restaurant_id": "bdcf9f50-dee9-4bf3-a84d-b8f8fe903dcd",
...
"items": [
{
"id": "5e4c65f8-e772-4b50-a578-25f676af5c29",
...
"image": "http://food-m.p-stageenv.xyz/food/000b3144-67d8-46be-b8de-b4dc90025cff.jpeg"
}
],
...
"featured_icon": "http://food-m.p-stageenv.xyz/food/icon_featured-s-badge@2x.png"
}
]
}
```
### Featured Icon APIs
- add new 1 key `featured_icon` nullable in all api's
- **Collection API**
**API:** `/api/v4/collections/ab02fefb-707a-47de-bd6c-5481fcbe6b1d`
- Method: `GET`
- Query Param: all required
- lat=23.75336640201234
- lon=90.3773300210014
- city=1
- page=2
- page_size=5
- Request Body: null
- Response:
```json
{
"count": 29,
"page_size": 5,
"next": 3,
"previous": 1,
"results": [
{
"id": "5c1f7bf0-03da-4800-9963-9c1b99a93bb4",
...
"featured_icon": "http://food-m.p-stageenv.xyz/food/icon_featured-s-badge@2x.png"
}
]
}
```
- **Restaurant API**
**API:** `/api/v4/search/restaurants?lat=23.740969&lon=90.413219&page=2&page_size=5&user_id=521&user_type=user`
- Method: `GET`
- Query Param: all required
- q=Five
- lat=23.740969
- lon=90.413219
- page=2
- page_size=5
- Request Body: null
- Response:
```json
{
"count": 560,
"page_size": 5,
"next": 3,
"previous": 1,
"results": [
{
"id": "a8bc6c31-0c1a-4f3b-9139-e50a99230600",
...
"name": "Five Click(RESTO Do not ORDER)",
...
"featured_icon": "http://food-m.p-stageenv.xyz/food/icon_featured-s-badge@2x.png"
}
]
}
```
- **Platform Screen API**
**API:** `/api/v3/platform-screen?lat=23.740969&lon=90.413219&user_id=521&user_type=user`
- Method: `GET`
- Query Param: all required
- lat=23.740969
- lon=90.413219
- Request Body: null
- Response:
```json
[
{
...
"results": [
{
"id": "900b17ed-1184-4e60-a8ea-fafddac5aed0",
....
"featured_icon": "http://food-m.p-stageenv.xyz/food/icon_featured-s-badge@2x.png"
}
]
}
]
```
- **Search Screen API**
**API:** `/api/v3/search-screen?lat=23.740969&lon=90.413219&user_id=521&user_type=user`
- Method: `GET`
- Query Param: all required
- lat=23.740969
- lon=90.413219
- Request Body: null
- Response:
```json
[
{
...
"results": [
{
"id": "b0e30b4d-cc0e-4d8f-81d6-02a0c46c9355",
...
"featured_icon": "http://food-m.p-stageenv.xyz/food/icon_featured-s-badge@2x.png"
}
]
}
]
```
- **Favorite API**
**API:** `api/v1/users/8433/restaurants/favorites?page=1&page_size=10&user_id=8433&user_type=user`
- Method: `GET`
- Query Param: all required
- user_id=8433
- user_type=user
- page=1
- page_size=10
- Request Body: null
- Response:
```json
{
"count": 1,
"page_size": 10,
"next": null,
"prev": null,
"results": [
{
"id": "a2dcaa40-2bac-4910-a722-af6ffd1dff1b",
...
"featured_icon": "http://food-m.p-stageenv.xyz/food/icon_featured-s-badge@2x.png"
}
]
}
```