Use the query service to quickly retrieve precise, relevant data from your Sage Intacct company, based on conditions you specify.

**Note**: For details about the query service, including the request URI and supported filters, see [Query an object](/intacct/apis/intacct/1/intacct-openapi/groups/common-resources/tags/common_resources_query/paths/post-services-query) in the REST API Reference. For examples of specific types of queries and to learn how to sort and filter results, read the following sections of this guide.

The query service lets you build custom, flexible queries to filter, sort, and return data tailored to your business needs.

* Flexible, condition-based filtering - Retrieve exactly the data you need using operators and logic across standard and custom fields.
* Cross-object access - Query fields from related objects enabling richer and more connected data retrieval in a single request.
* Built for precise control - Tailor each query to your exact needs by controlling field selection, sort order and filtering.

## Querying objects

This section explains how to structure queries for a single object and how to retrieve data from referenced objects. It covers both data in the object itself and data in related objects.

The types of object queries you can perform are:

* [Single objects](#single-objects) - Query one main object and return selected fields, with optional filters, sorting, and pagination.
* [Document type objects](#document-type-objects) - Query transaction objects in base or derived form, depending on whether you need all document types or a specific document type.
* [Multiple (batch) objects](#multiple-batch-objects) - Submit an array of distinct query objects to retrieve multiple datasets in one request.
* [Referenced objects](#referenced-objects) - Use dot notation to return fields from related objects that resolve to a single record.
* [Owning (parent) objects](#owning-parent-objects) - Query from the owned (child) object to return fields from its owning (parent) object.

### Single objects

When querying a single object, the focus is on one main object, using fields and related data to filter and return results in a simple, direct way. Each single query request can only have one object.

The minimum required elements for inclusion in a query request are `object` and `fields`, all other elements are optional, for example `filterParameters`.

The following basic query request returns account groups in the Chart of Accounts:

```
{
    "object": "general-ledger/account-group",
    "fields": [
        "key",
        "id",
        "href"
    ]
}
```

The response returns the `key`, `id`, and `href` for all the `account-group` objects:

```
{
    "ia::result": [
        {
            "key": "381",
            "id": "Customer Count End of Period",
            "href": "/objects/general-ledger/account-group/381"
        },
        {
            "key": "382",
            "id": "Customer Churn Rate Net",
            "href": "/objects/general-ledger/account-group/382"
        },
        {
            "key": "383",
            "id": "Existing Customers Kept",
            "href": "/objects/general-ledger/account-group/383"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Document type objects

Use document type objects to query either all document types or a single document type:

* Base object - returns records across all document types; document-type custom fields are not available.
* Derived object - returns records for the document type named in the object.

This example request queries the base object, `order-entry/document` for all document types:

```
{
    "object": "order-entry/document",
    "fields": [
        "id",
        "documentType",
        "href"
    ]
}
```

The response returns the document type in the `href` for all `order-entry/document` objects:

```
{
   "ia::result": [
      {
         "id": "9",
         "documentType": "Contract Invoice",
         "href": "/objects/order-entry/document::Contract%20Invoice/9"
      },
      {
         "id": "139",
         "documentType": "Drop ship sales order",
         "href": "/objects/order-entry/document::Drop%20ship%20sales%20order/139"
      },
      {
         "id": "121",
         "documentType": "Contract Invoice",
         "href": "/objects/order-entry/document::Contract%20Invoice/121"
      },
      {
         "id": "8",
         "documentType": "Sales Invoice",
         "href": "/objects/order-entry/document::Sales%20Invoice/8"
      }
   ],
   "ia::meta": {
      "totalCount": 4,
      "start": 1,
      "pageSize": 100,
      "next": null,
      "previous": null
   }
}
```

When you query a derived object, the document type comes from the object name in the request, not from an explicit filter.

This example request queries the derived object, `order-entry/document::Contract Invoice` for contract invoices:

```
{
    "object": "order-entry/document::Contract Invoice",
    "fields": [
        "id",
        "documentType",
        "href"
    ]
}
```

The response returns `order-entry/document` objects with the `Contract%20Invoice` document type in the `href`:

```
{
   "ia::result": [
      {
         "id": "91",
         "documentType": "Contract Invoice",
         "href": "/objects/order-entry/document::Contract%20Invoice/91"
      },
      {
         "id": "77",
         "documentType": "Contract Invoice",
         "href": "/objects/order-entry/document::Contract%20Invoice/77"
      },
      {
         "id": "106",
         "documentType": "Contract Invoice",
         "href": "/objects/order-entry/document::Contract%20Invoice/106"
      }
   ],
   "ia::meta": {
      "totalCount": 3,
      "start": 1,
      "pageSize": 100,
      "next": null,
      "previous": null
   }
}
```

You can query an owned (child) object and include fields from its [owning (parent) object](#owning-parent-objects), whether you use a base object or a derived object. You cannot query an owning (parent) object and include fields from its owned (child) objects.

This example queries `order-entry/document-history` and includes `documentType` and `href` from the owning (parent) object:

```
{
    "object": "order-entry/document-history",
    "fields": [
        "id",
        "orderEntryDocument.documentType",
        "orderEntryDocument.href",
        "href"
    ]
}
```

The response returns `document-history` records with the parent `documentType` and `href`:

```
{
   "ia::result": [
      {
         "id": "1",
         "orderEntryDocument.documentType": "Contract Invoice",
         "orderEntryDocument.href": "/objects/order-entry/document::Contract%20Invoice/1",
         "href": "/objects/order-entry/document-history/1"
      },
      {
         "id": "3",
         "orderEntryDocument.documentType": "Contract Invoice",
         "orderEntryDocument.href": "/objects/order-entry/document::Contract%20Invoice/3",
         "href": "/objects/order-entry/document-history/3"
      },
      {
         "id": "4",
         "orderEntryDocument.documentType": "Contract Invoice",
         "orderEntryDocument.href": "/objects/order-entry/document::Contract%20Invoice/4",
         "href": "/objects/order-entry/document-history/4"
      }
   ],
   "ia::meta": {
      "totalCount": 3,
      "start": 1,
      "pageSize": 100,
      "next": null,
      "previous": null
   }
}
```

#### Custom fields

To query custom fields on a transaction, add the transaction definition to the object name. Custom fields are not available if you use only the base object. Query a derived object to use custom fields.

Note: The object path and custom field name in this example are samples. Use the transaction definition and custom field name configured for your company.

This example queries a custom field on the `purchasing/document::Vendor Invoice` derived object:

```
{
   "object": "purchasing/document::Vendor Invoice",
   "fields": [
      "id",
      "documentNumber",
      "documentType",
      "nsp::VENDOR_REFERENCE",
      "href"
   ]
}
```

The response returns all vendor invoices with the custom field `VENDOR_REFERENCE` for each result:

```
{
   "ia::result": [
      {
         "id": "191",
         "documentNumber": "VI#0009",
         "documentType": "Vendor Invoice",
         "nsp::VENDOR_REFERENCE": null,
         "href": "/objects/purchasing/document::Vendor%20Invoice/191"
      },
      {
         "id": "181",
         "documentNumber": "VI#0008",
         "documentType": "Vendor Invoice",
         "nsp::VENDOR_REFERENCE": null,
         "href": "/objects/purchasing/document::Vendor%20Invoice/181"
      },
      {
         "id": "198",
         "documentNumber": "VI#0011",
         "documentType": "Vendor Invoice",
         "nsp::VENDOR_REFERENCE": "VREF-PO-2026-00382",
         "href": "/objects/purchasing/document::Vendor%20Invoice/198"
      },
      {
         "id": "197",
         "documentNumber": "VI#0010",
         "documentType": "Vendor Invoice",
         "nsp::VENDOR_REFERENCE": "VREF-PO-2026-00482",
         "href": "/objects/purchasing/document::Vendor%20Invoice/197"
      }
   ],
   "ia::meta": {
      "totalCount": 4,
      "start": 1,
      "pageSize": 100,
      "next": null,
      "previous": null
   }
}
```

### Multiple (batch) objects

You can construct an array of distinct objects within a single query request to retrieve multiple datasets simultaneously, each with its own parameters and structure.

For more information, read about [batch, bulk and composite requests](https://developer.sage.com/intacct/docs/1/sage-intacct-rest-api/api-essentials/bulk-requests/).

This example query request filters both active vendors and active vendor payment providers:

```
[
    {
        "object": "accounts-payable/vendor",
        "fields": [
            "key",
            "id",
            "name",
            "href"
        ],
        "filters": [
            {"$eq": {"status": "active"}}
        ]
    },
    {
        "object": "accounts-payable/vendor-payment-provider",
        "fields": [
            "key",
            "id",
            "href"
        ],
        "filters": [
            {"$eq": {"status": "active"}}
        ]
    }
]
```

The response returns the `key`, `id`, `name`, and `href` for all the `vendor` and `vendor-payment-provider` objects:

```
{
    "ia::result": [
        {
            "ia::result": [
                {
                    "key": "274",
                    "id": "GK144",
                    "name": "GK144",
                    "href": "/objects/accounts-payable/vendor/274"
                },
                {
                    "key": "275",
                    "id": "GK145",
                    "name": "GK145",
                    "href": "/objects/accounts-payable/vendor/275"
                },
                {
                    "key": "276",
                    "id": "GK146",
                    "name": "GK146",
                    "href": "/objects/accounts-payable/vendor/276"
                }
            ],
            "ia::meta": {
                "totalCount": 3,
                "start": 1,
                "pageSize": 100,
                "next": null,
                "previous": null
            }
        },
        {
            "ia::result": [
                {
                    "key": "11242",
                    "id": "vendor_624B435F",
                    "name": "vendor_624B435F",
                    "href": "/objects/accounts-payable/vendor-payment-provider/11242"
                },
                {
                    "key": "11243",
                    "id": "vendor_299B1615",
                    "name": "vendor_299B1615",
                    "href": "/objects/accounts-payable/vendor-payment-provider/11243"
                },
                {
                    "key": "11244",
                    "id": "vendor_5F7C36D6",
                    "name": "vendor_5F7C36D6",
                    "href": "/objects/accounts-payable/vendor-payment-provider/11244"
                },
                {
                    "key": "11245",
                    "id": "vendor_79363876",
                    "name": "vendor_79363876",
                    "href": "/objects/accounts-payable/vendor-payment-provider/11245"
                }
            ],
            "ia::meta": {
                "totalCount": 4,
                "start": 1,
                "pageSize": 100,
                "next": null,
                "previous": null
            }
        }
    ],
    "ia::meta": {
        "totalCount": 2,
        "totalSuccess": 2,
        "totalError": 0
    }
}
```

### Referenced objects

Many objects in Sage Intacct have relationships with other objects. Understanding those relationships is essential for building effective queries.

When querying an object with references to other objects, you can use dot notation to access fields from the referenced record, provided it refers to a single related object.

The following example returns the `journal-entry` objects for a referenced `glJournal`:

```
{
     "object": "general-ledger/journal-entry",
     "fields": [
         "id",
         "txnNumber",
         "description",
         "glJournal.id"
     ],
      "filters": [
        {
            "$eq": {
                "glJournal.id": "ASC606REVREC"
            }
        }
    ]
 }
```

The response returns the `id` for the `journal-entry` objects and the `glJournal.id` for the referenced general ledger journal:

```
{
    "ia::result": [
        {
            "id": "30231",
            "txnNumber": 5243,
            "description": "Contract test biA and GL post date-7 line no. 1: 01/03/2026 batch",
            "glJournal.id": "ASC606REVREC"
        },
        {
            "id": "14192",
            "txnNumber": 3988,
            "description": "STRAIGHTLINE_AUTO For Power Aerospace Materials: 01/31/2026 Batch",
            "glJournal.id": "ASC606REVREC"
        },
        {
            "id": "18991",
            "txnNumber": 4899,
            "description": "Contract MEAConfig Line No. 4 : 01/09/2026 Batch",
            "glJournal.id": "ASC606REVREC"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

This example returns bank transaction rule maps and their associated rules for a specified bank transaction rule set:

```
{
    "object": "cash-management/bank-txn-rule-map",
    "fields": [
        "key",
        "id",
        "bankTxnRule.id",
        "bankTxnRule.name",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "bankTxnRuleSet.id": "2"
            }
        }
    ]
}
```

The response returns the `key`, `id`, `bankTxnRule.id`, `bankTxnRule.name`, and `href` for all the `bank-txn-rule-map` objects:

```
{
    "ia::result": [
        {
            "key": "1",
            "id": "1",
            "bankTxnRule.id": "21",
            "bankTxnRule.name": "Match by amount and doc number",
            "href": "/objects/cash-management/bank-txn-rule-map/1"
        },
        {
            "key": "2",
            "id": "2",
            "bankTxnRule.id": "28",
            "bankTxnRule.name": "Match amount plus day range",
            "href": "/objects/cash-management/bank-txn-rule-map/2"
        },
        {
            "key": "3",
            "id": "3",
            "bankTxnRule.id": "27",
            "bankTxnRule.name": "BOA Create CC txn from bank txn",
            "href": "/objects/cash-management/bank-txn-rule-map/3"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Owning (parent) objects

References to the owning (parent) objects describe a hierarchical relationship where an owning (parent) object contains one or more owned (child) objects. For example, the `journal-entry` may own multiple `journal-entry-line` objects.

Querying upwards from the owned (child) object to the owning (parent) object is the correct approach. You cannot query downward from an owning (parent) object to the owned (child) objects.

The following example returns the `journalEntry.postingDate` in the `currentYear` for all `journal-entry-line` objects:

```
{
     "object": "general-ledger/journal-entry-line",
     "fields": [
         "id",
         "journalEntry.postingDate"
     ],
      "filters": [
        {
            "$eq": {
                "journalEntry.postingDate": "currentYear"
            }
        }
    ]
 }
```

The response returns the `journal-entry-lines` where the `journal-entry` objects have the `postingDate` in the `currentYear`:

```
{
    "ia::result": [
        {
            "id": "465589",
            "journalEntry.postingDate": "2026-02-28"
        },
        {
            "id": "465591",
            "journalEntry.postingDate": "2026-02-28"
        },
        {
            "id": "465593",
            "journalEntry.postingDate": "2026-02-28"
        },
        {
            "id": "465595",
            "journalEntry.postingDate": "2026-02-28"
        },
        {
            "id": "465597",
            "journalEntry.postingDate": "2026-02-28"
        }
        ],
    "ia::meta": {
        "totalCount": 5,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Sorting query results

Sorting controls the order of query results by specifying fields and sort direction (ascending or descending). You can also sort fields from related objects.

### Order by a single field

Use `orderBy` to sort query results by a single field, specifying the field name and the desired sort direction (ascending or descending).

This query returns journal entries sorted in ascending order by posting date:

```
{
    "object": "general-ledger/journal-entry",
    "fields": [
        "key",
        "id",
        "postingDate",
        "href"
    ],
    "orderBy": [
        {
            "postingDate": "asc"
        }
    ]
}
```

The response returns the `key`, `id`, `postingDate`, and `href` for all the `journal-entry` objects, sorted by `postingDate` in ascending order:

```
{
    "ia::result": [
        {
            "key": "433",
            "id": "433",
            "postingDate": "2026-01-14",
            "href": "/objects/general-ledger/journal-entry/433"
        },
        {
            "key": "434",
            "id": "434",
            "postingDate": "2026-02-02",
            "href": "/objects/general-ledger/journal-entry/434"
        }
    ],
    "ia::meta": {
        "totalCount": 2,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Order by multiple fields

You can use `orderBy` to sort by multiple fields, for example sorting in ascending order by date, then in descending order by amount.

In this query example, the `invoice` object is ordered ascending by the date posted to the general ledger and descending by the total transaction amount for each date posted:

```
{
    "object": "accounts-receivable/invoice",
    "fields": [
        "key",
        "id",
        "invoiceSummary.glPostingDate",
        "totalTxnAmount",
        "href"
    ],
    "orderBy": [
        {
            "invoiceSummary.glPostingDate": "asc"
        },
        {
            "totalTxnAmount": "desc"
        }
    ]
}
```

The response shows the `invoice` objects, with the `invoiceSummary.glPostingDate` in ascending order and the `totalTxnAmount` in descending order for each posting date:

```
{
    "ia::result": [
        {
            "key": "230",
            "id": "230",
            "invoiceSummary.glPostingDate": "2016-01-01",
            "totalTxnAmount": "131493.57",
            "href": "/objects/accounts-receivable/invoice/230"
        },
        {
            "key": "170",
            "id": "170",
            "invoiceSummary.glPostingDate": "2016-01-01",
            "totalTxnAmount": "48890.06",
            "href": "/objects/accounts-receivable/invoice/170"
        },
        {
            "key": "20",
            "id": "20",
            "invoiceSummary.glPostingDate": "2016-11-11",
            "totalTxnAmount": "127319.19",
            "href": "/objects/accounts-receivable/invoice/20"
        },
        {
            "key": "38",
            "id": "38",
            "invoiceSummary.glPostingDate": "2016-11-11",
            "totalTxnAmount": "58441.60",
            "href": "/objects/accounts-receivable/invoice/38"
        },
        {
            "key": "29",
            "id": "29",
            "invoiceSummary.glPostingDate": "2016-11-11",
            "totalTxnAmount": "10436.00",
            "href": "/objects/accounts-receivable/invoice/29"
        },
        {
            "key": "172",
            "id": "172",
            "invoiceSummary.glPostingDate": "2017-01-01",
            "totalTxnAmount": "32215.93",
            "href": "/objects/accounts-receivable/invoice/172"
        },
        {
            "key": "178",
            "id": "178",
            "invoiceSummary.glPostingDate": "2017-01-01",
            "totalTxnAmount": "32116.79",
            "href": "/objects/accounts-receivable/invoice/178"
        },
        {
            "key": "163",
            "id": "163",
            "invoiceSummary.glPostingDate": "2017-01-01",
            "totalTxnAmount": "3756.96",
            "href": "/objects/accounts-receivable/invoice/163"
        }
    ],
    "ia::meta": {
        "totalCount": 8,
        "start": 1,
        "pageSize": 10,
        "next": null,
        "previous": null
    }
}
```

## Pagination filter parameters

Pagination filtering lets you retrieve large datasets in manageable chunks by specifying `start` and `size`.

Each paged request is evaluated independently against the data available at request time. If records are added, updated, or deleted between requests, page boundaries can shift and some records may be skipped or returned more than once.

For example, if a query returns 4000 records and new records are added before the next request is made using a `start` of 4000, some records may be skipped or duplicated because the result set has changed.

### start

Specify the first result to return, useful for skipping objects in queries.

This query request returns a list of `account-group` objects, in ascending order, starting at row `10` from the returned list:

```
{
    "object": "general-ledger/account-group",
    "fields": [
        "key",
        "id",
        "href"
    ],
    "orderBy": [
        {
            "key": "asc"
        }
    ],
    "start": 10
}
```

The response shows the `account-group` objects, with the `key` field in ascending order, starting at row `10` from the returned list:

```
{
    "ia::result": [
        {
            "key": "10",
            "id": "Accounts Receivable",
            "href": "/objects/general-ledger/account-group/10"
        },
        {
            "key": "11",
            "id": "Inter Entity Receivable",
            "href": "/objects/general-ledger/account-group/11"
        },
        {
            "key": "12",
            "id": "Inter Entity Receivable - ADV",
            "href": "/objects/general-ledger/account-group/12"
        }

    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 10,
        "pageSize": 100,
        "next": null,
        "previous": 1
    }
}
```

### size

Limit the maximum number of results to return per page.

This query request returns the `account-group` objects, in ascending order, starting at row `10` from the returned list, and displaying `5` results per page:

```
{
    "object": "general-ledger/account-group",
    "fields": [
        "key",
        "id",
        "href"
    ],
    "orderBy": [
        {
            "key": "asc"
        }
    ],
    "start": 10,
    "size": 5
}
```

The response returns the `account-group` objects, in ascending order, displaying `"start": 10` indicating the result set begins at row `10` from the returned list, and `"pageSize": 5` indicating the page size has `5` records:

```
{
    "ia::result": [
        {
            "key": "10",
            "id": "Accounts Receivable",
            "href": "/objects/general-ledger/account-group/10"
        },
        {
            "key": "11",
            "id": "Inter Entity Receivable",
            "href": "/objects/general-ledger/account-group/11"
        },
        {
            "key": "12",
            "id": "Inter Entity Receivable - ADV",
            "href": "/objects/general-ledger/account-group/12"
        },
        {
            "key": "13",
            "id": "Other Receivable",
            "href": "/objects/general-ledger/account-group/13"
        },
        {
            "key": "14",
            "id": "Other Current Assets",
            "href": "/objects/general-ledger/account-group/14"
        }
    ],
    "ia::meta": {
        "totalCount": 164,
        "start": 10,
        "pageSize": 5,
        "next": 15,
        "previous": 5
    }
}
```

## Query filters

The `filters` array defines filter conditions that can be applied to a query request. Using the `filters` array, you can apply a single filter condition to a query request by specifying the target field, an operator, and a corresponding value.

You can also use `null` as a filter condition to identify records where a field has no value. This is useful when you need to locate incomplete data or fields that have not been populated.

### Supported operators

The following operators can be used in query filters:

| Operator         | Reference                                             | Description                                                                                |
| ---------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `$eq`            | [equal to](#equal-to)                                 | Returns records where the values exactly match the specified value.                        |
| `$ne`            | [not equal to](#not-equal-to)                         | Returns records where the values differ from the specified value.                          |
| `$lt`            | [less than](#less-than)                               | Returns records where the values are smaller than the specified value.                     |
| `$lte`           | [less than or equal to](#less-than-or-equal-to)       | Returns records where the values are smaller than or exactly equal to the specified value. |
| `$gt`            | [greater than](#greater-than)                         | Returns records where the values are greater than the specified value.                     |
| `$gte`           | [greater than or equal to](#greater-than-or-equal-to) | Returns records where the values are greater than or exactly equal to the specified value. |
| `$in`            | [in array](#in-array)                                 | Returns records where the values are contained within the specified array.                 |
| `$notIn`         | [not in array](#not-in-array)                         | Returns records where the values are not contained within the specified array.             |
| `$between`       | [between](#between)                                   | Returns records where the values fall between the two specified boundary values.           |
| `$notBetween`    | [not between](#not-between)                           | Returns records where the values fall outside the defined boundary range.                  |
| `$contains`      | [contains](#contains)                                 | Returns records where the values contain the specified string.                             |
| `$notContains`   | [not contains](#not-contains)                         | Returns records where the values do not contain the specified string.                      |
| `$startsWith`    | [starts with](#starts-with)                           | Returns records where the values start with the specified string.                          |
| `$notStartsWith` | [not starts with](#not-starts-with)                   | Returns records where the values do not start with the specified string.                   |
| `$endsWith`      | [ends with](#ends-with)                               | Returns records where the values end with the specified string.                            |
| `$notEndsWith`   | [not ends with](#not-ends-with)                       | Returns records where the values do not end with the specified string.                     |

### Equal to

Use the `$eq` operator to return results that are equal to the specified value.

In this example, the query request returns all locations whose `parent` location is equal to `CA` (California):

```
{
    "object": "company-config/location",
    "fields": [
        "id",
        "name",
        "status",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "parent.id": "CA"
            }
        }
    ]
}
```

The response returns all `location` objects where the `parent` location is `CA` (California):

```
{
    "ia::result": [
        {
            "id": "LAS",
            "name": "Los Angeles",
            "status": "active",
            "href": "/objects/company-config/location/60"
        },
        {
            "id": "SDI",
            "name": "San Diego",
            "status": "active",
            "href": "/objects/company-config/location/61"
        },
        {
            "id": "SFO",
            "name": "San Francisco",
            "status": "inactive",
            "href": "/objects/company-config/location/62"
        },
        {
            "id": "SNJ",
            "name": "San Jose",
            "status": "inactive",
            "href": "/objects/company-config/location/66"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

In the example below, the request identifies `customer-contact` records where the `customer.id` is a `null` value:

```
{
    "object": "accounts-receivable/customer-contact",
    "fields": [
        "id",
        "key",
        "customer.id"
    ],
    "filters": [
        {
            "$eq": {
                "customer.id": null
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `customer-contact` records where `customer.id` is equal to `null`:

```
{
    "ia::result": [
        {
            "id": "1",
            "key": "1",
            "customer.id": null
        },
        {
            "id": "2",
            "key": "2",
            "customer.id": null
        },
        {
            "id": "3",
            "key": "3",
            "customer.id": null
        },
        {
            "id": "4",
            "key": "4",
            "customer.id": null
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Not equal to

Use the `$ne` operator to return results that are not equal to the specified value.

In this example, the query request uses the `$ne` operator in a filter condition to return only `vendor` objects that have a value in the `name` field:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$ne": {
                "name": null
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` objects where the value in the `name` field is not equal to `null`:

```
{
    "ia::result": [
    {
        "id": "GK1047",
        "key": "1177",
        "name": "GK1047"
    },
    {
        "id": "GK1048",
        "key": "1178",
        "name": "GK1048"
    },
    {
        "id": "GK1049",
        "key": "1179",
        "name": "GK1049"
    }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

In the example below, the request identifies `customer-contact` records where the `customer.id` is not a `null` value:

```
{
    "object": "accounts-receivable/customer-contact",
    "fields": [
        "id",
        "key",
        "customer.id"
    ],
    "filters": [
        {
            "$ne": {
                "customer.id": null
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `customer-contact` records where `customer.id` is not equal to `null`:

```
{
    "ia::result": [
        {
            "id": "152",
            "key": "152",
            "customer.id": "Green Energy Solutions Inc"
        },
        {
            "id": "153",
            "key": "153",
            "customer.id": "HarborView Consulting Group"
        },
        {
            "id": "165",
            "key": "165",
            "customer.id": "NorthStar Manufacturing"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Less than

Use the `$lt` operator to return results that are less than the specified value.

In this example, the query request returns every `bill` whose `totalTxnAmountDue` is less than `5.00`:

```
{
    "object": "accounts-payable/bill",
        "fields": [
        "id",
        "totalTxnAmountDue",
        "href"
    ],
    "filters": [
        {
            "$lt": {
                "totalTxnAmountDue": "5.00"
            }
        }
    ]
}
```

The response returns all `bill` records where `totalTxnAmountDue` is less than `5.00`:

```
{
   "ia::result": [
      {
         "id": "1037",
         "totalTxnAmountDue": "1.23",
         "href": "/objects/accounts-payable/bill/1037"
      },
      {
         "id": "1221",
         "totalTxnAmountDue": "1.23",
         "href": "/objects/accounts-payable/bill/1221"
      },
      {
         "id": "1298",
         "totalTxnAmountDue": "1.23",
         "href": "/objects/accounts-payable/bill/1298"
      },
      {
         "id": "1124",
         "totalTxnAmountDue": "1.23",
         "href": "/objects/accounts-payable/bill/1124"
      }
   ],
   "ia::meta": {
      "totalCount": 4,
      "start": 1,
      "pageSize": 100,
      "next": null,
      "previous": null
   }
}
```

### Less than or equal to

Use the `$lte` operator to return results that are less than or equal to the specified value.

In this example, the query request returns every `bill` whose `dueDate` is on or before `2026-04-06`:

```
{
    "object": "accounts-payable/bill",
    "fields": [
        "id",
        "totalTxnAmountDue",
        "dueDate",
        "href"
    ],
    "filters": [
        {
            "$lte": {
                "dueDate": "2026-04-06"
            }
        }
    ]
}
```

The response returns all `bill` records where `dueDate` is on or before `2026-04-06`:

```
{
    "ia::result": [
        {
            "id": "815",
            "totalTxnAmountDue": "6600.00",
            "dueDate": "2026-01-31",
            "href": "/objects/accounts-payable/bill/815"
        },
        {
            "id": "817",
            "totalTxnAmountDue": "21100.00",
            "dueDate": "2026-03-08",
            "href": "/objects/accounts-payable/bill/817"
        },
        {
            "id": "1123",
            "totalTxnAmountDue": "5.00",
            "dueDate": "2026-01-31",
            "href": "/objects/accounts-payable/bill/1123"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Greater than

Use the `$gt` operator to return results that are greater than the specified value.

In this example, the query request returns every `vendor` whose `totalDue` is greater than `500.00`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "name",
        "totalDue",
        "href"
    ],
    "filters": [
        {
            "$gt": {
                "totalDue": "500.00"
            }
        }
    ]
}
```

The response returns all `vendor` records where `totalDue` is greater than `500.00`:

```
{
    "ia::result": [
        {
            "id": "1099 Int",
            "name": "1099 Int",
            "totalDue": "6841.15",
            "href": "/objects/accounts-payable/vendor/43"
        },
        {
            "id": "201",
            "name": "PG & E",
            "totalDue": "21200.00",
            "href": "/objects/accounts-payable/vendor/47"
        },
        {
            "id": "202",
            "name": "Pac Bell",
            "totalDue": "31320.00",
            "href": "/objects/accounts-payable/vendor/48"
        },
        {
            "id": "UTC testing",
            "name": "UTC testing",
            "totalDue": "1353.00",
            "href": "/objects/accounts-payable/vendor/99"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Greater than or equal to

Use the `$gte` operator to return results that are greater than or equal to the specified value.

In this example, the query request returns every `revenue-schedule-line` whose `approvedHours` are greater than or equal to `15`:

```
{
    "object": "contracts/revenue-schedule-line",
    "fields": [
        "id",
        "contractRevenueSchedule.id",
        "approvedHours",
        "href"
    ],
    "filters": [
        {
            "$gte": {
                "approvedHours": "15"
            }
        }
    ]
}
```

The response returns all `revenue-schedule-line` records where `approvedHours` are greater than or equal to `15`:

```
{
    "ia::result": [
        {
            "id": "101914",
            "contractRevenueSchedule.id": "9914",
            "approvedHours": "40",
            "href": "/objects/contracts/revenue-schedule-line/101914"
        },
        {
            "id": "3550",
            "contractRevenueSchedule.id": "511",
            "approvedHours": "15",
            "href": "/objects/contracts/revenue-schedule-line/3550"
        },
        {
            "id": "3553",
            "contractRevenueSchedule.id": "512",
            "approvedHours": "15",
            "href": "/objects/contracts/revenue-schedule-line/3553"
        },
        {
            "id": "3559",
            "contractRevenueSchedule.id": "511",
            "approvedHours": "15",
            "href": "/objects/contracts/revenue-schedule-line/3559"
        },
        {
            "id": "3561",
            "contractRevenueSchedule.id": "512",
            "approvedHours": "15",
            "href": "/objects/contracts/revenue-schedule-line/3561"
        }
    ],
    "ia::meta": {
        "totalCount": 5,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### In array

Use the `$in` operator to return results that are contained within the specified array.

In this example, the query request returns every `journal-entry` from the `GJ` and the `GAAP` general ledger journals:

```
{
    "object": "general-ledger/journal-entry",
    "fields": [
        "id",
        "key",
        "glJournal.id"
    ],
    "filters": [
        {
            "$in": {
                "glJournal.id": [
                    "GJ",
                    "GAAP"
                ]
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `journal-entry` records from the `GJ` and the `GAAP` general ledger journals:

```
{
    "ia::result": [
        {
            "id": "1",
            "key": "1",
            "glJournal.id": "GJ"
        },
        {
            "id": "2",
            "key": "2",
            "glJournal.id": "GJ"
        },
        {
            "id": "3",
            "key": "3",
            "glJournal.id": "GJ"
        },
        {
            "id": "487",
            "key": "487",
            "glJournal.id": "GAAP"
        },
        {
            "id": "488",
            "key": "488",
            "glJournal.id": "GAAP"
        },
        {
            "id": "489",
            "key": "489",
            "glJournal.id": "GAAP"
        }
    ],
    "ia::meta": {
        "totalCount": 6,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Not in array

Use the `$notIn` operator to return results that are not contained within the specified array.

In this example, the query request returns every `journal-entry` not in the `GJ` and the `GAAP` general ledger journals:

```
{
    "object": "general-ledger/journal-entry",
    "fields": [
        "id",
        "key",
        "glJournal.id"
    ],
    "filters": [
        {
            "$notIn": {
                "glJournal.id": [
                    "GJ",
                    "GAAP"
                ]
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `journal-entry` records not in the `GJ` and `GAAP` general ledger journals:

```
{
    "ia::result": [
        {
            "id": "533",
            "key": "533",
            "glJournal.id": "GJ1"
        },
        {
            "id": "534",
            "key": "534",
            "glJournal.id": "GJ1"
        },
        {
            "id": "535",
            "key": "535",
            "glJournal.id": "GJ1"
        },
        {
            "id": "630",
            "key": "630",
            "glJournal.id": "Others"
        },
        {
            "id": "631",
            "key": "631",
            "glJournal.id": "Others"
        },
        {
            "id": "632",
            "key": "632",
            "glJournal.id": "Others"
        }
    ],
    "ia::meta": {
        "totalCount": 6,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Between

Use the `$between` operator to return results that are between the specified values.

In this example, the query request returns every `bill` whose `dueDate` is between `2026-01-01` and `2026-01-20`:

```
{
    "object": "accounts-payable/bill",
    "fields": [
        "id",
        "totalTxnAmountDue",
        "dueDate",
        "href"
    ],
    "filters": [
        {
            "$between": {
                "dueDate": [
                    "2026-01-01",
                    "2026-01-20"
                ]
            }
        }
    ]
}
```

The response returns all `bill` records where `dueDate` is between `2026-01-01` and `2026-01-20`:

```
{
    "ia::result": [
        {
            "id": "935",
            "totalTxnAmountDue": "5.00",
            "dueDate": "2026-01-05",
            "href": "/objects/accounts-payable/bill/935"
        },
        {
            "id": "942",
            "totalTxnAmountDue": "10.00",
            "dueDate": "2026-01-15",
            "href": "/objects/accounts-payable/bill/942"
        },
        {
            "id": "944",
            "totalTxnAmountDue": "10.00",
            "dueDate": "2026-01-15",
            "href": "/objects/accounts-payable/bill/944"
        },
        {
            "id": "943",
            "totalTxnAmountDue": "10.00",
            "dueDate": "2026-01-05",
            "href": "/objects/accounts-payable/bill/943"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Not between

Use the `$notBetween` operator to return results that are not between the specified values.

In this example, the query request returns every `bill` whose `dueDate` is not between `2026-01-10` and `2026-01-20`:

```
{
    "object": "accounts-payable/bill",
    "fields": [
        "id",
        "totalTxnAmountDue",
        "dueDate",
        "href"
    ],
    "filters": [
        {
            "$notBetween": {
                "dueDate": [
                    "2026-01-10",
                    "2026-01-20"
                ]
            }
        }
    ]
}
```

The response returns all `bill` records where `dueDate` is not between `2026-01-10` and `2026-01-20`:

```
{
    "ia::result": [
        {
            "id": "815",
            "totalTxnAmountDue": "6600.00",
            "dueDate": "2026-01-01",
            "href": "/objects/accounts-payable/bill/815"
        },
        {
            "id": "817",
            "totalTxnAmountDue": "21100.00",
            "dueDate": "2026-01-09",
            "href": "/objects/accounts-payable/bill/817"
        },
        {
            "id": "85",
            "totalTxnAmountDue": "120.00",
            "dueDate": "2026-01-26",
            "href": "/objects/accounts-payable/bill/85"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Contains

Use the `$contains` operator to return results that contain the specified value.

In this example, the query request returns every `vendor` whose `name` contains `CALOIL`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$contains": {
                "name": "CALOIL"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` records containing `CALOIL` in their `name`:

```
{
    "ia::result": [
        {
            "id": "CA",
            "key": "10",
            "name": "CALOIL Corporation"
        },
        {
            "id": "CAL",
            "key": "13",
            "name": "CALOIL Cor Corporation"
        },
        {
            "id": "CALO",
            "key": "15",
            "name": "CALOIL Rise Corporation"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Not contains

Use the `$notContains` operator to return results that do not contain the specified value.

In this example, the query request returns every `vendor` whose `name` does not contain `CALOIL`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$notContains": {
                "name": "CALOIL"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` records that do not contain `CALOIL` in their `name`:

```
{
    "ia::result": [
        {
            "id": "California Local Plc",
            "key": "40",
            "name": "California Local Plc"
        },
        {
            "id": "CHSE",
            "key": "74",
            "name": "Chase"
        },
        {
            "id": "CITI",
            "key": "72",
            "name": "CitiBank"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Starts with

Use the `$startsWith` operator to return results that start with the specified value.

In this example, the query request returns every `vendor` whose `name` starts with `CA`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$startsWith": {
                "name": "CA"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` records where `name` starts with `CA`:

```
{
    "ia::result": [
        {
            "id": "6",
            "key": "6",
            "name": "CA L Misc Type"
        },
        {
            "id": "CA",
            "key": "10",
            "name": "CALOIL Corporation"
        },
        {
            "id": "CAL",
            "key": "13",
            "name": "CALOIL Cor Corporation"
        },
        {
            "id": "CALO",
            "key": "15",
            "name": "CALOIL RCorporation"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Not starts with

Use the `$notStartsWith` operator to return results that do not start with the specified value.

In this example, the query request returns every `vendor` whose `name` does not start with `CA`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$notStartsWith": {
                "name": "CA"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` records where `name` does not start with `CA`:

```
{
    "ia::result": [
        {
            "id": "1099 Int",
            "key": "43",
            "name": "1099 Int"
        },
        {
            "id": "1099 INTCA",
            "key": "38",
            "name": "1099 IntCA"
        },
        {
            "id": "201",
            "key": "47",
            "name": "PG & E"
        },
        {
            "id": "202",
            "key": "48",
            "name": "Pac Bell"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Ends with

Use the `$endsWith` operator to return results that end with the specified value.

In this example, the query request returns every `vendor` whose `name` ends with `Corporation`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$endsWith": {
                "name": "Corporation"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` records where `name` ends with `Corporation`:

```
{
    "ia::result": [
        {
            "id": "CA",
            "key": "10",
            "name": "CALOIL Corporation"
        },
        {
            "id": "CAL",
            "key": "13",
            "name": "CALOIL Cor Corporation"
        },
        {
            "id": "CALO",
            "key": "15",
            "name": "CALOIL RCorporation"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Not ends with

Use the `$notEndsWith` operator to return results that do not end with the specified value.

In this example, the query request returns every `vendor` whose `name` does not end with `Corporation`:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "id",
        "key",
        "name"
    ],
    "filters": [
        {
            "$notEndsWith": {
                "name": "Corporation"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all `vendor` records where `name` does not end with `Corporation`:

```
{
    "ia::result": [
        {
            "id": "1099 Int",
            "key": "43",
            "name": "1099 Int"
        },
        {
            "id": "1099 INTCA",
            "key": "38",
            "name": "1099 IntCA"
        },
        {
            "id": "201",
            "key": "47",
            "name": "PG & E"
        },
        {
            "id": "202",
            "key": "48",
            "name": "Pac Bell"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Date filters

Date filters help you query records using either relative time periods, such as the current month or prior year, or explicit calendar date ranges.

### Relative date filters

Relative date filters let you filter by dynamic date periods without hard-coding calendar dates. These values are resolved at runtime by the query service and are useful for periods, such as the current month, prior quarter, or prior year. Relative date filters are evaluated against the current date unless you set the [asOfDate](#asofdate) filter parameter.

Supported relative date values are:

* `today`
* `yesterday`
* `currentWeek`
* `lastWeek`
* `currentMonth`
* `priorMonth`
* `currentQuarter`
* `priorQuarter`
* `currentYear`
* `priorYear`

This example retrieves `journal-entry` objects, where the `postingDate` is in the `currentQuarter`:

```
{
    "object": "general-ledger/journal-entry",
    "fields": [
        "id",
        "key",
        "postingDate",
        "description",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "postingDate": "currentQuarter"
            }
        }
    ]
}
```

The response returns `journal-entry` objects, where the `postingDate` is in the `currentQuarter`, evaluated relative to the current date at runtime. Therefore the returned `postingDate` values will vary depending on the current date:

```
{
    "ia::result": [
        {
            "id": "30368",
            "key": "30368",
            "postingDate": "2026-01-31",
            "description": "Monthly close entry (first month of quarter)",
            "href": "/objects/general-ledger/journal-entry/30368"
        },
        {
            "id": "30371",
            "key": "30371",
            "postingDate": "2026-02-28",
            "description": "Monthly close entry (second month of quarter)",
            "href": "/objects/general-ledger/journal-entry/30371"
        },
        {
            "id": "30373",
            "key": "30373",
            "postingDate": "2026-03-31",
            "description": "Monthly close entry (third month of quarter)",
            "href": "/objects/general-ledger/journal-entry/30373"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Date range filters

The `filters` array can be applied to a query request to list results between two dates using the `$between` operator in a filter condition.

This query retrieves order entry document lines and applies a filter based on the due date field from the related document header, returning only lines within the specified date range:

```
{
    "object": "order-entry/document-line",
    "fields": [
        "key",
        "id",
        "documentHeader.documentType",
        "documentHeader.customer.id",
        "documentHeader.documentNumber",
        "href"
    ],
    "filters": [
    {
        "$between": {
            "documentHeader.dueDate": ["2026-01-01", "2026-01-30"]
        }
    }
    ]
}
```

The response returns the order entry `document-line` objects, with associated `documentType`, `customer.id`, and `documentNumber` for the associated contract invoices.

```
{
    "ia::result": [
        {
            "key": "527",
            "id": "527",
            "documentHeader.documentType": "Contract Invoice",
            "documentHeader.customer.id": "001",
            "documentHeader.documentNumber": "CONIN#234",
            "href": "/objects/order-entry/document-line::Contract%20Invoice/527"
        },
        {
            "key": "528",
            "id": "528",
            "documentHeader.documentType": "Contract Invoice",
            "documentHeader.customer.id": "001",
            "documentHeader.documentNumber": "CONIN#235",
            "href": "/objects/order-entry/document-line::Contract%20Invoice/528"
        },
        {
            "key": "598",
            "id": "598",
            "documentHeader.documentType": "Contract Invoice",
            "documentHeader.customer.id": "001",
            "documentHeader.documentNumber": "CONIN#250",
            "href": "/objects/order-entry/document-line::Contract%20Invoice/598"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Multiple filter conditions

The `filters` array can also be used to define multiple filter conditions in a query request. Each condition in the array represents a discrete logical statement. You can reference these conditions in a filter expression using **1-based** array indexing to construct complex logic using the `and` and `or` operators.

The example below returns only active locations whose `parent` location is `CA` (California):

```
{
    "object": "company-config/location",
    "fields": [
        "id",
        "name",
        "status",
        "parent.id",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "status": "active"
            }
        },
        {
            "$eq": {
                "parent.id": "CA"
            }
        }
    ]
}
```

The response returns all `location` objects where the `status` is `active`, and the `parent` location is `CA` (California):

```
{
    "ia::result": [
        {
            "id": "LAS",
            "name": "Los Angeles",
            "status": "active",
            "parent.id": "CA",
            "href": "/objects/company-config/location/60"
        },
        {
            "id": "SDI",
            "name": "San Diego",
            "status": "active",
            "parent.id": "CA",
            "href": "/objects/company-config/location/61"
        }
    ],
    "ia::meta": {
        "totalCount": 2,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Filter expressions

Use the `filterExpression` element to define how filter conditions are combined. This allows you to apply logical operators (`and`, `or`) to the filters array.

The query request below returns locations either in `AZ` (Arizona) `or` in `CA` (California):

```
{
    "object": "company-config/location",
    "fields": [
        "id",
        "name",
        "parent.id",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "parent.id": "AZ"
            }
        },
        {
            "$eq": {
                "parent.id": "CA"
            }
        }
    ],
    "filterExpression": "or"
}
```

The response returns `location` objects based in either `AZ` (Arizona) or `CA` (California):

```
{
    "ia::result": [
        {
            "id": "MES",
            "name": "Mesa",
            "parent.id": "AZ",
            "href": "/objects/company-config/location/73"
        },
        {
            "id": "PHO",
            "name": "Phoenix",
            "parent.id": "AZ",
            "href": "/objects/company-config/location/74"
        },
        {
            "id": "LAS",
            "name": "Los Angeles",
            "parent.id": "CA",
            "href": "/objects/company-config/location/60"
        },
        {
            "id": "SDI",
            "name": "San Diego",
            "parent.id": "CA",
            "href": "/objects/company-config/location/61"
        },
        {
            "id": "SFO",
            "name": "San Francisco",
            "parent.id": "CA",
            "href": "/objects/company-config/location/62"
        }
    ],
    "ia::meta": {
        "totalCount": 5,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

The `filterExpression` element also uses **1-based** indexing of the `filters` array, parentheses, and logical operators to group conditions, for example, `(1 and 2) or 3`. By default, conditions are combined using `and`, so this does not need to be specified explicitly. All logical operators must be written in lowercase.

The example below returns locations in Arizona whose start date is the current year or any locations in California:

```
{
    "object": "company-config/location",
    "fields": [
        "key",
        "id",
        "name",
        "parent.id",
        "startDate",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "startDate": "currentYear"
            }
        },
        {
            "$eq": {
                "parent.id": "AZ"
            }
        },
        {
            "$eq": {
                "parent.id": "CA"
            }
        }
    ],
    "filterExpression": "(1 and 2) or 3"
}
```

The response returns `location` objects in `AZ` (Arizona) whose `startDate` is the `currentYear` or any `location` objects in `CA` (California):

```
{
    "ia::result": [
        {
            "key": "60",
            "id": "LAS",
            "name": "Los Angeles",
            "parent.id": "CA",
            "startDate": null,
            "href": "/objects/company-config/location/60"
        },
        {
            "key": "61",
            "id": "SDI",
            "name": "San Diego",
            "parent.id": "CA",
            "startDate": null,
            "href": "/objects/company-config/location/61"
        },
        {
            "key": "74",
            "id": "PHO",
            "name": "Phoenix",
            "parent.id": "AZ",
            "startDate": "2026-01-25",
            "href": "/objects/company-config/location/74"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Filter parameters

Filter parameters do not have to be included in a query. They modify the behavior of the query, rather than specifying data-matching conditions like standard filters.

The `caseSensitiveComparison`, `includePrivate`, and `asOfDate` filter parameters may be specified in the `filterParameters` section. When filter parameters are used with a view execution, the query service overrides the corresponding `filterParameters` section in an existing view or adds a `filterParameters` section, if not already present.

### asOfDate

The `asOfDate` filter parameter sets the anchor date used to evaluate [relative date filters](#relative-date-filters). Use it when you want a query that contains relative date values to run as if it were executed on a specific date.

If the `asOfDate` is not provided, relative date filters are evaluated against the current date.

This example retrieves primary contact details for employees whose start date is in the `currentMonth`:

```
{
    "object": "company-config/employee",
    "fields": [
        "primaryContact.lastName",
        "primaryContact.firstName",
        "primaryContact.id",
        "startDate",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "startDate": "currentMonth"
            }
        }
    ]
}
```

The response returns the primary contact details in the `employee` objects, where the `currentMonth` is evaluated relative to the current date at runtime. Therefore the returned `startDate` values will vary depending on the current date:

```
{
    "ia::result": [
        {
            "primaryContact.lastName": "Reyes",
            "primaryContact.firstName": "Anthony C.",
            "primaryContact.id": "Reyes",
            "startDate": "2026-04-08",
            "href": "/objects/company-config/employee/29"
        },
        {
            "primaryContact.lastName": "Reser",
            "primaryContact.firstName": "Wanda E.",
            "primaryContact.id": "Reser",
            "startDate": "2026-04-15",
            "href": "/objects/company-config/employee/1"
        },
        {
            "primaryContact.lastName": "Smith",
            "primaryContact.firstName": "John",
            "primaryContact.id": "Smith, John",
            "startDate": "2026-04-16",
            "href": "/objects/company-config/employee/43"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

If the `asOfDate` is provided, relative date filters are evaluated against the date provided.

This example retrieves primary contact details for employees whose start date is in the `currentMonth`, where the `asOfDate` is set to `2026-01-31`:

```
{
    "object": "company-config/employee",
    "fields": [
        "primaryContact.lastName",
        "primaryContact.firstName",
        "primaryContact.id",
        "startDate",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "startDate": "currentMonth"
            }
        }
    ],
    "filterParameters": {
        "asOfDate": "2026-01-31"
  }
}
```

The response returns the primary contact details in the `employee` objects, where the `currentMonth` is evaluated as January 2026, based on the `asOfDate` of `2026-01-31`:

```
{
    "ia::result": [
        {
            "primaryContact.lastName": "Scott",
            "primaryContact.firstName": "Jason",
            "primaryContact.id": "Scott, Jason",
            "startDate": "2026-01-06",
            "href": "/objects/company-config/employee/679"
        },
        {
            "primaryContact.lastName": "Wells",
            "primaryContact.firstName": "Michael",
            "primaryContact.id": "Wells, Michael",
            "startDate": "2026-01-25",
            "href": "/objects/company-config/employee/178"
        },
        {
            "primaryContact.lastName": "Jones",
            "primaryContact.firstName": "Arun",
            "primaryContact.id": "Jones, Arun",
            "startDate": "2026-01-31",
            "href": "/objects/company-config/employee/431"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### caseSensitiveComparison

The `caseSensitiveComparison` filter parameter ensures that letter casing is evaluated in a query request. This filter parameter is `true` by default, meaning that only exact matches in letter casing will be returned. To extend a query to include matches regardless of case, set this parameter to `false`.

The following example retrieves employees with Salaries as their earning type, and includes matches regardless of case, for example Salaries, salaries, and SALARIES:

```
{
    "object": "company-config/employee",
    "fields": [
        "key",
        "id",
        "earningType.id",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "earningType.id": "Salaries"
            }
        }
    ],
  "filterParameters": {
      "caseSensitiveComparison": false
  }
}
```

The response returns `employee` objects where the `earningType.id` matches regardless of case, Salaries, salaries, and SALARIES:

```
{
    "ia::result": [
        {
            "key": "13",
            "id": "EM M",
            "name": "Aaron",
            "earningType.id": "Salaries",
            "href": "/objects/company-config/employee/13"
        },
        {
            "key": "31",
            "id": "23",
            "name": "Jurasek",
            "earningType.id": "salaries",
            "href": "/objects/company-config/employee/31"
        },
        {
            "key": "42",
            "id": "001",
            "name": "Kim, Gabriel",
            "earningType.id": "SALARIES",
            "href": "/objects/company-config/employee/42"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### includePrivate

The `includePrivate` filter parameter lets you access private objects from other entities in the query (`false` by default). It is only available at the top company level and respects user permissions. See [Include private records from other entities in a list](https://www.intacct.com/ia/docs/en_US/help_action/Default.htm#cshid=Include_or_exclude_items_in_a_list_display) for more information.

This example includes all journal entries where there is a value in the entity identifier, across all entities:

```
{
    "object": "general-ledger/journal-entry",
    "fields": [
        "key",
        "id",
        "entity.id",
        "entity.name",
        "glJournal.id",
        "href"
    ],
    "filters": [
        {
            "$ne": {
                "entity.id": null
            }
        }
        ],
    "filterParameters": {
        "includePrivate": true
    }
}
```

The response returns `journal-entry` objects in different entities, where the `entity.id` is not equal to `null`.

```
{
    "ia::result": [
        {
            "key": "12300",
            "id": "12300",
            "entity.id": "1",
            "entity.name": "United States of America",
            "glJournal.id": "APJ",
            "href": "/objects/general-ledger/journal-entry/12300"
        },
        {
            "key": "5735",
            "id": "5735",
            "entity.id": "2",
            "entity.name": "India",
            "glJournal.id": "ASC606REVREC",
            "href": "/objects/general-ledger/journal-entry/5735"
        },
        {
            "key": "5736",
            "id": "5736",
            "entity.id": "3",
            "entity.name": "United Kingdom",
            "glJournal.id": "OpDBB",
            "href": "/objects/general-ledger/journal-entry/5736"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Aggregate functions

Aggregate functions are specified inside the `fields` element as `<function>:<dot.separated.fieldName>`. Supported functions are `count`, `avg`, `sum`, `min`, and `max`. If at least one aggregate function is present, all non-aggregate fields are treated as an implicit `groupBy` for the aggregation and response.

Fields with binary formats (including any base64 formats) cannot be used with any aggregate function, including `count`.

### sum

Returns the total of a numeric field across all matching objects using the same type and precision as the underlying field definition.

String fields with `date`, `date-time`, or no format cannot be used with the `sum` aggregate function.

The following query retrieves Accounts Payable (AP) bills, displaying the total amount due for bills where the `state` is not equal to `paid`:

```
{
     "object": "accounts-payable/bill",
     "fields": [
         "sum:vendor.vendorDue"
     ],
     "filters":[
         {"$ne": {
             "state": "paid"
         }}
     ],

     "orderBy": [
         {
             "sum:vendor.vendorDue": "desc"
         }
     ]
 }
```

The response returns a single result with the total (`sum`) amount due for bills where the `state` is not equal to `paid`:

```
{
    "ia::result": [
        {
            "sum:vendor.vendorDue": "54395.02"
        }
    ],
    "ia::meta": {
        "totalCount": 1,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

The following query retrieves Accounts Payable (AP) bills and uses the `sum` aggregate field to calculate the total amount due. It groups the aggregation by the non-aggregate field `vendor.name` so the response displays the total amount due for bills where the `state` is not equal to `paid`:

```
{
     "object": "accounts-payable/bill",
     "fields": [
         "vendor.name",
         "sum:vendor.vendorDue"
     ],
     "filters":[
         {"$ne": {
             "state": "paid"
         }}
     ],

     "orderBy": [
         {
             "sum:vendor.vendorDue": "desc"
         }
     ]
 }
```

The response returns multiple results with the total (`sum`) amount due for bills where the `state` is not equal to `paid`, grouped by `vendor.name`:

```
{
    "ia::result": [
        {
            "vendor.name": "PG & E",
            "sum:vendor.vendorDue": "21200.00"
        },
        {
            "vendor.name": "UTC testing",
            "sum:vendor.vendorDue": "17589.00"
        },
        {
            "vendor.name": "1099 Int",
            "sum:vendor.vendorDue": "13682.30"
        },
        {
            "vendor.name": "1099 IntCA",
            "sum:vendor.vendorDue": "1923.72"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### avg

Returns the average of a numeric field across all matching objects using the same type and precision as the underlying field definition.

String fields with `date`, `date-time`, or no format cannot be used with the `avg` aggregate function.

The following query retrieves Accounts Payable (AP) bills, displaying the average amount due for bills where the `state` is not equal to `paid`:

```
{
     "object": "accounts-payable/bill",
     "fields": [
         "avg:vendor.vendorDue"
     ],
     "filters":[
         {"$ne": {
             "state": "paid"
         }}
     ],

     "orderBy": [
         {
             "avg:vendor.vendorDue": "desc"
         }
     ]
 }
```

The response returns a single result with the average (`avg`) amount due for bills where the `state` is not equal to `paid`:

```
{
    "ia::result": [
        {
            "avg:vendor.vendorDue": "1648.33"
        }
    ],
    "ia::meta": {
        "totalCount": 1,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### min

Finds the smallest or earliest value in a specified field.

Use this query to find the smallest credit limit for vendors that have a credit limit applied:

```
{
    "object": "accounts-payable/vendor",
    "fields": [
        "min:creditLimit"
    ],
    "filters": [
        {
            "$ne": {
                "creditLimit": null
            }
        }
    ],
    "filterParameters": {
        "includePrivate": true
    },
    "orderBy": [
        {
            "min:creditLimit": "asc"
        }
    ],
    "size": 1
}
```

The response returns the minimum (`min`) credit limit for vendors where the `creditLimit` is not equal to `null`:

```
{
    "ia::result": [
        {
            "min:creditLimit": 10000
        }
    ],
    "ia::meta": {
        "totalCount": 1,
        "start": 1,
        "pageSize": 1,
        "next": null,
        "previous": null
    }
}
```

### max

Finds the largest or most recent value in a specified field.

Use this query to find the invoice with the largest amount due:

```
{
     "object": "accounts-receivable/invoice",
     "fields": [
         "max:totalTxnAmountDue"
     ],
     "filters":[
         {"$ne": {
             "state": "paid"
         }}
     ],

     "orderBy": [
         {
             "max:totalTxnAmountDue": "desc"
         }
     ]
 }
```

The response returns the maximum (`max`) amount in the `totalTxnAmountDue` field for all invoices where the `state` is not equal to `paid`:

```
{
    "ia::result": [
        {
            "max:totalTxnAmountDue": "9275705.52"
        }
    ],
    "ia::meta": {
        "totalCount": 1,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### count

Returns the total number of objects that meet the filter criteria. Only `boolean`, `array` and `enum` fields can use the `count` aggregate function.

Use this query to count the number of vendors and their preferred payment method:

```
 {
     "object": "accounts-payable/vendor",
     "fields": [
         "count:preferredPaymentMethod",
         "preferredPaymentMethod"
     ],
     "filters": [
         {
             "$ne": {
                 "preferredPaymentMethod": null
             }
         }
     ]
 }
```

The response returns the `count` of `vendor` objects grouped by `preferredPaymentMethod`, where `preferredPaymentMethod` is not equal to `null`:

```
{
    "ia::result": [
        {
            "count:preferredPaymentMethod": "3",
            "preferredPaymentMethod": "cash"
        },
        {
            "count:preferredPaymentMethod": "5",
            "preferredPaymentMethod": "ACH"
        },
        {
            "count:preferredPaymentMethod": "2",
            "preferredPaymentMethod": "EFT"
        }
    ],
    "ia::meta": {
        "totalCount": 3,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

### Combining functions

Applies multiple aggregate functions, such as `sum`, `avg`, `min`, `max`, and `count` to be used together in a single query.

This query example uses an array to find details of unpaid invoices due between two dates, the first query in the array identifies invoices in the time period and the second query in the array lists the specific invoice details:

```
[
    {
        "object": "accounts-receivable/invoice",
        "fields": [
            "customer.name",
            "sum:customer.customerDue",
            "sum:totalTxnAmountDue",
            "min:totalTxnAmountDue",
            "max:totalTxnAmountDue",
            "min:invoiceDate",
            "max:invoiceDate"
        ],
        "filters":[
            {"$ne": {
                "state": "paid"
            }},
            {"$between": {
                "dueDate": ["2026-01-01", "2026-01-30"]
            }}
        ],

        "orderBy": [
            {
                "customer.name": "desc"
            }
        ]
    },
    {
        "object": "accounts-receivable/invoice",
        "fields": [
            "customer.name",
            "invoiceNumber",
            "invoiceDate",
            "totalTxnAmountDue"
        ],
        "filters":[
            {"$ne": {
                "state": "paid"
            }},
            {"$between": {
                "dueDate": ["2026-01-01", "2026-01-30"]
            }}
        ],

        "orderBy": [
            {
                "invoiceNumber": "asc"
            }
        ]
    }
]

```

The first result in the response indicates multiple invoices in the specified time period, displaying a difference between the earliest `invoiceDate` and the latest `invoiceDate`. It also shows a difference between the `min:totalTxnAmountDue` and the `max:totalTxnAmountDue`. The second result in the response displays specific details of each invoice in the time period:

```
{
    "ia::result": [
        {
            "ia::result": [
                {
                    "customer.name": "Sonic Corporation",
                    "sum:customer.customerDue": "6452675.86",
                    "sum:totalTxnAmountDue": "780609.05",
                    "min:totalTxnAmountDue": "31308.00",
                    "max:totalTxnAmountDue": "749301.05",
                    "min:invoiceDate": "2026-01-07",
                    "max:invoiceDate": "2026-01-30"
                }
            ],
            "ia::meta": {
                "totalCount": 1,
                "start": 1,
                "pageSize": 100,
                "next": null,
                "previous": null
            }
        },
        {
            "ia::result": [
                {
                    "customer.name": "Sonic Corporation",
                    "invoiceNumber": "SONIC#234",
                    "invoiceDate": "2026-01-07",
                    "totalTxnAmountDue": "31308.00"

                },
                {
                    "customer.name": "Sonic Corporation",
                    "invoiceNumber": "SONIC#235",
                    "invoiceDate": "2026-01-30",
                    "totalTxnAmountDue": "749301.05"
                }
            ],
            "ia::meta": {
                "totalCount": 2,
                "start": 1,
                "pageSize": 100,
                "next": null,
                "previous": null
            }
        }
    ],
    "ia::meta": {
        "totalCount": 2,
        "totalSuccess": 2,
        "totalError": 0
    }
}
```

## Constructing a complete query

Use a complete query structure to retrieve exactly the information you need by combining multiple elements, such as field selection, filter conditions, sorting and pagination. This section provides an example that shows how to bring all these components together in a single request.

The following example query uses a filter to find all credit card transactions that are paid, and then displays the results in ascending order:

```
{
    "object": "cash-management/credit-card-txn",
    "fields": [
        "key",
        "id",
        "whenPaid",
        "totalPaid",
        "href"
    ],
    "filters": [
        {
            "$eq": {
                "state": "paid"
            }
        }
    ],
    "orderBy": [
        {
            "id": "asc"
        }
    ]
}
```

The response returns all credit card transactions, displaying the `key`, `id`, `whenPaid`, `totalPaid`, and `href` fields included for each object, and sorting the results by `id` in ascending order:

```
{
    "ia::result": [
        {
            "key": "1092",
            "id": "1092",
            "whenPaid": "2026-01-15",
            "totalPaid": "100.00",
            "href": "/objects/cash-management/credit-card-txn/1092"
        },
        {
            "key": "1148",
            "id": "1148",
            "whenPaid": "2026-01-01",
            "totalPaid": "500.00",
            "href": "/objects/cash-management/credit-card-txn/1148"
        },
        {
            "key": "1330",
            "id": "1330",
            "whenPaid": "2026-02-15",
            "totalPaid": "1000.00",
            "href": "/objects/cash-management/credit-card-txn/1330"
        },
        {
            "key": "1332",
            "id": "1332",
            "whenPaid": "2026-03-30",
            "totalPaid": "2000.00",
            "href": "/objects/cash-management/credit-card-txn/1332"
        }
    ],
    "ia::meta": {
        "totalCount": 4,
        "start": 1,
        "pageSize": 100,
        "next": null,
        "previous": null
    }
}
```

## Navigating large datasets

When retrieving large sets of objects using the Sage Intacct REST API, it's important to implement iteration to ensure reliable and complete data retrieval. The `query` endpoint supports a batching mechanism that enables you to fetch results incrementally using the `start`, `size`, and `next` parameters. See [pagination filtering](#pagination-filter-parameters) for request and response examples using the [`start`](#start) and [`size`](#size) filter parameters.

### Record limit per request

The maximum number of records that can be returned in a single response is 4,000. If your dataset exceeds this limit, the `query` response will contain a `next` field that indicates that more results are available. If `next` is greater than 0, update the [`start`](#start) value in your next query request to match the `next` value. Continue this process to fetch subsequent batches of results until `next` is `null`, which means all results have been retrieved.

### Example workflow

1. Make an initial query request with a `start` value (typically 1) and a `size` value up to 4000.

2. Inspect the `next` value in the response.

3. If `next` is not null, set `start` in your next request to the `next` value and reissue the query.

4. Repeat the process until `next` is null.

## Troubleshooting and FAQs

1. Does the query service support both single requests and collections of requests?

   Yes, the query service supports both. You can submit a single query request, or a collection of requests (array), including dynamic queries. This allows you to execute multiple queries in a single call.

2. Can I use `href` fields in `filter` or `orderBy` clauses in the query service?

   No, the query service does not support using `href` fields in `filter` or `orderBy` clauses. The `href` field is not valid for filtering or sorting within query requests.

3. Can I use an asterisk (`*`) to list all fields in the query service?

   No, the query service does not support the use of an asterisk (`*`) to select all fields. You must explicitly specify each field you want to include in the query response.

4. Why might certain fields not be queryable in the query service?

   A field may not be queryable for several reasons:

   * It is marked with `writeOnly: true` in the model, meaning it is not intended for retrieval.
   * It returns a list of data, which is not supported for querying.
   * It is marked as `deprecated` and therefore its availability and support are limited.

   If a field does not fall into these three categories, but still cannot be queried, you should open a defect described in [what support is available for developers](https://developer.sage.com/intacct/docs/1/sage-intacct-rest-api/rest-api-faq/#what-support-is-available-for-developers).

5. Can I query an owning (parent) object to retrieve details about the child objects that it owns?

   No, you cannot query an [owning (parent) object](#owning-parent-objects) and retrieve information from the child objects that it owns. For example, you cannot query a `journal-entry` and include data from the `journal-entry-lines` child objects that it owns.

6. Can I query an owned (child) object to retrieve details about the parent object that owns it?

   Yes, you can query an owned child object and include information from the [owning (parent) object](#owning-parent-objects). For example, you can query a `journal-entry-line` and include details from the `journal-entry` parent object.

7. Why can’t I query custom fields tied to a document type or transaction type from a base object?

   Custom fields for document-type and transaction-type objects are only available when you query a derived object. Use the derived object form, for example, `order-entry/document::Contract Invoice` or `purchasing/document::Vendor Invoice`. Custom fields are not available when querying a base object.

8. Why does a field from a related object work in one query but not another?

   Some related fields only work when you query a single [document type](#document-type-objects) (a derived object). If a related field does not return results with a base object, try using the derived object for the document type you need.

   For example, if you have a custom field on vendor invoices called `nsp::VENDOR_REFERENCE` as in the [custom fields](#custom-fields) section. The custom field is not available if you query the base object (`purchasing/document`). However, If you query the derived object (`purchasing/document::Vendor Invoice`), the custom field is available.

9. Why do results include a document type even when it is not in filters?

   The [document type](#document-type-objects) comes from the object form in the query, not from the filters. A base object can return results across multiple document types, while a derived object only returns results for the document type named in the object.