---
title: "Retrieve orders (legacy)"
slug: "retrieve-orders--legacy-"
abstract: "Describes how to retrieve orders using the Sitecore CDP Order REST API."
---
# Retrieve orders (legacy)

> [!important]
> [A newer version of this REST API (v2.1) is available](https://api-docs.sitecore.com/cdp/order-rest-api). If you're new to this REST API, use the new version. Alternatively, if you're already using the old version, [read about the differences between v2 and v2.1](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/order-rest-api-v2--legacy-/differences-between-v2-and-v2-1-of-the-order-rest-apis.html "Differences between v2 and v2.1 of the Order REST APIs") so you can upgrade.

Make one of the following requests:

- `GET /v2/orders?referenceId=<referenceId>`
- `GET /v2/orders?guestRef=<guestRef>`

Retrieves a list of orders. You must include either the `referenceId` of the order or the `guestRef` as a query string parameter in the URI of the request.

| Parameter name | Type | Description | Example |
| --- | --- | --- | --- |
| `referenceId` | string | A unique ID generated by your organization to reference the order. For flight orders, this is often the PNR. | `2d7de9df-45a2-45ea-872c-30e45139007d` |
| `guestRef` | string | The reference of the guest record.<br><br>If you do not know the guest reference, first [retrieve guests](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/order-rest-api-v2--legacy-/retrieve-guests--legacy-.html). | `f7aabbca-1c1b-4fc2-be72-3e16294a4f03` |

In the response, in `items.href`, the order reference is the string that follows the final slash:

`"href": "<baseURL>/v2/orders/<orderRef>"`

You use the order reference to interact with a specific order, for example, to [retrieve](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/order-rest-api-v2--legacy-/retrieve-an-order--legacy-.html "Retrieve an order (legacy)") or [update](https://doc.sitecore.com/cdp/en/developers/api/rest-apis/legacy-rest-apis/order-rest-api-v2--legacy-/update-an-order--legacy-.html "Update an order (legacy)") it.

Retrieving orders using `referenceId`:

```curl
curl -X GET '<baseURL>/v2/orders?referenceId=2d7de9df-45a2-45ea-872c-30e45139007d' \
-u '<username>:<password>' \
-H 'Accept: application/json'

```

Retrieving orders using `guestRef`:

```curl
curl -X GET '<baseURL>/v2/orders?guestRef=f7aabbca-1c1b-4fc2-be72-3e16294a4f03' \
-u '<username>:<password>' \
-H 'Accept: application/json'

```

```json
{
    "href": "<baseURL>/v2/orders?offset=0&limit=10&guestRef=f7aabbca-1c1b-4fc2-be72-3e16294a4f03",
    "offset": 0,
    "limit": 10,
    "first": {
        "href": "<baseURL>/v2/orders?offset=0&limit=10&guestRef=f7aabbca-1c1b-4fc2-be72-3e16294a4f03"
    },
    "last": {
        "href": "<baseURL>/v2/orders?offset=0&limit=10&guestRef=f7aabbca-1c1b-4fc2-be72-3e16294a4f03"
    },
    "items": [
        {
            "href": "<baseURL>/v2/orders/d680c9be-4c07-4731-857e-9602034b15f2"
        },
        {
            "href": "<baseURL>/v2/orders/9932bee2-25c2-4653-9ad3-8865865036d9"
        },­­­
        {
            "href": "<baseURL>/v2/orders/4b8eeee6-37f1-41ad-92fb-79e802db29a7"
        }
    ]
}

```