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 with a dot (see example 7 below)

Operator

Number

String

Date

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:

📘

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:.

🚧

It is notable 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'
  1. 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'
  1. Balance sheet line items with a value less than $1,000
    GET /balanceSheets?value=lt:1000
curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&value=lt:1000 \
  --header 'Accept: application/json'
  1. Balance sheet line items with a value greater than or equal to $1,000
    GET/balanceSheets?value=gte:1000
curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&value=gte:1000 \
  --header 'Accept: application/json'
  1. Balance sheet line items with a value less than or equal to $1,000
    GET/balanceSheets?value=lte:1000
curl --request GET \
  --url https://api.railz.ai/balanceSheets?businessName=Demo&reportFrequency=month&serviceName=quickbooks&value=lte:1000 \
  --header 'Accept: application/json'
  1. 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'
  1. Invoice for a particular customer with a total amount greater than or equal to $1,000
    GET /invoices?customerRef.id=123&totalAmount=gte:1000
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'