Table of Contents
Filtering - Reckon One API v2
Introduction
All API v2 endpoints that return a list of results support filtering. The filtering is applied before sorting and paging. Any field can be used in a filter, however some field types only support certain operators, functions etc.
A filter takes the following form:
{expression} {operator} {value}
An expression can be a field or one of several functions (depending on the field’s type). You can have multiple filters, separating them with and and or.
It is added to an endpoint URL as a query string parameter:
/r1/v2/{cashbookId}/ledgeraccounts?filter={expression} {operator} {value}
Supported operators
Key | Description |
| Not (must prefix an operator) |
| Equal |
| Not equal |
| Greater than |
| Greater than or equal to |
| Less than |
| Less than or equal to |
| In a list (string or number) |
| Field value contains the specified string |
| Field value starts with the specified string |
| Field value ends with the specified string |
String field functions
Key | Description |
| Gets the length of the string |
| Converts the string to lower case |
| Converts the string to upper case |
| Removes whitespace (spaces, new lines etc.) from the beginning and the end of the string |
| Gets part of a string from position a for a length of b characters |
Date / time field functions
Key | Description |
| Gets the day |
| Gets the month (as a number) |
| Gets the year |
| Gets the hour |
| Gets the minute |
| Gets the second |
Number functions
Key | Description |
| Rounds the number to x decimal places |
| Rounds the number down to the nearest whole number |
| Rounds the number up to the nearest whole number |
Examples
Example | Explanation |
| The name must be equal to Joe Bloggs (case sensitive) |
| The name converted to lower case must contain the word bloggs |
| The name converted to lower case must end with the word bloggs and the age must be greater than or equal to 18 |
| The month of the dateofbirth must be equal to December |
| The notes must not be an empty string or just contain whitespace |
| The amount must be between 100.00 and 199.99 when rounded to 2 decimal places |
| The lastname must be either Bloggs or Doe |
| The quantity must be 1, 2 or 3 |
| The amount must be greater than or equal to 1000 and the quantity must be 1 |