Filters

The Space Invoices API employs a filtering mechanism to manage and refine data queries.

Types of Filters

where
Where query filter.
Accepts operators, see the Where operators section below for details.

?filter[where][type]=invoice

include
Used to include related models.

?filter[include][tax]=taxRate

fields
Include or exclude certain fields.

?filter[fields][type]=true|false

limit
Limit the amount of data returned.

?filter[limit]=5

order
Order results by property.

?filter[order]=date ASC or ?filter[order][0]=date ASC&filter[order][1]=number DESC

skip
The number of results to skip.

?filter[skip]=5

deleted Also return deleted records.

?filter[deleted]=true

Where operators

Where operations function similarly to querying a database, and can be controlled using the following:

=
Equivalence.

?filter[where][type]=invoice


and
Logical AND operator.

?filter[where][<and|or>][0]=condition1&?filter[where][<and|or>]condition2


or
Logical OR operator.

?filter[where][date][<gt|get>]=2018-04-01T18:30:00.000Z


gt, gte
Numerical greather than (>); greater than of equal (>=). Valid for the numberical and the date values. For Geopoint values, the units are in miles by default.

?filter[where][date][<gt|get>]=2018-04-01T18:30:00.000Z


lt, lte
Numerical less than (<); less than or equal (<=). Valid only for the numerical and the date values. For Geopoint values, the units are in miles by default.

?filter[where][date][<lt|lte>]=2018-04-01T18:30:00.000Z


between
True if the value is between the two specified values: greater than or equal to the first value, and less than or equal to the second value.

?filter[where][date][between][0]=2023-04-01T00:00:00.000Z&filter[where][date][between][1]=2023-04-31T00:00:00.000Z


inq, nin
In / not in an array of values.

?filter[where][type][<inq|nin>]=invoice&filter[where][type][<inq|nin>]=estimate


neq
Not equal (!=).

?filter[where][draft][neq]=false


like, nlike, options: i
LIKE / NOT LIKE operators for use with regular expressions with the case insensitive flag.

?filter[where][number][like]=2023-.* or ?filter[where][number][like]=2018.*&filter[where][number][options]=i

Next: Pagination >