# Returns

## Order object array `Array`

Array of queried order objects with all available details

### Child attributes of the queried order details object

> ***
>
> orderId `Integer`
>
> Unique identifier for this order
>
> ***
>
> orderNumber `String`
>
> Order reference of customer platform
>
> ***
>
> companyId `Integer`
>
> Identifier of the company to which this order belong
>
> ***
>
> orderItem `String`
>
> Order items Json string, holding order info
>
> ***
>
> accepted `Boolean`
>
> Boolean value to indicate if the order is accepted
>
> ***
>
> placementTime `String`
>
> Order placement time (the sortable format)
>
> ***
>
> requestedPickupTime `String`
>
> Requested order pickup time (the sortable format)
>
> ***
>
> requestedDeliveryTime `String`
>
> Requested order delivery time (the sortable format)
>
> ***
>
> assignedTime `String`
>
> Carrier Assigned time (the sortable format)
>
> ***
>
> startTime `String`
>
> Starting time of the order of the carrier (the sortable format)
>
> ***
>
> pickedupTime `String`
>
> Picked up time for the order of the carrier (the sortable format)
>
> ***
>
> arrivedTime `String`
>
> Arrival time for the order of the carrier (the sortable format)
>
> ***
>
> deliveryTime `String`
>
> Delivery Time for the order (the sortable format)
>
> ***
>
> failedDeliveryTime `String`
>
> Failed Delivery time for the order (if failed) (the sortable format)
>
> ***
>
> deliveryNote `String`
>
> Delivery note for the order
>
> ***
>
> deliveryInstruction `String`
>
> Delivery Instruction for the order.
>
> ***
>
> dispatcherNote `String`
>
> Note form the dispatcher
>
> ***
>
> paymentMethod `String`
>
> Payment Method
>
> ***
>
> orderSource `String`
>
> Order Source for the order
>
> ***
>
> incomplete `Boolean`
>
> Indication, if the order is incomplete
>
> ***
>
> orderTotal `Double`
>
> Total payable amount for the order
>
> ***
>
> deliveryFee `Double`
>
> Delivery Fee for the order
>
> ***
>
> tip `Double`
>
> Tip amount for the order
>
> ***
>
> discount `Double`
>
> Discount amount for the order
>
> ***
>
> tax `Double`
>
> Tax amount for the order
>
> ***
>
> driverPayment `Double`
>
> Driver payment for the order
>
> ***
>
> distance `Double`
>
> Calculated distance between Pickup and Delivery address
>
> ***
>
> carrier `Object`
>
> Carrier details info
>
> ***
>
> pickup `Object`
>
> Pickup details info
>
> ***
>
> delivery `Object`
>
> Delivery details info
>
> ***
>
> status `String`
>
> Current Status of the order

## Supported Status Enum values

| Supported Status Enum values |
| --- |
| ACTIVE |
| NOT_ASSIGNED |
| NOT_ACCEPTED |
| NOT_STARTED_YET |
| STARTED |
| PICKED_UP |
| READY_TO_DELIVER |
| ALREADY_DELIVERED |
| FAILED_DELIVERY |
| INCOMPLETE |

*Note: ACTIVE orders are those which are neither ALREADY_DELIVERED nor FAILED_DELIVERY nor INCOMPLETE*

`Note: All datetimes are in UTC ISO format`

### Query Parameters

- **startTime**

- `date-time`
  - Defaults to `2020-01-01T00:00:00Z`
  - Starting time for the query.

- **endTime**

- `date-time`
  - Defaults to `2021-04-11T23:59:59Z`
  - Ending time for the query.

- **orderStatus**

- `string`
  - Defaults to `ALREADY_DELIVERED`
  - Order status from the supported status types.

- **startCursor**

- `int32`
  - Defaults to `1`
  - Starting pointer of the retrieved order list.

- **endCursor**

- `int32`
  - Defaults to `3`
  - Ending pointer of the retrieved order list.

### Example Response

```
[
  {
    "orderId": 2413471,
    "orderNumber": "98",
    "companyId": 1199,
    "orderItem": "[{unitPrice:10.0,quantity:1,name:Box}]",
    "accepted": true,
    "placementTime": "2021-04-08T17:23:21Z",
    "requestedPickupTime": "2020-03-20T11:35:19Z",
    "requestedDeliveryTime": "2020-03-20T12:05:19Z",
    "assignedTime": "2021-04-08T20:14:31Z",
    "startTime": "2021-04-08T20:14:47Z",
    "pickedupTime": "2021-04-08T20:14:49Z",
    "arrivedTime": "2021-04-08T20:14:50Z",
    "deliveryTime": "2021-04-08T20:14:52Z",
    "failedDeliveryTime": null,
    "deliveryNote": "O",
    "deliveryInstruction": null,
    "dispatcherNote": null,
    "paymentMethod": null,
    "orderSource": "",
    "additionalId": "",
    "incomplete": false,
    "orderTotal": 10,
    "deliveryFee": 0,
    "tip": 0,
    "discount": 0,
    "tax": 0,
    "driverPayment": 0,
    "distance": 0.883786088220417,
    "carrier": {
      "id": 2501,
      "name": "Mark",
      "phone": "0124121211",
      "email": "mark12@gmail.com",
      "status": "0",
      "vehiclePlateNumber": "",
      "vehicleDescription": "",
      "note": "",
      "imageUrl": "https://s3-us-west-2.amazonaws.com/qt.com.dashboard.profile.driver/621c3825230247a8bbab6dc9a20431ce.jpg",
      "partner": "None"
    },
    "pickup": {
      "id": 191101,
      "name": "XYZ Delivery",
      "address": "Seattle, WA, USA",
      "formattedAddress": "Seattle, WA, USA",
      "phone": "+11121212121",
      "lat": 47.6062095,
      "lng": -122.3320708
    },
    "delivery": {
      "id": 66561,
      "name": "Jonathan Banh",
      "address": "2720 3rd Avenue Apt 407, Mosler Lofts, Seattle, WA, 98121",
      "formattedAddress": "2720 3rd Ave APT 407, Seattle, WA 98121, USA",
      "phone": "4083070862",
      "email": "banh.Jon@yahoo.com",
      "lat": 47.61766600000001,
      "lng": -122.3492015
    },
    "status": "ALREADY_DELIVERED"
  },
  {
    "orderId": 2300714,
    "orderNumber": "5",
    "companyId": 1199,
    "orderItem": "[{name:Tea pot,quantity:1,unitPrice:5}]",
    "accepted": true,
    "placementTime": "2021-03-27T17:34:40Z",
    "requestedPickupTime": "2021-03-26T17:54:00Z",
    "requestedDeliveryTime": "2021-03-26T18:34:00Z",
    "assignedTime": "2021-03-27T17:41:42Z",
    "startTime": "2021-03-27T17:42:22Z",
    "pickedupTime": "2021-03-27T17:45:20Z",
    "arrivedTime": "2021-04-08T20:14:15Z",
    "deliveryTime": "2021-04-08T20:14:18Z",
    "failedDeliveryTime": null,
    "deliveryNote": "",
    "deliveryInstruction": null,
    "dispatcherNote": null,
    "paymentMethod": "CASH",
    "orderSource": "",
    "incomplete": false,
    "orderTotal": 5,
    "deliveryFee": 0,
    "tip": 0,
    "discount": 0,
    "tax": 0,
    "driverPayment": 0,
    "distance": 1.33233863,
    "carrier": {
      "id": 2501,
      "name": "Kayle",
      "phone": "+1234567891",
      "email": "kayle22@gmail.com",
      "status": "0",
      "vehiclePlateNumber": "",
      "vehicleDescription": "",
      "note": "",
      "imageUrl": "https://s3-us-west-2.amazonaws.com/qt.com.dashboard.profile.driver/621c3825230247a8bbab6dc9a20431ce.jpg",
      "partner": "None"
    },
    "pickup": {
      "id": 183258,
      "name": "Rocky Mountain Tea store",
      "address": "890 Geneva Ave, San Francisco, CA 94112, United States",
      "formattedAddress": "890 Geneva Ave, San Francisco, CA 94112, United States",
      "phone": "+11112221",
      "lat": 22.874216,
      "lng": -172.4000992
    },
    "delivery": {
      "id": 1730761,
      "name": "Niki",
      "address": "460 Ramona St, Palo Alto, CA 94301, United States",
      "formattedAddress": "460 Ramona St, Palo Alto, CA 94301, United States",
      "phone": "+151232323212",
      "email": "niki43@gmail.com",
      "lat": 22.8355565,
      "lng": -172.4184477
    },
    "status": "ALREADY_DELIVERED"
  },
  {
    "orderId": 2300704,
    "orderNumber": "41223",
    "companyId": 1199,
    "orderItem": "[{name:Banana,quantity:11,unitPrice:0.5}]",
    "accepted": true,
    "placementTime": "2021-03-27T17:34:12Z",
    "requestedPickupTime": "2021-03-26T17:53:00Z",
    "requestedDeliveryTime": "2021-03-26T18:33:00Z",
    "assignedTime": "2021-03-27T17:41:42Z",
    "startTime": "2021-03-27T17:42:15Z",
    "pickedupTime": "2021-03-27T17:45:20Z",
    "arrivedTime": "2021-04-08T20:13:00Z",
    "deliveryTime": "2021-04-08T20:13:12Z",
    "failedDeliveryTime": null,
    "deliveryNote": "Leave the package by the door if no one is available",
    "deliveryInstruction": null,
    "dispatcherNote": null,
    "paymentMethod": "CASH",
    "orderSource": "",
    "incomplete": false,
    "orderTotal": 5.5,
    "deliveryFee": 0,
    "tip": 0,
    "discount": 0,
    "tax": 0,
    "driverPayment": 0,
    "distance": 2.9833863,
    "carrier": {
      "id": 2501,
      "name": "Anderson",
      "phone": "+1231231211",
      "email": "andyContact@gmail.com",
      "status": "0",
      "vehiclePlateNumber": "",
      "vehicleDescription": "",
      "note": "",
      "imageUrl": "https://s3-us-west-2.amazonaws.com/qt.com.dashboard.profile.driver/621c3825230247a8bbab6dc9a20431ce.jpg",
      "partner": "None"
    },
    "pickup": {
      "id": 183258,
      "name": "XYZ Delivery",
      "address": "460 Ramona St, Palo Alto, CA 94301, United States",
      "formattedAddress": "460 Ramona St, Palo Alto, CA 94301, United States",
      "phone": "+111212322",
      "lat": 22.874216,
      "lng": -172.4000992
    },
    "delivery": {
      "id": 1730753,
      "name": "Jassica",
      "address": "CVV4+C7 Palo Alto, California, United States",
      "formattedAddress": "CVV4+C7 Palo Alto, California, United States",
      "phone": "+1512322132",
      "email": "Jassica12@gmail.com",
      "lat": 22.7392481,
      "lng": -172.3958189
    },
    "status": "ALREADY_DELIVERED"
  }
]
```
