> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.gohandy.us/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to read closed-route data through the API

You might need to know when a route is closed and which sales were carried out in that route. Here, we'll explain how to do this:

### Step 1. Get the routes

Make a GET request to this endpoint using these parameters:

```
https://app.handy.la/api/v2/route?includeSalesOrders=true&filterWithDate=dateClosed&start={start}&end={end}
```

With this request, you'll receive the closed routes within the dates you specify.

As an answer, you'll get a JSON with all of the route's information, as well as a field with the route sales IDs, which will look like this:

```
{    "pagination": { ... },    "routes": [        {            "id": 379,            "salesOrderIds": [1, 42, 69],            ....        }    ]}
```

### Step 2. Get information on each sale

Make a GET request to this endpoint for each sale ID.

```
https://app.handy.la/api/v2/salesOrder/{id}
```

As an answer, you'll get a JSON with all the sales details.

You can manage this information as you prefer. Save it in your database, create a report, sum all totals, etc.

# Recommendations

💡 Don't forget to take a look at all of the [API's documents](https://api.handy.la/) for more information.

💡 You can take these as examples. They were performed in JavaScript in the routes.js script with these code examples:

[https://github.com/arturo-ojeda/handy-api-examples](https://github.com/arturo-ojeda/handy-api-examples)

Send us a message in the chat if you have any questions!