# List Orders

**URL** : `/api/v1/orders/`

**Method** : `GET`

#### Query parameters

**Ordering**

* `order_by` - Which attribute to order the list by.
  * default ordering is ascending, can be made descending by prefixing the attribute name with `-`
  * Example: `order_by=created_at`
  * Example: `order_by=-created_at`

**Pagination**

Default pagination is 20 results per page.

* `limit` - Number of results to return per page.
  * Example: `limit=20`
* `offset` - The initial index from which to return the results.
  * Example: `offset=21`

**Filtering**

The results can be filtered by various attributes on order or related to the order.

If available, additional suffixes can be appended to attributes which further define the filter:

1. `__startswith` - string value is a starting substring of the attribute
2. `__icontains` - string value is a substring of the attribute (case insensitive)

Possible filters:

* `store_id`
* `store_id__startswith`
* `store_id__icontains`
* `customer__email`
* `customer__email__startswith`
* `customer__email__icontains`
* `company`
* `customer_id`
* `customer_email`
* `customer_company_name`
* `customer_company_name__icontains`
* `customer_reference__icontains`
* `customer_name__icontains`
* `customer_label__in`
* `customer__account`
* `customer__account__name`
* `customer__account__name__icontains`
* `customer__account__code`
* `customer__account__code__icontains`
* `customer__account__description`
* `customer__account__description__icontains`
* `customer__account__phone`
* `customer__account__phone__icontains`
* `customer__account__address`
* `customer__account__address__icontains`
* `customer__account__email`
* `customer__account__email__icontains`
* `customer__account__reference`
* `customer__account__reference__icontains`
* `customer__account__not`

#### Success Response

**Code** : `200 OK`

**Content examples** :

```json
{
    "count": 5,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1593781720493279,
            "customer": {
                "id": 620,
                "total_orders": 14,
                "total_licenses": 45,
                "labels": [
                    {
                        "id": 3,
                        "label_id": 8,
                        "label": "Customer",
                        "color": "#ff9f43"
                    },
                    {
                        "id": 53,
                        "label_id": 34,
                        "label": "Loyal",
                        "color": "#3a0cd4"
                    }
                ],
                "email": "tc@tc.com",
                "first_name": "",
                "last_name": "",
                "company_name": "",
                "phone": "",
                "reference": "",
                "address": "",
                "postcode": "",
                "city": "",
                "country": "",
                "state": "",
                "clabels_all": "customerloyal",
                "cognito_user_pool_id": "",
                "metadata": {},
                "company": 277,
                "license_user": null,
                "clabels": [
                    8,
                    34
                ]
            },
            "customer_account": null,
            "has_active_licenses": false,
            "created_at": "2020-07-03T13:08:40Z",
            "updated_at": "2020-07-03T13:08:40Z",
            "store_id": "d2d2dce02c844d4492c9d48758aa143a",
            "type": "normal",
            "customer_email": null,
            "is_test": false,
            "customer_reference": null,
            "is_trial": false,
            "download_id": null,
            "language": null,
            "campaign_params": null,
            "customer_first_name": null,
            "customer_last_name": null,
            "customer_company": null,
            "customer_phone": null,
            "metadata": {},
            "company": 277
        },
        ...
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.licensespring.com/management-api/order/list-orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
