# Queries / Orders

# Orders

**Query**
## order — Returns [Order](/documentation/Objects/Orders#Order)

**Scopes required:** see_stock_management

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the order to retrieve |

**Example Query**

```graphql
query GetOrder($id: ID!) {
    order(id: $id) {
        id,
        type,
        status,
        completed,
        undergoingReview
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Query**
## orderReview — Returns [OrderReview](/documentation/Objects/Orders#OrderReview)

**Scopes required:** see_stock_management

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the order review to retrieve |

**Example Query**

```graphql
query GetOrderReview($id: ID!) {
    orderReview(id: $id) {
        id,
        status,
        orderStatus,
        createdAt
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Query**
## orders — Returns [ConnectionType](/documentation/General/Connections) of [Order](/documentation/Objects/Orders#Order)

**Scopes required:** see_stock_management

### Sortable Fields
*Fields from [Order](/documentation/Objects/Orders#Order) that can be used to sort the connection items*

- createdAt
- sentAt
- receivedAt
- createdBy
- sentBy
- receivedBy
- orderDate
- dueDate

| Arguments | Type | Description |
| --- | --- | --- |
| status | [OrderStatusEnum](/documentation/Enums/Orders#OrderStatusEnum) | The status of the order |
| type | [OrderTypeEnum](/documentation/Enums/Orders#OrderTypeEnum) | The type of order |
| invoiceNumber | *String* | The invoice number / order number of the order |
| orderDateStart | [Date](/documentation/Types/Date#Date) | Get order that have an order date since this date (inclusive) |
| orderDateEnd | [Date](/documentation/Types/Date#Date) | Get orders that have an order date before this date (inclusive) |
| dueDateStart | [Date](/documentation/Types/Date#Date) | Get orders that have a due date since this date (inclusive) |
| dueDateEnd | [Date](/documentation/Types/Date#Date) | Get orders that have a due date before this date (inclusive) |
| reference | *String* | The reference for the order |
| supplier | [ID](/documentation/Types/UUID#UUID) | The supplier of the order |
| outlet | [ID](/documentation/Types/UUID#UUID) | The outlet to search for |
| product | [ID](/documentation/Types/UUID#UUID) | Get orders that contain this product |
| createdBy | [ID](/documentation/Types/UUID#UUID) | Who created the order |
| sentBy | [ID](/documentation/Types/UUID#UUID) | Who sent the order |
| receivedBy | [ID](/documentation/Types/UUID#UUID) | Who received the order |
| transferee | [ID](/documentation/Types/UUID#UUID) | The transferee the order is for |
| vendorConnection | [ID](/documentation/Types/UUID#UUID) | The vendor connection to search for |
| includeMerged | *Boolean* | Whether to include orders that have been merged into other orders (defaults to false), when used with `mergedInto`, true will display orders that have no merge, false will display only orders that have the specified id |
| mergedInto | [ID](/documentation/Types/UUID#UUID) | The ID of the order to get other orders that have been merged into (can be used with includeMerged) |
| mergeable | *Boolean* | Get orders that are mergeable (true is to get only mergeable orders, false is no mergeable orders, null is all orders) |

**Example Query**

```graphql
query GetOrders($status: OrderStatusEnum) {
    orders(status: $status) {
        edges {
            node {
                id,
                type,
                status,
                completed,
                undergoingReview
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "status": "OUTSTANDING"
}
```