commerce-sdk-isomorphic 4.0.1-preview-shopper-test.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +3 -61
  2. package/lib/index.cjs.d.ts +1 -18
  3. package/lib/index.cjs.js +1 -1
  4. package/lib/index.esm.d.ts +1 -18
  5. package/lib/index.esm.js +1 -1
  6. package/package.json +27 -94
  7. package/lib/clientConfig.cjs.d.ts +0 -52
  8. package/lib/clientConfig.cjs.js +0 -1
  9. package/lib/clientConfig.d.ts +0 -52
  10. package/lib/clientConfig.js +0 -1
  11. package/lib/config.cjs.d.ts +0 -2
  12. package/lib/config.cjs.js +0 -1
  13. package/lib/config.d.ts +0 -2
  14. package/lib/config.js +0 -1
  15. package/lib/helpers.cjs.d.ts +0 -2225
  16. package/lib/helpers.cjs.js +0 -1
  17. package/lib/helpers.d.ts +0 -2225
  18. package/lib/helpers.js +0 -1
  19. package/lib/responseError.cjs.d.ts +0 -12
  20. package/lib/responseError.cjs.js +0 -1
  21. package/lib/responseError.d.ts +0 -12
  22. package/lib/responseError.js +0 -1
  23. package/lib/shopperBaskets.cjs.d.ts +0 -10259
  24. package/lib/shopperBaskets.cjs.js +0 -1
  25. package/lib/shopperBaskets.d.ts +0 -10259
  26. package/lib/shopperBaskets.js +0 -1
  27. package/lib/shopperBasketsv2.cjs.d.ts +0 -10453
  28. package/lib/shopperBasketsv2.cjs.js +0 -1
  29. package/lib/shopperBasketsv2.d.ts +0 -10453
  30. package/lib/shopperBasketsv2.js +0 -1
  31. package/lib/shopperConsents.cjs.d.ts +0 -1142
  32. package/lib/shopperConsents.cjs.js +0 -1
  33. package/lib/shopperConsents.d.ts +0 -1142
  34. package/lib/shopperConsents.js +0 -1
  35. package/lib/shopperContext.cjs.d.ts +0 -1401
  36. package/lib/shopperContext.cjs.js +0 -1
  37. package/lib/shopperContext.d.ts +0 -1401
  38. package/lib/shopperContext.js +0 -1
  39. package/lib/shopperCustomers.cjs.d.ts +0 -12185
  40. package/lib/shopperCustomers.cjs.js +0 -1
  41. package/lib/shopperCustomers.d.ts +0 -12185
  42. package/lib/shopperCustomers.js +0 -1
  43. package/lib/shopperExperience.cjs.d.ts +0 -1169
  44. package/lib/shopperExperience.cjs.js +0 -1
  45. package/lib/shopperExperience.d.ts +0 -1169
  46. package/lib/shopperExperience.js +0 -1
  47. package/lib/shopperGiftCertificates.cjs.d.ts +0 -729
  48. package/lib/shopperGiftCertificates.cjs.js +0 -1
  49. package/lib/shopperGiftCertificates.d.ts +0 -729
  50. package/lib/shopperGiftCertificates.js +0 -1
  51. package/lib/shopperLogin.cjs.d.ts +0 -3842
  52. package/lib/shopperLogin.cjs.js +0 -1
  53. package/lib/shopperLogin.d.ts +0 -3842
  54. package/lib/shopperLogin.js +0 -1
  55. package/lib/shopperOrders.cjs.d.ts +0 -5393
  56. package/lib/shopperOrders.cjs.js +0 -1
  57. package/lib/shopperOrders.d.ts +0 -5393
  58. package/lib/shopperOrders.js +0 -1
  59. package/lib/shopperProducts.cjs.d.ts +0 -3479
  60. package/lib/shopperProducts.cjs.js +0 -1
  61. package/lib/shopperProducts.d.ts +0 -3479
  62. package/lib/shopperProducts.js +0 -1
  63. package/lib/shopperPromotions.cjs.d.ts +0 -1001
  64. package/lib/shopperPromotions.cjs.js +0 -1
  65. package/lib/shopperPromotions.d.ts +0 -1001
  66. package/lib/shopperPromotions.js +0 -1
  67. package/lib/shopperSearch.cjs.d.ts +0 -3352
  68. package/lib/shopperSearch.cjs.js +0 -1
  69. package/lib/shopperSearch.d.ts +0 -3352
  70. package/lib/shopperSearch.js +0 -1
  71. package/lib/shopperSeo.cjs.d.ts +0 -769
  72. package/lib/shopperSeo.cjs.js +0 -1
  73. package/lib/shopperSeo.d.ts +0 -769
  74. package/lib/shopperSeo.js +0 -1
  75. package/lib/shopperStores.cjs.d.ts +0 -1289
  76. package/lib/shopperStores.cjs.js +0 -1
  77. package/lib/shopperStores.d.ts +0 -1289
  78. package/lib/shopperStores.js +0 -1
  79. package/lib/templateUrl.cjs.d.ts +0 -76
  80. package/lib/templateUrl.cjs.js +0 -1
  81. package/lib/templateUrl.d.ts +0 -76
  82. package/lib/templateUrl.js +0 -1
  83. package/lib/version.cjs.d.ts +0 -3
  84. package/lib/version.cjs.js +0 -1
  85. package/lib/version.d.ts +0 -3
  86. package/lib/version.js +0 -1
@@ -1,3352 +0,0 @@
1
- /*
2
- * Copyright (c) 2021, salesforce.com, inc.
3
- * All rights reserved.
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- import { RequestInit as NodeRequestInit } from "node-fetch";
8
- /*
9
- * Copyright (c) 2025, Salesforce, Inc.
10
- * All rights reserved.
11
- * SPDX-License-Identifier: BSD-3-Clause
12
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
13
- */
14
- declare const defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/v1";
15
- /**
16
- * Makes a type easier to read.
17
- */
18
- type Prettify<T> = NonNullable<{
19
- [K in keyof T]: T[K];
20
- }>;
21
- /**
22
- * Generates the types required on a method, based on those provided in the config.
23
- */
24
- type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
25
- /**
26
- * If an object has a `parameters` property, and the `parameters` object has required properties,
27
- * then the `parameters` property on the root object is marked as required.
28
- */
29
- type RequireParametersUnlessAllAreOptional<T extends {
30
- parameters?: Record<string, unknown>;
31
- }> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
32
- /**
33
- * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
34
- * if not specified.
35
- */
36
- interface BaseUriParameters {
37
- shortCode: string;
38
- }
39
- type LocaleCode = {
40
- [key: string]: any;
41
- };
42
- /**
43
- * Generic interface for path parameters.
44
- */
45
- interface PathParameters {
46
- [key: string]: string | number | boolean;
47
- }
48
- /**
49
- * Generic interface for query parameters.
50
- */
51
- interface QueryParameters {
52
- [key: string]: string | number | boolean | string[] | number[] | LocaleCode;
53
- }
54
- /**
55
- * Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
56
- * it from the `RequestInit` provided by node-fetch.
57
- */
58
- type BrowserRequestInit = RequestInit;
59
- /**
60
- * Any properties supported in either the browser or node are accepted.
61
- * Using the right properties in the right context is left to the user.
62
- */
63
- type FetchOptions = NodeRequestInit & BrowserRequestInit;
64
- /**
65
- * Base options that can be passed to the `ClientConfig` class.
66
- */
67
- interface ClientConfigInit<Params extends BaseUriParameters> {
68
- baseUri?: string;
69
- proxy?: string;
70
- headers?: {
71
- [key: string]: string;
72
- };
73
- parameters: Params;
74
- fetchOptions?: FetchOptions;
75
- transformRequest?: (data: unknown, headers: {
76
- [key: string]: string;
77
- }) => Required<FetchOptions>["body"];
78
- throwOnBadResponse?: boolean;
79
- }
80
- /**
81
- * Configuration parameters common to Commerce SDK clients
82
- */
83
- declare class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
84
- baseUri?: string;
85
- proxy?: string;
86
- headers: {
87
- [key: string]: string;
88
- };
89
- parameters: Params;
90
- fetchOptions: FetchOptions;
91
- transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
92
- throwOnBadResponse: boolean;
93
- constructor(config: ClientConfigInit<Params>);
94
- static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
95
- }
96
- /**
97
- * @type SuggestedTerm: Document representing a suggested term.
98
- *
99
- * @property completed: Returns whether this term value is a completion match.
100
- *
101
- * @property corrected: Returns whether this term value is a correction match.
102
- *
103
- * @property exactMatch: Returns whether this term value is a exact match.
104
- *
105
- * @property value: Returns the term value.
106
- * - **Min Length:** 1
107
- * - **Max Length:** 50
108
- *
109
- */
110
- type SuggestedTerm = {
111
- completed: boolean;
112
- corrected: boolean;
113
- exactMatch: boolean;
114
- value: string;
115
- } & {
116
- [key: string]: any;
117
- };
118
- /**
119
- * @type SuggestedTerms: Document representing a list of suggested terms for each term of a search phrase.
120
- *
121
- * @property originalTerm: Returns the original term that the suggested terms relates to.
122
- * - **Min Length:** 1
123
- * - **Max Length:** 50
124
- *
125
- * @property terms: Returns the suggested terms.
126
- *
127
- */
128
- type SuggestedTerms = {
129
- originalTerm: string;
130
- terms?: Array<SuggestedTerm>;
131
- } & {
132
- [key: string]: any;
133
- };
134
- /**
135
- * @type SuggestedPhrase: Document representing a suggested search phrase.
136
- *
137
- * @property exactMatch: Returns whether this suggested phrase exactly matches the user input search phrase.
138
- *
139
- * @property phrase: Returns the suggested search phrase.
140
- * - **Min Length:** 1
141
- * - **Max Length:** 50
142
- *
143
- */
144
- type SuggestedPhrase = {
145
- exactMatch: boolean;
146
- phrase: string;
147
- } & {
148
- [key: string]: any;
149
- };
150
- /**
151
- * @type BrandSuggestions: The suggested brand names are listed in suggested phrases. If this list is empty, no brand suggestion for a given search phrase was found.
152
- *
153
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
154
- *
155
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
156
- *
157
- */
158
- type BrandSuggestions = {
159
- suggestedPhrases?: Array<SuggestedPhrase>;
160
- suggestedTerms: Array<SuggestedTerms>;
161
- } & {
162
- [key: string]: any;
163
- };
164
- /**
165
- * @type SuggestedCategory:
166
- *
167
- * @property id: The ID of the category.
168
- * - **Min Length:** 1
169
- * - **Max Length:** 260
170
- *
171
- * @property name: The localized name of the category.
172
- * - **Min Length:** 1
173
- * - **Max Length:** 4000
174
- *
175
- * @property parentCategoryName: The name of the parent category.
176
- * - **Min Length:** 1
177
- * - **Max Length:** 4000
178
- *
179
- */
180
- type SuggestedCategory = {
181
- id: string;
182
- name: string;
183
- parentCategoryName: string;
184
- } & {
185
- [key: string]: any;
186
- };
187
- /**
188
- * @type CategorySuggestions:
189
- *
190
- * @property categories: The sorted list of suggested categories. This list can be empty.
191
- *
192
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
193
- *
194
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
195
- *
196
- */
197
- type CategorySuggestions = {
198
- categories?: Array<SuggestedCategory>;
199
- suggestedPhrases?: Array<SuggestedPhrase>;
200
- suggestedTerms: Array<SuggestedTerms>;
201
- } & {
202
- [key: string]: any;
203
- };
204
- /**
205
- * A specialized value indicating the lack of definition of a currency, for example, if the value of the monetary value of the currency is an undefined number.
206
- */
207
- type NoValue = "N/A";
208
- /**
209
- * @type CurrencyCode
210
- * A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
211
- */
212
- type CurrencyCode = NoValue | string;
213
- /**
214
- * @type CustomSuggestions: The custom suggestions are listed in suggested phrases. If this list is empty, no custom suggestion for the given search phrase was found.
215
- *
216
- * @property customSuggestion:
217
- *
218
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
219
- *
220
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
221
- *
222
- */
223
- type CustomSuggestions = {
224
- customSuggestion?: string;
225
- suggestedPhrases?: Array<SuggestedPhrase>;
226
- suggestedTerms: Array<SuggestedTerms>;
227
- } & {
228
- [key: string]: any;
229
- };
230
- /**
231
- * A specialized value indicating the system default values for locales.
232
- */
233
- type DefaultFallback = "default";
234
- /**
235
- * @type EinsteinSuggestedPhrases: Einstein-suggested phrases containing popular and recent search phrases.
236
- *
237
- * @property popularSearchPhrases: A list of popular search phrases suggested by Einstein. This list can be empty.
238
- *
239
- * @property recentSearchPhrases: A list of recent search phrases suggested by Einstein. This list can be empty.
240
- *
241
- */
242
- type EinsteinSuggestedPhrases = {
243
- popularSearchPhrases?: Array<SuggestedPhrase>;
244
- recentSearchPhrases?: Array<SuggestedPhrase>;
245
- } & {
246
- [key: string]: any;
247
- };
248
- /**
249
- * @type ErrorResponse:
250
- *
251
- * @property title: A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization
252
- * - **Max Length:** 256
253
- *
254
- * @property type: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\". It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
255
- * - **Max Length:** 2048
256
- *
257
- * @property detail: A human-readable explanation specific to this occurrence of the problem.
258
- *
259
- * @property instance: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
260
- * - **Max Length:** 2048
261
- *
262
- */
263
- type ErrorResponse = {
264
- title: string;
265
- type: string;
266
- detail: string;
267
- instance?: string;
268
- } & {
269
- [key: string]: any;
270
- };
271
- /**
272
- * @type Image:
273
- *
274
- * @property alt: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
275
- * - **Max Length:** 4000
276
- *
277
- * @property disBaseLink: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
278
- * - **Max Length:** 4000
279
- *
280
- * @property link: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
281
- * - **Min Length:** 1
282
- * - **Max Length:** 4000
283
- *
284
- * @property title: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
285
- * - **Max Length:** 4000
286
- *
287
- */
288
- type Image = {
289
- alt?: string;
290
- disBaseLink?: string;
291
- link: string;
292
- title?: string;
293
- } & {
294
- [key: string]: any;
295
- };
296
- /**
297
- * @type VariationAttributeValue: Document representing a variation attribute value.
298
- *
299
- * @property description: The localized description of the variation value.
300
- * - **Max Length:** 4000
301
- *
302
- * @property image: The first product image for the configured viewtype and this variation value.
303
- *
304
- * @property imageSwatch: The first product image for the configured viewtype and this variation value. Typically the swatch image.
305
- *
306
- * @property name: The localized display name of the variation value.
307
- * - **Max Length:** 4000
308
- *
309
- * @property orderable: A flag indicating whether at least one variant with this variation attribute value is available to sell.
310
- *
311
- * @property value: The actual variation value.
312
- * - **Min Length:** 1
313
- * - **Max Length:** 4000
314
- *
315
- */
316
- type VariationAttributeValue = {
317
- description?: string;
318
- image?: Image;
319
- imageSwatch?: Image;
320
- name?: string;
321
- orderable?: boolean;
322
- value: string;
323
- } & {
324
- [key: string]: any;
325
- };
326
- /**
327
- * @type VariationAttribute: Document representing a variation attribute.
328
- *
329
- * @property id: The ID of the variation attribute.
330
- * - **Min Length:** 1
331
- * - **Max Length:** 256
332
- *
333
- * @property name: The localized display name of the variation attribute.
334
- * - **Max Length:** 4000
335
- *
336
- * @property values: The sorted array of variation values. This array can be empty.
337
- *
338
- */
339
- type VariationAttribute = {
340
- id: string;
341
- name?: string;
342
- values?: Array<VariationAttributeValue>;
343
- } & {
344
- [key: string]: any;
345
- };
346
- /**
347
- * @type ImageGroup: Document representing an image group containing a list of images for a particular view type and an optional variation value.
348
- *
349
- * @property images: The images of the image group.
350
- *
351
- * @property variationAttributes: Returns a list of variation attributes applying to this image group.
352
- *
353
- * @property viewType: The image view type.
354
- * - **Min Length:** 1
355
- * - **Max Length:** 256
356
- *
357
- */
358
- type ImageGroup = {
359
- images: Array<Image>;
360
- variationAttributes?: Array<VariationAttribute>;
361
- viewType: string;
362
- } & {
363
- [key: string]: any;
364
- };
365
- /**
366
- * @type LocaleCode
367
- * A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
368
- */
369
- type LocaleCode$0 = DefaultFallback | string;
370
- /**
371
- * @type PageMetaTag: Document representing a Page Meta Tag object.
372
- *
373
- * @property id: The ID of the Page Meta Tag.
374
- * - **Max Length:** 256
375
- *
376
- * @property value: Locale-specific value of the Page Meta Tag, evaluated by resolving the rule set for the given Business Manager ID.
377
- *
378
- */
379
- type PageMetaTag = {
380
- id?: string;
381
- value?: string;
382
- } & {
383
- [key: string]: any;
384
- };
385
- /**
386
- * @type PaginatedResultBase: Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. If you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.
387
- *
388
- * @property offset: The zero-based index of the first hit/data to include in the result.
389
- *
390
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
391
- *
392
- * @property total: 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.
393
- *
394
- */
395
- type PaginatedResultBase = {
396
- offset: number;
397
- limit: number;
398
- total: number;
399
- } & {
400
- [key: string]: any;
401
- };
402
- /**
403
- * @type PriceRange: Document representing price ranges for a product which happens to be a master product (per Pricebook)
404
- *
405
- * @property maxPrice: Maximum price for the given pricebook (usually for a master Product would be the price for the Variant which has the highest price out of all Variants in that pricebook)
406
- *
407
- * @property minPrice: Minimum price for the given pricebook (usually for a master Product would be the price for the Variant which has the least price out of all Variants in that pricebook)
408
- *
409
- * @property pricebook: The active pricebook from which the min and the max prices are calculated. The pricebook is based on the site context of the request as defined in ECOM.
410
- * - **Max Length:** 256
411
- *
412
- */
413
- type PriceRange = {
414
- maxPrice?: number;
415
- minPrice?: number;
416
- pricebook?: string;
417
- } & {
418
- [key: string]: any;
419
- };
420
- /**
421
- * @type ProductPriceTable: Tiered Price Level Object
422
- *
423
- * @property price: Price for the product for the specified tier for the specified pricebook
424
- *
425
- * @property pricebook: The active pricebook for which this price is defined
426
- * - **Max Length:** 256
427
- *
428
- * @property quantity: Quantity tier for which the price is defined.
429
- *
430
- */
431
- type ProductPriceTable = {
432
- price?: number;
433
- pricebook?: string;
434
- quantity?: number;
435
- } & {
436
- [key: string]: any;
437
- };
438
- /**
439
- * @type ProductPromotion: Document representing a product promotion.
440
- *
441
- * @property calloutMsg: The localized call-out message of the promotion.
442
- * - **Min Length:** 1
443
- * - **Max Length:** 4000
444
- *
445
- * @property promotionId: The unique ID of the promotion.
446
- * - **Min Length:** 1
447
- * - **Max Length:** 260
448
- *
449
- * @property promotionalPrice: The promotional price for this product.
450
- *
451
- */
452
- type ProductPromotion = {
453
- calloutMsg: string;
454
- promotionId: string;
455
- promotionalPrice: number;
456
- } & {
457
- [key: string]: any;
458
- };
459
- /**
460
- * @type ProductRef: Document representing a product reference.
461
- *
462
- * @property id: The ID of the product reference.
463
- * - **Min Length:** 1
464
- * - **Max Length:** 100
465
- *
466
- */
467
- type ProductRef = {
468
- id: string;
469
- } & {
470
- [key: string]: any;
471
- };
472
- /**
473
- * @type Variant: A product which is a variation within a master product that describes different colors, sizes, or other variation attributes. *Has a SKU.*
474
- *
475
- * @property orderable: A flag indicating whether the variant is orderable.
476
- *
477
- * @property price: The sales price of the variant.
478
- *
479
- * @property productId: The ID (SKU) of the variant.
480
- * - **Min Length:** 1
481
- * - **Max Length:** 100
482
- *
483
- * @property tieredPrices: List of tiered prices if the product is a variant
484
- *
485
- * @property variationValues: The actual variation attribute ID - value pairs.
486
- *
487
- * @property productPromotions: The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.
488
- *
489
- */
490
- type Variant = {
491
- orderable?: boolean;
492
- price?: number;
493
- productId: string;
494
- tieredPrices?: Array<ProductPriceTable>;
495
- variationValues?: {
496
- [key: string]: string;
497
- };
498
- productPromotions?: Array<ProductPromotion>;
499
- } & {
500
- [key: string]: any;
501
- };
502
- /**
503
- * @type VariationGroup: Representation of a group of variant products by an attribute. This can\'t be purchased by a shopper. It provides inheritable attributes for its product variants and is used for navigation. A VariationGroup doesn\'t have a SKU.
504
- *
505
- * @property orderable: A flag indicating whether the variation group is orderable.
506
- *
507
- * @property price: The sales price of the variation group.
508
- *
509
- * @property productId: The ID (SKU) of the variation group.
510
- * - **Min Length:** 1
511
- * - **Max Length:** 100
512
- *
513
- * @property variationValues: The actual variation attribute ID - value pairs.
514
- *
515
- */
516
- type VariationGroup = {
517
- orderable: boolean;
518
- price: number;
519
- productId: string;
520
- variationValues: {
521
- [key: string]: string;
522
- };
523
- } & {
524
- [key: string]: any;
525
- };
526
- /**
527
- * @type ProductType: Document representing a product type.
528
- *
529
- * @property bundle: A flag indicating whether the product is a bundle.
530
- *
531
- * @property item: A flag indicating whether the product is a standard item.
532
- *
533
- * @property master: A flag indicating whether the product is a master.
534
- *
535
- * @property option: A flag indicating whether the product is an option.
536
- *
537
- * @property set: A flag indicating whether the product is a set.
538
- *
539
- * @property variant: A flag indicating whether the product is a variant.
540
- *
541
- * @property variationGroup: A flag indicating whether the product is a variation group.
542
- *
543
- */
544
- type ProductType = {
545
- bundle?: boolean;
546
- item?: boolean;
547
- master?: boolean;
548
- option?: boolean;
549
- set?: boolean;
550
- variant?: boolean;
551
- variationGroup?: boolean;
552
- } & {
553
- [key: string]: any;
554
- };
555
- /**
556
- * @type ProductSearchHit: Document representing a product search hit.
557
- *
558
- * @property currency:
559
- *
560
- * @property hitType: The type information for the search hit.
561
- * - **Max Length:** 256
562
- *
563
- * @property image: The first image of the product hit for the configured viewtype.
564
- *
565
- * @property orderable: A flag indicating whether the product is orderable.
566
- *
567
- * @property price: The sales price of the product. In complex products, like master or set, this is the minimum price of related child products.
568
- *
569
- * @property priceMax: The maximum sales of related child products in complex products like master or set.
570
- *
571
- * @property productId: The ID (SKU) of the product.
572
- * - **Min Length:** 1
573
- * - **Max Length:** 100
574
- *
575
- * @property productName: The localized name of the product.
576
- * - **Max Length:** 4000
577
- *
578
- * @property productType: The type information for the product.
579
- *
580
- * @property representedProduct: The first represented product.
581
- *
582
- * @property representedProducts: All the represented products.
583
- *
584
- * @property variationAttributes: The array of represented variation attributes, for the master product only. This array can be empty.
585
- *
586
- * @property imageGroups: The array of product image groups.
587
- *
588
- * @property priceRanges: Array of one or more price range objects representing one or more Pricebooks in context for the site.
589
- *
590
- * @property productPromotions: The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.
591
- *
592
- * @property tieredPrices: The document represents list of tiered prices if the product is a variant
593
- *
594
- * @property variants: The array of actual variants. Only for master, variation group, and variant types. This array can be empty.
595
- *
596
- * @property variationGroups: The array of actual variation groups. Only for master, variation group, and variant types. This array can be empty.
597
- *
598
- */
599
- type ProductSearchHit = {
600
- currency?: CurrencyCode;
601
- hitType?: string;
602
- image?: Image;
603
- orderable?: boolean;
604
- price?: number;
605
- priceMax?: number;
606
- productId: string;
607
- productName?: string;
608
- productType?: ProductType;
609
- representedProduct?: ProductRef;
610
- representedProducts?: Array<ProductRef>;
611
- variationAttributes?: Array<VariationAttribute>;
612
- imageGroups?: Array<ImageGroup>;
613
- priceRanges?: Array<PriceRange>;
614
- productPromotions?: Array<ProductPromotion>;
615
- tieredPrices?: Array<ProductPriceTable>;
616
- variants?: Array<Variant>;
617
- variationGroups?: Array<VariationGroup>;
618
- } & {
619
- [key: string]: any;
620
- };
621
- /**
622
- * @type ProductSearchRefinementValue: Document representing a product search refinement value.
623
- *
624
- * @property description: The localized description of the refinement value.
625
- * - **Max Length:** 4000
626
- *
627
- * @property hitCount: The number of search hits when selecting the refinement value. Can be 0.
628
- *
629
- * @property label: The localized label of the refinement value.
630
- * - **Min Length:** 1
631
- * - **Max Length:** 4000
632
- *
633
- * @property presentationId: The optional presentation ID associated with the refinement value. The presentation ID can be used, for example, to associate an ID with an HTML widget.
634
- * - **Max Length:** 256
635
- *
636
- * @property value: The refinement value. In the case of an attribute refinement, this is the bucket, the attribute value, or a value range. In the case of a category refinement, this is the category ID. In the case of a price refinement, this is the price range. Ranges are enclosed by parentheses and delimited by \"..\"; for example, \"(100..999)\" and \"(Aa..Fa)\" are valid ranges.
637
- * - **Min Length:** 1
638
- * - **Max Length:** 4000
639
- *
640
- * @property values: The array of hierarchical refinement values. This array can be empty.
641
- *
642
- */
643
- type ProductSearchRefinementValue = {
644
- description?: string;
645
- hitCount: number;
646
- label: string;
647
- presentationId?: string;
648
- value: string;
649
- values?: Array<ProductSearchRefinementValue>;
650
- } & {
651
- [key: string]: any;
652
- };
653
- /**
654
- * @type ProductSearchRefinement: Document representing a product search refinement attribute.
655
- *
656
- * @property attributeId: The ID of the search refinement attribute. In the case of an attribute refinement, this is the attribute ID. Custom attributes are marked by the prefix \"c_\" (for example, \"c_refinementColor\"). In the case of a category refinement, the ID must be \"cgid\". In the case of a price refinement, the ID must be \"price\".
657
- * - **Min Length:** 1
658
- * - **Max Length:** 256
659
- *
660
- * @property label: The localized label of the refinement.
661
- * - **Max Length:** 256
662
- *
663
- * @property values: The sorted array of refinement values. This array can be empty.
664
- *
665
- */
666
- type ProductSearchRefinement = {
667
- attributeId: string;
668
- label?: string;
669
- values?: Array<ProductSearchRefinementValue>;
670
- } & {
671
- [key: string]: any;
672
- };
673
- /**
674
- * @type Suggestion: Document representing a suggestion.
675
- *
676
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
677
- *
678
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
679
- *
680
- */
681
- type Suggestion = {
682
- suggestedPhrases?: Array<SuggestedPhrase>;
683
- suggestedTerms: Array<SuggestedTerms>;
684
- } & {
685
- [key: string]: any;
686
- };
687
- /**
688
- * @type ProductSearchSortingOption: Document representing a product search sorting option.
689
- *
690
- * @property id: The ID of the sorting option.
691
- * - **Min Length:** 1
692
- * - **Max Length:** 256
693
- *
694
- * @property label: The localized label of the sorting option.
695
- * - **Min Length:** 1
696
- * - **Max Length:** 4000
697
- *
698
- */
699
- type ProductSearchSortingOption = {
700
- id: string;
701
- label: string;
702
- } & {
703
- [key: string]: any;
704
- };
705
- /**
706
- * @type ProductSearchResult: Document representing a product search result.
707
- *
708
- * @property hits: A sorted array of search hits (`ProductSearchHit` objects). The array can be empty.
709
- *
710
- * @property pageMetaTags: Page Meta tags associated with the search result.
711
- *
712
- * @property query: The query string that was searched for.
713
- * - **Max Length:** 50
714
- *
715
- * @property refinements: The sorted array of search refinements. This array can be empty.
716
- *
717
- * @property searchPhraseSuggestions: The suggestion given by the system for the submitted search phrase.
718
- * - **Min Length:** 1
719
- *
720
- * @property selectedRefinements: A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL.
721
- *
722
- * @property selectedSortingOption: The ID of the applied sorting option.
723
- * - **Max Length:** 4000
724
- *
725
- * @property sortingOptions: The sorted array of search sorting options. This array can be empty.
726
- *
727
- * @property offset: The zero-based index of the first hit/data to include in the result.
728
- *
729
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
730
- *
731
- * @property total: 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.
732
- *
733
- */
734
- type ProductSearchResult = {
735
- hits: Array<ProductSearchHit>;
736
- pageMetaTags?: Array<PageMetaTag>;
737
- query: string;
738
- refinements: Array<ProductSearchRefinement>;
739
- searchPhraseSuggestions: Suggestion;
740
- selectedRefinements?: {
741
- [key: string]: string;
742
- };
743
- selectedSortingOption?: string;
744
- sortingOptions: Array<ProductSearchSortingOption>;
745
- offset: number;
746
- limit: number;
747
- total: number;
748
- } & {
749
- [key: string]: any;
750
- };
751
- /**
752
- * @type SuggestedProduct: Document representing a product search hit.
753
- *
754
- * @property currency:
755
- *
756
- * @property price: The sales price of the product. In the case of complex products like a master or a set, this is the minimum price of related child products.
757
- *
758
- * @property productId: The ID (SKU) of the product.
759
- * - **Min Length:** 1
760
- * - **Max Length:** 100
761
- *
762
- * @property productName: The localized name of the product.
763
- * - **Min Length:** 1
764
- * - **Max Length:** 4000
765
- *
766
- */
767
- type SuggestedProduct = {
768
- currency: CurrencyCode;
769
- price: number;
770
- productId: string;
771
- productName: string;
772
- } & {
773
- [key: string]: any;
774
- };
775
- /**
776
- * @type ProductSuggestions:
777
- *
778
- * @property products: The sorted list of suggested products. This list can be empty.
779
- *
780
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
781
- *
782
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
783
- *
784
- */
785
- type ProductSuggestions = {
786
- products?: Array<SuggestedProduct>;
787
- suggestedPhrases?: Array<SuggestedPhrase>;
788
- suggestedTerms: Array<SuggestedTerms>;
789
- } & {
790
- [key: string]: any;
791
- };
792
- /**
793
- * @type ResultBase: Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.
794
- *
795
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
796
- *
797
- * @property total: 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.
798
- *
799
- */
800
- type ResultBase = {
801
- limit: number;
802
- total: number;
803
- } & {
804
- [key: string]: any;
805
- };
806
- /**
807
- * @type SuggestionResult: Document representing a search suggestion result.
808
- *
809
- * @property brandSuggestions: Returns the suggested brands.
810
- *
811
- * @property categorySuggestions: Returns the suggested categories.
812
- *
813
- * @property productSuggestions: Returns the suggested products.
814
- *
815
- * @property customSuggestion: Returns custom suggestions.
816
- *
817
- * @property einsteinSuggestedPhrases: Returns Einstein suggested phrases containing popular and recent search phrases.
818
- *
819
- * @property searchPhrase: The query phrase (q) for which suggestions where made.
820
- * - **Min Length:** 3
821
- * - **Max Length:** 50
822
- *
823
- */
824
- type SuggestionResult = {
825
- brandSuggestions?: BrandSuggestions;
826
- categorySuggestions?: CategorySuggestions;
827
- productSuggestions?: ProductSuggestions;
828
- customSuggestion?: CustomSuggestions;
829
- einsteinSuggestedPhrases?: EinsteinSuggestedPhrases;
830
- searchPhrase: string;
831
- } & {
832
- [key: string]: any;
833
- };
834
- type GetSearchSuggestionsExpandEnum = "images" | "prices" | "custom_product_properties";
835
- type ProductSearchExpandEnum = "none" | "availability" | "images" | "prices" | "represented_products" | "variations" | "promotions" | "custom_properties" | "page_meta_tags";
836
- type getSearchSuggestionsQueryParameters = {
837
- siteId: string;
838
- q: string;
839
- limit?: number;
840
- currency?: CurrencyCode;
841
- locale?: LocaleCode$0;
842
- expand?: Array<"images" | "prices" | "custom_product_properties">;
843
- includedCustomProductProperties?: Array<string>;
844
- includeEinsteinSuggestedPhrases?: boolean;
845
- };
846
- type getSearchSuggestionsPathParameters = {
847
- organizationId: string;
848
- };
849
- type productSearchQueryParameters = {
850
- select?: string;
851
- siteId: string;
852
- q?: string;
853
- refine?: string;
854
- sort?: string;
855
- currency?: CurrencyCode;
856
- locale?: LocaleCode$0;
857
- expand?: Array<"none" | "availability" | "images" | "prices" | "represented_products" | "variations" | "promotions" | "custom_properties" | "page_meta_tags">;
858
- allImages?: boolean;
859
- perPricebook?: boolean;
860
- allVariationProperties?: boolean;
861
- includedCustomVariationProperties?: Array<string>;
862
- limit?: number;
863
- offset?: number;
864
- };
865
- type productSearchPathParameters = {
866
- organizationId: string;
867
- };
868
- /**
869
- * All path parameters that are used by at least one ShopperSearch method.
870
- */
871
- type ShopperSearchPathParameters = Partial<getSearchSuggestionsPathParameters & productSearchPathParameters & {}>;
872
- /**
873
- * All query parameters that are used by at least one ShopperSearch method.
874
- */
875
- type ShopperSearchQueryParameters = Partial<getSearchSuggestionsQueryParameters & productSearchQueryParameters & {}>;
876
- /**
877
- * All parameters that are used by ShopperSearch.
878
- */
879
- type ShopperSearchParameters = ShopperSearchPathParameters & BaseUriParameters & ShopperSearchQueryParameters;
880
- /**
881
- * [Shopper Search](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-search:Summary)
882
- * ==================================
883
- *
884
- * *# API Overview
885
-
886
- Use the Shopper Search API for search functionality that lets shoppers search for products using keywords and refinement. The search results can be products or suggestions based on the endpoint you choose in the API.
887
-
888
- Caching is provided for the Shopper Search API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
889
-
890
- ## Authentication & Authorization
891
-
892
- The client requesting the API must have access to the product search and search suggestion resources.
893
-
894
- The Shopper Search API requires a JWT acquired via the Shopper Customers endpoint:
895
-
896
- ```
897
- https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{organizationId}/customers/actions/login
898
- ```
899
-
900
- ## Use Cases
901
-
902
- ### Provide Search Suggestions
903
-
904
- Use the Shopper Search API to provide search suggestions as a shopper searches.
905
-
906
- For example, a developer who is building a shopping app using the Salesforce Commerce API would like to provide product, brand, and category suggestions. When a shopper types in a search phrase that exceeds a definable minimum length and the GET Search Suggestion endpoint is requested, the platform delivers a set of suggestions with products (name, ID), brands (name), and categories (name, ID). Shoppers can reach their desired search results more quickly using the suggested completion and correction.
907
-
908
- ### Provide Search Results
909
-
910
- Use the Shopper Search API to gather product results for a shoppers search query.
911
-
912
- For example, a developer who is building a shopping app using the Salesforce Commerce API would like to implement a product search functionality. When a shopper enters a search phrase and the GET Product Search endpoint is requested, the platform performs a keyword search and a sorted search result is returned. The sorted search result can be refined according to given values (for example, a price range).
913
- The product search result contains a definable number of product search hits. A product search hit describes a matching product with its ID and name. Furthermore, the search hit contains product images, prices, represented products, and variations. In addition to the search hits, the search results also deliver refinement and sorting options.
914
-
915
- ### Retrieve Promotion Information
916
-
917
- Note: This only applies if `promotions` expand is provided in the query parameter.
918
-
919
- Promotions provide discounts to shoppers when they meet certain purchase requirements.
920
-
921
- Promotion information is described in detail in [Promotion Details](https://developer.salesforce.com/docs/commerce/commerce-api/guide/promotion-details.html), but the following list provides several key points:
922
-
923
- - Pricing discounts for basket and shipping promotions are NEVER returned by the 'getProduct' or 'getProducts' endpoint.
924
- - Promotional pricing is ONLY returned for products that are included with non-conditional promotions.
925
- - Callout messages are ALWAYS returned by the 'getProduct' and 'getProducts' endpoints.
926
-
927
- By default, 'getProduct' and 'getProducts' return promotion information for a queried product. Promotion information includes both pricing and callout message information. However, the specific pricing and callout information that is fetched is determined by:
928
-
929
- - Promotion Type
930
- - Product Type
931
- - Product Purchase Requirements
932
-
933
- Some promotions can be displayed on a Product Data Page (PDP) or Product Listing page (PLP), while other promotions are displayed in the context of a basket, such as an order level promotion: "add the product to your basket to view price information". It is important to understand what is included in the response when designing a PDP or PLP on top of SCAPI to ensure your design aligns with implementable features.
934
-
935
- Note: When you search for a variant product, the Product Search API returns the master or main product as the primary search hit. When promotion data (productPromotion) is returned, it does not contain pricing information because the returned product is the main product. To retrieve pricing information, pass the query string `allVariationProperties=true` with the `promotions` expand parameter, which returns pricing data for variant products if the promotion is unconditional. The `allVariationProperties` flag specifies the variation properties to be included in the result.
936
-
937
- ### Filter Products by Promotion Role
938
-
939
- You can filter products by their role in a promotion using the `pmid` (promotion ID) and `pmpt` (promotion product type) refinement parameters together. This allows you to find specific types of products within a promotion:
940
-
941
- - **`pmid`**: Specifies the promotion ID to filter by
942
- - **`pmpt`**: Specifies the type of products to return within that promotion:
943
- - `all`: Returns all products related to the promotion (default behavior)
944
- - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus
945
- - `discounted`: Returns only products that receive a discount in the promotion
946
- - `bonus`: Returns only products that are given as bonuses in the promotion
947
-
948
- **Example Usage:**
949
- ```
950
- GET /organizations/{organizationId}/product-search?refine=pmid=summer-sale&refine=pmpt=discounted
951
- ```
952
-
953
- This would return only the products that receive discounts in the "summer-sale" promotion.
954
-
955
- **Note:** The `pmpt` parameter only has an effect when used with `pmid`. If `pmpt` is specified without `pmid`, it will be ignored and all products will be returned.
956
-
957
- #### Shopper Personalization
958
- The SCAPI response can be personalized using the Shopper Context API or hooks. By setting specific values in the Shopper Context API, you can modify the response of the 'getProduct' or 'getProducts' endpoint based on the shopper's context. For instance, you can offer a 5% discount or free shipping to shoppers using mobile devices.
959
-
960
- #### JWA Caching
961
- The response is cached in JWA, which means promotion data contained in the response is also cached based on the TTL (Time to Live) specified in the Business Manager [Feature Switches](https://help.salesforce.com/s/articleView?id=cc.b2c_feature_switches.htm&type=5) configuration.
962
- When the shopper context value is updated, a check is conducted to see if the updated shopper context affects the retrieval of product-promotion data. If it does, then the response is fetched from the source and cached in the JWA.
963
-
964
- For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
965
-
966
-
967
- ### Use Hooks
968
-
969
- For details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)
970
-
971
- ## Best Practices
972
-
973
- These best practices refer to features that are generally available with B2C Commerce 24.3.
974
-
975
- For better performance, when you call the GET Product Search endpoint, we recommend that you:
976
-
977
- - Use the `select` query parameter to filter the response of a specified field or set of fields, and remove default outputs that you don't need. For example, filter the response to return only the relevant product names, ids, variants, and product IDs of the variants.
978
- - Limit API requests to the GET Product Search endpoint instead of calling both the GET Product Search and GET Products endpoints to show information on a product listing page (PLP). Use these features to provide the additional product information needed to render product tiles:
979
- - **Allowable value:** `promotions` value in the `expand` query parameter
980
- - **Query parameters:** `perPricebook`, `allImages`, and `allVariationProperties`
981
- - **Responses:** `productPromotions`, `imageGroups`, `priceRanges`, `tieredPrices`, `variants`, and `variationGroups`
982
- - Pass in only the `expand` values and query parameters that you consider necessary to meet your PLP requirements. Requesting large amounts of information can increase the latency, especially if there's a lot of data to be returned (for example, many imageGroups and variants).*<br />
983
- *
984
- * Simple example:
985
- *
986
- * ```typescript
987
- * import { ShopperSearch } from "commerce-sdk-isomorphic";
988
- *
989
- * const clientConfig = {
990
- * parameters: {
991
- * clientId: "XXXXXX",
992
- * organizationId: "XXXX",
993
- * shortCode: "XXX",
994
- * siteId: "XX"
995
- * }
996
- * };
997
- * const shopperSearchClient = new ShopperSearch(clientConfig);
998
- * ```
999
- *
1000
- * <span style="font-size:.7em; display:block; text-align: right">
1001
- * API Version: 0.0.33<br />
1002
- * Last Updated: <br />
1003
- * </span>
1004
- *
1005
- *
1006
- */
1007
- declare class ShopperSearch<ConfigParameters extends ShopperSearchParameters & Record<string, unknown>> {
1008
- // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
1009
- clientConfig: ClientConfig<ConfigParameters> & {
1010
- baseUri: string;
1011
- };
1012
- static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/v1";
1013
- static readonly apiPaths: {
1014
- getSearchSuggestions: string;
1015
- productSearch: string;
1016
- };
1017
- constructor(config: ClientConfigInit<ConfigParameters>);
1018
- static readonly paramKeys: {
1019
- readonly getSearchSuggestions: readonly [
1020
- "organizationId",
1021
- "siteId",
1022
- "q",
1023
- "limit",
1024
- "currency",
1025
- "locale",
1026
- "expand",
1027
- "includedCustomProductProperties",
1028
- "includeEinsteinSuggestedPhrases"
1029
- ];
1030
- readonly getSearchSuggestionsRequired: readonly [
1031
- "organizationId",
1032
- "siteId",
1033
- "q"
1034
- ];
1035
- readonly productSearch: readonly [
1036
- "organizationId",
1037
- "siteId",
1038
- "select",
1039
- "q",
1040
- "refine",
1041
- "sort",
1042
- "currency",
1043
- "locale",
1044
- "expand",
1045
- "allImages",
1046
- "perPricebook",
1047
- "allVariationProperties",
1048
- "includedCustomVariationProperties",
1049
- "limit",
1050
- "offset"
1051
- ];
1052
- readonly productSearchRequired: readonly [
1053
- "organizationId",
1054
- "siteId"
1055
- ];
1056
- };
1057
- /**
1058
- * Provide keyword search functionality for products, categories, and brands suggestions. Returns suggested
1059
- products, suggested categories, and suggested brands for the given search phrase.
1060
- *
1061
- * If you would like to get a raw Response object use the other getSearchSuggestions function.
1062
- *
1063
- * @param options - An object containing the options for this method.
1064
- * @param options.parameters - An object containing the parameters for this method.
1065
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1066
- * @param options.parameters.siteId - 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.
1067
- * @param options.parameters.q - The search phrase (q) for which suggestions are evaluated. Search suggestions are determined when the search phrase input is at least three (default) characters long. The value is configurable in the Business Manager.
1068
- * @param options.parameters.limit - The maximum number of suggestions made per request. If no value is defined, by default five suggestions per suggestion type are evaluated. This affects all types of suggestions (category, product, brand, and custom suggestions).
1069
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
1070
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
1071
- * @param options.parameters.expand - A comma-separated list that allows values `images`, `prices`, `custom_product_properties`.
1072
- By default, the expand parameter includes `prices`.
1073
- * @param options.parameters.includedCustomProductProperties - A comma-separated list of custom property ids to be returned for product suggestions. The `custom_product_properties` expand parameter is required for these properties to be returned.
1074
- * @param options.parameters.includeEinsteinSuggestedPhrases - The flag that determines whether or not to show recent and popular suggested phrases from Einstein.
1075
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1076
- *
1077
- * @returns A promise of type SuggestionResult.
1078
- */
1079
- getSearchSuggestions(options?: RequireParametersUnlessAllAreOptional<{
1080
- parameters?: CompositeParameters<{
1081
- organizationId: string;
1082
- siteId: string;
1083
- q: string;
1084
- limit?: number;
1085
- currency?: CurrencyCode;
1086
- locale?: LocaleCode$0;
1087
- expand?: Array<GetSearchSuggestionsExpandEnum>;
1088
- includedCustomProductProperties?: Array<string>;
1089
- includeEinsteinSuggestedPhrases?: boolean;
1090
- } & QueryParameters, ConfigParameters>;
1091
- headers?: {
1092
- [key: string]: string;
1093
- };
1094
- }>): Promise<SuggestionResult>;
1095
- /**
1096
- * Provide keyword search functionality for products, categories, and brands suggestions. Returns suggested
1097
- products, suggested categories, and suggested brands for the given search phrase.
1098
- *
1099
- * @param options - An object containing the options for this method.
1100
- * @param options.parameters - An object containing the parameters for this method.
1101
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1102
- * @param options.parameters.siteId - 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.
1103
- * @param options.parameters.q - The search phrase (q) for which suggestions are evaluated. Search suggestions are determined when the search phrase input is at least three (default) characters long. The value is configurable in the Business Manager.
1104
- * @param options.parameters.limit - The maximum number of suggestions made per request. If no value is defined, by default five suggestions per suggestion type are evaluated. This affects all types of suggestions (category, product, brand, and custom suggestions).
1105
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
1106
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
1107
- * @param options.parameters.expand - A comma-separated list that allows values `images`, `prices`, `custom_product_properties`.
1108
- By default, the expand parameter includes `prices`.
1109
- * @param options.parameters.includedCustomProductProperties - A comma-separated list of custom property ids to be returned for product suggestions. The `custom_product_properties` expand parameter is required for these properties to be returned.
1110
- * @param options.parameters.includeEinsteinSuggestedPhrases - The flag that determines whether or not to show recent and popular suggested phrases from Einstein.
1111
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1112
- * @param rawResponse - Set to true to return entire Response object instead of DTO.
1113
- *
1114
- * @returns A promise of type Response if rawResponse is true, a promise of type SuggestionResult otherwise.
1115
- */
1116
- getSearchSuggestions<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1117
- parameters?: CompositeParameters<{
1118
- organizationId: string;
1119
- siteId: string;
1120
- q: string;
1121
- limit?: number;
1122
- currency?: CurrencyCode;
1123
- locale?: LocaleCode$0;
1124
- expand?: Array<GetSearchSuggestionsExpandEnum>;
1125
- includedCustomProductProperties?: Array<string>;
1126
- includeEinsteinSuggestedPhrases?: boolean;
1127
- } & QueryParameters, ConfigParameters>;
1128
- headers?: {
1129
- [key: string]: string;
1130
- };
1131
- }>, rawResponse?: T): Promise<T extends true ? Response : SuggestionResult>;
1132
- /**
1133
- * Provide keyword and refinement search functionality for products. Only returns the product ID, link, and name in
1134
- the product search hit. The search result only contains products that are online and assigned to the site
1135
- catalog.
1136
- *
1137
- * If you would like to get a raw Response object use the other productSearch function.
1138
- *
1139
- * @param options - An object containing the options for this method.
1140
- * @param options.parameters - An object containing the parameters for this method.
1141
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1142
- * @param options.parameters.siteId - 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.
1143
- * @param options.parameters.select - The property selector declaring which fields are included into the response payload. You can specify a single field name, a comma-separated list of names or work with wildcards. You can also specify array operations and filter expressions. The actual selector value must be enclosed within parentheses.
1144
- * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
1145
- * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='. Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\") i.e. refine=c_refinementColor=red|green|blue. Value ranges can be specified like this: refine=price=(100..500) .
1146
- Multiple refine parameters can be provided by using the refine as the key i.e refine=price=(0..10)&refine=c_refinementColor=green. The refinements can be a collection of custom defined attributes IDs
1147
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
1148
-
1149
- The following system refinement attribute ids are supported:<br>
1150
- `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
1151
- `price`: Allows refinement per single price range. Multiple price ranges are not supported.
1152
- `htype`: Allow refinement by including only the provided hit types. Accepted types are 'product', 'master', 'set', 'bundle', 'slicing_group' (deprecated), 'variation_group'.<br>
1153
- `orderable_only`: Unavailable products are excluded from the search results if true is set. Multiple refinement values are not supported.<br>
1154
- `ilids`: Allows refining by inventory list IDs. Supports up to 10 inventory list IDs per request.<br>
1155
- `pmid`: Allows refinement on the supplied promotion ID(s). When used with `pmpt`, filters products by their role in the promotion.<br>
1156
- `pmpt`: Allows refinement per promotion product type. Must be used with `pmid` to filter products by their role in the promotion. Valid values are:
1157
- - `all`: Returns all products related to the promotion (default)
1158
- - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus
1159
- - `discounted`: Returns only products that receive a discount in the promotion
1160
- - `bonus`: Returns only products that are given as bonuses in the promotion
1161
-
1162
- **Note:** To refine a search using multiple promotion filters—for example, to find products in both the spring and summer campaigns—see [Refining by Multiple Promotions](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-promotions-for-developers.html#refining-by-multiple-promotions).
1163
- * @param options.parameters.sort - The ID of the sorting option to sort the search hits.
1164
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
1165
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
1166
- * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
1167
- By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
1168
- Use none to disable all expand options.
1169
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
1170
- * @param options.parameters.allImages - When the `images` expand parameter is used with this flag, the response includes the `imageGroups property`, which contains an image model.
1171
- If this flag is true, the full image model is returned. If false, only matching images are included.
1172
- If no flag is passed, the `imageGroups` property is omitted from the response.
1173
- * @param options.parameters.perPricebook - When this flag is set to `true` and is used with the `prices` expand parameter, the response includes per PriceBook prices and tiered prices (if available).
1174
- * @param options.parameters.allVariationProperties - The flag that determines which variation properties are included in the result. When set to `true` with the `variations` expand parameter, all variation properties (`variationAttributes`, `variationGroups`, `variants`) are returned. When set to false, only the default property `variationAttributes` is returned.
1175
- * @param options.parameters.includedCustomVariationProperties - A comma-separated list of custom property ids to be returned for variant products. The `variants` expand parameter and `allVariationProperties` query parameter are required for these properties to be returned.
1176
- * @param options.parameters.limit - Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
1177
- * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset.
1178
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1179
- *
1180
- * @returns A promise of type ProductSearchResult.
1181
- */
1182
- productSearch(options?: RequireParametersUnlessAllAreOptional<{
1183
- parameters?: CompositeParameters<{
1184
- organizationId: string;
1185
- siteId: string;
1186
- select?: string;
1187
- q?: string;
1188
- refine?: string;
1189
- sort?: string;
1190
- currency?: CurrencyCode;
1191
- locale?: LocaleCode$0;
1192
- expand?: Array<ProductSearchExpandEnum>;
1193
- allImages?: boolean;
1194
- perPricebook?: boolean;
1195
- allVariationProperties?: boolean;
1196
- includedCustomVariationProperties?: Array<string>;
1197
- limit?: number;
1198
- offset?: number;
1199
- } & QueryParameters, ConfigParameters>;
1200
- headers?: {
1201
- [key: string]: string;
1202
- };
1203
- }>): Promise<ProductSearchResult>;
1204
- /**
1205
- * Provide keyword and refinement search functionality for products. Only returns the product ID, link, and name in
1206
- the product search hit. The search result only contains products that are online and assigned to the site
1207
- catalog.
1208
- *
1209
- * @param options - An object containing the options for this method.
1210
- * @param options.parameters - An object containing the parameters for this method.
1211
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1212
- * @param options.parameters.siteId - 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.
1213
- * @param options.parameters.select - The property selector declaring which fields are included into the response payload. You can specify a single field name, a comma-separated list of names or work with wildcards. You can also specify array operations and filter expressions. The actual selector value must be enclosed within parentheses.
1214
- * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
1215
- * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='. Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\") i.e. refine=c_refinementColor=red|green|blue. Value ranges can be specified like this: refine=price=(100..500) .
1216
- Multiple refine parameters can be provided by using the refine as the key i.e refine=price=(0..10)&refine=c_refinementColor=green. The refinements can be a collection of custom defined attributes IDs
1217
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
1218
-
1219
- The following system refinement attribute ids are supported:<br>
1220
- `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
1221
- `price`: Allows refinement per single price range. Multiple price ranges are not supported.
1222
- `htype`: Allow refinement by including only the provided hit types. Accepted types are 'product', 'master', 'set', 'bundle', 'slicing_group' (deprecated), 'variation_group'.<br>
1223
- `orderable_only`: Unavailable products are excluded from the search results if true is set. Multiple refinement values are not supported.<br>
1224
- `ilids`: Allows refining by inventory list IDs. Supports up to 10 inventory list IDs per request.<br>
1225
- `pmid`: Allows refinement on the supplied promotion ID(s). When used with `pmpt`, filters products by their role in the promotion.<br>
1226
- `pmpt`: Allows refinement per promotion product type. Must be used with `pmid` to filter products by their role in the promotion. Valid values are:
1227
- - `all`: Returns all products related to the promotion (default)
1228
- - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus
1229
- - `discounted`: Returns only products that receive a discount in the promotion
1230
- - `bonus`: Returns only products that are given as bonuses in the promotion
1231
-
1232
- **Note:** To refine a search using multiple promotion filters—for example, to find products in both the spring and summer campaigns—see [Refining by Multiple Promotions](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-promotions-for-developers.html#refining-by-multiple-promotions).
1233
- * @param options.parameters.sort - The ID of the sorting option to sort the search hits.
1234
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
1235
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
1236
- * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
1237
- By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
1238
- Use none to disable all expand options.
1239
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
1240
- * @param options.parameters.allImages - When the `images` expand parameter is used with this flag, the response includes the `imageGroups property`, which contains an image model.
1241
- If this flag is true, the full image model is returned. If false, only matching images are included.
1242
- If no flag is passed, the `imageGroups` property is omitted from the response.
1243
- * @param options.parameters.perPricebook - When this flag is set to `true` and is used with the `prices` expand parameter, the response includes per PriceBook prices and tiered prices (if available).
1244
- * @param options.parameters.allVariationProperties - The flag that determines which variation properties are included in the result. When set to `true` with the `variations` expand parameter, all variation properties (`variationAttributes`, `variationGroups`, `variants`) are returned. When set to false, only the default property `variationAttributes` is returned.
1245
- * @param options.parameters.includedCustomVariationProperties - A comma-separated list of custom property ids to be returned for variant products. The `variants` expand parameter and `allVariationProperties` query parameter are required for these properties to be returned.
1246
- * @param options.parameters.limit - Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
1247
- * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset.
1248
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1249
- * @param rawResponse - Set to true to return entire Response object instead of DTO.
1250
- *
1251
- * @returns A promise of type Response if rawResponse is true, a promise of type ProductSearchResult otherwise.
1252
- */
1253
- productSearch<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1254
- parameters?: CompositeParameters<{
1255
- organizationId: string;
1256
- siteId: string;
1257
- select?: string;
1258
- q?: string;
1259
- refine?: string;
1260
- sort?: string;
1261
- currency?: CurrencyCode;
1262
- locale?: LocaleCode$0;
1263
- expand?: Array<ProductSearchExpandEnum>;
1264
- allImages?: boolean;
1265
- perPricebook?: boolean;
1266
- allVariationProperties?: boolean;
1267
- includedCustomVariationProperties?: Array<string>;
1268
- limit?: number;
1269
- offset?: number;
1270
- } & QueryParameters, ConfigParameters>;
1271
- headers?: {
1272
- [key: string]: string;
1273
- };
1274
- }>, rawResponse?: T): Promise<T extends true ? Response : ProductSearchResult>;
1275
- }
1276
- declare namespace ShopperSearchApiTypes {
1277
- /*
1278
- * Copyright (c) 2023, Salesforce, Inc.
1279
- * All rights reserved.
1280
- * SPDX-License-Identifier: BSD-3-Clause
1281
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
1282
- */
1283
- /**
1284
- * Makes a type easier to read.
1285
- */
1286
- type Prettify<T> = NonNullable<{
1287
- [K in keyof T]: T[K];
1288
- }>;
1289
- /**
1290
- * Generates the types required on a method, based on those provided in the config.
1291
- */
1292
- type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
1293
- /**
1294
- * If an object has a `parameters` property, and the `parameters` object has required properties,
1295
- * then the `parameters` property on the root object is marked as required.
1296
- */
1297
- type RequireParametersUnlessAllAreOptional<T extends {
1298
- parameters?: Record<string, unknown>;
1299
- }> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
1300
- /**
1301
- * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
1302
- * if not specified.
1303
- */
1304
- interface BaseUriParameters {
1305
- shortCode: string;
1306
- }
1307
- type LocaleCode = {
1308
- [key: string]: any;
1309
- };
1310
- /**
1311
- * Generic interface for path parameters.
1312
- */
1313
- interface PathParameters {
1314
- [key: string]: string | number | boolean;
1315
- }
1316
- /**
1317
- * Generic interface for query parameters.
1318
- */
1319
- interface QueryParameters {
1320
- [key: string]: string | number | boolean | string[] | number[] | LocaleCode;
1321
- }
1322
- /**
1323
- * Generic interface for all parameter types.
1324
- */
1325
- type UrlParameters = PathParameters | QueryParameters;
1326
- /**
1327
- * Custom query parameter type with any string prefixed with `c_` as the key and the allowed
1328
- * types for query parameters for the value.
1329
- */
1330
- type CustomQueryParameters = {
1331
- [key in `c_${string}`]: string | number | boolean | string[] | number[];
1332
- };
1333
- /**
1334
- * Custom body request type with any string prefixed with `c_` as the key and the allowed
1335
- * types for the value.
1336
- */
1337
- type CustomRequestBody = {
1338
- [key in `c_${string}`]: string | number | boolean | string[] | number[] | {
1339
- [key: string]: unknown;
1340
- };
1341
- };
1342
- /**
1343
- * Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
1344
- * it from the `RequestInit` provided by node-fetch.
1345
- */
1346
- type BrowserRequestInit = RequestInit;
1347
- /**
1348
- * Any properties supported in either the browser or node are accepted.
1349
- * Using the right properties in the right context is left to the user.
1350
- */
1351
- type FetchOptions = NodeRequestInit & BrowserRequestInit;
1352
- /**
1353
- * Base options that can be passed to the `ClientConfig` class.
1354
- */
1355
- interface ClientConfigInit<Params extends BaseUriParameters> {
1356
- baseUri?: string;
1357
- proxy?: string;
1358
- headers?: {
1359
- [key: string]: string;
1360
- };
1361
- parameters: Params;
1362
- fetchOptions?: FetchOptions;
1363
- transformRequest?: (data: unknown, headers: {
1364
- [key: string]: string;
1365
- }) => Required<FetchOptions>["body"];
1366
- throwOnBadResponse?: boolean;
1367
- }
1368
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
1369
- /**
1370
- * Configuration parameters common to Commerce SDK clients
1371
- */
1372
- class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
1373
- baseUri?: string;
1374
- proxy?: string;
1375
- headers: {
1376
- [key: string]: string;
1377
- };
1378
- parameters: Params;
1379
- fetchOptions: FetchOptions;
1380
- transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
1381
- throwOnBadResponse: boolean;
1382
- constructor(config: ClientConfigInit<Params>);
1383
- static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
1384
- }
1385
- /**
1386
- * @type SuggestedTerm: Document representing a suggested term.
1387
- *
1388
- * @property completed: Returns whether this term value is a completion match.
1389
- *
1390
- * @property corrected: Returns whether this term value is a correction match.
1391
- *
1392
- * @property exactMatch: Returns whether this term value is a exact match.
1393
- *
1394
- * @property value: Returns the term value.
1395
- * - **Min Length:** 1
1396
- * - **Max Length:** 50
1397
- *
1398
- */
1399
- type SuggestedTerm = {
1400
- completed: boolean;
1401
- corrected: boolean;
1402
- exactMatch: boolean;
1403
- value: string;
1404
- } & {
1405
- [key: string]: any;
1406
- };
1407
- /**
1408
- * @type SuggestedTerms: Document representing a list of suggested terms for each term of a search phrase.
1409
- *
1410
- * @property originalTerm: Returns the original term that the suggested terms relates to.
1411
- * - **Min Length:** 1
1412
- * - **Max Length:** 50
1413
- *
1414
- * @property terms: Returns the suggested terms.
1415
- *
1416
- */
1417
- type SuggestedTerms = {
1418
- originalTerm: string;
1419
- terms?: Array<SuggestedTerm>;
1420
- } & {
1421
- [key: string]: any;
1422
- };
1423
- /**
1424
- * @type SuggestedPhrase: Document representing a suggested search phrase.
1425
- *
1426
- * @property exactMatch: Returns whether this suggested phrase exactly matches the user input search phrase.
1427
- *
1428
- * @property phrase: Returns the suggested search phrase.
1429
- * - **Min Length:** 1
1430
- * - **Max Length:** 50
1431
- *
1432
- */
1433
- type SuggestedPhrase = {
1434
- exactMatch: boolean;
1435
- phrase: string;
1436
- } & {
1437
- [key: string]: any;
1438
- };
1439
- /**
1440
- * @type BrandSuggestions: The suggested brand names are listed in suggested phrases. If this list is empty, no brand suggestion for a given search phrase was found.
1441
- *
1442
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
1443
- *
1444
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
1445
- *
1446
- */
1447
- type BrandSuggestions = {
1448
- suggestedPhrases?: Array<SuggestedPhrase>;
1449
- suggestedTerms: Array<SuggestedTerms>;
1450
- } & {
1451
- [key: string]: any;
1452
- };
1453
- /**
1454
- * @type SuggestedCategory:
1455
- *
1456
- * @property id: The ID of the category.
1457
- * - **Min Length:** 1
1458
- * - **Max Length:** 260
1459
- *
1460
- * @property name: The localized name of the category.
1461
- * - **Min Length:** 1
1462
- * - **Max Length:** 4000
1463
- *
1464
- * @property parentCategoryName: The name of the parent category.
1465
- * - **Min Length:** 1
1466
- * - **Max Length:** 4000
1467
- *
1468
- */
1469
- type SuggestedCategory = {
1470
- id: string;
1471
- name: string;
1472
- parentCategoryName: string;
1473
- } & {
1474
- [key: string]: any;
1475
- };
1476
- /**
1477
- * @type CategorySuggestions:
1478
- *
1479
- * @property categories: The sorted list of suggested categories. This list can be empty.
1480
- *
1481
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
1482
- *
1483
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
1484
- *
1485
- */
1486
- type CategorySuggestions = {
1487
- categories?: Array<SuggestedCategory>;
1488
- suggestedPhrases?: Array<SuggestedPhrase>;
1489
- suggestedTerms: Array<SuggestedTerms>;
1490
- } & {
1491
- [key: string]: any;
1492
- };
1493
- /**
1494
- * A specialized value indicating the lack of definition of a currency, for example, if the value of the monetary value of the currency is an undefined number.
1495
- */
1496
- type NoValue = "N/A";
1497
- /**
1498
- * @type CurrencyCode
1499
- * A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
1500
- */
1501
- type CurrencyCode = NoValue | string;
1502
- /**
1503
- * @type CustomSuggestions: The custom suggestions are listed in suggested phrases. If this list is empty, no custom suggestion for the given search phrase was found.
1504
- *
1505
- * @property customSuggestion:
1506
- *
1507
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
1508
- *
1509
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
1510
- *
1511
- */
1512
- type CustomSuggestions = {
1513
- customSuggestion?: string;
1514
- suggestedPhrases?: Array<SuggestedPhrase>;
1515
- suggestedTerms: Array<SuggestedTerms>;
1516
- } & {
1517
- [key: string]: any;
1518
- };
1519
- /**
1520
- * A specialized value indicating the system default values for locales.
1521
- */
1522
- type DefaultFallback = "default";
1523
- /**
1524
- * @type EinsteinSuggestedPhrases: Einstein-suggested phrases containing popular and recent search phrases.
1525
- *
1526
- * @property popularSearchPhrases: A list of popular search phrases suggested by Einstein. This list can be empty.
1527
- *
1528
- * @property recentSearchPhrases: A list of recent search phrases suggested by Einstein. This list can be empty.
1529
- *
1530
- */
1531
- type EinsteinSuggestedPhrases = {
1532
- popularSearchPhrases?: Array<SuggestedPhrase>;
1533
- recentSearchPhrases?: Array<SuggestedPhrase>;
1534
- } & {
1535
- [key: string]: any;
1536
- };
1537
- /**
1538
- * @type ErrorResponse:
1539
- *
1540
- * @property title: A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization
1541
- * - **Max Length:** 256
1542
- *
1543
- * @property type: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\". It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
1544
- * - **Max Length:** 2048
1545
- *
1546
- * @property detail: A human-readable explanation specific to this occurrence of the problem.
1547
- *
1548
- * @property instance: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
1549
- * - **Max Length:** 2048
1550
- *
1551
- */
1552
- type ErrorResponse = {
1553
- title: string;
1554
- type: string;
1555
- detail: string;
1556
- instance?: string;
1557
- } & {
1558
- [key: string]: any;
1559
- };
1560
- /**
1561
- * @type Image:
1562
- *
1563
- * @property alt: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
1564
- * - **Max Length:** 4000
1565
- *
1566
- * @property disBaseLink: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
1567
- * - **Max Length:** 4000
1568
- *
1569
- * @property link: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
1570
- * - **Min Length:** 1
1571
- * - **Max Length:** 4000
1572
- *
1573
- * @property title: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
1574
- * - **Max Length:** 4000
1575
- *
1576
- */
1577
- type Image = {
1578
- alt?: string;
1579
- disBaseLink?: string;
1580
- link: string;
1581
- title?: string;
1582
- } & {
1583
- [key: string]: any;
1584
- };
1585
- /**
1586
- * @type VariationAttributeValue: Document representing a variation attribute value.
1587
- *
1588
- * @property description: The localized description of the variation value.
1589
- * - **Max Length:** 4000
1590
- *
1591
- * @property image: The first product image for the configured viewtype and this variation value.
1592
- *
1593
- * @property imageSwatch: The first product image for the configured viewtype and this variation value. Typically the swatch image.
1594
- *
1595
- * @property name: The localized display name of the variation value.
1596
- * - **Max Length:** 4000
1597
- *
1598
- * @property orderable: A flag indicating whether at least one variant with this variation attribute value is available to sell.
1599
- *
1600
- * @property value: The actual variation value.
1601
- * - **Min Length:** 1
1602
- * - **Max Length:** 4000
1603
- *
1604
- */
1605
- type VariationAttributeValue = {
1606
- description?: string;
1607
- image?: Image;
1608
- imageSwatch?: Image;
1609
- name?: string;
1610
- orderable?: boolean;
1611
- value: string;
1612
- } & {
1613
- [key: string]: any;
1614
- };
1615
- /**
1616
- * @type VariationAttribute: Document representing a variation attribute.
1617
- *
1618
- * @property id: The ID of the variation attribute.
1619
- * - **Min Length:** 1
1620
- * - **Max Length:** 256
1621
- *
1622
- * @property name: The localized display name of the variation attribute.
1623
- * - **Max Length:** 4000
1624
- *
1625
- * @property values: The sorted array of variation values. This array can be empty.
1626
- *
1627
- */
1628
- type VariationAttribute = {
1629
- id: string;
1630
- name?: string;
1631
- values?: Array<VariationAttributeValue>;
1632
- } & {
1633
- [key: string]: any;
1634
- };
1635
- /**
1636
- * @type ImageGroup: Document representing an image group containing a list of images for a particular view type and an optional variation value.
1637
- *
1638
- * @property images: The images of the image group.
1639
- *
1640
- * @property variationAttributes: Returns a list of variation attributes applying to this image group.
1641
- *
1642
- * @property viewType: The image view type.
1643
- * - **Min Length:** 1
1644
- * - **Max Length:** 256
1645
- *
1646
- */
1647
- type ImageGroup = {
1648
- images: Array<Image>;
1649
- variationAttributes?: Array<VariationAttribute>;
1650
- viewType: string;
1651
- } & {
1652
- [key: string]: any;
1653
- };
1654
- /**
1655
- * @type LocaleCode
1656
- * A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
1657
- */
1658
- type LocaleCode$0 = DefaultFallback | string;
1659
- /**
1660
- * @type PageMetaTag: Document representing a Page Meta Tag object.
1661
- *
1662
- * @property id: The ID of the Page Meta Tag.
1663
- * - **Max Length:** 256
1664
- *
1665
- * @property value: Locale-specific value of the Page Meta Tag, evaluated by resolving the rule set for the given Business Manager ID.
1666
- *
1667
- */
1668
- type PageMetaTag = {
1669
- id?: string;
1670
- value?: string;
1671
- } & {
1672
- [key: string]: any;
1673
- };
1674
- /**
1675
- * @type PaginatedResultBase: Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. If you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.
1676
- *
1677
- * @property offset: The zero-based index of the first hit/data to include in the result.
1678
- *
1679
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
1680
- *
1681
- * @property total: 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.
1682
- *
1683
- */
1684
- type PaginatedResultBase = {
1685
- offset: number;
1686
- limit: number;
1687
- total: number;
1688
- } & {
1689
- [key: string]: any;
1690
- };
1691
- /**
1692
- * @type PriceRange: Document representing price ranges for a product which happens to be a master product (per Pricebook)
1693
- *
1694
- * @property maxPrice: Maximum price for the given pricebook (usually for a master Product would be the price for the Variant which has the highest price out of all Variants in that pricebook)
1695
- *
1696
- * @property minPrice: Minimum price for the given pricebook (usually for a master Product would be the price for the Variant which has the least price out of all Variants in that pricebook)
1697
- *
1698
- * @property pricebook: The active pricebook from which the min and the max prices are calculated. The pricebook is based on the site context of the request as defined in ECOM.
1699
- * - **Max Length:** 256
1700
- *
1701
- */
1702
- type PriceRange = {
1703
- maxPrice?: number;
1704
- minPrice?: number;
1705
- pricebook?: string;
1706
- } & {
1707
- [key: string]: any;
1708
- };
1709
- /**
1710
- * @type ProductPriceTable: Tiered Price Level Object
1711
- *
1712
- * @property price: Price for the product for the specified tier for the specified pricebook
1713
- *
1714
- * @property pricebook: The active pricebook for which this price is defined
1715
- * - **Max Length:** 256
1716
- *
1717
- * @property quantity: Quantity tier for which the price is defined.
1718
- *
1719
- */
1720
- type ProductPriceTable = {
1721
- price?: number;
1722
- pricebook?: string;
1723
- quantity?: number;
1724
- } & {
1725
- [key: string]: any;
1726
- };
1727
- /**
1728
- * @type ProductPromotion: Document representing a product promotion.
1729
- *
1730
- * @property calloutMsg: The localized call-out message of the promotion.
1731
- * - **Min Length:** 1
1732
- * - **Max Length:** 4000
1733
- *
1734
- * @property promotionId: The unique ID of the promotion.
1735
- * - **Min Length:** 1
1736
- * - **Max Length:** 260
1737
- *
1738
- * @property promotionalPrice: The promotional price for this product.
1739
- *
1740
- */
1741
- type ProductPromotion = {
1742
- calloutMsg: string;
1743
- promotionId: string;
1744
- promotionalPrice: number;
1745
- } & {
1746
- [key: string]: any;
1747
- };
1748
- /**
1749
- * @type ProductRef: Document representing a product reference.
1750
- *
1751
- * @property id: The ID of the product reference.
1752
- * - **Min Length:** 1
1753
- * - **Max Length:** 100
1754
- *
1755
- */
1756
- type ProductRef = {
1757
- id: string;
1758
- } & {
1759
- [key: string]: any;
1760
- };
1761
- /**
1762
- * @type Variant: A product which is a variation within a master product that describes different colors, sizes, or other variation attributes. *Has a SKU.*
1763
- *
1764
- * @property orderable: A flag indicating whether the variant is orderable.
1765
- *
1766
- * @property price: The sales price of the variant.
1767
- *
1768
- * @property productId: The ID (SKU) of the variant.
1769
- * - **Min Length:** 1
1770
- * - **Max Length:** 100
1771
- *
1772
- * @property tieredPrices: List of tiered prices if the product is a variant
1773
- *
1774
- * @property variationValues: The actual variation attribute ID - value pairs.
1775
- *
1776
- * @property productPromotions: The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.
1777
- *
1778
- */
1779
- type Variant = {
1780
- orderable?: boolean;
1781
- price?: number;
1782
- productId: string;
1783
- tieredPrices?: Array<ProductPriceTable>;
1784
- variationValues?: {
1785
- [key: string]: string;
1786
- };
1787
- productPromotions?: Array<ProductPromotion>;
1788
- } & {
1789
- [key: string]: any;
1790
- };
1791
- /**
1792
- * @type VariationGroup: Representation of a group of variant products by an attribute. This can\'t be purchased by a shopper. It provides inheritable attributes for its product variants and is used for navigation. A VariationGroup doesn\'t have a SKU.
1793
- *
1794
- * @property orderable: A flag indicating whether the variation group is orderable.
1795
- *
1796
- * @property price: The sales price of the variation group.
1797
- *
1798
- * @property productId: The ID (SKU) of the variation group.
1799
- * - **Min Length:** 1
1800
- * - **Max Length:** 100
1801
- *
1802
- * @property variationValues: The actual variation attribute ID - value pairs.
1803
- *
1804
- */
1805
- type VariationGroup = {
1806
- orderable: boolean;
1807
- price: number;
1808
- productId: string;
1809
- variationValues: {
1810
- [key: string]: string;
1811
- };
1812
- } & {
1813
- [key: string]: any;
1814
- };
1815
- /**
1816
- * @type ProductType: Document representing a product type.
1817
- *
1818
- * @property bundle: A flag indicating whether the product is a bundle.
1819
- *
1820
- * @property item: A flag indicating whether the product is a standard item.
1821
- *
1822
- * @property master: A flag indicating whether the product is a master.
1823
- *
1824
- * @property option: A flag indicating whether the product is an option.
1825
- *
1826
- * @property set: A flag indicating whether the product is a set.
1827
- *
1828
- * @property variant: A flag indicating whether the product is a variant.
1829
- *
1830
- * @property variationGroup: A flag indicating whether the product is a variation group.
1831
- *
1832
- */
1833
- type ProductType = {
1834
- bundle?: boolean;
1835
- item?: boolean;
1836
- master?: boolean;
1837
- option?: boolean;
1838
- set?: boolean;
1839
- variant?: boolean;
1840
- variationGroup?: boolean;
1841
- } & {
1842
- [key: string]: any;
1843
- };
1844
- /**
1845
- * @type ProductSearchHit: Document representing a product search hit.
1846
- *
1847
- * @property currency:
1848
- *
1849
- * @property hitType: The type information for the search hit.
1850
- * - **Max Length:** 256
1851
- *
1852
- * @property image: The first image of the product hit for the configured viewtype.
1853
- *
1854
- * @property orderable: A flag indicating whether the product is orderable.
1855
- *
1856
- * @property price: The sales price of the product. In complex products, like master or set, this is the minimum price of related child products.
1857
- *
1858
- * @property priceMax: The maximum sales of related child products in complex products like master or set.
1859
- *
1860
- * @property productId: The ID (SKU) of the product.
1861
- * - **Min Length:** 1
1862
- * - **Max Length:** 100
1863
- *
1864
- * @property productName: The localized name of the product.
1865
- * - **Max Length:** 4000
1866
- *
1867
- * @property productType: The type information for the product.
1868
- *
1869
- * @property representedProduct: The first represented product.
1870
- *
1871
- * @property representedProducts: All the represented products.
1872
- *
1873
- * @property variationAttributes: The array of represented variation attributes, for the master product only. This array can be empty.
1874
- *
1875
- * @property imageGroups: The array of product image groups.
1876
- *
1877
- * @property priceRanges: Array of one or more price range objects representing one or more Pricebooks in context for the site.
1878
- *
1879
- * @property productPromotions: The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.
1880
- *
1881
- * @property tieredPrices: The document represents list of tiered prices if the product is a variant
1882
- *
1883
- * @property variants: The array of actual variants. Only for master, variation group, and variant types. This array can be empty.
1884
- *
1885
- * @property variationGroups: The array of actual variation groups. Only for master, variation group, and variant types. This array can be empty.
1886
- *
1887
- */
1888
- type ProductSearchHit = {
1889
- currency?: CurrencyCode;
1890
- hitType?: string;
1891
- image?: Image;
1892
- orderable?: boolean;
1893
- price?: number;
1894
- priceMax?: number;
1895
- productId: string;
1896
- productName?: string;
1897
- productType?: ProductType;
1898
- representedProduct?: ProductRef;
1899
- representedProducts?: Array<ProductRef>;
1900
- variationAttributes?: Array<VariationAttribute>;
1901
- imageGroups?: Array<ImageGroup>;
1902
- priceRanges?: Array<PriceRange>;
1903
- productPromotions?: Array<ProductPromotion>;
1904
- tieredPrices?: Array<ProductPriceTable>;
1905
- variants?: Array<Variant>;
1906
- variationGroups?: Array<VariationGroup>;
1907
- } & {
1908
- [key: string]: any;
1909
- };
1910
- /**
1911
- * @type ProductSearchRefinementValue: Document representing a product search refinement value.
1912
- *
1913
- * @property description: The localized description of the refinement value.
1914
- * - **Max Length:** 4000
1915
- *
1916
- * @property hitCount: The number of search hits when selecting the refinement value. Can be 0.
1917
- *
1918
- * @property label: The localized label of the refinement value.
1919
- * - **Min Length:** 1
1920
- * - **Max Length:** 4000
1921
- *
1922
- * @property presentationId: The optional presentation ID associated with the refinement value. The presentation ID can be used, for example, to associate an ID with an HTML widget.
1923
- * - **Max Length:** 256
1924
- *
1925
- * @property value: The refinement value. In the case of an attribute refinement, this is the bucket, the attribute value, or a value range. In the case of a category refinement, this is the category ID. In the case of a price refinement, this is the price range. Ranges are enclosed by parentheses and delimited by \"..\"; for example, \"(100..999)\" and \"(Aa..Fa)\" are valid ranges.
1926
- * - **Min Length:** 1
1927
- * - **Max Length:** 4000
1928
- *
1929
- * @property values: The array of hierarchical refinement values. This array can be empty.
1930
- *
1931
- */
1932
- type ProductSearchRefinementValue = {
1933
- description?: string;
1934
- hitCount: number;
1935
- label: string;
1936
- presentationId?: string;
1937
- value: string;
1938
- values?: Array<ProductSearchRefinementValue>;
1939
- } & {
1940
- [key: string]: any;
1941
- };
1942
- /**
1943
- * @type ProductSearchRefinement: Document representing a product search refinement attribute.
1944
- *
1945
- * @property attributeId: The ID of the search refinement attribute. In the case of an attribute refinement, this is the attribute ID. Custom attributes are marked by the prefix \"c_\" (for example, \"c_refinementColor\"). In the case of a category refinement, the ID must be \"cgid\". In the case of a price refinement, the ID must be \"price\".
1946
- * - **Min Length:** 1
1947
- * - **Max Length:** 256
1948
- *
1949
- * @property label: The localized label of the refinement.
1950
- * - **Max Length:** 256
1951
- *
1952
- * @property values: The sorted array of refinement values. This array can be empty.
1953
- *
1954
- */
1955
- type ProductSearchRefinement = {
1956
- attributeId: string;
1957
- label?: string;
1958
- values?: Array<ProductSearchRefinementValue>;
1959
- } & {
1960
- [key: string]: any;
1961
- };
1962
- /**
1963
- * @type Suggestion: Document representing a suggestion.
1964
- *
1965
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
1966
- *
1967
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
1968
- *
1969
- */
1970
- type Suggestion = {
1971
- suggestedPhrases?: Array<SuggestedPhrase>;
1972
- suggestedTerms: Array<SuggestedTerms>;
1973
- } & {
1974
- [key: string]: any;
1975
- };
1976
- /**
1977
- * @type ProductSearchSortingOption: Document representing a product search sorting option.
1978
- *
1979
- * @property id: The ID of the sorting option.
1980
- * - **Min Length:** 1
1981
- * - **Max Length:** 256
1982
- *
1983
- * @property label: The localized label of the sorting option.
1984
- * - **Min Length:** 1
1985
- * - **Max Length:** 4000
1986
- *
1987
- */
1988
- type ProductSearchSortingOption = {
1989
- id: string;
1990
- label: string;
1991
- } & {
1992
- [key: string]: any;
1993
- };
1994
- /**
1995
- * @type ProductSearchResult: Document representing a product search result.
1996
- *
1997
- * @property hits: A sorted array of search hits (`ProductSearchHit` objects). The array can be empty.
1998
- *
1999
- * @property pageMetaTags: Page Meta tags associated with the search result.
2000
- *
2001
- * @property query: The query string that was searched for.
2002
- * - **Max Length:** 50
2003
- *
2004
- * @property refinements: The sorted array of search refinements. This array can be empty.
2005
- *
2006
- * @property searchPhraseSuggestions: The suggestion given by the system for the submitted search phrase.
2007
- * - **Min Length:** 1
2008
- *
2009
- * @property selectedRefinements: A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL.
2010
- *
2011
- * @property selectedSortingOption: The ID of the applied sorting option.
2012
- * - **Max Length:** 4000
2013
- *
2014
- * @property sortingOptions: The sorted array of search sorting options. This array can be empty.
2015
- *
2016
- * @property offset: The zero-based index of the first hit/data to include in the result.
2017
- *
2018
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
2019
- *
2020
- * @property total: 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.
2021
- *
2022
- */
2023
- type ProductSearchResult = {
2024
- hits: Array<ProductSearchHit>;
2025
- pageMetaTags?: Array<PageMetaTag>;
2026
- query: string;
2027
- refinements: Array<ProductSearchRefinement>;
2028
- searchPhraseSuggestions: Suggestion;
2029
- selectedRefinements?: {
2030
- [key: string]: string;
2031
- };
2032
- selectedSortingOption?: string;
2033
- sortingOptions: Array<ProductSearchSortingOption>;
2034
- offset: number;
2035
- limit: number;
2036
- total: number;
2037
- } & {
2038
- [key: string]: any;
2039
- };
2040
- /**
2041
- * @type SuggestedProduct: Document representing a product search hit.
2042
- *
2043
- * @property currency:
2044
- *
2045
- * @property price: The sales price of the product. In the case of complex products like a master or a set, this is the minimum price of related child products.
2046
- *
2047
- * @property productId: The ID (SKU) of the product.
2048
- * - **Min Length:** 1
2049
- * - **Max Length:** 100
2050
- *
2051
- * @property productName: The localized name of the product.
2052
- * - **Min Length:** 1
2053
- * - **Max Length:** 4000
2054
- *
2055
- */
2056
- type SuggestedProduct = {
2057
- currency: CurrencyCode;
2058
- price: number;
2059
- productId: string;
2060
- productName: string;
2061
- } & {
2062
- [key: string]: any;
2063
- };
2064
- /**
2065
- * @type ProductSuggestions:
2066
- *
2067
- * @property products: The sorted list of suggested products. This list can be empty.
2068
- *
2069
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
2070
- *
2071
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
2072
- *
2073
- */
2074
- type ProductSuggestions = {
2075
- products?: Array<SuggestedProduct>;
2076
- suggestedPhrases?: Array<SuggestedPhrase>;
2077
- suggestedTerms: Array<SuggestedTerms>;
2078
- } & {
2079
- [key: string]: any;
2080
- };
2081
- /**
2082
- * @type ResultBase: Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.
2083
- *
2084
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
2085
- *
2086
- * @property total: 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.
2087
- *
2088
- */
2089
- type ResultBase = {
2090
- limit: number;
2091
- total: number;
2092
- } & {
2093
- [key: string]: any;
2094
- };
2095
- /**
2096
- * @type SuggestionResult: Document representing a search suggestion result.
2097
- *
2098
- * @property brandSuggestions: Returns the suggested brands.
2099
- *
2100
- * @property categorySuggestions: Returns the suggested categories.
2101
- *
2102
- * @property productSuggestions: Returns the suggested products.
2103
- *
2104
- * @property customSuggestion: Returns custom suggestions.
2105
- *
2106
- * @property einsteinSuggestedPhrases: Returns Einstein suggested phrases containing popular and recent search phrases.
2107
- *
2108
- * @property searchPhrase: The query phrase (q) for which suggestions where made.
2109
- * - **Min Length:** 3
2110
- * - **Max Length:** 50
2111
- *
2112
- */
2113
- type SuggestionResult = {
2114
- brandSuggestions?: BrandSuggestions;
2115
- categorySuggestions?: CategorySuggestions;
2116
- productSuggestions?: ProductSuggestions;
2117
- customSuggestion?: CustomSuggestions;
2118
- einsteinSuggestedPhrases?: EinsteinSuggestedPhrases;
2119
- searchPhrase: string;
2120
- } & {
2121
- [key: string]: any;
2122
- };
2123
- type GetSearchSuggestionsExpandEnum = "images" | "prices" | "custom_product_properties";
2124
- type ProductSearchExpandEnum = "none" | "availability" | "images" | "prices" | "represented_products" | "variations" | "promotions" | "custom_properties" | "page_meta_tags";
2125
- type getSearchSuggestionsQueryParameters = {
2126
- siteId: string;
2127
- q: string;
2128
- limit?: number;
2129
- currency?: CurrencyCode;
2130
- locale?: LocaleCode$0;
2131
- expand?: Array<"images" | "prices" | "custom_product_properties">;
2132
- includedCustomProductProperties?: Array<string>;
2133
- includeEinsteinSuggestedPhrases?: boolean;
2134
- };
2135
- type getSearchSuggestionsPathParameters = {
2136
- organizationId: string;
2137
- };
2138
- type productSearchQueryParameters = {
2139
- select?: string;
2140
- siteId: string;
2141
- q?: string;
2142
- refine?: string;
2143
- sort?: string;
2144
- currency?: CurrencyCode;
2145
- locale?: LocaleCode$0;
2146
- expand?: Array<"none" | "availability" | "images" | "prices" | "represented_products" | "variations" | "promotions" | "custom_properties" | "page_meta_tags">;
2147
- allImages?: boolean;
2148
- perPricebook?: boolean;
2149
- allVariationProperties?: boolean;
2150
- includedCustomVariationProperties?: Array<string>;
2151
- limit?: number;
2152
- offset?: number;
2153
- };
2154
- type productSearchPathParameters = {
2155
- organizationId: string;
2156
- };
2157
- /**
2158
- * All path parameters that are used by at least one ShopperSearch method.
2159
- */
2160
- type ShopperSearchPathParameters = Partial<getSearchSuggestionsPathParameters & productSearchPathParameters & {}>;
2161
- /**
2162
- * All query parameters that are used by at least one ShopperSearch method.
2163
- */
2164
- type ShopperSearchQueryParameters = Partial<getSearchSuggestionsQueryParameters & productSearchQueryParameters & {}>;
2165
- /**
2166
- * All parameters that are used by ShopperSearch.
2167
- */
2168
- type ShopperSearchParameters = ShopperSearchPathParameters & BaseUriParameters & ShopperSearchQueryParameters;
2169
- /**
2170
- * [Shopper Search](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-search:Summary)
2171
- * ==================================
2172
- *
2173
- * *# API Overview
2174
-
2175
- Use the Shopper Search API for search functionality that lets shoppers search for products using keywords and refinement. The search results can be products or suggestions based on the endpoint you choose in the API.
2176
-
2177
- Caching is provided for the Shopper Search API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
2178
-
2179
- ## Authentication & Authorization
2180
-
2181
- The client requesting the API must have access to the product search and search suggestion resources.
2182
-
2183
- The Shopper Search API requires a JWT acquired via the Shopper Customers endpoint:
2184
-
2185
- ```
2186
- https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{organizationId}/customers/actions/login
2187
- ```
2188
-
2189
- ## Use Cases
2190
-
2191
- ### Provide Search Suggestions
2192
-
2193
- Use the Shopper Search API to provide search suggestions as a shopper searches.
2194
-
2195
- For example, a developer who is building a shopping app using the Salesforce Commerce API would like to provide product, brand, and category suggestions. When a shopper types in a search phrase that exceeds a definable minimum length and the GET Search Suggestion endpoint is requested, the platform delivers a set of suggestions with products (name, ID), brands (name), and categories (name, ID). Shoppers can reach their desired search results more quickly using the suggested completion and correction.
2196
-
2197
- ### Provide Search Results
2198
-
2199
- Use the Shopper Search API to gather product results for a shoppers search query.
2200
-
2201
- For example, a developer who is building a shopping app using the Salesforce Commerce API would like to implement a product search functionality. When a shopper enters a search phrase and the GET Product Search endpoint is requested, the platform performs a keyword search and a sorted search result is returned. The sorted search result can be refined according to given values (for example, a price range).
2202
- The product search result contains a definable number of product search hits. A product search hit describes a matching product with its ID and name. Furthermore, the search hit contains product images, prices, represented products, and variations. In addition to the search hits, the search results also deliver refinement and sorting options.
2203
-
2204
- ### Retrieve Promotion Information
2205
-
2206
- Note: This only applies if `promotions` expand is provided in the query parameter.
2207
-
2208
- Promotions provide discounts to shoppers when they meet certain purchase requirements.
2209
-
2210
- Promotion information is described in detail in [Promotion Details](https://developer.salesforce.com/docs/commerce/commerce-api/guide/promotion-details.html), but the following list provides several key points:
2211
-
2212
- - Pricing discounts for basket and shipping promotions are NEVER returned by the 'getProduct' or 'getProducts' endpoint.
2213
- - Promotional pricing is ONLY returned for products that are included with non-conditional promotions.
2214
- - Callout messages are ALWAYS returned by the 'getProduct' and 'getProducts' endpoints.
2215
-
2216
- By default, 'getProduct' and 'getProducts' return promotion information for a queried product. Promotion information includes both pricing and callout message information. However, the specific pricing and callout information that is fetched is determined by:
2217
-
2218
- - Promotion Type
2219
- - Product Type
2220
- - Product Purchase Requirements
2221
-
2222
- Some promotions can be displayed on a Product Data Page (PDP) or Product Listing page (PLP), while other promotions are displayed in the context of a basket, such as an order level promotion: "add the product to your basket to view price information". It is important to understand what is included in the response when designing a PDP or PLP on top of SCAPI to ensure your design aligns with implementable features.
2223
-
2224
- Note: When you search for a variant product, the Product Search API returns the master or main product as the primary search hit. When promotion data (productPromotion) is returned, it does not contain pricing information because the returned product is the main product. To retrieve pricing information, pass the query string `allVariationProperties=true` with the `promotions` expand parameter, which returns pricing data for variant products if the promotion is unconditional. The `allVariationProperties` flag specifies the variation properties to be included in the result.
2225
-
2226
- ### Filter Products by Promotion Role
2227
-
2228
- You can filter products by their role in a promotion using the `pmid` (promotion ID) and `pmpt` (promotion product type) refinement parameters together. This allows you to find specific types of products within a promotion:
2229
-
2230
- - **`pmid`**: Specifies the promotion ID to filter by
2231
- - **`pmpt`**: Specifies the type of products to return within that promotion:
2232
- - `all`: Returns all products related to the promotion (default behavior)
2233
- - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus
2234
- - `discounted`: Returns only products that receive a discount in the promotion
2235
- - `bonus`: Returns only products that are given as bonuses in the promotion
2236
-
2237
- **Example Usage:**
2238
- ```
2239
- GET /organizations/{organizationId}/product-search?refine=pmid=summer-sale&refine=pmpt=discounted
2240
- ```
2241
-
2242
- This would return only the products that receive discounts in the "summer-sale" promotion.
2243
-
2244
- **Note:** The `pmpt` parameter only has an effect when used with `pmid`. If `pmpt` is specified without `pmid`, it will be ignored and all products will be returned.
2245
-
2246
- #### Shopper Personalization
2247
- The SCAPI response can be personalized using the Shopper Context API or hooks. By setting specific values in the Shopper Context API, you can modify the response of the 'getProduct' or 'getProducts' endpoint based on the shopper's context. For instance, you can offer a 5% discount or free shipping to shoppers using mobile devices.
2248
-
2249
- #### JWA Caching
2250
- The response is cached in JWA, which means promotion data contained in the response is also cached based on the TTL (Time to Live) specified in the Business Manager [Feature Switches](https://help.salesforce.com/s/articleView?id=cc.b2c_feature_switches.htm&type=5) configuration.
2251
- When the shopper context value is updated, a check is conducted to see if the updated shopper context affects the retrieval of product-promotion data. If it does, then the response is fetched from the source and cached in the JWA.
2252
-
2253
- For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
2254
-
2255
-
2256
- ### Use Hooks
2257
-
2258
- For details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)
2259
-
2260
- ## Best Practices
2261
-
2262
- These best practices refer to features that are generally available with B2C Commerce 24.3.
2263
-
2264
- For better performance, when you call the GET Product Search endpoint, we recommend that you:
2265
-
2266
- - Use the `select` query parameter to filter the response of a specified field or set of fields, and remove default outputs that you don't need. For example, filter the response to return only the relevant product names, ids, variants, and product IDs of the variants.
2267
- - Limit API requests to the GET Product Search endpoint instead of calling both the GET Product Search and GET Products endpoints to show information on a product listing page (PLP). Use these features to provide the additional product information needed to render product tiles:
2268
- - **Allowable value:** `promotions` value in the `expand` query parameter
2269
- - **Query parameters:** `perPricebook`, `allImages`, and `allVariationProperties`
2270
- - **Responses:** `productPromotions`, `imageGroups`, `priceRanges`, `tieredPrices`, `variants`, and `variationGroups`
2271
- - Pass in only the `expand` values and query parameters that you consider necessary to meet your PLP requirements. Requesting large amounts of information can increase the latency, especially if there's a lot of data to be returned (for example, many imageGroups and variants).*<br />
2272
- *
2273
- * Simple example:
2274
- *
2275
- * ```typescript
2276
- * import { ShopperSearch } from "commerce-sdk-isomorphic";
2277
- *
2278
- * const clientConfig = {
2279
- * parameters: {
2280
- * clientId: "XXXXXX",
2281
- * organizationId: "XXXX",
2282
- * shortCode: "XXX",
2283
- * siteId: "XX"
2284
- * }
2285
- * };
2286
- * const shopperSearchClient = new ShopperSearch(clientConfig);
2287
- * ```
2288
- *
2289
- * <span style="font-size:.7em; display:block; text-align: right">
2290
- * API Version: 0.0.33<br />
2291
- * Last Updated: <br />
2292
- * </span>
2293
- *
2294
- *
2295
- */
2296
- class ShopperSearch<ConfigParameters extends ShopperSearchParameters & Record<string, unknown>> {
2297
- // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
2298
- clientConfig: ClientConfig<ConfigParameters> & {
2299
- baseUri: string;
2300
- };
2301
- static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/v1";
2302
- static readonly apiPaths: {
2303
- getSearchSuggestions: string;
2304
- productSearch: string;
2305
- };
2306
- constructor(config: ClientConfigInit<ConfigParameters>);
2307
- static readonly paramKeys: {
2308
- readonly getSearchSuggestions: readonly [
2309
- "organizationId",
2310
- "siteId",
2311
- "q",
2312
- "limit",
2313
- "currency",
2314
- "locale",
2315
- "expand",
2316
- "includedCustomProductProperties",
2317
- "includeEinsteinSuggestedPhrases"
2318
- ];
2319
- readonly getSearchSuggestionsRequired: readonly [
2320
- "organizationId",
2321
- "siteId",
2322
- "q"
2323
- ];
2324
- readonly productSearch: readonly [
2325
- "organizationId",
2326
- "siteId",
2327
- "select",
2328
- "q",
2329
- "refine",
2330
- "sort",
2331
- "currency",
2332
- "locale",
2333
- "expand",
2334
- "allImages",
2335
- "perPricebook",
2336
- "allVariationProperties",
2337
- "includedCustomVariationProperties",
2338
- "limit",
2339
- "offset"
2340
- ];
2341
- readonly productSearchRequired: readonly [
2342
- "organizationId",
2343
- "siteId"
2344
- ];
2345
- };
2346
- /**
2347
- * Provide keyword search functionality for products, categories, and brands suggestions. Returns suggested
2348
- products, suggested categories, and suggested brands for the given search phrase.
2349
- *
2350
- * If you would like to get a raw Response object use the other getSearchSuggestions function.
2351
- *
2352
- * @param options - An object containing the options for this method.
2353
- * @param options.parameters - An object containing the parameters for this method.
2354
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2355
- * @param options.parameters.siteId - 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.
2356
- * @param options.parameters.q - The search phrase (q) for which suggestions are evaluated. Search suggestions are determined when the search phrase input is at least three (default) characters long. The value is configurable in the Business Manager.
2357
- * @param options.parameters.limit - The maximum number of suggestions made per request. If no value is defined, by default five suggestions per suggestion type are evaluated. This affects all types of suggestions (category, product, brand, and custom suggestions).
2358
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
2359
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
2360
- * @param options.parameters.expand - A comma-separated list that allows values `images`, `prices`, `custom_product_properties`.
2361
- By default, the expand parameter includes `prices`.
2362
- * @param options.parameters.includedCustomProductProperties - A comma-separated list of custom property ids to be returned for product suggestions. The `custom_product_properties` expand parameter is required for these properties to be returned.
2363
- * @param options.parameters.includeEinsteinSuggestedPhrases - The flag that determines whether or not to show recent and popular suggested phrases from Einstein.
2364
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2365
- *
2366
- * @returns A promise of type SuggestionResult.
2367
- */
2368
- getSearchSuggestions(options?: RequireParametersUnlessAllAreOptional<{
2369
- parameters?: CompositeParameters<{
2370
- organizationId: string;
2371
- siteId: string;
2372
- q: string;
2373
- limit?: number;
2374
- currency?: CurrencyCode;
2375
- locale?: LocaleCode$0;
2376
- expand?: Array<GetSearchSuggestionsExpandEnum>;
2377
- includedCustomProductProperties?: Array<string>;
2378
- includeEinsteinSuggestedPhrases?: boolean;
2379
- } & QueryParameters, ConfigParameters>;
2380
- headers?: {
2381
- [key: string]: string;
2382
- };
2383
- }>): Promise<SuggestionResult>;
2384
- /**
2385
- * Provide keyword search functionality for products, categories, and brands suggestions. Returns suggested
2386
- products, suggested categories, and suggested brands for the given search phrase.
2387
- *
2388
- * @param options - An object containing the options for this method.
2389
- * @param options.parameters - An object containing the parameters for this method.
2390
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2391
- * @param options.parameters.siteId - 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.
2392
- * @param options.parameters.q - The search phrase (q) for which suggestions are evaluated. Search suggestions are determined when the search phrase input is at least three (default) characters long. The value is configurable in the Business Manager.
2393
- * @param options.parameters.limit - The maximum number of suggestions made per request. If no value is defined, by default five suggestions per suggestion type are evaluated. This affects all types of suggestions (category, product, brand, and custom suggestions).
2394
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
2395
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
2396
- * @param options.parameters.expand - A comma-separated list that allows values `images`, `prices`, `custom_product_properties`.
2397
- By default, the expand parameter includes `prices`.
2398
- * @param options.parameters.includedCustomProductProperties - A comma-separated list of custom property ids to be returned for product suggestions. The `custom_product_properties` expand parameter is required for these properties to be returned.
2399
- * @param options.parameters.includeEinsteinSuggestedPhrases - The flag that determines whether or not to show recent and popular suggested phrases from Einstein.
2400
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2401
- * @param rawResponse - Set to true to return entire Response object instead of DTO.
2402
- *
2403
- * @returns A promise of type Response if rawResponse is true, a promise of type SuggestionResult otherwise.
2404
- */
2405
- getSearchSuggestions<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2406
- parameters?: CompositeParameters<{
2407
- organizationId: string;
2408
- siteId: string;
2409
- q: string;
2410
- limit?: number;
2411
- currency?: CurrencyCode;
2412
- locale?: LocaleCode$0;
2413
- expand?: Array<GetSearchSuggestionsExpandEnum>;
2414
- includedCustomProductProperties?: Array<string>;
2415
- includeEinsteinSuggestedPhrases?: boolean;
2416
- } & QueryParameters, ConfigParameters>;
2417
- headers?: {
2418
- [key: string]: string;
2419
- };
2420
- }>, rawResponse?: T): Promise<T extends true ? Response : SuggestionResult>;
2421
- /**
2422
- * Provide keyword and refinement search functionality for products. Only returns the product ID, link, and name in
2423
- the product search hit. The search result only contains products that are online and assigned to the site
2424
- catalog.
2425
- *
2426
- * If you would like to get a raw Response object use the other productSearch function.
2427
- *
2428
- * @param options - An object containing the options for this method.
2429
- * @param options.parameters - An object containing the parameters for this method.
2430
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2431
- * @param options.parameters.siteId - 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.
2432
- * @param options.parameters.select - The property selector declaring which fields are included into the response payload. You can specify a single field name, a comma-separated list of names or work with wildcards. You can also specify array operations and filter expressions. The actual selector value must be enclosed within parentheses.
2433
- * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
2434
- * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='. Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\") i.e. refine=c_refinementColor=red|green|blue. Value ranges can be specified like this: refine=price=(100..500) .
2435
- Multiple refine parameters can be provided by using the refine as the key i.e refine=price=(0..10)&refine=c_refinementColor=green. The refinements can be a collection of custom defined attributes IDs
2436
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
2437
-
2438
- The following system refinement attribute ids are supported:<br>
2439
- `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
2440
- `price`: Allows refinement per single price range. Multiple price ranges are not supported.
2441
- `htype`: Allow refinement by including only the provided hit types. Accepted types are 'product', 'master', 'set', 'bundle', 'slicing_group' (deprecated), 'variation_group'.<br>
2442
- `orderable_only`: Unavailable products are excluded from the search results if true is set. Multiple refinement values are not supported.<br>
2443
- `ilids`: Allows refining by inventory list IDs. Supports up to 10 inventory list IDs per request.<br>
2444
- `pmid`: Allows refinement on the supplied promotion ID(s). When used with `pmpt`, filters products by their role in the promotion.<br>
2445
- `pmpt`: Allows refinement per promotion product type. Must be used with `pmid` to filter products by their role in the promotion. Valid values are:
2446
- - `all`: Returns all products related to the promotion (default)
2447
- - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus
2448
- - `discounted`: Returns only products that receive a discount in the promotion
2449
- - `bonus`: Returns only products that are given as bonuses in the promotion
2450
-
2451
- **Note:** To refine a search using multiple promotion filters—for example, to find products in both the spring and summer campaigns—see [Refining by Multiple Promotions](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-promotions-for-developers.html#refining-by-multiple-promotions).
2452
- * @param options.parameters.sort - The ID of the sorting option to sort the search hits.
2453
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
2454
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
2455
- * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
2456
- By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
2457
- Use none to disable all expand options.
2458
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
2459
- * @param options.parameters.allImages - When the `images` expand parameter is used with this flag, the response includes the `imageGroups property`, which contains an image model.
2460
- If this flag is true, the full image model is returned. If false, only matching images are included.
2461
- If no flag is passed, the `imageGroups` property is omitted from the response.
2462
- * @param options.parameters.perPricebook - When this flag is set to `true` and is used with the `prices` expand parameter, the response includes per PriceBook prices and tiered prices (if available).
2463
- * @param options.parameters.allVariationProperties - The flag that determines which variation properties are included in the result. When set to `true` with the `variations` expand parameter, all variation properties (`variationAttributes`, `variationGroups`, `variants`) are returned. When set to false, only the default property `variationAttributes` is returned.
2464
- * @param options.parameters.includedCustomVariationProperties - A comma-separated list of custom property ids to be returned for variant products. The `variants` expand parameter and `allVariationProperties` query parameter are required for these properties to be returned.
2465
- * @param options.parameters.limit - Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
2466
- * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset.
2467
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2468
- *
2469
- * @returns A promise of type ProductSearchResult.
2470
- */
2471
- productSearch(options?: RequireParametersUnlessAllAreOptional<{
2472
- parameters?: CompositeParameters<{
2473
- organizationId: string;
2474
- siteId: string;
2475
- select?: string;
2476
- q?: string;
2477
- refine?: string;
2478
- sort?: string;
2479
- currency?: CurrencyCode;
2480
- locale?: LocaleCode$0;
2481
- expand?: Array<ProductSearchExpandEnum>;
2482
- allImages?: boolean;
2483
- perPricebook?: boolean;
2484
- allVariationProperties?: boolean;
2485
- includedCustomVariationProperties?: Array<string>;
2486
- limit?: number;
2487
- offset?: number;
2488
- } & QueryParameters, ConfigParameters>;
2489
- headers?: {
2490
- [key: string]: string;
2491
- };
2492
- }>): Promise<ProductSearchResult>;
2493
- /**
2494
- * Provide keyword and refinement search functionality for products. Only returns the product ID, link, and name in
2495
- the product search hit. The search result only contains products that are online and assigned to the site
2496
- catalog.
2497
- *
2498
- * @param options - An object containing the options for this method.
2499
- * @param options.parameters - An object containing the parameters for this method.
2500
- * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2501
- * @param options.parameters.siteId - 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.
2502
- * @param options.parameters.select - The property selector declaring which fields are included into the response payload. You can specify a single field name, a comma-separated list of names or work with wildcards. You can also specify array operations and filter expressions. The actual selector value must be enclosed within parentheses.
2503
- * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
2504
- * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='. Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\") i.e. refine=c_refinementColor=red|green|blue. Value ranges can be specified like this: refine=price=(100..500) .
2505
- Multiple refine parameters can be provided by using the refine as the key i.e refine=price=(0..10)&refine=c_refinementColor=green. The refinements can be a collection of custom defined attributes IDs
2506
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
2507
-
2508
- The following system refinement attribute ids are supported:<br>
2509
- `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
2510
- `price`: Allows refinement per single price range. Multiple price ranges are not supported.
2511
- `htype`: Allow refinement by including only the provided hit types. Accepted types are 'product', 'master', 'set', 'bundle', 'slicing_group' (deprecated), 'variation_group'.<br>
2512
- `orderable_only`: Unavailable products are excluded from the search results if true is set. Multiple refinement values are not supported.<br>
2513
- `ilids`: Allows refining by inventory list IDs. Supports up to 10 inventory list IDs per request.<br>
2514
- `pmid`: Allows refinement on the supplied promotion ID(s). When used with `pmpt`, filters products by their role in the promotion.<br>
2515
- `pmpt`: Allows refinement per promotion product type. Must be used with `pmid` to filter products by their role in the promotion. Valid values are:
2516
- - `all`: Returns all products related to the promotion (default)
2517
- - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus
2518
- - `discounted`: Returns only products that receive a discount in the promotion
2519
- - `bonus`: Returns only products that are given as bonuses in the promotion
2520
-
2521
- **Note:** To refine a search using multiple promotion filters—for example, to find products in both the spring and summer campaigns—see [Refining by Multiple Promotions](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-promotions-for-developers.html#refining-by-multiple-promotions).
2522
- * @param options.parameters.sort - The ID of the sorting option to sort the search hits.
2523
- * @param options.parameters.currency - A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
2524
- * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
2525
- * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
2526
- By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
2527
- Use none to disable all expand options.
2528
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
2529
- * @param options.parameters.allImages - When the `images` expand parameter is used with this flag, the response includes the `imageGroups property`, which contains an image model.
2530
- If this flag is true, the full image model is returned. If false, only matching images are included.
2531
- If no flag is passed, the `imageGroups` property is omitted from the response.
2532
- * @param options.parameters.perPricebook - When this flag is set to `true` and is used with the `prices` expand parameter, the response includes per PriceBook prices and tiered prices (if available).
2533
- * @param options.parameters.allVariationProperties - The flag that determines which variation properties are included in the result. When set to `true` with the `variations` expand parameter, all variation properties (`variationAttributes`, `variationGroups`, `variants`) are returned. When set to false, only the default property `variationAttributes` is returned.
2534
- * @param options.parameters.includedCustomVariationProperties - A comma-separated list of custom property ids to be returned for variant products. The `variants` expand parameter and `allVariationProperties` query parameter are required for these properties to be returned.
2535
- * @param options.parameters.limit - Maximum records to retrieve per request, not to exceed 200. Defaults to 25.
2536
- * @param options.parameters.offset - Used to retrieve the results based on a particular resource offset.
2537
- * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2538
- * @param rawResponse - Set to true to return entire Response object instead of DTO.
2539
- *
2540
- * @returns A promise of type Response if rawResponse is true, a promise of type ProductSearchResult otherwise.
2541
- */
2542
- productSearch<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2543
- parameters?: CompositeParameters<{
2544
- organizationId: string;
2545
- siteId: string;
2546
- select?: string;
2547
- q?: string;
2548
- refine?: string;
2549
- sort?: string;
2550
- currency?: CurrencyCode;
2551
- locale?: LocaleCode$0;
2552
- expand?: Array<ProductSearchExpandEnum>;
2553
- allImages?: boolean;
2554
- perPricebook?: boolean;
2555
- allVariationProperties?: boolean;
2556
- includedCustomVariationProperties?: Array<string>;
2557
- limit?: number;
2558
- offset?: number;
2559
- } & QueryParameters, ConfigParameters>;
2560
- headers?: {
2561
- [key: string]: string;
2562
- };
2563
- }>, rawResponse?: T): Promise<T extends true ? Response : ProductSearchResult>;
2564
- }
2565
- }
2566
- declare namespace ShopperSearchModelTypes {
2567
- /**
2568
- * @type SuggestedTerm: Document representing a suggested term.
2569
- *
2570
- * @property completed: Returns whether this term value is a completion match.
2571
- *
2572
- * @property corrected: Returns whether this term value is a correction match.
2573
- *
2574
- * @property exactMatch: Returns whether this term value is a exact match.
2575
- *
2576
- * @property value: Returns the term value.
2577
- * - **Min Length:** 1
2578
- * - **Max Length:** 50
2579
- *
2580
- */
2581
- type SuggestedTerm = {
2582
- completed: boolean;
2583
- corrected: boolean;
2584
- exactMatch: boolean;
2585
- value: string;
2586
- } & {
2587
- [key: string]: any;
2588
- };
2589
- /**
2590
- * @type SuggestedTerms: Document representing a list of suggested terms for each term of a search phrase.
2591
- *
2592
- * @property originalTerm: Returns the original term that the suggested terms relates to.
2593
- * - **Min Length:** 1
2594
- * - **Max Length:** 50
2595
- *
2596
- * @property terms: Returns the suggested terms.
2597
- *
2598
- */
2599
- type SuggestedTerms = {
2600
- originalTerm: string;
2601
- terms?: Array<SuggestedTerm>;
2602
- } & {
2603
- [key: string]: any;
2604
- };
2605
- /**
2606
- * @type SuggestedPhrase: Document representing a suggested search phrase.
2607
- *
2608
- * @property exactMatch: Returns whether this suggested phrase exactly matches the user input search phrase.
2609
- *
2610
- * @property phrase: Returns the suggested search phrase.
2611
- * - **Min Length:** 1
2612
- * - **Max Length:** 50
2613
- *
2614
- */
2615
- type SuggestedPhrase = {
2616
- exactMatch: boolean;
2617
- phrase: string;
2618
- } & {
2619
- [key: string]: any;
2620
- };
2621
- /**
2622
- * @type BrandSuggestions: The suggested brand names are listed in suggested phrases. If this list is empty, no brand suggestion for a given search phrase was found.
2623
- *
2624
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
2625
- *
2626
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
2627
- *
2628
- */
2629
- type BrandSuggestions = {
2630
- suggestedPhrases?: Array<SuggestedPhrase>;
2631
- suggestedTerms: Array<SuggestedTerms>;
2632
- } & {
2633
- [key: string]: any;
2634
- };
2635
- /**
2636
- * @type SuggestedCategory:
2637
- *
2638
- * @property id: The ID of the category.
2639
- * - **Min Length:** 1
2640
- * - **Max Length:** 260
2641
- *
2642
- * @property name: The localized name of the category.
2643
- * - **Min Length:** 1
2644
- * - **Max Length:** 4000
2645
- *
2646
- * @property parentCategoryName: The name of the parent category.
2647
- * - **Min Length:** 1
2648
- * - **Max Length:** 4000
2649
- *
2650
- */
2651
- type SuggestedCategory = {
2652
- id: string;
2653
- name: string;
2654
- parentCategoryName: string;
2655
- } & {
2656
- [key: string]: any;
2657
- };
2658
- /**
2659
- * @type CategorySuggestions:
2660
- *
2661
- * @property categories: The sorted list of suggested categories. This list can be empty.
2662
- *
2663
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
2664
- *
2665
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
2666
- *
2667
- */
2668
- type CategorySuggestions = {
2669
- categories?: Array<SuggestedCategory>;
2670
- suggestedPhrases?: Array<SuggestedPhrase>;
2671
- suggestedTerms: Array<SuggestedTerms>;
2672
- } & {
2673
- [key: string]: any;
2674
- };
2675
- /**
2676
- * A specialized value indicating the lack of definition of a currency, for example, if the value of the monetary value of the currency is an undefined number.
2677
- */
2678
- type NoValue = "N/A";
2679
- /**
2680
- * @type CurrencyCode
2681
- * A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.
2682
- */
2683
- type CurrencyCode = NoValue | string;
2684
- /**
2685
- * @type CustomSuggestions: The custom suggestions are listed in suggested phrases. If this list is empty, no custom suggestion for the given search phrase was found.
2686
- *
2687
- * @property customSuggestion:
2688
- *
2689
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
2690
- *
2691
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
2692
- *
2693
- */
2694
- type CustomSuggestions = {
2695
- customSuggestion?: string;
2696
- suggestedPhrases?: Array<SuggestedPhrase>;
2697
- suggestedTerms: Array<SuggestedTerms>;
2698
- } & {
2699
- [key: string]: any;
2700
- };
2701
- /**
2702
- * A specialized value indicating the system default values for locales.
2703
- */
2704
- type DefaultFallback = "default";
2705
- /**
2706
- * @type EinsteinSuggestedPhrases: Einstein-suggested phrases containing popular and recent search phrases.
2707
- *
2708
- * @property popularSearchPhrases: A list of popular search phrases suggested by Einstein. This list can be empty.
2709
- *
2710
- * @property recentSearchPhrases: A list of recent search phrases suggested by Einstein. This list can be empty.
2711
- *
2712
- */
2713
- type EinsteinSuggestedPhrases = {
2714
- popularSearchPhrases?: Array<SuggestedPhrase>;
2715
- recentSearchPhrases?: Array<SuggestedPhrase>;
2716
- } & {
2717
- [key: string]: any;
2718
- };
2719
- /**
2720
- * @type ErrorResponse:
2721
- *
2722
- * @property title: A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization
2723
- * - **Max Length:** 256
2724
- *
2725
- * @property type: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\". It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
2726
- * - **Max Length:** 2048
2727
- *
2728
- * @property detail: A human-readable explanation specific to this occurrence of the problem.
2729
- *
2730
- * @property instance: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
2731
- * - **Max Length:** 2048
2732
- *
2733
- */
2734
- type ErrorResponse = {
2735
- title: string;
2736
- type: string;
2737
- detail: string;
2738
- instance?: string;
2739
- } & {
2740
- [key: string]: any;
2741
- };
2742
- /**
2743
- * @type Image:
2744
- *
2745
- * @property alt: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
2746
- * - **Max Length:** 4000
2747
- *
2748
- * @property disBaseLink: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
2749
- * - **Max Length:** 4000
2750
- *
2751
- * @property link: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
2752
- * - **Min Length:** 1
2753
- * - **Max Length:** 4000
2754
- *
2755
- * @property title: The String4000 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 4000 bytes. This schema accommodates various character sets, with the following considerations: - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 4000 characters. - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 2000 characters. - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 1333 characters.
2756
- * - **Max Length:** 4000
2757
- *
2758
- */
2759
- type Image = {
2760
- alt?: string;
2761
- disBaseLink?: string;
2762
- link: string;
2763
- title?: string;
2764
- } & {
2765
- [key: string]: any;
2766
- };
2767
- /**
2768
- * @type VariationAttributeValue: Document representing a variation attribute value.
2769
- *
2770
- * @property description: The localized description of the variation value.
2771
- * - **Max Length:** 4000
2772
- *
2773
- * @property image: The first product image for the configured viewtype and this variation value.
2774
- *
2775
- * @property imageSwatch: The first product image for the configured viewtype and this variation value. Typically the swatch image.
2776
- *
2777
- * @property name: The localized display name of the variation value.
2778
- * - **Max Length:** 4000
2779
- *
2780
- * @property orderable: A flag indicating whether at least one variant with this variation attribute value is available to sell.
2781
- *
2782
- * @property value: The actual variation value.
2783
- * - **Min Length:** 1
2784
- * - **Max Length:** 4000
2785
- *
2786
- */
2787
- type VariationAttributeValue = {
2788
- description?: string;
2789
- image?: Image;
2790
- imageSwatch?: Image;
2791
- name?: string;
2792
- orderable?: boolean;
2793
- value: string;
2794
- } & {
2795
- [key: string]: any;
2796
- };
2797
- /**
2798
- * @type VariationAttribute: Document representing a variation attribute.
2799
- *
2800
- * @property id: The ID of the variation attribute.
2801
- * - **Min Length:** 1
2802
- * - **Max Length:** 256
2803
- *
2804
- * @property name: The localized display name of the variation attribute.
2805
- * - **Max Length:** 4000
2806
- *
2807
- * @property values: The sorted array of variation values. This array can be empty.
2808
- *
2809
- */
2810
- type VariationAttribute = {
2811
- id: string;
2812
- name?: string;
2813
- values?: Array<VariationAttributeValue>;
2814
- } & {
2815
- [key: string]: any;
2816
- };
2817
- /**
2818
- * @type ImageGroup: Document representing an image group containing a list of images for a particular view type and an optional variation value.
2819
- *
2820
- * @property images: The images of the image group.
2821
- *
2822
- * @property variationAttributes: Returns a list of variation attributes applying to this image group.
2823
- *
2824
- * @property viewType: The image view type.
2825
- * - **Min Length:** 1
2826
- * - **Max Length:** 256
2827
- *
2828
- */
2829
- type ImageGroup = {
2830
- images: Array<Image>;
2831
- variationAttributes?: Array<VariationAttribute>;
2832
- viewType: string;
2833
- } & {
2834
- [key: string]: any;
2835
- };
2836
- /**
2837
- * @type LocaleCode
2838
- * A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
2839
- */
2840
- type LocaleCode = DefaultFallback | string;
2841
- /**
2842
- * @type PageMetaTag: Document representing a Page Meta Tag object.
2843
- *
2844
- * @property id: The ID of the Page Meta Tag.
2845
- * - **Max Length:** 256
2846
- *
2847
- * @property value: Locale-specific value of the Page Meta Tag, evaluated by resolving the rule set for the given Business Manager ID.
2848
- *
2849
- */
2850
- type PageMetaTag = {
2851
- id?: string;
2852
- value?: string;
2853
- } & {
2854
- [key: string]: any;
2855
- };
2856
- /**
2857
- * @type PaginatedResultBase: Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. If you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.
2858
- *
2859
- * @property offset: The zero-based index of the first hit/data to include in the result.
2860
- *
2861
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
2862
- *
2863
- * @property total: 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.
2864
- *
2865
- */
2866
- type PaginatedResultBase = {
2867
- offset: number;
2868
- limit: number;
2869
- total: number;
2870
- } & {
2871
- [key: string]: any;
2872
- };
2873
- /**
2874
- * @type PriceRange: Document representing price ranges for a product which happens to be a master product (per Pricebook)
2875
- *
2876
- * @property maxPrice: Maximum price for the given pricebook (usually for a master Product would be the price for the Variant which has the highest price out of all Variants in that pricebook)
2877
- *
2878
- * @property minPrice: Minimum price for the given pricebook (usually for a master Product would be the price for the Variant which has the least price out of all Variants in that pricebook)
2879
- *
2880
- * @property pricebook: The active pricebook from which the min and the max prices are calculated. The pricebook is based on the site context of the request as defined in ECOM.
2881
- * - **Max Length:** 256
2882
- *
2883
- */
2884
- type PriceRange = {
2885
- maxPrice?: number;
2886
- minPrice?: number;
2887
- pricebook?: string;
2888
- } & {
2889
- [key: string]: any;
2890
- };
2891
- /**
2892
- * @type ProductPriceTable: Tiered Price Level Object
2893
- *
2894
- * @property price: Price for the product for the specified tier for the specified pricebook
2895
- *
2896
- * @property pricebook: The active pricebook for which this price is defined
2897
- * - **Max Length:** 256
2898
- *
2899
- * @property quantity: Quantity tier for which the price is defined.
2900
- *
2901
- */
2902
- type ProductPriceTable = {
2903
- price?: number;
2904
- pricebook?: string;
2905
- quantity?: number;
2906
- } & {
2907
- [key: string]: any;
2908
- };
2909
- /**
2910
- * @type ProductPromotion: Document representing a product promotion.
2911
- *
2912
- * @property calloutMsg: The localized call-out message of the promotion.
2913
- * - **Min Length:** 1
2914
- * - **Max Length:** 4000
2915
- *
2916
- * @property promotionId: The unique ID of the promotion.
2917
- * - **Min Length:** 1
2918
- * - **Max Length:** 260
2919
- *
2920
- * @property promotionalPrice: The promotional price for this product.
2921
- *
2922
- */
2923
- type ProductPromotion = {
2924
- calloutMsg: string;
2925
- promotionId: string;
2926
- promotionalPrice: number;
2927
- } & {
2928
- [key: string]: any;
2929
- };
2930
- /**
2931
- * @type ProductRef: Document representing a product reference.
2932
- *
2933
- * @property id: The ID of the product reference.
2934
- * - **Min Length:** 1
2935
- * - **Max Length:** 100
2936
- *
2937
- */
2938
- type ProductRef = {
2939
- id: string;
2940
- } & {
2941
- [key: string]: any;
2942
- };
2943
- /**
2944
- * @type Variant: A product which is a variation within a master product that describes different colors, sizes, or other variation attributes. *Has a SKU.*
2945
- *
2946
- * @property orderable: A flag indicating whether the variant is orderable.
2947
- *
2948
- * @property price: The sales price of the variant.
2949
- *
2950
- * @property productId: The ID (SKU) of the variant.
2951
- * - **Min Length:** 1
2952
- * - **Max Length:** 100
2953
- *
2954
- * @property tieredPrices: List of tiered prices if the product is a variant
2955
- *
2956
- * @property variationValues: The actual variation attribute ID - value pairs.
2957
- *
2958
- * @property productPromotions: The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.
2959
- *
2960
- */
2961
- type Variant = {
2962
- orderable?: boolean;
2963
- price?: number;
2964
- productId: string;
2965
- tieredPrices?: Array<ProductPriceTable>;
2966
- variationValues?: {
2967
- [key: string]: string;
2968
- };
2969
- productPromotions?: Array<ProductPromotion>;
2970
- } & {
2971
- [key: string]: any;
2972
- };
2973
- /**
2974
- * @type VariationGroup: Representation of a group of variant products by an attribute. This can\'t be purchased by a shopper. It provides inheritable attributes for its product variants and is used for navigation. A VariationGroup doesn\'t have a SKU.
2975
- *
2976
- * @property orderable: A flag indicating whether the variation group is orderable.
2977
- *
2978
- * @property price: The sales price of the variation group.
2979
- *
2980
- * @property productId: The ID (SKU) of the variation group.
2981
- * - **Min Length:** 1
2982
- * - **Max Length:** 100
2983
- *
2984
- * @property variationValues: The actual variation attribute ID - value pairs.
2985
- *
2986
- */
2987
- type VariationGroup = {
2988
- orderable: boolean;
2989
- price: number;
2990
- productId: string;
2991
- variationValues: {
2992
- [key: string]: string;
2993
- };
2994
- } & {
2995
- [key: string]: any;
2996
- };
2997
- /**
2998
- * @type ProductType: Document representing a product type.
2999
- *
3000
- * @property bundle: A flag indicating whether the product is a bundle.
3001
- *
3002
- * @property item: A flag indicating whether the product is a standard item.
3003
- *
3004
- * @property master: A flag indicating whether the product is a master.
3005
- *
3006
- * @property option: A flag indicating whether the product is an option.
3007
- *
3008
- * @property set: A flag indicating whether the product is a set.
3009
- *
3010
- * @property variant: A flag indicating whether the product is a variant.
3011
- *
3012
- * @property variationGroup: A flag indicating whether the product is a variation group.
3013
- *
3014
- */
3015
- type ProductType = {
3016
- bundle?: boolean;
3017
- item?: boolean;
3018
- master?: boolean;
3019
- option?: boolean;
3020
- set?: boolean;
3021
- variant?: boolean;
3022
- variationGroup?: boolean;
3023
- } & {
3024
- [key: string]: any;
3025
- };
3026
- /**
3027
- * @type ProductSearchHit: Document representing a product search hit.
3028
- *
3029
- * @property currency:
3030
- *
3031
- * @property hitType: The type information for the search hit.
3032
- * - **Max Length:** 256
3033
- *
3034
- * @property image: The first image of the product hit for the configured viewtype.
3035
- *
3036
- * @property orderable: A flag indicating whether the product is orderable.
3037
- *
3038
- * @property price: The sales price of the product. In complex products, like master or set, this is the minimum price of related child products.
3039
- *
3040
- * @property priceMax: The maximum sales of related child products in complex products like master or set.
3041
- *
3042
- * @property productId: The ID (SKU) of the product.
3043
- * - **Min Length:** 1
3044
- * - **Max Length:** 100
3045
- *
3046
- * @property productName: The localized name of the product.
3047
- * - **Max Length:** 4000
3048
- *
3049
- * @property productType: The type information for the product.
3050
- *
3051
- * @property representedProduct: The first represented product.
3052
- *
3053
- * @property representedProducts: All the represented products.
3054
- *
3055
- * @property variationAttributes: The array of represented variation attributes, for the master product only. This array can be empty.
3056
- *
3057
- * @property imageGroups: The array of product image groups.
3058
- *
3059
- * @property priceRanges: Array of one or more price range objects representing one or more Pricebooks in context for the site.
3060
- *
3061
- * @property productPromotions: The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.
3062
- *
3063
- * @property tieredPrices: The document represents list of tiered prices if the product is a variant
3064
- *
3065
- * @property variants: The array of actual variants. Only for master, variation group, and variant types. This array can be empty.
3066
- *
3067
- * @property variationGroups: The array of actual variation groups. Only for master, variation group, and variant types. This array can be empty.
3068
- *
3069
- */
3070
- type ProductSearchHit = {
3071
- currency?: CurrencyCode;
3072
- hitType?: string;
3073
- image?: Image;
3074
- orderable?: boolean;
3075
- price?: number;
3076
- priceMax?: number;
3077
- productId: string;
3078
- productName?: string;
3079
- productType?: ProductType;
3080
- representedProduct?: ProductRef;
3081
- representedProducts?: Array<ProductRef>;
3082
- variationAttributes?: Array<VariationAttribute>;
3083
- imageGroups?: Array<ImageGroup>;
3084
- priceRanges?: Array<PriceRange>;
3085
- productPromotions?: Array<ProductPromotion>;
3086
- tieredPrices?: Array<ProductPriceTable>;
3087
- variants?: Array<Variant>;
3088
- variationGroups?: Array<VariationGroup>;
3089
- } & {
3090
- [key: string]: any;
3091
- };
3092
- /**
3093
- * @type ProductSearchRefinementValue: Document representing a product search refinement value.
3094
- *
3095
- * @property description: The localized description of the refinement value.
3096
- * - **Max Length:** 4000
3097
- *
3098
- * @property hitCount: The number of search hits when selecting the refinement value. Can be 0.
3099
- *
3100
- * @property label: The localized label of the refinement value.
3101
- * - **Min Length:** 1
3102
- * - **Max Length:** 4000
3103
- *
3104
- * @property presentationId: The optional presentation ID associated with the refinement value. The presentation ID can be used, for example, to associate an ID with an HTML widget.
3105
- * - **Max Length:** 256
3106
- *
3107
- * @property value: The refinement value. In the case of an attribute refinement, this is the bucket, the attribute value, or a value range. In the case of a category refinement, this is the category ID. In the case of a price refinement, this is the price range. Ranges are enclosed by parentheses and delimited by \"..\"; for example, \"(100..999)\" and \"(Aa..Fa)\" are valid ranges.
3108
- * - **Min Length:** 1
3109
- * - **Max Length:** 4000
3110
- *
3111
- * @property values: The array of hierarchical refinement values. This array can be empty.
3112
- *
3113
- */
3114
- type ProductSearchRefinementValue = {
3115
- description?: string;
3116
- hitCount: number;
3117
- label: string;
3118
- presentationId?: string;
3119
- value: string;
3120
- values?: Array<ProductSearchRefinementValue>;
3121
- } & {
3122
- [key: string]: any;
3123
- };
3124
- /**
3125
- * @type ProductSearchRefinement: Document representing a product search refinement attribute.
3126
- *
3127
- * @property attributeId: The ID of the search refinement attribute. In the case of an attribute refinement, this is the attribute ID. Custom attributes are marked by the prefix \"c_\" (for example, \"c_refinementColor\"). In the case of a category refinement, the ID must be \"cgid\". In the case of a price refinement, the ID must be \"price\".
3128
- * - **Min Length:** 1
3129
- * - **Max Length:** 256
3130
- *
3131
- * @property label: The localized label of the refinement.
3132
- * - **Max Length:** 256
3133
- *
3134
- * @property values: The sorted array of refinement values. This array can be empty.
3135
- *
3136
- */
3137
- type ProductSearchRefinement = {
3138
- attributeId: string;
3139
- label?: string;
3140
- values?: Array<ProductSearchRefinementValue>;
3141
- } & {
3142
- [key: string]: any;
3143
- };
3144
- /**
3145
- * @type Suggestion: Document representing a suggestion.
3146
- *
3147
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
3148
- *
3149
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
3150
- *
3151
- */
3152
- type Suggestion = {
3153
- suggestedPhrases?: Array<SuggestedPhrase>;
3154
- suggestedTerms: Array<SuggestedTerms>;
3155
- } & {
3156
- [key: string]: any;
3157
- };
3158
- /**
3159
- * @type ProductSearchSortingOption: Document representing a product search sorting option.
3160
- *
3161
- * @property id: The ID of the sorting option.
3162
- * - **Min Length:** 1
3163
- * - **Max Length:** 256
3164
- *
3165
- * @property label: The localized label of the sorting option.
3166
- * - **Min Length:** 1
3167
- * - **Max Length:** 4000
3168
- *
3169
- */
3170
- type ProductSearchSortingOption = {
3171
- id: string;
3172
- label: string;
3173
- } & {
3174
- [key: string]: any;
3175
- };
3176
- /**
3177
- * @type ProductSearchResult: Document representing a product search result.
3178
- *
3179
- * @property hits: A sorted array of search hits (`ProductSearchHit` objects). The array can be empty.
3180
- *
3181
- * @property pageMetaTags: Page Meta tags associated with the search result.
3182
- *
3183
- * @property query: The query string that was searched for.
3184
- * - **Max Length:** 50
3185
- *
3186
- * @property refinements: The sorted array of search refinements. This array can be empty.
3187
- *
3188
- * @property searchPhraseSuggestions: The suggestion given by the system for the submitted search phrase.
3189
- * - **Min Length:** 1
3190
- *
3191
- * @property selectedRefinements: A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL.
3192
- *
3193
- * @property selectedSortingOption: The ID of the applied sorting option.
3194
- * - **Max Length:** 4000
3195
- *
3196
- * @property sortingOptions: The sorted array of search sorting options. This array can be empty.
3197
- *
3198
- * @property offset: The zero-based index of the first hit/data to include in the result.
3199
- *
3200
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
3201
- *
3202
- * @property total: 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.
3203
- *
3204
- */
3205
- type ProductSearchResult = {
3206
- hits: Array<ProductSearchHit>;
3207
- pageMetaTags?: Array<PageMetaTag>;
3208
- query: string;
3209
- refinements: Array<ProductSearchRefinement>;
3210
- searchPhraseSuggestions: Suggestion;
3211
- selectedRefinements?: {
3212
- [key: string]: string;
3213
- };
3214
- selectedSortingOption?: string;
3215
- sortingOptions: Array<ProductSearchSortingOption>;
3216
- offset: number;
3217
- limit: number;
3218
- total: number;
3219
- } & {
3220
- [key: string]: any;
3221
- };
3222
- /**
3223
- * @type SuggestedProduct: Document representing a product search hit.
3224
- *
3225
- * @property currency:
3226
- *
3227
- * @property price: The sales price of the product. In the case of complex products like a master or a set, this is the minimum price of related child products.
3228
- *
3229
- * @property productId: The ID (SKU) of the product.
3230
- * - **Min Length:** 1
3231
- * - **Max Length:** 100
3232
- *
3233
- * @property productName: The localized name of the product.
3234
- * - **Min Length:** 1
3235
- * - **Max Length:** 4000
3236
- *
3237
- */
3238
- type SuggestedProduct = {
3239
- currency: CurrencyCode;
3240
- price: number;
3241
- productId: string;
3242
- productName: string;
3243
- } & {
3244
- [key: string]: any;
3245
- };
3246
- /**
3247
- * @type ProductSuggestions:
3248
- *
3249
- * @property products: The sorted list of suggested products. This list can be empty.
3250
- *
3251
- * @property suggestedPhrases: A list of suggested phrases. This list can be empty.
3252
- *
3253
- * @property suggestedTerms: A list of suggested terms. This list can be empty.
3254
- *
3255
- */
3256
- type ProductSuggestions = {
3257
- products?: Array<SuggestedProduct>;
3258
- suggestedPhrases?: Array<SuggestedPhrase>;
3259
- suggestedTerms: Array<SuggestedTerms>;
3260
- } & {
3261
- [key: string]: any;
3262
- };
3263
- /**
3264
- * @type ResultBase: Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.
3265
- *
3266
- * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
3267
- *
3268
- * @property total: 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.
3269
- *
3270
- */
3271
- type ResultBase = {
3272
- limit: number;
3273
- total: number;
3274
- } & {
3275
- [key: string]: any;
3276
- };
3277
- /**
3278
- * @type SuggestionResult: Document representing a search suggestion result.
3279
- *
3280
- * @property brandSuggestions: Returns the suggested brands.
3281
- *
3282
- * @property categorySuggestions: Returns the suggested categories.
3283
- *
3284
- * @property productSuggestions: Returns the suggested products.
3285
- *
3286
- * @property customSuggestion: Returns custom suggestions.
3287
- *
3288
- * @property einsteinSuggestedPhrases: Returns Einstein suggested phrases containing popular and recent search phrases.
3289
- *
3290
- * @property searchPhrase: The query phrase (q) for which suggestions where made.
3291
- * - **Min Length:** 3
3292
- * - **Max Length:** 50
3293
- *
3294
- */
3295
- type SuggestionResult = {
3296
- brandSuggestions?: BrandSuggestions;
3297
- categorySuggestions?: CategorySuggestions;
3298
- productSuggestions?: ProductSuggestions;
3299
- customSuggestion?: CustomSuggestions;
3300
- einsteinSuggestedPhrases?: EinsteinSuggestedPhrases;
3301
- searchPhrase: string;
3302
- } & {
3303
- [key: string]: any;
3304
- };
3305
- }
3306
- declare namespace ShopperSearchTypes {
3307
- type ShopperSearchPathParameters = ShopperSearchApiTypes.ShopperSearchPathParameters;
3308
- type ShopperSearchQueryParameters = ShopperSearchApiTypes.ShopperSearchQueryParameters;
3309
- type GetSearchSuggestionsExpandEnum = ShopperSearchApiTypes.GetSearchSuggestionsExpandEnum;
3310
- type getSearchSuggestionsQueryParameters = ShopperSearchApiTypes.getSearchSuggestionsQueryParameters;
3311
- type getSearchSuggestionsPathParameters = ShopperSearchApiTypes.getSearchSuggestionsPathParameters;
3312
- type ProductSearchExpandEnum = ShopperSearchApiTypes.ProductSearchExpandEnum;
3313
- type productSearchQueryParameters = ShopperSearchApiTypes.productSearchQueryParameters;
3314
- type productSearchPathParameters = ShopperSearchApiTypes.productSearchPathParameters;
3315
- type BrandSuggestions = ShopperSearchModelTypes.BrandSuggestions;
3316
- type CategorySuggestions = ShopperSearchModelTypes.CategorySuggestions;
3317
- type CurrencyCode = ShopperSearchModelTypes.CurrencyCode;
3318
- type CustomSuggestions = ShopperSearchModelTypes.CustomSuggestions;
3319
- type DefaultFallback = ShopperSearchModelTypes.DefaultFallback;
3320
- type EinsteinSuggestedPhrases = ShopperSearchModelTypes.EinsteinSuggestedPhrases;
3321
- type ErrorResponse = ShopperSearchModelTypes.ErrorResponse;
3322
- type Image = ShopperSearchModelTypes.Image;
3323
- type ImageGroup = ShopperSearchModelTypes.ImageGroup;
3324
- type LocaleCode = ShopperSearchModelTypes.LocaleCode;
3325
- type NoValue = ShopperSearchModelTypes.NoValue;
3326
- type PageMetaTag = ShopperSearchModelTypes.PageMetaTag;
3327
- type PaginatedResultBase = ShopperSearchModelTypes.PaginatedResultBase;
3328
- type PriceRange = ShopperSearchModelTypes.PriceRange;
3329
- type ProductPriceTable = ShopperSearchModelTypes.ProductPriceTable;
3330
- type ProductPromotion = ShopperSearchModelTypes.ProductPromotion;
3331
- type ProductRef = ShopperSearchModelTypes.ProductRef;
3332
- type ProductSearchHit = ShopperSearchModelTypes.ProductSearchHit;
3333
- type ProductSearchRefinement = ShopperSearchModelTypes.ProductSearchRefinement;
3334
- type ProductSearchRefinementValue = ShopperSearchModelTypes.ProductSearchRefinementValue;
3335
- type ProductSearchResult = ShopperSearchModelTypes.ProductSearchResult;
3336
- type ProductSearchSortingOption = ShopperSearchModelTypes.ProductSearchSortingOption;
3337
- type ProductSuggestions = ShopperSearchModelTypes.ProductSuggestions;
3338
- type ProductType = ShopperSearchModelTypes.ProductType;
3339
- type ResultBase = ShopperSearchModelTypes.ResultBase;
3340
- type SuggestedCategory = ShopperSearchModelTypes.SuggestedCategory;
3341
- type SuggestedPhrase = ShopperSearchModelTypes.SuggestedPhrase;
3342
- type SuggestedProduct = ShopperSearchModelTypes.SuggestedProduct;
3343
- type SuggestedTerm = ShopperSearchModelTypes.SuggestedTerm;
3344
- type SuggestedTerms = ShopperSearchModelTypes.SuggestedTerms;
3345
- type Suggestion = ShopperSearchModelTypes.Suggestion;
3346
- type SuggestionResult = ShopperSearchModelTypes.SuggestionResult;
3347
- type Variant = ShopperSearchModelTypes.Variant;
3348
- type VariationAttribute = ShopperSearchModelTypes.VariationAttribute;
3349
- type VariationAttributeValue = ShopperSearchModelTypes.VariationAttributeValue;
3350
- type VariationGroup = ShopperSearchModelTypes.VariationGroup;
3351
- }
3352
- export { defaultBaseUri, GetSearchSuggestionsExpandEnum, ProductSearchExpandEnum, getSearchSuggestionsQueryParameters, getSearchSuggestionsPathParameters, productSearchQueryParameters, productSearchPathParameters, ShopperSearchPathParameters, ShopperSearchQueryParameters, ShopperSearchParameters, ShopperSearch, BrandSuggestions, CategorySuggestions, CurrencyCode, CustomSuggestions, DefaultFallback, EinsteinSuggestedPhrases, ErrorResponse, Image, ImageGroup, LocaleCode$0 as LocaleCode, NoValue, PageMetaTag, PaginatedResultBase, PriceRange, ProductPriceTable, ProductPromotion, ProductRef, ProductSearchHit, ProductSearchRefinement, ProductSearchRefinementValue, ProductSearchResult, ProductSearchSortingOption, ProductSuggestions, ProductType, ResultBase, SuggestedCategory, SuggestedPhrase, SuggestedProduct, SuggestedTerm, SuggestedTerms, Suggestion, SuggestionResult, Variant, VariationAttribute, VariationAttributeValue, VariationGroup, ShopperSearchTypes };