Search for customer groups.
Operation ID: searchCustomerGroupSearch for customer groups in a given site ID. The query attribute specifies a complex query that can be used to narrow down the search. The following list provides searchable attributes:
Attribute | Type |
---|---|
id | String |
description | String |
type | String |
Note: This endpoint is available with B2C Commerce version 24.2.
curl "https://{shortCode}.api.commercecloud.salesforce.com/customer/customers/v1/organizations/{organizationId}/customer-group-search?siteId=RefArch" \
-X POST \
-H "content-type: application/json" \
-d '{
"limit": 2,
"offset": 50,
"query": {
"textQuery": {
"fields": [
"email"
],
"searchPhrase": "wleung"
}
}
}'
An identifier for the organization the request is being made by
f_ecom_zzxy_prd
The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites
RefArch
{
"limit": 2,
"offset": 50,
"query": {
"textQuery": {
"fields": [
"email"
],
"searchPhrase": "wleung"
}
}
}
Maximum records to retrieve per request, not to exceed 200.
10
A set of objects that define criteria used to select records. A query can contain one of the following:
MatchAllQuery
- Matches all documents.
TermQuery
- Matches one or more documents against one or more document fields.
TextQuery
- Matches text against one or more fields.
BoolQuery
- Allows construction of a logical expression of multiple queries.
FilteredQuery
- Allows a filter to be applied to a query.
NestedQuery
- Allows you to query on nested documents.
- Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation.
{
"filteredQuery": {
"query": {
"textQuery": {
"fields": [
"couponId"
],
"searchPhrase": "disabled"
}
},
"filter": {
"termFilter": {
"field": "enabled",
"operator": "is",
"values": [
false
]
}
}
}
}
The list of sort clauses configured for the search request. Sort clauses are optional. See the description of the search endpoint for details on the default sorting behavior that is used when explicit sorts are not passed.
[{
"field": "couponId",
"sortOrder": "desc"
}]
The zero-based index of the first hit/data to include in the result.
0
Success
{
"limit": 1,
"hits": [
{
"creationDate": "2020-01-09T16:50:32.000Z",
"description": "Big Spenders",
"id": "Big Spenders",
"inDeletion": false,
"lastModified": "2020-01-09T16:50:32.000Z",
"memberCount": 109,
"rule": {
"description": "Customers who spend more than $1000 in the last month"
},
"type": "dynamic"
}
],
"query": {
"textQuery": {
"fields": [
"id"
],
"searchPhrase": "Big"
}
},
"offset": 0,
"total": 1
}
The sorted array of search hits. Can be empty.
Properties inherited from PaginatedSearchResult.
A set of objects that define criteria used to select records. A query can contain one of the following:
MatchAllQuery
- Matches all documents.
TermQuery
- Matches one or more documents against one or more document fields.
TextQuery
- Matches text against one or more fields.
BoolQuery
- Allows construction of a logical expression of multiple queries.
FilteredQuery
- Allows a filter to be applied to a query.
NestedQuery
- Allows you to query on nested documents.
- Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation.
{
"filteredQuery": {
"query": {
"textQuery": {
"fields": [
"couponId"
],
"searchPhrase": "disabled"
}
},
"filter": {
"termFilter": {
"field": "enabled",
"operator": "is",
"values": [
false
]
}
}
}
}
The sorting that was applied to the result.
[{
"field": "couponId",
"sortOrder": "desc"
}]
The sorted array of search hits. Can be empty.
Properties inherited from PaginatedResultBase.
The zero-based index of the first hit/data to include in the result.
0
Properties inherited from ResultBase.
The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.
10