POST /<entity>/search endpoints that return entities matching a structured selection-criteria payload. They are useful when you need to find or preview a set of entities — typically before deciding whether to perform a bulk operation on them.
These endpoints are distinct from the simple search query parameter accepted by some GET list endpoints, which performs a text match against names. Advanced search endpoints accept a JSON body and support structured filters on relationships and attributes.
Relationship to Bulk Operations
Each advanced search endpoint accepts the same selection-criteria grammar as the corresponding bulk update and bulk delete endpoints, minus any bulk-only restrictions:- The payroll does not have to be in draft status.
- Managed line items are included in the results.
Endpoints
| Endpoint | Returns |
|---|---|
POST /pay_stubs/search | Pay stubs in a payroll |
POST /work_assignments/search | Work assignments in a business entity |
POST /pay_rates/search | Pay rates under matching work assignments |
POST /overtime_rates/search | Overtime rates under matching pay rates |
POST /<recurrence_type>s/search | Recurrences under matching work assignments |
POST /<line_item_type>_line_items/search | Line items on matching pay stubs |
<recurrence_type> is one of:
allowancedeductionearningemployee_benefitemployer_benefitreimbursement
<line_item_type> is one of:
allowancedeductionearningemployee_benefitemployer_benefitreimbursement
Request Shape
The request body always identifies a parent scope and one or more criteria objects. Two parent scopes are used across the family:- Payroll-scoped endpoints (
pay_stubs, line items): requirepayroll_idand acceptpay_stubs.include/pay_stubs.exclude. - Business-entity-scoped endpoints (
work_assignments,pay_rates,overtime_rates, recurrences): requirebusiness_entity_idand acceptwork_assignments.include/work_assignments.exclude.
Pay Stub Criteria
Used by/pay_stubs/search and the line item search endpoints.
pay_stubs.include can be either the string "all" or an object with one of:
ids: array of pay stub IDspayee_type:"employee"or"contractor"
pay_stubs.exclude is optional and accepts the same object shape (without "all").
Work Assignment Criteria
Used by/work_assignments/search, /pay_rates/search, /overtime_rates/search, and the recurrence search endpoints.
work_assignments.include can be either the string "all" or an object with one of:
ids: array of work assignment IDspayee_type:"employee"or"contractor"pay_schedule_id: ID of a pay schedulearchived:trueto match archived work assignments,falseto match active onespayee_names: string matched against the payee’s name
work_assignments.exclude is optional and accepts the same object shape (without "all").
Additional Criteria
Recurrence and line item search endpoints accept additional filters that narrow the matched entities under the selected parents:business_presets.include.ids/business_presets.exclude.ids: filter by the entity’s business preset. Usenullin the array to match entities with no business preset.expense_accounting_codes.include.ids/expense_accounting_codes.exclude.ids: filter by expense accounting code. Usenullto match entities with no expense accounting code.liability_accounting_codes.include.ids/liability_accounting_codes.exclude.ids: filter by liability accounting code. Usenullto match entities with no liability accounting code.
effective_from/effective_to: filter by the recurrence’s effective date range.subtype: filter by the recurrence subtype (e.g.cell_phone_allowance,bonus_discretionary).ids: filter to a specific set of recurrence IDs.
Response
Each endpoint returns200 OK with a paginated collection of the matching entities, in the same shape as the corresponding GET list endpoint.
422 Unprocessable Entity with standard validation messages.
Examples
Find all pay stubs in a payroll
POST /pay_stubs/search
Find work assignments by payee name
POST /work_assignments/search
Find all recurring allowances tied to a specific business preset
POST /allowances/search
Find earning line items on contractor pay stubs
POST /earning_line_items/search

