Filtering

Efficiently retrieve DailyPay REST API resources with filtering queries by specifying query parameters in the request URL. This guide outlines how to build your queries.

The request URL for a filtered query is structured as follows:

https://dailypay.com/{endpoint}?filter={field}{operator}{value}

Terminology

As mentioned above, filter queries are structured with clauses - a field coupled with an operator and a value. Combine these clauses using keywords for advanced filtering.

  • The {endpoint} is the resource you want to filter, such as organizations, transfers, or paychecks.
  • A {field} is the attribute of a resource you want to filter by, such as a person's name or a transfer's status.
  • An {operator} describes how filters should look up values, such as : for exact match or ~ for partial match.
  • A {value} is any value that could be a valid payload for the attribute, such as "DailyPay" for an organization name, or "PROCESSING" for a transfer status.

Practical Examples

Exact Match & Partial Match

Filter for an organization with the exact name "DailyPay" (using the : operator) or any organization with "Daily" in the name (using the ~ operator).

GET https://dailypay.com/organizations?filter=name:"DailyPay"
GET https://dailypay.com/organizations?filter=name~"Daily"

Exact matches can also include multiple comma-separated values (no whitespace), which will return matches for any of the values.

GET https://dailypay.com/paychecks?filter=status:"IN_TRANSIT","PROCESSING","DEPOSITED"

Escaping Characters

\ is used to escape quotes within strings.

GET https://dailypay.com/organizations?filter=name:"The \"Daily Pay\" Company"

AND & OR Clauses

Together, {field}{operator}{value} form a clause. Clauses can be joined with AND or OR to form more complex filters.

Note that these keywords can be upper or lower case and & is also supported

  • AND, and or & are equivalent
  • OR, or are equivalent
GET https://dailypay.com/paychecks?filter=job_id:"12345" AND status:"PROCESSING"
GET https://dailypay.com/paychecks?filter=job_id:"67890" OR status:"DEPOSITED"

Parenthesis

Parentheses are used to group expressions together and control the order of evaluation. By using parentheses, you can create complex filter conditions that combine multiple criteria clearly and unambiguously. Parentheses are useful for two main purposes:

1. Controlling Evaluation Order

Without parentheses, the filter conditions are evaluated from left to right. Using parentheses allows you to specify the evaluation order explicitly.

GET https://dailypay.com/paychecks?filter=job_id:"aa860051-c411-4709-9685-c1b716df611b" AND (status:"DEPOSITED" OR status:"IN_TRANSIT")

In this example, the API will retrieve paychecks whose status is "DEPOSITED" OR "IN_TRANSIT" belonging to the job of specified job_id. The parentheses ensure that the OR condition is evaluated first, and then the AND condition is applied to the result.

2. Nested Parenthesis

You can also use nested parentheses to create more complex filter conditions. By nesting parentheses, you can create intricate combinations of filtering criteria.

GET https://dailypay.com/paychecks?filter=((status:"IN_TRANSIT" OR status:"PROCESSING") AND (job_id:"aa860051-c411-4709-9685-c1b716df611b" OR job_id:"ta123051-c611-4710-9687-c1b716jld32"))

In this example, the API will retrieve all paychecks with either an IN_TRANSIT or PROCESSING status and belonging to either of the two specified job_ids.

See a complete list of fields and operators for each endpoint below.


Supported Endpoint Filters

accounts

The filter is required when requests are made using oauth_client_credentials_token but optional when using oauth_user_token.

  • Match Type: Exact Only
  • Filterable Parameter: person_id
Field Usage Type Allowed Operators
person_id person_id:"aa860051-c411-4709-9685-c1b716df611b" string :
GET https://dailypay.com/accounts?filter=person_id:"aa860051-c411-4709-9685-c1b716df611b"

organizations

  • Match Type: Exact or Partial
  • Filterable Parameter: name
Field Usage Type Allowed Operators
name name:"DailyPay" string : ~
GET https://dailypay.com/organizations?filter=name:"DailyPay"
GET https://dailypay.com/organizations?filter=name~"Daily"

transfers

  • Match Type: Exact Only
  • Filterable Parameter: person_id
Field Usage Type Allowed Operators
person_id person_id:"aa860051-c411-4709-9685-c1b716df611b" string :
GET https://dailypay.com/transfers?filter=person_id:"aa860051-c411-4709-9685-c1b716df611b"

paychecks

  • Match Type: Exact Only
  • Filterable Parameters: job_id, status
Field Usage Type Allowed Operators
job_id job_id:"aa860051-c411-4709-9685-c1b716df611b" string :
status status:"DEPOSITED" string :
GET https://dailypay.com/paychecks?filter=job_id:"aa860051-c411-4709-9685-c1b716df611b" AND status:"DEPOSITED"

jobs

  • Match Type: Exact Only
  • Filterable Parameters: person_id, first_name, last_name, external_identifiers
Field Usage Type Allowed Operators
person_id person_id:"aa860051-c411-4709-9685-c1b716df611b" string :
first_name first_name:"Edith" string :
last_name last_name:"Clarke" string :
external_identifiers[] external_identifiers[employee_id]:"0123456789" string :