Skip to content

Commit 4055fc1

Browse files
committed
Updated API from documentation release
1 parent 00b9b10 commit 4055fc1

22 files changed

+242
-45
lines changed

api-specs/api/resources/product-projections-search.raml

Lines changed: 87 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
type: base
22
displayName: Product Projection Search
3-
description: |
4-
This endpoint provides high performance search queries over ProductProjections. The query result contains the
5-
ProductProjections for which at least one ProductVariant matches the search query. This means that variants can
6-
be included in the result also for which the search query does not match. To determine which ProductVariants match
7-
the search query, the returned ProductProjections include the additional field isMatchingVariant.
83
post:
9-
displayName: Search Products by post
4+
displayName: Search Products by POST
5+
description: |
6+
For implementing funnel search on Product Listing Pages where users select multiple filters, use this POST method.
7+
To avoid URL length restrictions, this method passes the same query parameters as defined in the [GET](ctp:api:endpoint:/{projectKey}/product-projections/search:GET) method, within the request body in URL-encoded format.
108
securedBy:
119
[
1210
oauth_2_0:
@@ -18,7 +16,6 @@ post:
1816
],
1917
},
2018
]
21-
description: Product Projection Search
2219
body:
2320
application/x-www-form-urlencoded:
2421
type: string
@@ -29,50 +26,110 @@ post:
2926
example: !include ../examples/product-projections-search.example.json
3027
type: ProductProjectionPagedSearchResponse
3128
get:
32-
displayName: Search Products by get
33-
description: Product Projection Search
29+
displayName: Search Products by GET
30+
description: |
31+
This method appends query parameters to the URL.
32+
The maximum allowed URL length is 8192 characters.
33+
Exceeding this limit will result in URL truncation, potentially leading to unexpected results.
34+
For funnel searches on Product Listing Pages, where users select multiple filters, we recommend the [POST](ctp:api:endpoint:/{projectKey}/product-projections/search:POST) method which passes the query parameters within the request body, avoiding URL length restrictions.
3435
queryParameters:
36+
markMatchingVariants?:
37+
type: boolean
38+
default: false
39+
description: |
40+
Set to `true` to mark [matching variants](/../api/projects/products-search#matching-variants) in the search result.
41+
#TODO clarify correct syntax
42+
/text\.[a-z]{2}(-[A-Z]{2})?/:
43+
(placeholderParam):
44+
paramName: text
45+
template: text.<locale>
46+
placeholder: locale
47+
type: string[]
48+
required: false
49+
description: |
50+
The text to analyze and search for, for example as supplied by a user through a search input field.
51+
The parameter must include the language in form of a [Locale](ctp:api:type:Locale).
52+
The content to search in, that means the full-text search, is only performed in the localized Product content of the specified language.
3553
fuzzy?:
3654
type: boolean
37-
description: Whether to apply fuzzy search on the text to analyze.
55+
default: false
56+
description: |
57+
Set to `true` to apply [fuzzy search](#fuzzy-search) on the `text` to analyze.
3858
fuzzyLevel?:
3959
type: number
4060
format: int32
4161
minimum: 0
4262
maximum: 2
4363
description: |
44-
The fuzzy level desired, if fuzzy is enabled. This value cannot exceed the default value that is calculated based on the length of the searched text.
45-
markMatchingVariants?:
46-
type: boolean
47-
default: false
64+
Set this parameter to overwrite the default fuzzy level.
65+
Only applicable if `fuzzy` is `true`.
66+
67+
- `0` for `text` with 1-2 characters
68+
- `1` for `text` with 3-5 characters
69+
- `2` for `text` with more than 5 characters
70+
71+
If the provided value exceeds the default value, the API responds with an [InvalidInput](/../api/errors#invalidinput) error.
72+
filter.query?:
73+
type: string[]
4874
description: |
49-
If `markMatchingVariants` parameter is `true`, those ProductVariants that match the search query have the additional
50-
field `isMatchingVariant` set to `true`. For the other variants in the same product projection, this field is set to `false`.
75+
Applies a [filter](/../api/projects/products-search#filters) to the [query results](/../api/projects/products-search#query-results) before [facets](/../api/projects/products-search#facets) are calculated.
76+
This parameter has an impact on facet counts.
77+
If you don't use the `facet` parameter in the same request, use this parameter instead of `filter`.
5178
filter?:
5279
type: string[]
53-
filter.facets?:
80+
description: |
81+
Applies a [filter](/../api/projects/products-search#filters) to the query results after facets are calculated.
82+
This parameter does not have an impact on facet counts.
83+
Use this parameter in combination with the `facet` and `filter.facets` parameters for multi-select faceting.
84+
facet?:
5485
type: string[]
55-
filter.query?:
86+
description: |
87+
Requests calculation of [facets](/../api/projects/products-search#facets).
88+
filter.facets?:
5689
type: string[]
57-
facet?:
90+
description: |
91+
Applies a [filter](/../api/projects/products-search#filters) to the calculated [facet results](/../api/projects/products-search#facet-results), not to the Products returned with the [query results](/../api/projects/products-search#query-results).
92+
A facet's own aggregation is not filtered by its corresponding `filter.facets` criteria.
93+
Use this parameter in combination with the `facet` and `filter` parameters for multi-select faceting.
94+
expand?:
5895
type: string[]
59-
#TODO clarify correct syntax
60-
/text\.[a-z]{2}(-[A-Z]{2})?/:
61-
(placeholderParam):
62-
paramName: text
63-
template: text.<locale>
64-
placeholder: locale
96+
description: |
97+
Enables server-side expansion of [References](ctp:api:type:Reference). For details, see [Reference Expansion](/../api/general-concepts#reference-expansion).
98+
sort?:
6599
type: string[]
66-
required: false
100+
description: |
101+
Controls [sorting](/../api/projects/products-search#sorting) of results.
102+
Use this parameter multiple times to sort by multiple fields.
103+
104+
* When `text` is provided, but no sort parameter is given, the results are returned in descending order of relevance (equivalent to `score desc`).
105+
* When neither `text` nor a sort parameter is given, the sort order is nondeterministic.
106+
limit?:
107+
type: number
108+
format: int32
109+
default: 20
110+
minimum: 0
111+
maximum: 500
112+
description: |
113+
The maximum number of results returned on a [page](/../api/projects/products-search#pagination).
114+
offset?:
115+
type: number
116+
format: int32
117+
default: 0
118+
minimum: 0
119+
maximum: 10000
120+
description: |
121+
The starting point for retrieving [paginated](/../api/projects/products-search#pagination) results.
122+
staged?:
123+
type: boolean
124+
description: |
125+
Whether to search in the current or staged Product Projections.
126+
127+
For API Clients with the `view_published_products`, but not the `view_products` [OAuth scope](/../api/scopes#products), `true` leads to a [403 Forbidden](/../api/errors#403-forbidden) error.
67128
is:
68-
- sortable:
69-
sortExample: createdAt asc
70-
- paging
71129
- projectionSelecting
72130
- priceSelecting
73131
- localeProjecting
74132
- storeProjectingTailoring
75-
- expandable
76133
securedBy:
77134
[
78135
oauth_2_0:

api-specs/api/traits/price-selecting.raml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@ queryParameters:
33
priceCurrency?:
44
type: CurrencyCode
55
description: |
6-
The currency used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection).
6+
Enables [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection) and [Scoped Price Search](/../api/pricing-and-discounts-overview#scoped-price-search).
77
priceCountry?:
88
type: CountryCode
99
description: |
10-
The country used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). It can be used only *in conjunction with* the `priceCurrency` parameter.
10+
Enables [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection) and [Scoped Price Search](/../api/pricing-and-discounts-overview#scoped-price-search).
11+
It can be used only *in conjunction with* the `priceCurrency` parameter.
1112
priceCustomerGroup?:
1213
type: string
1314
description: |
14-
`id` of an existing [CustomerGroup](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). It can be used only *in conjunction with* the `priceCurrency` parameter.
15+
`id` of an existing [CustomerGroup](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection).
16+
It can be used only *in conjunction with* the `priceCurrency` parameter.
1517
priceCustomerGroupAssignments?:
1618
type: string[]
1719
(beta): true
1820
description: |
19-
IDs of existing [CustomerGroups](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection), when using [multiple Customer Groups](/../api/customers-overview#customer-groups). It can be used only *in conjunction with* the `priceCurrency` parameter.
21+
IDs of existing [CustomerGroups](ctp:api:type:CustomerGroup) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection), when using [multiple Customer Groups](/../api/customers-overview#customer-groups).
22+
It can be used only *in conjunction with* the `priceCurrency` parameter.
2023
priceChannel?:
2124
type: string
2225
description: |
23-
`id` of an existing [Channel](ctp:api:type:Channel) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection). It can be used only *in conjunction with* the `priceCurrency` parameter.
26+
`id` of an existing [Channel](ctp:api:type:Channel) used for [Product price selection](/../api/pricing-and-discounts-overview#product-price-selection).
27+
It can be used only *in conjunction with* the `priceCurrency` parameter.

api-specs/api/types/PagedQueryResponse.raml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
displayName: PagedQueryResponse
55
type: object
6+
description: |
7+
Each query endpoint returns a paged query response containing the actual resources matching the query predicate plus information about [pagination](#paging).
8+
This documents the fields all query responses have in common, for specific response types, see the respective API reference pages.
69
properties:
710
limit:
811
type: number
@@ -18,6 +21,7 @@ properties:
1821
description: |
1922
Number of [elements skipped](/../api/general-concepts#offset).
2023
default: 0
24+
minimum: 0
2125
maximum: 10000
2226
count:
2327
type: number
@@ -35,5 +39,10 @@ properties:
3539
When the results are filtered with a [Query Predicate](/../api/predicates/query), `total` is subject to a [limit](/../api/limits#queries).
3640
results:
3741
type: BaseResource[]
42+
description: |
43+
The resources matching the query predicate.
44+
Each query endpoint returns resources of its specific type.
3845
meta?:
3946
type: object
47+
description: |
48+
Object containing supplementary information about the results.

api-specs/api/types/common/Sort.raml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
displayName: Sort
44
type: string
55
description: |
6-
Enables server-side expansion of [References](ctp:api:type:Reference). For details, see [Reference Expansion](/../api/general-concepts#reference-expansion).
6+
Controls [sorting](/../api//general-concepts#sorting) of query results.
7+
Use this parameter multiple times to sort by multiple fields.

api-specs/api/types/error/InsufficientScopeError.raml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,13 @@
33
type: ErrorObject
44
displayName: InsufficientScopeError
55
discriminatorValue: insufficient_scope
6+
description: |
7+
This error occurs when your [API Client](/../api/projects/api-clients) does not have the [OAuth scope](/../api/scopes) required for the endpoint.
8+
Use an API Client with the required permissions for this endpoint instead.
9+
properties:
10+
code:
11+
type: string
12+
message:
13+
type: string
14+
description: |
15+
`"Insufficient scope. One of the following scopes is missing:"`

api-specs/api/types/error/graphql/GraphQLInsufficientScopeError.raml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
type: GraphQLErrorObject
44
displayName: GraphQLInsufficientScopeError
55
discriminatorValue: insufficient_scope
6+
description: |
7+
This error occurs when your [API Client](/../api/projects/api-clients) does not have the [OAuth scope](/../api/scopes) required for the endpoint.
8+
Use an API Client with the required permissions for this endpoint instead.
9+
properties:
10+
code:
11+
type: string

api-specs/api/types/product-type/AttributeBooleanType.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ type: AttributeType
44
displayName: AttributeBooleanType
55
discriminatorValue: boolean
66
description: |
7-
Attribute type for Boolean values. Valid values for the Attribute are `true` and `false` (JSON Boolean).
7+
Attribute type for boolean values. Valid values for the Attribute are `true` and `false`.

api-specs/api/types/product-type/AttributeDateTimeType.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
type: AttributeType
44
displayName: AttributeDateTimeType
55
discriminatorValue: datetime
6+
description: |
7+
Attribute type for [DateTime](ctp:api:type:DateTime) type values.

api-specs/api/types/product-type/AttributeDateType.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
type: AttributeType
44
displayName: AttributeDateType
55
discriminatorValue: date
6+
description: |
7+
Attribute type for [Date](ctp:api:type:Date) type values.

api-specs/api/types/product-type/AttributeLocalizableTextType.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ type: AttributeType
44
displayName: AttributeLocalizableTextType
55
discriminatorValue: ltext
66
description: |
7-
Attribute type for [LocalizedString](ctp:api:type:LocalizedString) values.
7+
Attribute type for [LocalizedString](ctp:api:type:LocalizedString) type values.

0 commit comments

Comments
 (0)