Filtering

The Railz API uses a simple, flexible query language to enable the filtering of response data.

Data returned from the API can be filtered by including a URL encoded query parameter with your request.

Filter Format

  • The query takes the form of {propertyName}={value}.
  • For queries that need comparisons other than simple equals, operators are supported for greater-than, greater-than-or-equal, less-than, and less-than-or-equal-to. In order, the operators are: gt, gte, lt, and lte.
  • Multiple query clauses can be specified, separated by ampersands (;) for AND queries.
  • Sub-properties can be accessed by separating them with a dot (see example 7 below). At this time, you can only filter on the id sub-property.
  • You can query strings using the wildcard (%) operator.
  • You can query with child elements by applying the dot notation (e.g. ?lines.description="abc").
OperatorNumberStringDate
Equals: =:white-check-mark::white-check-mark::white-check-mark:
Greater than: gt:white-check-mark::no-entry-sign::white-check-mark:
Greater than or equal to: gte:white-check-mark::no-entry-sign::white-check-mark:
Less than: lt:white-check-mark::no-entry-sign::white-check-mark:
Less than or equal to: lte:white-check-mark::no-entry-sign::white-check-mark:
Wildcard: %:no-entry-sign::white-check-mark::no-entry-sign:

📘

Operators must be followed by colons, so the query ?foo=gte searches for the literal string “gte” and searching for “gte:” can be done by quoting the value as ?foo=gte:.

📘

Supported Filter Parameters

To view a list of all filterable parameters per endpoint, see our Data Model for more details.

📘

Please note that Railz doesn’t support OR filters, requiring separate requests per query.

Example Filters

1. Current Assets line item of the Balance Sheet

GET /balanceSheets?group=Current%20Assets

curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&group=Current%20Assets \
  --header 'Accept: application/json'

2. Balance sheet line items with a value greater than $1,000

GET /balanceSheets?value=gt:1000

curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&value=gt:1000 \
  --header 'Accept: application/json'

4. Balance sheet line items with a value greater than or equal to $1,000 and less than or equal to $5,000

GET /balanceSheets?value=gte:1000;lte:5000

curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&value=gte:1000;lte:5000 \
  --header 'Accept: application/json'

4. Invoices for a particular customer

GET /invoices?customerRef.id=123

curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&customerRef.id=123&totalAmount=gte:1000 \
  --header 'Accept: application/json'

5. Vendors with a name containing "Office"

GET /vendors?vendorName=%25Office%25

curl --request GET \
  --url https://api.railz.ai/vendors?vendorName=%25Office%25 \
  --header 'Accept: application/json'