# Id Sort Clause

> For the complete documentation index, see [llms.txt](https://doc.ibexa.co/en/saas/llms.txt).

Id Sort Clause

The `Location\Id` Sort Clause sorts search results by the ID of the location.

## Arguments

- (optional) sorting direction, either `ascending` (default) or `descending`

## Example

In the REST API, this Sort Clause is called `LocationId`. Use it in the `SortClauses` element of the payload of the [`POST /views`](https://doc.ibexa.co/en/saas/api/rest_api/rest_api_reference/rest_api_reference.html#tag/Views/operation/ibexa.rest.views.create) request:

**XML**

```xml
<Query>
    <SortClauses>
        <LocationId>ascending</LocationId>
    </SortClauses>
</Query>
```

**JSON**

```json
"Query": {
    "SortClauses": {
        "LocationId": "ascending"
    }
}
```
