# Foodops api changes for kfc integration
## Restaurant
### Create restaurant
- API: `/admin/api/v1/restaurants`
- Method: `POST`
- Query Param: n/a
- Request Body: Multipart Form
- new fields: `merchant_store_id` (string), `merchant_order_push`(bool), `merchant_type` (string)
- Response:
- code: `200`
```json
{
"success": true,
"message": "request is successful"
}
```
### Update restaurant
- API: `/admin/api/v1/restaurants/<restaurant_id>`
- Method: `PUT`
- Query Param: n/a
- Request Body: Multipart Form
- new fields(Required): `merchant_store_id` (string), `merchant_order_push`(bool), `merchant_type` (string)
- Response:
- code: `200`
```json
{
"success": true,
"message": "request is successful"
}
```
### Get restaurant by id
- API: `/admin/api/v1/restaurants/<id>`
- Method: `GET`
- Query Param: n/a
- Request Body: n/a
- Response:
- new fields(Required): `merchant_store_id` (string), `merchant_order_push`(bool), `merchant_type` (string)
- code: `200`
```json
{
"success": true,
"message": "request is successful",
"data": {
"id": "000369fa-c126-49d5-b996-bd0ca5dc32c3",
"parse_id": 20127,
"name": "Saltbae updated",
"address": "Kazi Aspharagus Food Court, Zindabazar",
"latitude": 24.895700454711914,
"longitude": 91.87020111083984,
"logo": null,
"banner": "http://food-m.p-stageenv.xyz/food/20127_banner.jpeg",
"min_delivery_time": "60 min",
"min_order_value": 50,
"min_delivery_fee": 0,
"delivery_discount_percent": 33.33,
"global_delivery_fee": 0,
"global_delivery_fee_discount_percent": 60,
"vat": 0,
"service_charge": 0,
"phone": "01312005531",
"email": "",
"website": "",
"store_front": null,
"long_shot": null,
"discount_type": "PERCENTAGE",
"discount": 0,
"max_discount_amount": null,
"min_discount_order_amount": 0,
"visible_in_app": true,
"is_flagged": false,
"search_score": 0,
"radius_promotion": false,
"city": 3,
"is_resto": false,
"accepting_orders": true,
"average_rating": null,
"rating_count": 0,
"marketplace_fee": 0,
"is_partner": false,
"is_supershop": false,
"currency": "BDT",
"sd": 0,
"created_at": "2021-03-05T23:09:48+0000",
"modified_at": "2022-01-16T01:00:51+0000",
"is_chain": false,
"is_manual_dispatch": false,
"popularity_score": 0,
"is_tong": false,
"is_pharma": false,
"custom_radius": null,
"badges": null,
"tags": null,
"mpf": 0,
"upfront": false,
"merchant_type": "KFC_NEPAL",
"merchant_store_id": "123qwe",
"merchant_order_push": false,
"subsidy_resto_share": 0,
"subsidy_pathao_share": 0,
"is_featured": true,
"is_sc_inclusive": false,
"is_vat_inclusive": false,
"is_sd_inclusive": false
}
}
```
### List restaurants by filter
- API: `/admin/api/v1/restaurants`
- Method: `GET`
- Query Param:
- `id`: Optional. String
- `name`: Optional. String
- `city`: Optional. Interger
- `delivery_discount`: Optional. String (for example: 10-20)
- `radius_promotion`: Optional. Boolean
- `visible_in_app`: Optional. Boolean
- `is_partner`: Optional. Boolean
- `is_resto`: Optional. Boolean
- `upfront`: Optional. Boolean
- `is_supershop`: Optional. Boolean
- `page`: Optional. Default: 1
- `page_size`: Optional.
- Request Body: n/a
- note:
- sorted in parse_id ascending order
- Response:
- new fields(Required): `merchant_store_id` (string), `merchant_order_push`(bool), `merchant_type` (string)
- code: `200`
```json
{
"success": true,
"message": "request is successful",
"count": 1,
"page_size": 30,
"current_page": 1,
"data": [
{
"id": "000369fa-c126-49d5-b996-bd0ca5dc32c3",
"parse_id": 20127,
"name": "Saltbae updated",
"address": "Kazi Aspharagus Food Court, Zindabazar",
"latitude": 24.895700454711914,
"longitude": 91.87020111083984,
"logo": null,
"banner": "http://food-m.p-stageenv.xyz/food/20127_banner.jpeg",
"min_delivery_time": "60 min",
"min_order_value": 50,
"min_delivery_fee": 0,
"delivery_discount_percent": 33.33,
"global_delivery_fee": 0,
"global_delivery_fee_discount_percent": 60,
"vat": 0,
"service_charge": 0,
"phone": "01312005531",
"email": "",
"website": "",
"store_front": null,
"long_shot": null,
"discount_type": "PERCENTAGE",
"discount": 0,
"max_discount_amount": null,
"min_discount_order_amount": 0,
"visible_in_app": true,
"is_flagged": false,
"search_score": 0,
"radius_promotion": false,
"city": 3,
"is_resto": false,
"accepting_orders": true,
"average_rating": null,
"rating_count": 0,
"marketplace_fee": 0,
"is_partner": false,
"is_supershop": false,
"currency": "BDT",
"sd": 0,
"created_at": "2021-03-05T23:09:48.893044Z",
"modified_at": "2022-01-16T01:00:51.85117Z",
"is_chain": false,
"is_manual_dispatch": false,
"popularity_score": 0,
"is_tong": false,
"is_pharma": false,
"custom_radius": null,
"badges": null,
"tags": null,
"mpf": 0,
"upfront": false,
"merchant_type": "",
"merchant_store_id": "",
"merchant_order_push": false,
"subsidy_resto_share": 0,
"subsidy_pathao_share": 0,
"is_featured": true,
"is_sc_inclusive": false,
"is_vat_inclusive": false,
"is_sd_inclusive": false
}
]
}
```
## Item
### Single Item Details
- API: `/admin/api/v1/items/:item_id`
- Method: `GET`
- Query Param: N/A
- Response:
- new fields: `merchant_item_id` (string), `merchant_original_net_price` (float), `is_combo` (bool)
- code: `200`
> fields note: `image`: null or string, `priority`: null or interger, `popularity_priority`: null or integer, `description`: null or string, `ingredients`: null or string, `max_allowed_quantity`: null or interger
```json
{
"success": true,
"message": "request is successful",
"data": {
"id": "cb6bdee0-b20b-4136-b0f9-f9380e68a52c",
"name": "No Bones (About It) Platter (4) Sides",
"image": null,
"image_required": false,
"category": {
"id": "4fea7063-2aa1-42c2-bb4f-29f3ae19393f",
"name": "Sharing Platters"
},
"price": 1550,
"cuisine": {
"id": "ea406c2c-f0ab-4a57-aff0-595553783412",
"name": "Portuguese"
},
"addons_required": [
{
"addon_key": "Extra",
"addon_name": "Choose Your Extra Veg Toppings",
"required_addon_count": 2,
"items": [
{
"id": "53fd2367-8146-45a4-81f7-a6bcef031389",
"name": "Mushroom"
},
{
"id": "b2cc20c1-39c6-4b65-839f-9c93a0e9ad05",
"name": "Gr. Pepper"
},
{
"id": "db441d4e-9fd9-4e9d-86ce-98a4622dfcc8",
"name": "Spinach"
},
{
"id": "618c78ee-4e67-4b45-a531-042bee79b09e",
"name": "Pineapple"
},
{
"id": "6dc3fed6-a76c-4505-b6ef-7739dd95bbea",
"name": "Onion"
},
{
"id": "3a110ea7-1596-4c8a-bed5-494a2d4b7569",
"name": "Olive"
}
]
},
{
"addon_key": "Extras",
"addon_name": "Choose Your Extra Non-Veg Toppings",
"required_addon_count": 1,
"items": [
{
"id": "7ab41e26-53b6-4439-bd4d-690ab5a41aa2",
"name": "Ham"
},
{
"id": "83d83002-ab27-4d06-a0a0-d90611a014ef",
"name": "Bacon"
},
{
"id": "803268d9-9bc1-4b86-8427-f5178bdb0963",
"name": "Salami"
},
{
"id": "742aab2d-5df5-4740-b9eb-d7e40bbc37f1",
"name": "Chicken"
},
{
"id": "00efc3b1-6352-4201-876c-321f413b82ac",
"name": "Egg"
},
{
"id": "98d8abe8-ca4a-4580-8fd9-bb38faf426ff",
"name": "Pepperoni"
},
{
"id": "c3dd053b-3eb8-4794-a9ea-97deac705e5d",
"name": "Tuna"
},
{
"id": "b712a2a7-4eea-44f2-af7b-1dca5fd3ce22",
"name": "Cheese"
}
]
},
{
"addon_key": "Extrass",
"addon_name": "Choose Your Extra Topping",
"required_addon_count": 1,
"items": [
{
"id": "eba9edd1-6528-47d3-8c5b-054ca749c789",
"name": "Extra non veg"
},
{
"id": "ed58ecff-0dd1-43d9-a106-ed41cd815af0",
"name": "Extra Cheese"
},
{
"id": "aaf7c006-07b1-4979-a90f-cb324042681c",
"name": "Extra Fried Egg"
}
]
}
],
"addons_optional": [
{
"addon_key": "Extra",
"addon_name": "Choose Your Extra Veg Toppings",
"items": [
{
"id": "7816cb0e-e3eb-45d8-8e07-3ff6a5828673",
"name": "Mushroom"
},
{
"id": "adbc0ca8-b946-4fc2-a66c-7ab5587b4541",
"name": "Gr. Pepper"
},
{
"id": "15b4a9af-7269-49c4-92cb-fd44e09f1af0",
"name": "Spinach"
},
{
"id": "6e019545-8502-45c1-bec3-0e7442496e60",
"name": "Pineapple"
},
{
"id": "d7cdc6ab-9509-442e-9a6e-f74b6c8592e8",
"name": "Onion"
},
{
"id": "99b01b10-6502-4bcb-8b34-ed47d95efd70",
"name": "Olive"
}
]
},
{
"addon_key": "Extras",
"addon_name": "Choose Your Extra Non-Veg Toppings",
"items": [
{
"id": "cddc6c62-4e42-4ddd-93f0-8918c90051ca",
"name": "Ham"
},
{
"id": "81bf14b2-2da3-497a-bdb3-22971d72f35b",
"name": "Bacon"
},
{
"id": "c002710c-aea5-406a-af84-4181e34ef6d6",
"name": "Salami"
},
{
"id": "f4adf6f4-36cb-499d-973a-afd5e6b338d0",
"name": "Chicken"
},
{
"id": "bb8ce00a-60cf-4cc5-83e4-5f8a9ee81160",
"name": "Egg"
},
{
"id": "4492dff8-b3aa-400a-8c15-91318141929f",
"name": "Pepperoni"
},
{
"id": "81b80fcf-4950-4eb6-8b55-9b3cf71fcb25",
"name": "Tuna"
},
{
"id": "d458e8f2-3921-42d1-b3ad-772377380bfb",
"name": "Cheese"
}
]
},
{
"addon_key": "Extrass",
"addon_name": "Choose Your Extra Topping",
"items": [
{
"id": "961f2163-58b3-427e-a7a1-4998f11ef2e2",
"name": "Extra non veg"
},
{
"id": "aaf3a5d2-a2df-4f8a-8407-120f287c1b78",
"name": "Extra Cheese"
},
{
"id": "bea70e8a-47c7-47d1-9e4e-0f9141ff31bf",
"name": "Extra Fried Egg"
}
]
}
],
"menu_hour": {
"id": "e52c1163-5006-4a9b-a65a-96f39d0007df",
"menu_type": "All Day Menu"
},
"discount_type": "PERCENTAGE",
"discount": 0,
"visibility": true,
"priority": null,
"popular": false,
"popularity_priority": null,
"description": "new description",
"ingredients": "tomato, onion",
"max_allowed_quantity": 9,
"is_available": true,
"merchant_item_id": "T1",
"merchant_original_net_price": 13.95,
"is_combo": true
}
}
```
### List Item by Filter
- API: `/admin/api/v1/items`
- Method: `GET`
- Query Param:
- `restaurant_id` - Required. String
- `name`: Optional. String. Items name.
- `menu_hour_id`: Optional. String.
- `has_discount`: Optional. Boolean.
- `page` - Optional. Integer. default 1.
- `page_size` - Optional. Integer. default 30.
- `popular` - Optional. Boolean. default NULL
- `has_addons` - Optional. Boolean. default NULL
- `visible` - Optional. Boolean. default NULL
- Request Body: `N/A`
- Response:
- new fields: `merchant_item_id` (string), `merchant_original_net_price` (float), `is_combo` (bool)
- code: `200`
```json
{
"success": true,
"message": "request is successful",
"count": 2,
"page_size": 30,
"current_page": 1,
"data": [
{
"id": "e368d9fb-c008-4073-9f93-51e84f3c286c",
"name": "Mini Cappuccino",
"description": "Served with Fried Rice, Sweet & Sour Chicken, Mixed Vegetable & French Fry",
"image": null,
"image_required": false,
"max_allowed_quantity": null,
"category": "Specialty",
"price": 150,
"currency": "BDT",
"addons_required_count": 0,
"addons_optional_count": 2,
"is_popular": true,
"menu_type": "Full Day Menu",
"is_visible": true,
"popularity_priority": null,
"priority": null,
"is_available": true,
"merchant_item_id": "T1",
"merchant_original_net_price": 13.95,
"is_combo": true
},
{
"id": "ea7854df-8c37-499a-be5f-8eadc14bd1c2",
"name": "Hazelnut Coffee Freddos (Large)",
"description": "",
"image": "http://image.com/123",
"image_required": true,
"max_allowed_quantity": 5,
"category": "Coffee Freddos",
"price": 345,
"currency": "BDT",
"addons_required_count": 0,
"addons_optional_count": 2,
"is_popular": true,
"menu_type": "Full Day Menu",
"is_visible": true,
"popularity_priority": null,
"priority": null,
"is_available": true,
"merchant_item_id": "T2",
"merchant_original_net_price": 135.95,
"is_combo": true
}
]
}
```
### Create item
- API: `/admin/api/v1/items`
- Method: `POST`
- Query Param: N/A
- Request Body: Multipart Form
- new fields: `merchant_item_id` (string), `merchant_original_net_price` (float), `is_combo` (bool)
- Response:
- code: `200`
```json
{
"success": true,
"message": "request is successful"
}
```
### Update item
- API: `/admin/api/v1/items/:item_id`
- Method: `PUT`
- Query Param: N/A
- Request Body: Multipart Form
- new fields: `merchant_item_id` (string), `merchant_original_net_price` (float), `is_combo` (bool)
- Response:
- code: `200`
```json
{
"success": true,
"message": "request is successful"
}
```
### Upload KFC items using zip
- API: `/admin/api/v1/jobs/upload`
- Method: `POST`
- Query Param: n/a
- Request Body: Multipart form
- `created_by`
- `description`
- `file`
- `task_name`: `upload-kfc-items`
- Response:
- code: `200`
```json
{
"success": true,
"message": "request is successful",
"data": {
"job_id": 10
}
}
```