# Where

### Where Filter <a href="#where-filter" id="where-filter"></a>

The **where** parameter allows you to filter elements using operators on their properties.

**Note:**

* Even though the where filter supports complex queries we recommend you keep them as simple as possible. Long, complex *where queries* can cause time outs.
* To ensure your calls run efficiently against larger organisations it's a good idea to restrict your queries to simple == operations.
* Submit your query as a string value to avoid possible errors, for example:

#### Examples <a href="#examples" id="examples"></a>

* **Retrieve all Bank Accounts using the GetAccounts function**

  ```
  Type=="BANK"
  ```

  This would translate to the following URL encoded string

  ```
  https://api.xero.com/api.xro/2.0/Accounts?where=Type%3D%3D%22BANK%22
  ```
* **Retrieve all contacts with specific text in the contact name using the GetContacts function**

  ```
    Name.Contains("Peter")
  ```

  ```
    Name.StartsWith("P")
  ```

  ```
    Name.EndsWith("r")
  ```
* For optional elements such as email address, it is best that you add a not null at the start of the query. If you don’t include it you will get an exception if any of the optional elements aren’t set. This example is using the GetContacts function.

  ```
  EmailAddress!=null&&EmailAddress.StartsWith("boom")
  ```
* **Retrieve invoices with an invoice date between a date range**

  ```
  Date >= DateTime(2015, 01, 01) && Date < DateTime(2015, 12, 31)
  ```

### Links <a href="#links" id="links"></a>

[Xero API Request filters](https://developer.xero.com/documentation/api/requests-and-responses)


---

# 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.linx.software/reference/plugins/xero/filters/where.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.
