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

  1. API Path: api/orders/
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/orders/getProcessOrder
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/orders/getOrders
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/orders/updateOrderStatus
  2. Method: PUT
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/orders/getOrderStatus
  2. Method: GET
  3. Description: This is a protected route which gets the all order details counts.
  4. 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

  1. API Path: api/orders/getOrderBarDetails
  2. Method: GET
  3. Description: This is a protected route which gets the all order pacled and avg order place in month.
  4. 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

  1. API Path: api/orders/getAllOrder
  2. Method: GET
    1. Description: This is a protected route in which you get the all order details
  3. 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

results matching ""

    No results matching ""