Routes : Order
File Name : order.js
File Path : server/routes/api/order.js
Contains route which create, update, view and delete the order. These functionalities are included in order Controller.
Post Orders Route
1.API Path:
api/orders/
2.Method:
POST
3.Description:
Message route is used to create a new orders.
4.Parameters:
FieldName: req,
Type: Object,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Name | Type | Required |
---|---|---|
productDetails | Array | True |
user | ObjectId | True |
loyalty | Number | True |
shippingAddress | Object | True |
restaurantName | String | True |
locationName | String | True |
status | String | True |
month | Number | True |
year | Number | True |
Response:
Returns an object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with a newly created order.
Get Orders Route
1.API Path:
api/orders/user/:id
2.Method:
GET
3.Description:
Order route is used to get all orders of particular user.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders of particular user.
Get Orders Route
1.API Path:
api/orders/userorder/history/
2.Method:
GET
3.Description:
Order route is used to get all orders history of particular user.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders history of particular user.
Get Orders Route
1.API Path:
api/orders/userorder/pending/
2.Method:
GET
3.Description:
Order route is used to get all orders history which are pending of particular user.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders of particular user which are pending.
Get Orders Route
1.API Path:
api/orders/dashboard/data/:id
2.Method:
GET
3.Description:
Order route is used to get dashboard of particular reataurent.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
StatusCode | Number |
Data | Object |
Description:Data is an Object with dashboard of particular restaurent.
Get Orders Route
1.API Path:
api/orders/customer/restaurant/:id
2.Method:
GET
3.Description:
Order route is used to get customer information of particular restaurent.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(restaurentId)
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with user information of particular restaurent.
Get Orders Route
1.API Path:
api/orders/customer/location/:id
2.Method:
GET
3.Description:
Order route is used to get customer information of particular location.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(locationId)
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all users information of particular restaurent.
Get Orders Route
1.API Path:
api/orders/location/:id
2.Method:
GET
3.Description:
Message route is used to get all orders based on particular locationId.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(locationId)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all users information of particular locationId.
Get Orders Route
1.API Path:
api/orders/delivered/location/:id
2.Method:
GET
3.Description:
Message route is used to get all orders based on particular locationId.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(locationId)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all users information of particular locationId which orders are delivered.
Get Orders Route
1.API Path:
api/orders/restaurant/:id
2.Method:
GET
3.Description:
Message route is used to get all orders based on particular restaurentId.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(restaurentId),
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Array with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders information of particular restaurentId.
Get Orders Route
1.API Path:
api/orders/:id
2.Method:
GET
3.Description:
Message route is used to get particular order.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with a particular order.
Post Orders Route
1.API Path:
api/orders/
2.Method:
POST
3.Description:
Order route is used to create a new order.
4.Parameters:
FieldName: req,
Type: Object,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with a newly created order.
Update Orders Route
1.API Path:
api/orders/:id
2.Method:
PUT
3.Description:
Order route is used to update an particular order.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with updated particular order.
Delete Orders Route
1.API Path:
api/orders/:id
2.Method:
DELETE
3.Description:
Order route is used to delete an particular order.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | blank Object |
Description:Data is an blank Object.
Post Orders Route
1.API Path:
api/orders/csv/restaurant/:id
2.Method:
POST
3.Description:
Order route is used to get orderData customized for days.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(restaurentId),
id: req.body.upperLimit,
id: req.body.lowerLimit,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with order.
Get Orders Route
1.API Path:
api/orders/one/day/:id
2.Method:
GET
3.Description:
Order route is used to get orderData in oneday.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(restaurentId),
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with order on particular day.
Post Orders Route
1.API Path:
api/orders/search/:id
2.Method:
POST
3.Description:
Order route is used to search an order data.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(restaurentId),
name: req.body.name,
contactNumber: req.body.contactNumber,
status: req.body.status,
upperlimit: req.params.upperlimit,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with order details.
Post Orders Route
1.API Path:
api/orders/search/order/bylocation/:id
2.Method:
POST
3.Description:
Order route is used to search an order data ob location and status basis .
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(restaurentId),
status: req.body.status,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:{ }
Type: Object
Name | Type |
---|---|
statusCode | Number |
Data | Object |
Description:Data is an Object with order details.
Get Orders Route
1.API Path:
api/orders/delivery/list/:id
2.Method:
GET
3.Description:
Order route is used to get all orders that already delivered or that has to deliver by delivery guy.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(deliveryby),
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with order details that deliveryguy delivered and that has to deliver.
Get Orders Route
1.API Path:
api/orders/pending/:id
2.Method:
GET
3.Description:
Order route is used to get all orders that are pending.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(deliveryby),
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with order details that are pending.
Post Orders Route
1.API Path:
api/orders/delivered/:id
2.Method:
GET
3.Description:
Order route is used to get all orders that are delivered by deliveryguy.
4.Parameters:
FieldName: req,
Type: Object,
id: req.params.id(deliveryby),
lowerLimit = req.body.lowerLimit;
upperLimit = req.body.upperLimit,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with order details that are delivered by delivery guy.
Post Orders Route
1.API Path:
api/orders/custom
2.Method:
GET
3.Description:
Order route is used to change JSON data which has to change in csv at client side.
4.Parameters:
FieldName: req,
Type: Object,
location: req.body.location,
flag: req.body.flag,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
StatusCode | Number |
Data | Array |
Description:Data is an Array with order details that are changed to CSV format.
Get Orders Route
1.API Path:
api/orders/all/show/:id
2.Method:
GET
3.Description:
Order route is used to get information on basis of day,month,year by delivery guy.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(deliverygy)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with order details based on day,month,year by particular delivery guy.
Get Orders Route
1.API Path:
api/orders/and/withdraw/:id
2.Method:
GET
3.Description:
Order route is used to get seven days orders and withdraw of a seller.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(deliverygy)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with seven days order details and withdraw of a seller.
Get Orders Route
1.API Path:
api/orders/amount/count
2.Method:
GET
3.Description:
Order route is used to get all sellers orders and orders count of a week in decending order.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(deliverygy)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all sellers orders and orders count of a week in decending order.
Post Orders Route
1.API Path:
api/orders/search
2.Method:
GET
3.Description:
Order route is used to get order by searching locationID, order status, customer name.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(locationId)
status: req.params.status
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders by locationId,status and customer name.
Get Orders Route
1.API Path:
api/orders/restaurant/info/:id
2.Method:
GET
3.Description:
Order route is used to get all orders based on reataurentId.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(restaurentId)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders based on restaurentId.
Get Orders Route
1.API Path:
api/orders/location/info/:id
2.Method:
GET
3.Description:
Order route is used to get all orders based on locationId.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(locationId)
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders based on locationId.
Get Orders Route
1.API Path:
api/orders/restaurant/:id/:lowerlimit/:upperlimit
2.Method:
GET
3.Description:
Order route is used to get all orders based on restaurentId between two days.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(restaurentId)
lowerlimit: req.params.lowerlimit,
upperlimit: req.params.upperlimit
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array
Name | Type |
---|---|
statusCode | Number |
Data | Array |
Description:Data is an Array with all orders based on restaurentId between two days.
Get Orders Route
1.API Path:
api/orders/restaurant/:id/:lowerlimit/:upperlimit
2.Method:
GET
3.Description:
Order route is used to get all orders based on restaurentId between two days.
4.Parameters:
FieldName: req,
Type: Object,
id:req.params.id(restaurentId)
lowerlimit: req.params.lowerlimit,
upperlimit: req.params.upperlimit
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the order.
Response:
Returns an Object with properties: Data.
Http Code:200
Data:[ ]
Type: Array