> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/returns-api/returns-api-2.0/methods/retrieve-return-orders-within-a-date-range.md).

# Retrieve Return Orders Within A Date Range

To retrieve all return orders within a specific date range and return status (for example, created, on-hold, or processed), use the `GetReturnOrders` method and send a `GET` request to `/api/v2/Returns`.

<details>

<summary>Required Parameters</summary>

| **Parameter**     | **Type** | **Description**                                                                                                                                                                                                                                                          |
| ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| brandCode         | String   | <p>ESW’s unique identifier for the retailer.</p><p>Example: <code>GOC</code></p>                                                                                                                                                                                         |
| returnOrderStatus | Integer  | <p>The status of the return order.</p><p>Example: <code>5</code></p>                                                                                                                                                                                                     |
| fromDate          | DateTime | <p>The starting date and time when the <code>returnOrderStatus</code> was created.</p><p>For example: <code>2020-10-01</code></p>                                                                                                                                        |
| toDate            | DateTime | <p>The ending date and time when the <code>returnOrderStatus</code> was created.</p><p>Example: <code>2020-10-20</code></p><p>The <code>toDate</code> must be a date later than <code>fromDate</code>. It must also not be 31 days later than <code>fromDate</code>.</p> |

</details>

### Response <a href="#response" id="response"></a>

When you send the API request, the system validates these parameters and searches for all return orders within the specified date range in the ESW database.

<details>

<summary><strong>HTTP Response Status</strong></summary>

| **Response Code**     | **Description**                                                                                                                                                                                  |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **200 - OK**          | Indicates that the validation is successful and the system is able to find all or at least one return order in the database. The API response includes detailed information on the return order. |
| **400 - Bad Request** | Indicates that the request does not contain all information.                                                                                                                                     |
| **404 - Not Found**   | Indicates that the system is unable to locate the return order in the ESW database.                                                                                                              |

</details>

### Request Example <a href="#request-example" id="request-example"></a>

The following example shows how to get return orders using the `fromDate` and `toDate` parameters along with `returnStatus`.

`/api/v2/Returns?brandCode=ABC&returnOrderStatus=5&fromDate=2020-10-01T00:00:00.000Z&toDate=2020-10-20T00:00:00.000Z`

<details>

<summary>Response Example</summary>

{% code expandable="true" %}

```json
{
  "responseMessage": "1",
  "returnOrders": [
    {
      "returnOrderNumber": "2123456789",
      "returnCarrierReference": "123ABC1234567",
      "brandOrderReference": "123456789",
      "eshopOrderReference": "1122334455",
      "creationTime": "2020-10-12T09:15:42.615Z",
      "returnOrderType": "ReturnsPortalReturnNormal",
      "returnOrderStatus": "Processed",
      "returnOrderStatusTime": "2020-10-12T09:15:42.615Z",
      "createReturnLabel": "",
      "updateReturnLabel": "",
      "refundFailedReason": "",
      "refundOrderRefund": {
        "currencyIso": "EUR",
        "total": 12.34,
        "merchandise": 12.34,
        "shipping": 12.34,
        "duty": 12.34,
        "tax": 12.34,
        "returnFee": 0,
        "refundStatus": "Pending"
      },
      "returnOrderArticles": [
        {
          "productCode": "123456",
          "productDescription": "Sweatshirt",
          "price": 12.34,
          "currencyIso": "EUR",
          "itemAccepted": true,
          "prohibitedForExportItem": true,
          "returnReason": "WrongItemShipped",
          "processReason": "Accepted",
          "returnOrderArticleRefund": {
            "refundType": "StandardFullOrderCancel",
            "total": 12.34,
            "merchandise": 12.34,
            "shipping": 12.34,
            "duty": 12.34,
            "tax": 12.34
          }
        }
      ]
    },
    {
      "returnOrderNumber": "2312314412",
      "returnCarrierReference": "123ABC1234567",
      "brandOrderReference": "13123789",
      "eshopOrderReference": "44123312312",
      "creationTime": "2020-10-15T09:15:42.615Z",
      "returnOrderType": "ReturnsPortalReturnNormal",
      "returnOrderStatus": "Processed",
      "returnOrderStatusTime": "2020-10-15T09:15:42.615Z",
      "createReturnLabel": "",
      "updateReturnLabel": "",
      "refundFailedReason": "",
      "refundOrderRefund": {
        "currencyIso": "EUR",
        "total": 12.34,
        "merchandise": 12.34,
        "shipping": 12.34,
        "duty": 12.34,
        "tax": 12.34,
        "returnFee": 0,
        "refundStatus": "Pending"
      },
      "returnOrderArticles": [
        {
          "productCode": "1241231",
          "productDescription": "Blue Jeans",
          "price": 12.34,
          "currencyIso": "EUR",
          "itemAccepted": true,
          "prohibitedForExportItem": true,
          "returnReason": "WrongItemShipped",
          "processReason": "Accepted",
          "returnOrderArticleRefund": {
            "refundType": "StandardFullOrderCancel",
            "total": 12.34,
            "merchandise": 12.34,
            "shipping": 12.34,
            "duty": 12.34,
            "tax": 12.34
          }
        }
      ]
    }
  ],
  "responseCode": "1"
}
```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.esw.com/returns-api/returns-api-2.0/methods/retrieve-return-orders-within-a-date-range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
