# Efood Service
Baseurl for promo service: http://api-dev.evaly.com.bd/efood/api/v1.0.0
## Explore
### Profile
#### Create Follow
* ##### Description:
This api is used to follow users.
* ##### Endpoint: /explore/users/follow/01932062088
* ##### Method: POST
* ##### Headers:
Authorization : < admin_user_token >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
}
```
#### Create Profile
* ##### Description:
This api is used to by frontend to call existing created profile. [this api is temporary]
* ##### Endpoint: /users/profile
* ##### Method: POST
* ##### Headers:
Authorization : < user token >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"profile_pic_url": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png"
}
```
* ##### Response Body :
``` json=
{
"success": true,
"data": {
"user": 1,
"cover_photo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/ce571035693a-3.png",
"follower_count": 5,
"following_count": 6,
"points": 0.0,
"order_count": 0,
"badges": [],
"meta": {}
}
}
```
#### Get User Profile
* ##### Description:
This api is show user profile
* ##### Endpoint: /users/profile-details
* ##### Method: GET
* ##### Headers:
Authorization : < user token >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
{
"success": true,
"message": "Status OK",
"data": {
"user": 1,
"cover_photo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/ce571035693a-3.png",
"follower_count": 5,
"following_count": 6,
"points": 0.0,
"order_count": 0,
"badges": [],
"meta": {}
}
}
}
```
### **Feed**
#### **Create Feed**
* ##### Description:
This api creates a user feed against a restaurant.
* ##### Endpoint: /explore/users/feeds
* ##### Method: POST
* ##### Headers:
Authorization : < user login token >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "Another-ieato",
"images": [ "https://images.pexels.com/photos/315755/pexels-photo-315755.jpeg" ],
"latitude": 23.8099057,
"longitude": 90.8099057,
"description": "some description"
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Your feed has been published",
"data": {
"id": 36,
"created_at": "2020-12-21T07:41:14.573534Z",
"updated_at": "2020-12-21T07:41:14.573570Z",
"created_by": {
"username": "01932062088",
"address": null,
"first_name": "Kashfia",
"last_name": "v1",
"profile_pic_url": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png"
},
"updated_by": {
"username": "01932062088",
"address": null,
"first_name": "Kashfia",
"last_name": "v1",
"profile_pic_url": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png"
},
"restaurant_slug": "Another-ieato",
"restaurant_details": {
"id": 9,
"name": "Another",
"slug": "Another-ieato",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"latitude": 23.7547394,
"longitude": 90.3757636,
"total_review_count": 0,
"total_avg_rating": 0.0
},
"description": "some description",
"latitude": 23.8099057,
"longitude": 90.8099057,
"posted_by_username": "01932062088",
"images": [
"https://images.pexels.com/photos/315755/pexels-photo-315755.jpeg"
],
"status": "active",
"like_count": 0
}
}
```
```Error Message```
``` json=
{
"success": false,
"message": "Restaurant not found"
}
```
#### **Like Feed**
* ##### Description:
This api creates Like against a feed.
* ##### Endpoint: /explore/users/feed/3/likes
* ##### Method: POST
* ##### Headers:
Authorization : < user login token >
Content-Type : application/json
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "Another-ieato",
"images": ["https://images.pexels.com/photos/315755/pexels-photo-315755.jpg"],
"latitude": 23.8099057,
"longitude": 90.8099057,
"description": "asdasdasdasd"
}
```
* ##### Response Body :
```json=
{
}
```
#### Admin
Admin can create/ update/ delete/ like a feed.
##### **Create Feed**
* ##### Description:
This api creates a feed from admin panel.
* ##### Endpoint: /explore/admin/feed
* ##### Method: POST
* ##### Headers:
Authorization : < user login token >
Content-Type : application/json
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "bfc-bmrxu",
"images": ["example.com/121.jpg"],
"latitude": 23.8099057,
"longitude": 90.8099057,
"description": "asdasdasdasd"
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Created",
"data": {
"id": 38,
"created_at": "2020-12-21T09:47:31.936305Z",
"updated_at": "2020-12-21T09:47:31.936328Z",
"created_by": {
"username": "kashfia",
"address": null,
"first_name": "Kashfia",
"last_name": "Akhter",
"profile_pic_url": null
},
"updated_by": {
"username": "kashfia",
"address": null,
"first_name": "Kashfia",
"last_name": "Akhter",
"profile_pic_url": null
},
"restaurant_slug": "Another-ieato",
"restaurant_details": {
"id": 9,
"name": "Another",
"slug": "Another-ieato",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"latitude": 23.7547394,
"longitude": 90.3757636,
"total_review_count": 0,
"total_avg_rating": 0.0
},
"description": "asdasdasdasd",
"latitude": 23.0,
"longitude": 90.0,
"posted_by_username": "system",
"images": [
"example.com/121.jpg"
],
"status": "active",
"like_count": 0
}
}
```
##### **Get Feed**
* ##### Description:
This api retrieves the feed data .
* ##### Endpoint: /explore/admin/feed
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"meta_data": {
"count": 36,
"page_size": 12,
"next": 2,
"previous": null
},
"data": [
{
"id": 38,
"created_at": "2020-12-21T09:47:31.936305Z",
"updated_at": "2020-12-21T09:47:31.936328Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"restaurant_slug": "Another-ieato",
"restaurant_details": {
"id": 9,
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"name": "Another",
"slug": "Another-ieato",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"latitude": 23.7547394,
"longitude": 90.3757636,
"total_avg_rating": 0.0,
"total_review_count": 0
},
"description": "asdasdasdasd",
"latitude": 23.0,
"longitude": 90.0,
"posted_by_username": "system",
"images": [
"example.com/121.jpg"
],
"status": "active",
"like_count": 0
}
```
##### **Update Feed**
* ##### Description:
This api updates an existing feed. Admin can change image, description of a feed.
* ##### Endpoint: /explore/admin/feed/38
* ##### Method: PTCH
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "Another-ieato",
"images": ["example.com/121.jpg"],
"latitude": 23.8099057,
"longitude": 90.8099057,
"description": "Updated"
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Status OK",
"data": {
"id": 38,
"created_at": "2020-12-21T09:47:31.936305Z",
"updated_at": "2020-12-21T10:10:32.653037Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"restaurant_slug": "Another-ieato",
"restaurant_details": {
"id": 9,
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"name": "Another",
"slug": "Another-ieato",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"latitude": 23.7547394,
"longitude": 90.3757636,
"total_avg_rating": 0.0,
"total_review_count": 0
},
"description": "Updated",
"latitude": 23.8099057,
"longitude": 90.8099057,
"posted_by_username": "system",
"images": [
"example.com/121.jpg"
],
"status": "active",
"like_count": 0
}
}
```
##### **Delete Feed**
* ##### Description:
This api is used to delete any feed.
* ##### Endpoint: /explore/admin/feed/38
* ##### Method: DELETE
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Success Token : 204 No Content
### **Story**
#### Admin
##### **Create Story**
* ##### Description:
This api is used to create story by Admin.
* ##### Endpoint: /explore/admin/story
* ##### Method: POST
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "Another-ieato",
"image": "example.com/121.jpg",
"description": "asdasdasdasd",
"restaurant_details": {},
"cuisine_details": {}
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Created",
"data": {
"id": 104,
"restaurant_details": {
"id": 9,
"name": "Another",
"slug": "Another-ieato",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"latitude": 23.7547394,
"longitude": 90.3757636,
"total_review_count": 0,
"total_avg_rating": 0.0
},
"cuisine_details": {},
"username": "system",
"expired_at": "2020-12-22T10:22:19.445682Z",
"created_at": "2020-12-21T10:22:19.446066Z",
"updated_at": "2020-12-21T10:22:19.446088Z",
"created_by": {
"username": "system",
"address": null,
"first_name": null,
"last_name": null,
"profile_pic_url": null
},
"updated_by": {
"username": "system",
"address": null,
"first_name": null,
"last_name": null,
"profile_pic_url": null
},
"restaurant_slug": "Another-ieato",
"image": "example.com/121.jpg",
"description": "asdasdasdasd",
"approved": true,
"status": "active"
}
}
```
##### **Get All Stories**
* ##### Description:
This api is used to get the story list on Admin. All the stories created bt
* ##### Endpoint: /explore/admin/story
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "Another-ieato",
"image": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png",
"description": "asdasdasdasd",
"cuisine_id": 1
}
```
* ##### Response Body :
``` json=
{
}
```
##### **Get a Story**
* ##### Description:
This api is used to get details of a single story to view.
* ##### Endpoint: /explore/admin/story/9
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"meta_data": {
"count": 0,
"page_size": 12,
"next": null,
"previous": null
},
"data": []
}
```
#### User
Users can create/delete, see other's stories.
##### **Create Story**
* ##### Description:
This api is used to create story by user.
* ##### Endpoint: /explore/admin/story
* ##### Method: POST
* ##### Headers:
Authorization : < user access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant_slug": "Mezzan-1-trihd",
"image": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png",
"description": "asdasdasdasd",
"cuisine_id": 1
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Your story is awaiting admin review",
"data": {
"id": 105,
"created_at": "2020-12-21T10:44:51.880427Z",
"updated_at": "2020-12-21T10:44:51.880449Z",
"created_by": {
"username": "01932062088",
"address": null,
"first_name": "Kashfia",
"last_name": "v1",
"profile_pic_url": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png"
},
"updated_by": {
"username": "01932062088",
"address": null,
"first_name": "Kashfia",
"last_name": "v1",
"profile_pic_url": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png"
},
"restaurant_slug": "Another-ieato",
"restaurant_details": {
"id": 9,
"name": "Another",
"slug": "Another-ieato",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"latitude": 23.7547394,
"longitude": 90.3757636,
"total_review_count": 0,
"total_avg_rating": 0.0
},
"username": "01932062088",
"cuisine_details": {
"id": 1,
"name": "Fast food"
},
"image": "https://images.prothomalo.com/prothomalo-bangla%2F2020-10%2F6e7164ab-2bf3-4b22-8b2e-d728e70d4fee%2Fpolice.png",
"expired_at": "2020-12-22T10:44:51.878756Z",
"description": "asdasdasdasd",
"approved": false,
"status": "active"
}
}
```
##### **Delete Story**
* ##### Description:
This api is used to delete story.
* ##### Endpoint: /explore/users/story/105
* ##### Method: DELETE
* ##### Headers:
Authorization : < user access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Story deleted"
}
```
## Campaign
#### Admin
##### **Create Campaign**
* ##### Description:
This api is used to create campaign on Admin Panel.
* ##### Endpoint: /campaigns/admin/campaign
* ##### Method: POST
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"name": "Buy 2 মেজ্জান's Get 1",
"description": "some description here",
"image": "example.com",
"banner_image": "example.com",
"description": "Buy two get one with 40% discount and 60% cashback",
"start_date": "2020-10-19T00:00:00.00Z",
"end_date": "2020-10-22T00:00:00.00Z",
"promotion_start_date": "2020-10-18T00:00:00.00Z",
"cashback": 60,
"cashback_claim_type": "backoff",
"claim_backoff_value": 3,
"claim_backoff_unit": "day",
"allowed_payment_methods": ["bkash_gateway"],
"discount": 40,
"terms_and_conditions": "some condition"
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Created",
"data": {
"id": 7,
"cashback_payment_methods": [],
"created_at": "2020-12-21T11:34:09.247183Z",
"updated_at": "2020-12-21T11:34:09.247203Z",
"created_by": {
"username": "kashfia",
"address": null,
"first_name": "Kashfia",
"last_name": "Akhter",
"profile_pic_url": null
},
"updated_by": {},
"name": "Buy 2 মেজ্জান's Get 1",
"slug": "Buy-2-মেজ্জানs-Get-1-hfhxn",
"description": "Buy two get one with 40% discount and 60% cashback",
"image": "example.com",
"banner_image": "example.com",
"start_date": "2020-10-19T00:00:00Z",
"end_date": "2020-10-22T00:00:00Z",
"promotion_start_date": "2020-10-18T00:00:00Z",
"cashback": 60.0,
"cashback_claim_type": "backoff",
"claim_date": null,
"claim_backoff_value": 3,
"claim_backoff_unit": "day",
"allowed_payment_methods": [
"bkash_gateway"
],
"discount": 40.0,
"status": "inactive",
"terms_and_conditions": "some condition"
}
}
```
##### **Get Campaign**
* ##### Description:
This api is used to retrieve campaign data.
* ##### Endpoint: /campaigns/admin/campaign/Buy-2-মেজ্জানs-Get-1-hfhxn
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Status OK",
"data": {
"id": 7,
"cashback_payment_methods": [],
"created_at": "2020-12-21T11:34:09.247183Z",
"updated_at": "2020-12-21T11:34:09.247203Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {},
"name": "Buy 2 মেজ্জান's Get 1",
"slug": "Buy-2-মেজ্জানs-Get-1-hfhxn",
"description": "Buy two get one with 40% discount and 60% cashback",
"image": "example.com",
"banner_image": "example.com",
"start_date": "2020-10-19T00:00:00Z",
"end_date": "2020-10-22T00:00:00Z",
"promotion_start_date": "2020-10-18T00:00:00Z",
"cashback": 60.0,
"cashback_claim_type": "backoff",
"claim_date": null,
"claim_backoff_value": 3,
"claim_backoff_unit": "day",
"allowed_payment_methods": [
"bkash_gateway"
],
"discount": 40.0,
"status": "inactive",
"terms_and_conditions": "some condition"
}
}
```
##### **Get All Campaign**
* ##### Description:
This api is used to retrieve all campaign data.
* ##### Endpoint: /campaigns/admin/campaign
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"meta_data": {
"count": 1,
"page_size": 12,
"next": null,
"previous": null
},
"data": [
{
"id": 7,
"cashback_payment_methods": [],
"created_at": "2020-12-21T11:34:09.247183Z",
"updated_at": "2020-12-21T11:34:09.247203Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {},
"name": "Buy 2 মেজ্জান's Get 1",
"slug": "Buy-2-মেজ্জানs-Get-1-hfhxn",
"description": "Buy two get one with 40% discount and 60% cashback",
"image": "example.com",
"banner_image": "example.com",
"start_date": "2020-10-19T00:00:00Z",
"end_date": "2020-10-22T00:00:00Z",
"promotion_start_date": "2020-10-18T00:00:00Z",
"cashback": 60.0,
"cashback_claim_type": "backoff",
"claim_date": null,
"claim_backoff_value": 3,
"claim_backoff_unit": "day",
"allowed_payment_methods": [
"bkash_gateway"
],
"discount": 40.0,
"status": "inactive",
"terms_and_conditions": "some condition"
}
]
}
```
##### **UPDATE Campaign**
* ##### Description:
This api is used to retrieve all campaign data.
* ##### Endpoint: /campaigns/admin/campaign/Buy-2-মেজ্জানs-Get-1-hfhxn
* ##### Method: PTCH
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"status": "active",
"start_date": "2020-11-19T00:00:00Z",
"end_date": "2020-12-30T00:00:00Z",
"promotion_start_date": "2020-11-18T00:00:00Z"
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Status OK",
"data": {
"id": 7,
"cashback_payment_methods": [],
"created_at": "2020-12-21T11:34:09.247183Z",
"updated_at": "2020-12-21T11:56:59.789099Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {
"username": "kashfia",
"address": null,
"first_name": "Kashfia",
"last_name": "Akhter",
"profile_pic_url": null
},
"name": "Buy 2 মেজ্জান's Get 1",
"slug": "Buy-2-মেজ্জানs-Get-1-hfhxn",
"description": "Buy two get one with 40% discount and 60% cashback",
"image": "example.com",
"banner_image": "example.com",
"start_date": "2020-11-19T00:00:00Z",
"end_date": "2020-12-30T00:00:00Z",
"promotion_start_date": "2020-11-18T00:00:00Z",
"cashback": 60.0,
"cashback_claim_type": "backoff",
"claim_date": null,
"claim_backoff_value": 3,
"claim_backoff_unit": "day",
"allowed_payment_methods": [
"bkash_gateway"
],
"discount": 40.0,
"status": "active",
"terms_and_conditions": "some condition"
}
}
```
##### **DELETE Campaign**
* ##### Description:
This api is used to delete campaign on Admin.
* ##### Endpoint: /campaigns/admin/campaign/Buy-2-মেজ্জানs-Get-1-hfhxn
* ##### Method: DELETE
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
No body returned for response
}
```
* ##### Success Token : 204 No Content
##### **Create Campaign Member**
* ##### Description:
This api is used to enlist an existing restaurant against a campaign.
* ##### Endpoint: /campaigns/admin/campaign_member
* ##### Method: POST
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant": 7,
"campaign": 2
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Created",
"data": {
"id": 12,
"restaurant_details": {
"id": 7,
"name": "Regular",
"slug": "Regular-pbkhy",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/b0a31039c7ac-redvelvetcake-8-400x400.jpg"
},
"campaign_details": {
"id": 2,
"cashback_payment_methods": [
"evaly_pay",
"gift_code"
],
"created_at": "2020-12-08T09:10:03.626270Z",
"updated_at": "2020-12-15T07:14:59.903604Z",
"created_by": {
"address": null,
"username": "toma",
"last_name": null,
"first_name": null
},
"updated_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia"
},
"name": "Food Map Campaign",
"slug": "Food-Map-Campaign-gbqkh",
"description": "test test order",
"image": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/970e7a3bd8de-hly-nam-prik-horizontal.jpg",
"banner_image": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/c8f01ca08946-map_es_small.png",
"start_date": "2020-12-07T18:00:00Z",
"end_date": "2021-02-27T18:00:00Z",
"promotion_start_date": "2020-12-07T18:00:00Z",
"cashback": 300.0,
"cashback_claim_type": "immediate",
"claim_date": null,
"claim_backoff_value": 0,
"claim_backoff_unit": "day",
"allowed_payment_methods": [
"bkash_gateway",
"sslcommerz_gateway",
"evaly_pay",
"gift_code",
"nagad"
],
"discount": 50.0,
"status": "active",
"terms_and_conditions": "eyg \ngaeshdfgcnvb \nsehgh\nucvh"
},
"created_at": "2020-12-21T12:25:04.223893Z",
"updated_at": "2020-12-21T12:25:04.223910Z",
"created_by": {
"username": "kashfia",
"address": null,
"first_name": "Kashfia",
"last_name": "Akhter",
"profile_pic_url": null
},
"updated_by": {},
"status": "active",
"campaign": 2,
"restaurant": 7
}
}
```
##### **Get Campaign Member**
* ##### Description:
This api is used to retrieve campaign member data.
* ##### Endpoint: /campaigns/admin/campaign_member
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"meta_data": {
"count": 0,
"page_size": 12,
"next": null,
"previous": null
},
"data": []
}
```
##### **Update Campaign Member**
* ##### Description:
This api is used to update
* ##### Endpoint: /campaigns/admin/campaign_member/{restaurant id}
* ##### Method: PATCH
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
}
```
##### **Delete Campaign Member**
* ##### Description:
This api is used to update
* ##### Endpoint: /campaigns/admin/campaign_member/{restaurant id}
* ##### Method: DELETE
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
No body returned for response
}
```
* ##### Success Token : 204 No Content
##### **Create Campaign Item**
* ##### Description:
This api is used items of an enlisted restaurant against campaign.
* ##### Endpoint: /campaigns/admin/campaign_item
* ##### Method: POST
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"campaign_member": 11,
"item": 5
}
```
* ##### Response Body :
``` json=
{
}
```
##### **Get Campaign Item**
* ##### Description:
This api is used retrieve campaign
* ##### Endpoint: /campaigns/admin/campaign_item
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
}
```
##### **Update Campaign Item**
* ##### Description:
This api is used to update any campaign item. For that we need to input the campaign member and which item.
* ##### Endpoint: /campaigns/admin/campaign_item/9
* ##### Method: PATCH
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"campaign_member": 1,
"item": 1
}
```
* ##### Response Body :
``` json=
{
}
```
##### **Delete Campaign Item**
* ##### Description:
This api is used to delete any campaign item
* ##### Endpoint: /campaigns/admin/campaign_item/9
* ##### Method: PATCH
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
Success : 204 Not Found
}
```
## Analytics
Baseurl: http://api-dev.evaly.com.bd/efood-search
#### Admin Order Analytics
* ##### Description:
This api is used to show analytics of orders. The analytics consist of Total Orders, Total orders delivered, pending, accepted, picked_up, etc
* ##### Endpoint: /api/v1.0.0/analytics
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Status OK",
"data": {
"counts": {
"delivered": 0,
"picked_up": 0,
"accepted": 0,
"assigned": 0,
"confirmed": 0,
"placed": 0,
"pending": 0,
"canceled": 0
},
"total_order": 0,
"delivered_amount": 0.0,
"ordered_amount": 0.0,
"canceled_amount": 0.0,
"paid_with_cash": 0.0,
"paid_with_balance": 0.0
}
}
```
#### Merchant Order Analytics
* ##### Description:
This api is used to show analytics of orders of merchants. This helps merchants to track their order day wise.
* ##### Endpoint: /api/v1.0.0/merchant/analytics
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
Content-Type :
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
}
```
* ##### Response Body :
``` json=
{
"success": true,
"message": "Status OK",
"data": {
"counts": {
"delivered": 0,
"picked_up": 0,
"accepted": 0,
"assigned": 0,
"confirmed": 0,
"placed": 0,
"pending": 0,
"canceled": 0
},
"total_order": 0,
"delivered_amount": 0.0,
"ordered_amount": 0.0,
"canceled_amount": 0.0,
"paid_with_cash": 0.0,
"paid_with_balance": 0.0
}
} ```
## Excel Report
* ##### Description:
This api generates an excel report of order list. It includes all order information against an invoice, like customer information, order details like discount, sd amount, delivery method, amount etc.
* ##### Endpoint: /orders/admin/reports
* ##### Method: POST
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"start_datetime": "2020-08-30",
"end_datetime": "2020-08-30",
"to": "gmail.com",
"status": "placed",
"payment_method": "cod"
}
```
* ##### Response Body :
```json=
{
"success": false,
"message": "You do not have permission to perform this action."
}
```
## Search
*Baseurl: http://api-dev.evaly.com.bd/efood-search*
#### **Search Restaurant**
* ##### Description:
This api searches restaurant on client side.
* ##### Endpoint: /api/v1.0.0/users/restaurants
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"meta_data": {
"count": 0,
"page_size": 10,
"next": null,
"previous": null
},
"data": []
}
```
#### **Restaurant Details**
* ##### Description:
This api gives details of a restaurant.
* ##### Endpoint: /api/v1.0.0/public/restaurants/Regular-pbkhy
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"data": {
"is_open_now": true,
"cuisines": [
{
"id": 1,
"name": "Fast food"
},
{
"id": 2,
"name": "Italian"
}
],
"name": "Regular",
"slug": "Regular-pbkhy",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"latitude": 23.7547394,
"longitude": 90.3757636,
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/b0a31039c7ac-redvelvetcake-8-400x400.jpg",
"discount_type": "percentage",
"discount": 0.0,
"discount_cap": 0.0,
"tax": 0.0,
"banner": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/7f04bbf1a206-top-25-functional-foods-for-healh-with-nutrition-key-1000x500.jpg",
"delivery_fee": 40.0,
"review_summary": {
"total_ratings": 0,
"avg_rating": 0,
"star_5": 0,
"star_4": 0,
"star_3": 0,
"star_2": 0,
"star_1": 0
}
}
}
```
#### **Search Orders**
* ##### Description:
This api searches order of an user on Order History.
* ##### Endpoint: /api/v1.0.0/users/orders
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"meta_data": {
"count": 0,
"page_size": 10,
"next": null,
"previous": null
},
"data": []
}
```
#### **Search Items**
* ##### Description:
This api searches items on client end.
* ##### Endpoint: /api/v1.0.0/users/items
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"meta_data": {
"count": 0,
"page_size": 10,
"next": null,
"previous": null
},
"data": []
}
```
#### **Admin Search Items**
* ##### Description:
This api searches items on client end.
* ##### Endpoint: https://api-dev.evaly.com.bd/efood/api/v1.0.0/search/admin/items
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"meta_data": {
"count": 30,
"page_size": 12,
"next": 2,
"previous": null
},
"data": [
{
"id": 1,
"name": "French fries",
"restaurant": {
"id": 1,
"name": "Mr. Restaurant",
"slug": "mr.-restaurant-psoeg",
"latitude": 23.7561898,
"longitude": 90.3755722,
"location": {
"lat": 23.7561898,
"lon": 90.3755722
},
"is_active": true,
"schedules": [
{
"opening": {
"day": 1,
"time": 39600
},
"closing": {
"day": 1,
"time": 75600
}
},
{
"opening": {
"day": 2,
"time": 39600
},
"closing": {
"day": 2,
"time": 75600
}
},
{
"opening": {
"day": 3,
"time": 39600
},
"closing": {
"day": 3,
"time": 75600
}
},
{
"opening": {
"day": 4,
"time": 39600
},
"closing": {
"day": 4,
"time": 75600
}
},
{
"opening": {
"day": 5,
"time": 39600
},
"closing": {
"day": 5,
"time": 75600
}
},
{
"opening": {
"day": 6,
"time": 39600
},
"closing": {
"day": 6,
"time": 75600
}
},
{
"opening": {
"day": 7,
"time": 36000
},
"closing": {
"day": 7,
"time": 82800
}
}
],
"discount": 10.0,
"address": "Mirpur Rd, Dhaka 1207, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/64d654fabd20-c8c498db180b87d44a31954e739a1d79-bar-food-food-food.jpg",
"banner": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/bf4d2d01dd6e-reversed_earth_map_1000x500.jpg",
"phone": "1911111111",
"discount_type": "percentage",
"discount_cap": 500.0,
"tax": 5.0,
"sd": 0.0,
"sd_type": "not_applicable",
"status": "active",
"search_score": 80,
"owner_username": "01911111111",
"owner": {
"username": "01911111111",
"first_name": "Kashfia",
"last_name": "User",
"is_active": true
},
"cuisines": [
{
"id": 1,
"name": "Fast food"
}
],
"created_at": "2020-11-25T10:57:53.419915+00:00",
"updated_at": "2020-12-21T12:42:19.713354+00:00",
"review_summary": {
"star_1": 0,
"star_2": 0,
"star_3": 0,
"star_4": 2,
"star_5": 1,
"avg_rating": 4.33,
"total_ratings": 3
},
"in_campaign": true,
"campaign_data": {
"id": 2,
"name": "Food Map Campaign",
"slug": "Food-Map-Campaign-gbqkh",
"start_date": "2020-12-07T18:00:00+00:00",
"end_date": "2021-02-27T18:00:00+00:00",
"cashback": 300.0,
"discount": 50.0,
"allowed_payment_methods": [
"bkash_gateway",
"sslcommerz_gateway",
"evaly_pay",
"gift_code",
"nagad"
],
"campaign_member_status": "active"
},
"delivery_fee": 40.0
},
"cuisine": {
"id": 1,
"name": "Fast food"
},
"image": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/0bb33ad504e1-c8c498db180b87d44a31954e739a1d79-bar-food-food-food.jpg",
"price": 20.0,
"is_variable_price": false,
"ingredients": null,
"addons_required": [],
"addons_optional": [],
"variants": [
{
"id": 1,
"attribute_name": "asfds",
"attribute_value": "123",
"price": 20.0
},
{
"id": 2,
"attribute_name": "asfds",
"attribute_value": "123",
"price": 20.0
}
],
"created_at": "2020-11-25T11:47:36.143381+00:00",
"updated_at": "2020-12-17T08:58:39.912030+00:00",
"status": "active",
"has_sd": false
},
}
```
#### **Search Orders**
* ##### Description:
This api searches order of an user on Order History.
* ##### Endpoint: /api/v1.0.0/users/orders
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"meta_data": {
"count": 0,
"page_size": 10,
"next": null,
"previous": null
},
"data": []
}
```
#### **Get Items with cuisine by slug**
* ##### Description:
This api shows all the items under a cuisine, when searched with restaurant slug.
* ##### Endpoint: /api/v1.0.0/users/items/pinewood-dwmuw
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"data": []
}
```
#### **Admin Restaurant Search**
* ##### Description:
This api shows all the items under a cuisine, when searched with restaurant slug.
* ##### Endpoint: https://api-dev.evaly.com.bd/efood/api/v1.0.0/search/admin/restaurants
* ##### Method: GET
* ##### Headers:
Authorization : < admin access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"meta_data": {
"count": 13,
"page_size": 12,
"next": 2,
"previous": null
},
"data": [
{
"id": "13",
"name": "Cashback Restaurant",
"slug": "Cashback-Restaurant-jhlpi",
"address": "House #8 1st Floor, Road: 14, Dhaka 1209, Bangladesh",
"latitude": 23.754266,
"longitude": 90.3748885,
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/177205c644c4-zarda.jpg",
"banner": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/7b02a6fbe4d1-gorsel_1000x500px-15_09fxflzc.jpg",
"phone": "1800000000",
"discount_type": "percentage",
"discount": 0.0,
"status": "active",
"search_score": 6,
"is_active": true,
"owner_username": "01800000000",
"owner": {
"username": "01800000000",
"first_name": "hchci",
"last_name": "hchc7i",
"is_active": true
},
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"cuisines": [
{
"id": 2,
"cuisine__name": "Italian"
}
],
"schedules": [
{
"opening": {
"day": 3,
"time": 39600
},
"closing": {
"day": 3,
"time": 75600
}
},
{
"opening": {
"day": 4,
"time": 39600
},
"closing": {
"day": 4,
"time": 75600
}
},
{
"opening": {
"day": 5,
"time": 39600
},
"closing": {
"day": 5,
"time": 75600
}
}
],
"created_at": "2020-12-15T11:10:42.691215+00:00",
"updated_at": "2020-12-21T13:34:50.649606+00:00",
"delivery_fee": 40.0,
"sd_type": "not_applicable",
"sd": 0.0
}
}
```
#### **Merchant Search Items**
* ##### Description:
This api searches item on merchant admin.
* ##### Endpoint: https://api-dev.evaly.com.bd/efood/api/v1.0.0/search/merchant/items
* ##### Method: GET
* ##### Headers:
Authorization : < merchant access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
{
"success": true,
"meta_data": {
"count": 9,
"page_size": 12,
"next": null,
"previous": null
},
"data": [
{
"id": 11,
"name": "Tree Cookie",
"restaurant": {
"id": 9,
"name": "Another T",
"slug": "Another-ieato",
"latitude": 23.7547394,
"longitude": 90.3757636,
"location": {
"lat": 23.7547394,
"lon": 90.3757636
},
"is_active": true,
"schedules": [
{
"opening": {
"day": 1,
"time": 39600
},
"closing": {
"day": 1,
"time": 75600
}
},
{
"opening": {
"day": 2,
"time": 39600
},
"closing": {
"day": 2,
"time": 75600
}
},
{
"opening": {
"day": 3,
"time": 39600
},
"closing": {
"day": 3,
"time": 75600
}
},
{
"opening": {
"day": 5,
"time": 39600
},
"closing": {
"day": 5,
"time": 75600
}
},
{
"opening": {
"day": 4,
"time": 39600
},
"closing": {
"day": 4,
"time": 75600
}
},
{
"opening": {
"day": 6,
"time": 39600
},
"closing": {
"day": 6,
"time": 75600
}
}
],
"discount": 20.0,
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"banner": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fc805a15ffc2-peartart-1000x500px.jpg",
"phone": "01800000000",
"discount_type": "percentage",
"discount_cap": 500.0,
"tax": 0.0,
"sd": 0.0,
"sd_type": "not_applicable",
"status": "active",
"search_score": 22,
"owner_username": "01800000000",
"owner": {
"username": "01800000000",
"first_name": "hchci",
"last_name": "hchc7i",
"is_active": true
},
"cuisines": [
{
"id": 11,
"name": "Fast food"
}
],
"created_at": "2020-12-15T09:09:46.411025+00:00",
"updated_at": "2020-12-21T12:41:40.542172+00:00",
"review_summary": {
"total_ratings": 0,
"avg_rating": 0,
"star_5": 0,
"star_4": 0,
"star_3": 0,
"star_2": 0,
"star_1": 0
},
"in_campaign": true,
"campaign_data": {
"id": 7,
"name": "Buy 2 মেজ্জান's Get 1",
"slug": "Buy-2-মেজ্জানs-Get-1-hfhxn",
"start_date": "2020-11-19T00:00:00+00:00",
"end_date": "2020-12-30T00:00:00+00:00",
"cashback": 60.0,
"discount": 40.0,
"allowed_payment_methods": [
"bkash_gateway"
],
"campaign_member_status": "active"
},
"delivery_fee": 40.0
},
"cuisine": {
"id": 1,
"name": "Fast food"
},
"image": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/b8bd16d44440-christmas-cookies.jpg",
"price": 340.0,
"is_variable_price": false,
"ingredients": null,
"addons_required": [],
"addons_optional": [],
"variants": [],
"created_at": "2020-12-15T09:10:38.735669+00:00",
"updated_at": "2020-12-15T09:10:38.735693+00:00",
"status": "inactive",
"has_sd": false
},
}
```
## Restaurants
### System
#### **Order Count Reset**
* ##### Description:
This api is run under a cron to reset merchant's order serial number every night. So that from next day the serial number starts from 1.
* ##### Endpoint: https://api-dev.evaly.com.bd/efood/api/v1.0.0/restaurants/system/order-count-reset
* ##### Method: GET
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Restaurant Current order serial reset started"
}
```
### Merchant
#### **Merchant create Restaurant**
*Baseurl: https://api-dev.evaly.com.bd/efood/api/v1.0.0*
* ##### Description:
This api is run under a cron to reset merchant's order serial number every night. So that from next day the serial number starts from 1.
* ##### Endpoint: /restaurants/merchant/restaurant
* ##### Method: GET
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"name": "Dominos Pizza",
"address": "Some address",
"latitude": 23.8099057,
"longitude": 90.3705373
}
```
* ##### Response Body :
```json=
{
"success": true,
"meta_data": {
"count": 6,
"page_size": 12,
"next": null,
"previous": null
},
"data": [
{
"id": 9,
"owner": {
"username": "01800000000",
"address": null,
"first_name": "hchci",
"last_name": "hchc7i",
"profile_pic_url": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/5f0fe6f5edba-image.jpg"
},
"created_at": "2020-12-15T09:09:46.411025Z",
"updated_at": "2020-12-21T12:41:40.542172Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"slug": "Another-ieato",
"name": "Another T",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"latitude": 23.7547394,
"longitude": 90.3757636,
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"banner": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fc805a15ffc2-peartart-1000x500px.jpg",
"phone": "01800000000",
"discount_type": "percentage",
"discount": 20.0,
"discount_cap": 500.0,
"tax": 0.0,
"status": "active",
"search_score": 22,
"is_active": true,
"delivery_fee": 40.0,
"commission": 0.0,
"sd_type": "not_applicable",
"sd": 0.0,
"in_campaign": true,
"delivery_methods": [
"home_delivery",
"takeaway",
"dine_in"
],
"total_review_count": 0,
"total_avg_rating": 0.0,
"review_summary": {},
"current_order_serial": 0
},
}
```
#### **Merchant get Restaurant**
* ##### Description:
This api calls restaurant Details against the merchant.
* ##### Endpoint: /restaurants/merchant/restaurant
* ##### Method: GET
* ##### Headers:
Authorization : < merchant access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"meta_data": {
"count": 6,
"page_size": 12,
"next": null,
"previous": null
},
"data": [
{
"id": 9,
"owner": {
"username": "01800000000",
"address": null,
"first_name": "hchci",
"last_name": "hchc7i",
"profile_pic_url": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/5f0fe6f5edba-image.jpg"
},
"created_at": "2020-12-15T09:09:46.411025Z",
"updated_at": "2020-12-21T12:41:40.542172Z",
"created_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"updated_by": {
"address": null,
"username": "kashfia",
"last_name": "Akhter",
"first_name": "Kashfia",
"profile_pic_url": null
},
"slug": "Another-ieato",
"name": "Another T",
"address": "Next to Rapa Plaza, Sobahanbagh, Main Road Dhanmondi, Dhaka 1209, Bangladesh",
"latitude": 23.7547394,
"longitude": 90.3757636,
"logo": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fd806d0d9d7c-christmas-cookies.jpg",
"banner": "https://s3-ap-southeast-1.amazonaws.com/media.evaly.com.bd/media/images/fc805a15ffc2-peartart-1000x500px.jpg",
"phone": "01800000000",
"discount_type": "percentage",
"discount": 20.0,
"discount_cap": 500.0,
"tax": 0.0,
"status": "active",
"search_score": 22,
"is_active": true,
"delivery_fee": 40.0,
"commission": 0.0,
"sd_type": "not_applicable",
"sd": 0.0,
"in_campaign": true,
"delivery_methods": [
"home_delivery",
"takeaway",
"dine_in"
],
"total_review_count": 0,
"total_avg_rating": 0.0,
"review_summary": {},
"current_order_serial": 0
},
}
```
### Users
Baseurl: https://api-dev.evaly.com.bd/efood/api/v1.0.0
This section shows what can user do against a restaurant.
#### **Add to favourite**
* ##### Description:
This api adds restaurant in favourite restauant list
* ##### Endpoint: /restaurants/system/order-count-reset
* ##### Method: POST
* ##### Headers:
Authorization : < user access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant": "Delight-sezfam"
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Added as a favorite restaurant"
}
```
If already added to favorite list
```json=
{
"success": true,
"message": "Added as a favorite restaurant"
}
```
#### **Get Restaurant Details**
* ##### Description:
This api adds restaurant in favourite restauant list
* ##### Endpoint: https://api-dev.evaly.com.bd/efood/api/v1.0.0/restaurants/system/order-count-reset
* ##### Method: POST
* ##### Headers:
Authorization : < user access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"restaurant": "Delight-sezfam"
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Added as a favorite restaurant"
}
```
#### **Remove from favourite**
* ##### Description:
This api adds restaurant in favourite restauant list
* ##### Endpoint: /restaurants/users/favorite/5
* ##### Method: PATCH
* ##### Headers:
Authorization : < user access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
"status": "archived"
}
```
* ##### Response Body :
```json=
{
}
```
#### **Get list of favourites**
* ##### Description:
This api gives favourite restauant list
* ##### Endpoint: http://api-dev.evaly.com.bd/efood-search /api/v1.0.0/users/favorite-restaurants
* ##### Method: GET
* ##### Headers:
Authorization : < user access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"meta_data": {
"count": 0,
"page_size": 10,
"next": null,
"previous": null
},
"data": []
}
```
#### **Is favourite Restaurant**
* ##### Description:
This api checks if the restaurant is favourite
* ##### Endpoint: http://api-dev.evaly.com.bd/efood-search /api/v1.0.0/users/favorite-restaurants/star-kabab-pnabu
* ##### Method: GET
* ##### Headers:
Authorization : < user access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": true,
"message": "Status OK",
"data": {}
}
```
### Admin
Baseurl: https://api-dev.evaly.com.bd/efood/api/v1.0.0
This section shows activities of Admin against a restaurant.
#### **Create Operational Hours**
* ##### Description:
This api creates operational hour of restaurant.
* ##### Endpoint: /restaurants/admin/schedules
* ##### Method: POST
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
```json=
{
"restaurant": "star-kabab-pnabu",
"day": "Saturday",
"opening_time": "00:00",
"closing_time": "23:59"
}
```
* ##### Response Body :
```json=
{
"success": false,
"message": "cannot find restaurant"
}
```
# Promo Service
*Baseurl for promo service:* https://api.evaly.com.bd/efood-promo
#### **Create Promo**
* ##### Description:
This api creates a new promo.
* ##### Endpoint: /api/v1.0.0/promos
* ##### Method: POST
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
``` json=
{
N/A
}
```
* ##### Response Body :
```json=
{
"success": false,
"message": "Restaurant matching query does not exist."
}
```
#### **Get Promo**
* ##### Description:
This api calls the promo.
* ##### Endpoint: /api/v1.0.0/promos/5f9a83f54bcfd27bd60903c0
* ##### Method: GET
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body : N/A
* ##### Response Body :
```json=
{
}
```
#### **Get All Promo**
* ##### Description:
This api is used to get all promo list.
* ##### Endpoint: /api/v1.0.0/promos
* ##### Method: GET
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body : N/A
* ##### Response Body :
```json=
{
}
```
#### **Update Promo**
* ##### Description:
Promo can be updated using this api, only if no user is enlisted. As once user is enlisted notification is sent to them that instant.
* ##### Endpoint: /api/v1.0.0/promos/5f9e527f38148d6c3f955a99
* ##### Method: PUT
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
```json=
{
"code": "Food20",
"type": "delivery",
"description": "get flat 10tk",
"max_use_per_user": 1,
"usage_limit": 1,
"devices": null,
"service": "efood",
"max_value": null,
"min_order_amount": 10,
"total_usages": 0,
"start_at": "2020-11-02T18:00:00.000Z",
"end_at": "2020-11-05T18:00:00.000Z"
}
```
* ##### Response Body :
#### **Create Promo User**
* ##### Description:
This api is used to create Promos
* ##### Endpoint: /api/v1.0.0/promo/users
* ##### Method: POST
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
```json=
{
"code": "bonus100",
"username": "01310101010"
}
```
* ##### Response Body :
```json=
{{
"success": true,
"message": "Created",
"data": {
"promo": {
"_id": "5f9cf70b38148d6c3f955a90",
"code": "FOOD",
"type": "total",
"description": "Get Flat Tk 50 OFF",
"discount_type": "flat",
"discount_value": 50.0,
"max_use_per_user": 2,
"usage_limit": 2,
"devices": null,
"service": "efood",
"max_value": null,
"misc": null,
"total_usages": 1,
"start_at": "2020-10-29T18:00:00.000Z",
"end_at": "2020-10-31T18:00:00.000Z",
"edit": false,
"created_by": "kashfia",
"updated_by": "kashfia",
"created_at": "2020-10-31T05:32:59.017778+06:00",
"updated_at": "2020-10-31T05:32:59.017795+06:00"
},
"promo_code": "FOOD",
"username": "123456",
"created_by": "01932062088",
"updated_by": "01932062088",
"created_at": "2020-11-01T06:09:07.801905+06:00",
"updated_at": "2020-11-01T06:09:07.801923+06:00",
"_id": "5f9e510338148d6c3f955a98"
}
}
```
```Message``` field contains “created” or error log for unsuccessful requests.
```Data``` field contains the promo type, description and all necessary details.
#### **Bulk Promo User**
* ##### Description:
This api is used to create users against a Promo in bulk.
* ##### Endpoint: /api/v1.0.0/promo/bulk/users
* ##### Method: POST
Multipart
* ##### Headers:
Authorization : < your access token here >
Content-Type : multipart/form-data
* ##### Query Parameters : N/A
* ##### Request Body :
#### **Get All Users Promo**
* ##### Description:
This api is used to get all promo user list.
* ##### Endpoint: /api/v1.0.0/promo/users?search=bonus100
* ##### Method: GET
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body : N/A
* ##### Response Body :
```json=
{
}
```
#### **All User Notification**
* ##### Description:
This api is used to get all promo user list.
* ##### Endpoint: /api/v1.0.0/promos/bulk-notification/5f9fff8fce9783c411e320c0
* ##### Method: POST
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
```json=
{
}
```
* ##### Response Body :
```json=
{
}
```
#### **Delete Promo**
* ##### Description:
This api is used to get all promo user list.
* ##### Endpoint: /api/v1.0.0/promos/5f9ff9e9ce9783c411e320be
* ##### Method: DEL
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body : N/A
* ##### Response Body :
```json=
{
}
```
#### **User Attach Promo**
#### Create Promo User
* ##### Description:
This api is used to get all promo user list.
* ##### Endpoint: /api/v1.0.0/users/attach/promos
* ##### Method: POST
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body :
```json=
{
"code": "bonus100",
"username": "01683193505",
"auto_attach": true
}
```
* ##### Response Body :
```json=
{
}
```
#### Get All Promo User
* ##### Description:
This api is used to get all promo user list attached against a promo.
* ##### Endpoint: /api/v1.0.0/users/attach/promos
* ##### Method: GET
* ##### Headers:
Authorization : < your access token here >
* ##### Query Parameters : N/A
* ##### Request Body : N/A
* ##### Response Body :
```json=
{
}
```