How to filter, sort, and select JSON subset and/or includes
Most fields available on given resource can be filtered against and/or sorted by. See details of each endpoint for complete list of fields.
Filters available on each resource list
General query string filtering format: field[operator]=comma,separated,values
Example Reservations
filtering:
GET /customers/{customer}/reservations?city[is]=New York,Seattle&status[not]=deny,cancelled&arrival_date[before]=2024-02-01
Available operators
is
- accepts 1+ comma separated values to look for
not
- accepts 1+ comma separated values to reject
lt
= less than - accepts 1 value to compare against (exclusive <)
lte
= less than or equal - accepts 1 value to compare against (inclusive <=)
gt
= greater than - accepts 1 value to compare against (exclusive >)
gte
= greater than or equal - accepts 1 value to compare against (inclusive >=)
between
- accepts 2 comma separated values (inclusive >= <=)
before
- accepts 1 value to compare against as date (exclusive <)
after
- accepts 1 value to compare against as date (exclusive >)
Sorting available on each resource list
General query string sorting format: sort[asc|desc]=field
Example Reservations
sorting:
GET /customers/{customer}/listings?sort[desc]=arrival_date
Special sort options: sort=latest
& sort=oldest
- sorts by the time a record was created in our API.
NOTE API supports single sort
parameter on each request
Select JSON subset
You can select a subset of JSON result by using _select
query parameter.
GET /customers/{customer}/reservations?_select=id,arrival_date,financials.host
{
"data": [
{
"id": "13ff62f8-6c9d-4392-bdff-90dc2e2959ac",
"arrival_date": "2023-10-01",
"financials": {
"host": {
"accommodation": {
...