Filter Rules

Overview

The Tabs API provides a powerful filtering system that allows you to query and filter data across all endpoints using consistent syntax and rules. This guide covers how to construct and use filters effectively.

Filter Syntax

Filters use a structured format: property:rule:"value"

Basic Structure

GET /v3/customers?filter=name:eq:"Acme Corp"

Multiple Filters

Use commas to separate multiple filters (all filters are combined with AND logic):

GET /v3/invoices?filter=status:eq:"PENDING",customerId:eq:"123e4567-e89b"

Handling Commas in Values

Use double quotes to wrap values containing commas:

GET /v3/customers?filter=name:like:"Acme, Corp"

Filter Rules

The following filter rules are supported:

RuleOperatorDescriptionExample
eqequalsExact matchstatus:eq:"ACTIVE"
neqnot equalsNot equal tostatus:neq:"DELETED"
gtgreater thanGreater thantotal:gt:"100"
gtegreater than or equalsGreater than or equaltotal:gte:"100"
ltless thanLess thantotal:lt:"1000"
lteless than or equalsLess than or equaltotal:lte:"1000"
likecontainsCase-insensitive substring matchname:like:"acme"
nlikenot likeDoes not contain substringname:nlike:"test"
inin arrayValue is in list (use | separator)`status:in:"ACTIVE\
ninnot in arrayValue is not in list`status:nin:"DELETED\
isnullis nullField is nullendDate:isnull:""
isnotnullis not nullField is not nullendDate:isnotnull:""

Pagination

All filtered endpoints support pagination with these query parameters:

  • page - Page number (default: 1)
  • limit - Items per page (default: 50)
GET /v3/customers?filter=name:like:"corp"&page=2&limit=25

Nested Property Filtering

Some properties support nested filtering using dot notation:

GET /v3/customers?filter=externalIds.externalId:eq:"EXT123"

This filters customers where any of their external IDs matches "EXT123".

Date Filtering

When filtering by dates, use ISO format (YYYY-MM-DD):

GET /events?filter=datetime:gte:"2024-01-01",datetime:lt:"2024-02-01"

Common Examples

Find active customers with "Corp" in name

GET /v3/customers?filter=name:like:"Corp"

Get pending invoices over $500

GET /v3/invoices?filter=status:eq:"PENDING",total:gt:"500"

Find payments received this month

GET /v3/payments?filter=receivedAt:gte:"2024-01-01",receivedAt:lt:"2024-02-01"

Get contracts by multiple statuses

GET /v3/contracts?filter=status:in:"ACTIVE|PENDING"

Find customers without external IDs

GET /v3/customers?filter=externalIds.externalId:isnull:""

Error Handling

The API will return 400 Bad Request for:

  • Invalid filter format
  • Unsupported properties for the endpoint
  • Invalid filter rules
  • Malformed filter syntax

Response Format

All filtered endpoints return paginated responses:

{
  "success": true,
  "payload": {
    "data": [...],
    "currentPage": 1,
    "limit": 50,
    "totalItems": 150
  }
}

Best Practices

  1. Use specific filters - More specific filters improve performance
  2. Combine filters efficiently - Use multiple filters to narrow results
  3. Handle pagination - Always implement pagination for large datasets
  4. Quote values properly - Use double quotes for values with special characters
  5. Test filter combinations - Verify your filter logic returns expected results
    Collapse