Search Templates
Searches, filters, sorts, and paginates Sales Configuration Templates, supporting field-level filtering (AND logic), free-text search (OR logic), tag-based filtering, and multi-field sorting.
- Resource URL:
/services/apexrest/<namespace>/v1/cpq/templates/search - HTTP Method: POST
- Content-Type: application/json
- Response Format: JSON
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | Object | No | Filter criteria applied with AND logic. |
| offset | Integer | No | Number of records to skip. Default value is 0. |
| pageSize | Integer | No | Number of results per page. Default value is 20. |
| search | Object | No | Search criteria applied with OR logic across specified fields. |
| sortby | Array | No | Array of sort clauses. |
| Property | Type | Description |
|---|---|---|
| criteria | Array | Array of filter criterion objects. All criteria are combined with AND logic. |
| criteria[].field | String | The API name of the field to filter on. Supports SalesConfigTemplate__c fields and relationship fields through TemplateQuoteId__r and TemplateOrderId__r. |
| criteria[].operator | String | The comparison operator. |
| criteria[].values | String | The value(s) to compare against. For IN and NOT IN, provide comma-separated values. |
| Operator | Description | Example Values |
|---|---|---|
| = | Equals | "Approved" |
| != | Not equals | "Draft" |
| IN | Value is in list | "Draft,Approved" |
| NOT IN | Value is not in list | "Obsolete" |
| LIKE | Pattern match (auto-adds % wildcards) | "Enterprise" |
| > | Greater than | "2024-01-01" |
| >= | Greater than or equal | "100" |
| < | Less than | "500" |
| <= | Less than or equal | "1000" |
To filter templates by tag IDs, use the special field name tagIds with the IN operator.
You can filter on fields from the related Quote or Order
Only TemplateQuoteId__r (Quote) and TemplateOrderId__r (Order) relationships are supported.
| Property | Type | Description |
|---|---|---|
| fields | String | Comma-separated list of field names to search across. Use Tags to include tag name matching. All fields are searched with OR logic using LIKE matching. |
| value | String | The search term. Automatically wrapped with % wildcards for LIKE queries. |
| Property | Type | Description |
|---|---|---|
| field | String | The API name of the field to sort by. |
| direction | String | "ASC" (ascending) or "DESC" (descending). Default: "ASC". |
|
Success Response (200):