Routes - Order
File Name : order.js
File Path : /server/routes/order.js
Order route contains getOrder, getProcessing order, getDriverOrder and updateOrderStatus . These functionalities are included in Order Controller.
Get Order Route
- API Path: api/orders/
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the current order and past order details to user.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Driver Processing Order Route
- API Path: api/orders/getProcessOrder
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the Pending, Processing, Received, Started, Picked order details to driver.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Driver Delivered Order Route
- API Path: api/orders/getOrders
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the Delivered order details to driver.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Update Order Status Route
- API Path: api/orders/updateOrderStatus
- Method: PUT
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
- Type: Object
Name Type orderId string driverId string status string - Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the updated Order status to driver.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Get All Order Status Count Route For Admin
- API Path: api/orders/getOrderStatus
- Method: GET
- Description: This is a protected route which gets the all order details counts.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
- Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the order status counts.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data object
Get All Order placed in year Route For Admin
- API Path: api/orders/getOrderBarDetails
- Method: GET
- Description: This is a protected route which gets the all order pacled and avg order place in month.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
- Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the order places in a current year.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Get All Order placed For Admin
- API Path: api/orders/getAllOrder
- Method: GET
- Description: This is a protected route in which you get the all order details
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name In Type pageNo req.query number
- Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the all order placed .
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array