commerce-sdk-isomorphic 4.1.0 → 4.2.0

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 +1 -114
  2. package/lib/index.cjs.d.ts +1320 -169
  3. package/lib/index.cjs.js +1 -1
  4. package/lib/index.esm.d.ts +1320 -169
  5. package/lib/index.esm.js +1 -1
  6. package/package.json +24 -91
  7. package/lib/clientConfig.cjs.d.ts +0 -54
  8. package/lib/clientConfig.cjs.js +0 -1
  9. package/lib/clientConfig.d.ts +0 -54
  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 -10264
  24. package/lib/shopperBaskets.cjs.js +0 -1
  25. package/lib/shopperBaskets.d.ts +0 -10264
  26. package/lib/shopperBaskets.js +0 -1
  27. package/lib/shopperBasketsv2.cjs.d.ts +0 -10458
  28. package/lib/shopperBasketsv2.cjs.js +0 -1
  29. package/lib/shopperBasketsv2.d.ts +0 -10458
  30. package/lib/shopperBasketsv2.js +0 -1
  31. package/lib/shopperConsents.cjs.d.ts +0 -1147
  32. package/lib/shopperConsents.cjs.js +0 -1
  33. package/lib/shopperConsents.d.ts +0 -1147
  34. package/lib/shopperConsents.js +0 -1
  35. package/lib/shopperContext.cjs.d.ts +0 -1406
  36. package/lib/shopperContext.cjs.js +0 -1
  37. package/lib/shopperContext.d.ts +0 -1406
  38. package/lib/shopperContext.js +0 -1
  39. package/lib/shopperCustomers.cjs.d.ts +0 -12190
  40. package/lib/shopperCustomers.cjs.js +0 -1
  41. package/lib/shopperCustomers.d.ts +0 -12190
  42. package/lib/shopperCustomers.js +0 -1
  43. package/lib/shopperExperience.cjs.d.ts +0 -1174
  44. package/lib/shopperExperience.cjs.js +0 -1
  45. package/lib/shopperExperience.d.ts +0 -1174
  46. package/lib/shopperExperience.js +0 -1
  47. package/lib/shopperGiftCertificates.cjs.d.ts +0 -734
  48. package/lib/shopperGiftCertificates.cjs.js +0 -1
  49. package/lib/shopperGiftCertificates.d.ts +0 -734
  50. package/lib/shopperGiftCertificates.js +0 -1
  51. package/lib/shopperLogin.cjs.d.ts +0 -3847
  52. package/lib/shopperLogin.cjs.js +0 -1
  53. package/lib/shopperLogin.d.ts +0 -3847
  54. package/lib/shopperLogin.js +0 -1
  55. package/lib/shopperOrders.cjs.d.ts +0 -5398
  56. package/lib/shopperOrders.cjs.js +0 -1
  57. package/lib/shopperOrders.d.ts +0 -5398
  58. package/lib/shopperOrders.js +0 -1
  59. package/lib/shopperProducts.cjs.d.ts +0 -3484
  60. package/lib/shopperProducts.cjs.js +0 -1
  61. package/lib/shopperProducts.d.ts +0 -3484
  62. package/lib/shopperProducts.js +0 -1
  63. package/lib/shopperPromotions.cjs.d.ts +0 -1006
  64. package/lib/shopperPromotions.cjs.js +0 -1
  65. package/lib/shopperPromotions.d.ts +0 -1006
  66. package/lib/shopperPromotions.js +0 -1
  67. package/lib/shopperSearch.cjs.d.ts +0 -3357
  68. package/lib/shopperSearch.cjs.js +0 -1
  69. package/lib/shopperSearch.d.ts +0 -3357
  70. package/lib/shopperSearch.js +0 -1
  71. package/lib/shopperSeo.cjs.d.ts +0 -774
  72. package/lib/shopperSeo.cjs.js +0 -1
  73. package/lib/shopperSeo.d.ts +0 -774
  74. package/lib/shopperSeo.js +0 -1
  75. package/lib/shopperStores.cjs.d.ts +0 -1294
  76. package/lib/shopperStores.cjs.js +0 -1
  77. package/lib/shopperStores.d.ts +0 -1294
  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
@@ -77,7 +77,6 @@ type BrowserRequestInit = RequestInit;
77
77
  * Using the right properties in the right context is left to the user.
78
78
  */
79
79
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
80
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
81
80
  /**
82
81
  * Base options that can be passed to the `ClientConfig` class.
83
82
  */
@@ -89,12 +88,12 @@ interface ClientConfigInit<Params extends BaseUriParameters> {
89
88
  };
90
89
  parameters: Params;
91
90
  fetchOptions?: FetchOptions;
92
- fetch?: FetchFunction;
93
91
  transformRequest?: (data: unknown, headers: {
94
92
  [key: string]: string;
95
93
  }) => Required<FetchOptions>["body"];
96
94
  throwOnBadResponse?: boolean;
97
95
  }
96
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
98
97
  /**
99
98
  * Configuration parameters common to Commerce SDK clients
100
99
  */
@@ -106,7 +105,6 @@ declare class ClientConfig<Params extends BaseUriParameters> implements ClientCo
106
105
  };
107
106
  parameters: Params;
108
107
  fetchOptions: FetchOptions;
109
- fetch?: FetchFunction;
110
108
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
111
109
  throwOnBadResponse: boolean;
112
110
  constructor(config: ClientConfigInit<Params>);
@@ -1386,6 +1384,7 @@ type removeShipmentFromBasketPathParameters = {
1386
1384
  type transferBasketQueryParameters = {
1387
1385
  siteId: string;
1388
1386
  overrideExisting?: boolean;
1387
+ merge?: boolean;
1389
1388
  locale?: LocaleCode$0;
1390
1389
  };
1391
1390
  type transferBasketPathParameters = {
@@ -1526,7 +1525,9 @@ type ShopperBasketsParameters = ShopperBasketsPathParameters & BaseUriParameters
1526
1525
  * [Shopper Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-baskets:Summary)
1527
1526
  * ==================================
1528
1527
  *
1529
- * *# API Overview
1528
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets/shopper-baskets-oas-v1-public.yaml)
1529
+
1530
+ # API Overview
1530
1531
 
1531
1532
  Use the Shopper Baskets API to create a basket in the B2C Commerce system and populate it with all the data required to ready the basket for checkout.
1532
1533
 
@@ -1959,6 +1960,7 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
1959
1960
  "siteId",
1960
1961
  "organizationId",
1961
1962
  "overrideExisting",
1963
+ "merge",
1962
1964
  "locale"
1963
1965
  ];
1964
1966
  readonly transferBasketRequired: readonly [
@@ -3068,7 +3070,9 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3068
3070
  };
3069
3071
  }>, rawResponse?: T): Promise<T extends true ? Response : Taxes>;
3070
3072
  /**
3071
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
3073
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
3074
+
3075
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
3072
3076
 
3073
3077
  The following information is merged:
3074
3078
  - custom attributes on the basket and on all copied records
@@ -3140,7 +3144,9 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3140
3144
  };
3141
3145
  }>): Promise<Basket>;
3142
3146
  /**
3143
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
3147
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
3148
+
3149
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
3144
3150
 
3145
3151
  The following information is merged:
3146
3152
  - custom attributes on the basket and on all copied records
@@ -3547,12 +3553,16 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3547
3553
  /**
3548
3554
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
3549
3555
 
3550
- A success response contains the transferred basket.
3556
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
3557
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
3558
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
3551
3559
 
3552
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
3560
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
3553
3561
  - Keep the current shopper's active basket.
3554
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
3555
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
3562
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
3563
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
3564
+
3565
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
3556
3566
  *
3557
3567
  * If you would like to get a raw Response object use the other transferBasket function.
3558
3568
  *
@@ -3563,6 +3573,31 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3563
3573
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
3564
3574
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
3565
3575
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
3576
+ * @param options.parameters.merge - This parameter controls the behavior:
3577
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
3578
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
3579
+
3580
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
3581
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
3582
+
3583
+ There are four possible use cases:
3584
+
3585
+ a) Guest basket and registered basket exist
3586
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
3587
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
3588
+
3589
+ b) Guest basket exists but no registered basket exists
3590
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
3591
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
3592
+
3593
+ c) No guest basket exists but a registered basket exists
3594
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
3595
+ passed to the hook).
3596
+
3597
+ d) Neither basket exists
3598
+ The hook dw.order.mergeBasket is not called.
3599
+
3600
+ The API returns the current basket (after executing dw.order.mergeBasket).
3566
3601
  * @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.
3567
3602
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3568
3603
  *
@@ -3573,6 +3608,7 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3573
3608
  siteId: string;
3574
3609
  organizationId: string;
3575
3610
  overrideExisting?: boolean;
3611
+ merge?: boolean;
3576
3612
  locale?: LocaleCode$0;
3577
3613
  } & QueryParameters, ConfigParameters>;
3578
3614
  headers?: {
@@ -3582,12 +3618,16 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3582
3618
  /**
3583
3619
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
3584
3620
 
3585
- A success response contains the transferred basket.
3621
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
3622
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
3623
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
3586
3624
 
3587
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
3625
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
3588
3626
  - Keep the current shopper's active basket.
3589
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
3590
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
3627
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
3628
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
3629
+
3630
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
3591
3631
  *
3592
3632
  * @param options - An object containing the options for this method.
3593
3633
  * @param options.parameters - An object containing the parameters for this method.
@@ -3596,6 +3636,31 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3596
3636
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
3597
3637
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
3598
3638
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
3639
+ * @param options.parameters.merge - This parameter controls the behavior:
3640
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
3641
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
3642
+
3643
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
3644
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
3645
+
3646
+ There are four possible use cases:
3647
+
3648
+ a) Guest basket and registered basket exist
3649
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
3650
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
3651
+
3652
+ b) Guest basket exists but no registered basket exists
3653
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
3654
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
3655
+
3656
+ c) No guest basket exists but a registered basket exists
3657
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
3658
+ passed to the hook).
3659
+
3660
+ d) Neither basket exists
3661
+ The hook dw.order.mergeBasket is not called.
3662
+
3663
+ The API returns the current basket (after executing dw.order.mergeBasket).
3599
3664
  * @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.
3600
3665
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3601
3666
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
@@ -3607,6 +3672,7 @@ declare class ShopperBaskets<ConfigParameters extends ShopperBasketsParameters &
3607
3672
  siteId: string;
3608
3673
  organizationId: string;
3609
3674
  overrideExisting?: boolean;
3675
+ merge?: boolean;
3610
3676
  locale?: LocaleCode$0;
3611
3677
  } & QueryParameters, ConfigParameters>;
3612
3678
  headers?: {
@@ -4571,7 +4637,6 @@ declare namespace ShopperBasketsApiTypes {
4571
4637
  * Using the right properties in the right context is left to the user.
4572
4638
  */
4573
4639
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
4574
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
4575
4640
  /**
4576
4641
  * Base options that can be passed to the `ClientConfig` class.
4577
4642
  */
@@ -4583,12 +4648,12 @@ declare namespace ShopperBasketsApiTypes {
4583
4648
  };
4584
4649
  parameters: Params;
4585
4650
  fetchOptions?: FetchOptions;
4586
- fetch?: FetchFunction;
4587
4651
  transformRequest?: (data: unknown, headers: {
4588
4652
  [key: string]: string;
4589
4653
  }) => Required<FetchOptions>["body"];
4590
4654
  throwOnBadResponse?: boolean;
4591
4655
  }
4656
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
4592
4657
  /**
4593
4658
  * Configuration parameters common to Commerce SDK clients
4594
4659
  */
@@ -4600,7 +4665,6 @@ declare namespace ShopperBasketsApiTypes {
4600
4665
  };
4601
4666
  parameters: Params;
4602
4667
  fetchOptions: FetchOptions;
4603
- fetch?: FetchFunction;
4604
4668
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
4605
4669
  throwOnBadResponse: boolean;
4606
4670
  constructor(config: ClientConfigInit<Params>);
@@ -5903,6 +5967,7 @@ declare namespace ShopperBasketsApiTypes {
5903
5967
  type transferBasketQueryParameters = {
5904
5968
  siteId: string;
5905
5969
  overrideExisting?: boolean;
5970
+ merge?: boolean;
5906
5971
  locale?: LocaleCode$0;
5907
5972
  };
5908
5973
  type transferBasketPathParameters = {
@@ -6043,7 +6108,9 @@ declare namespace ShopperBasketsApiTypes {
6043
6108
  * [Shopper Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-baskets:Summary)
6044
6109
  * ==================================
6045
6110
  *
6046
- * *# API Overview
6111
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets/shopper-baskets-oas-v1-public.yaml)
6112
+
6113
+ # API Overview
6047
6114
 
6048
6115
  Use the Shopper Baskets API to create a basket in the B2C Commerce system and populate it with all the data required to ready the basket for checkout.
6049
6116
 
@@ -6476,6 +6543,7 @@ declare namespace ShopperBasketsApiTypes {
6476
6543
  "siteId",
6477
6544
  "organizationId",
6478
6545
  "overrideExisting",
6546
+ "merge",
6479
6547
  "locale"
6480
6548
  ];
6481
6549
  readonly transferBasketRequired: readonly [
@@ -7585,7 +7653,9 @@ declare namespace ShopperBasketsApiTypes {
7585
7653
  };
7586
7654
  }>, rawResponse?: T): Promise<T extends true ? Response : Taxes>;
7587
7655
  /**
7588
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
7656
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
7657
+
7658
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
7589
7659
 
7590
7660
  The following information is merged:
7591
7661
  - custom attributes on the basket and on all copied records
@@ -7657,7 +7727,9 @@ declare namespace ShopperBasketsApiTypes {
7657
7727
  };
7658
7728
  }>): Promise<Basket>;
7659
7729
  /**
7660
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
7730
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
7731
+
7732
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
7661
7733
 
7662
7734
  The following information is merged:
7663
7735
  - custom attributes on the basket and on all copied records
@@ -8064,12 +8136,16 @@ declare namespace ShopperBasketsApiTypes {
8064
8136
  /**
8065
8137
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
8066
8138
 
8067
- A success response contains the transferred basket.
8139
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
8140
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
8141
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
8068
8142
 
8069
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
8143
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
8070
8144
  - Keep the current shopper's active basket.
8071
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
8072
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
8145
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
8146
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
8147
+
8148
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
8073
8149
  *
8074
8150
  * If you would like to get a raw Response object use the other transferBasket function.
8075
8151
  *
@@ -8080,6 +8156,31 @@ declare namespace ShopperBasketsApiTypes {
8080
8156
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
8081
8157
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
8082
8158
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
8159
+ * @param options.parameters.merge - This parameter controls the behavior:
8160
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
8161
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
8162
+
8163
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
8164
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
8165
+
8166
+ There are four possible use cases:
8167
+
8168
+ a) Guest basket and registered basket exist
8169
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
8170
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
8171
+
8172
+ b) Guest basket exists but no registered basket exists
8173
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
8174
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
8175
+
8176
+ c) No guest basket exists but a registered basket exists
8177
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
8178
+ passed to the hook).
8179
+
8180
+ d) Neither basket exists
8181
+ The hook dw.order.mergeBasket is not called.
8182
+
8183
+ The API returns the current basket (after executing dw.order.mergeBasket).
8083
8184
  * @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.
8084
8185
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
8085
8186
  *
@@ -8090,6 +8191,7 @@ declare namespace ShopperBasketsApiTypes {
8090
8191
  siteId: string;
8091
8192
  organizationId: string;
8092
8193
  overrideExisting?: boolean;
8194
+ merge?: boolean;
8093
8195
  locale?: LocaleCode$0;
8094
8196
  } & QueryParameters, ConfigParameters>;
8095
8197
  headers?: {
@@ -8099,12 +8201,16 @@ declare namespace ShopperBasketsApiTypes {
8099
8201
  /**
8100
8202
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
8101
8203
 
8102
- A success response contains the transferred basket.
8204
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
8205
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
8206
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
8103
8207
 
8104
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
8208
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
8105
8209
  - Keep the current shopper's active basket.
8106
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
8107
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
8210
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
8211
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
8212
+
8213
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
8108
8214
  *
8109
8215
  * @param options - An object containing the options for this method.
8110
8216
  * @param options.parameters - An object containing the parameters for this method.
@@ -8113,6 +8219,31 @@ declare namespace ShopperBasketsApiTypes {
8113
8219
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
8114
8220
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
8115
8221
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
8222
+ * @param options.parameters.merge - This parameter controls the behavior:
8223
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
8224
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
8225
+
8226
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
8227
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
8228
+
8229
+ There are four possible use cases:
8230
+
8231
+ a) Guest basket and registered basket exist
8232
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
8233
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
8234
+
8235
+ b) Guest basket exists but no registered basket exists
8236
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
8237
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
8238
+
8239
+ c) No guest basket exists but a registered basket exists
8240
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
8241
+ passed to the hook).
8242
+
8243
+ d) Neither basket exists
8244
+ The hook dw.order.mergeBasket is not called.
8245
+
8246
+ The API returns the current basket (after executing dw.order.mergeBasket).
8116
8247
  * @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.
8117
8248
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
8118
8249
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
@@ -8124,6 +8255,7 @@ declare namespace ShopperBasketsApiTypes {
8124
8255
  siteId: string;
8125
8256
  organizationId: string;
8126
8257
  overrideExisting?: boolean;
8258
+ merge?: boolean;
8127
8259
  locale?: LocaleCode$0;
8128
8260
  } & QueryParameters, ConfigParameters>;
8129
8261
  headers?: {
@@ -11545,6 +11677,7 @@ type removeShipmentFromBasketPathParameters$0 = {
11545
11677
  type transferBasketQueryParameters$0 = {
11546
11678
  siteId: string;
11547
11679
  overrideExisting?: boolean;
11680
+ merge?: boolean;
11548
11681
  locale?: LocaleCode$1;
11549
11682
  };
11550
11683
  type transferBasketPathParameters$0 = {
@@ -11685,7 +11818,9 @@ type ShopperBasketsParameters$0 = ShopperBasketsPathParameters$0 & BaseUriParame
11685
11818
  * [Shopper Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-baskets:Summary)
11686
11819
  * ==================================
11687
11820
  *
11688
- * *# API Overview
11821
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets-v2/shopper-baskets-oas-v2-public.yaml)
11822
+
11823
+ # API Overview
11689
11824
 
11690
11825
  Shopper Baskets V2 provides all Shopper Basket V1 functionality and adds support for temporary baskets.
11691
11826
  Temporary baskets can perform calculations to generate totals, line items, promotions, and item availability without affecting the shopper’s storefront cart, and you can use those calculations for temporary basket checkout. You can also use a temporary basket for an immediate order request.
@@ -12133,6 +12268,7 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
12133
12268
  "siteId",
12134
12269
  "organizationId",
12135
12270
  "overrideExisting",
12271
+ "merge",
12136
12272
  "locale"
12137
12273
  ];
12138
12274
  readonly transferBasketRequired: readonly [
@@ -13248,7 +13384,9 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13248
13384
  };
13249
13385
  }>, rawResponse?: T): Promise<T extends true ? Response : Taxes$0>;
13250
13386
  /**
13251
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
13387
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
13388
+
13389
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
13252
13390
 
13253
13391
  The following information is merged:
13254
13392
  - custom attributes on the basket and on all copied records
@@ -13320,7 +13458,9 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13320
13458
  };
13321
13459
  }>): Promise<Basket$0>;
13322
13460
  /**
13323
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
13461
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
13462
+
13463
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
13324
13464
 
13325
13465
  The following information is merged:
13326
13466
  - custom attributes on the basket and on all copied records
@@ -13727,12 +13867,16 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13727
13867
  /**
13728
13868
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
13729
13869
 
13730
- A success response contains the transferred basket.
13870
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
13871
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
13872
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
13731
13873
 
13732
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
13874
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
13733
13875
  - Keep the current shopper's active basket.
13734
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
13735
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
13876
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
13877
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
13878
+
13879
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
13736
13880
  *
13737
13881
  * If you would like to get a raw Response object use the other transferBasket function.
13738
13882
  *
@@ -13743,6 +13887,31 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13743
13887
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
13744
13888
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
13745
13889
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
13890
+ * @param options.parameters.merge - This parameter controls the behavior:
13891
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
13892
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
13893
+
13894
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
13895
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
13896
+
13897
+ There are four possible use cases:
13898
+
13899
+ a) Guest basket and registered basket exist
13900
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
13901
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
13902
+
13903
+ b) Guest basket exists but no registered basket exists
13904
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
13905
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
13906
+
13907
+ c) No guest basket exists but a registered basket exists
13908
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
13909
+ passed to the hook).
13910
+
13911
+ d) Neither basket exists
13912
+ The hook dw.order.mergeBasket is not called.
13913
+
13914
+ The API returns the current basket (after executing dw.order.mergeBasket).
13746
13915
  * @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.
13747
13916
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
13748
13917
  *
@@ -13753,6 +13922,7 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13753
13922
  siteId: string;
13754
13923
  organizationId: string;
13755
13924
  overrideExisting?: boolean;
13925
+ merge?: boolean;
13756
13926
  locale?: LocaleCode$1;
13757
13927
  } & QueryParameters, ConfigParameters>;
13758
13928
  headers?: {
@@ -13762,12 +13932,16 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13762
13932
  /**
13763
13933
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
13764
13934
 
13765
- A success response contains the transferred basket.
13935
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
13936
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
13937
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
13766
13938
 
13767
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
13939
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
13768
13940
  - Keep the current shopper's active basket.
13769
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
13770
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
13941
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
13942
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
13943
+
13944
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
13771
13945
  *
13772
13946
  * @param options - An object containing the options for this method.
13773
13947
  * @param options.parameters - An object containing the parameters for this method.
@@ -13776,6 +13950,31 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13776
13950
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
13777
13951
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
13778
13952
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
13953
+ * @param options.parameters.merge - This parameter controls the behavior:
13954
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
13955
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
13956
+
13957
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
13958
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
13959
+
13960
+ There are four possible use cases:
13961
+
13962
+ a) Guest basket and registered basket exist
13963
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
13964
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
13965
+
13966
+ b) Guest basket exists but no registered basket exists
13967
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
13968
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
13969
+
13970
+ c) No guest basket exists but a registered basket exists
13971
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
13972
+ passed to the hook).
13973
+
13974
+ d) Neither basket exists
13975
+ The hook dw.order.mergeBasket is not called.
13976
+
13977
+ The API returns the current basket (after executing dw.order.mergeBasket).
13779
13978
  * @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.
13780
13979
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
13781
13980
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
@@ -13787,6 +13986,7 @@ declare class ShopperBasketsV2<ConfigParameters extends ShopperBasketsParameters
13787
13986
  siteId: string;
13788
13987
  organizationId: string;
13789
13988
  overrideExisting?: boolean;
13989
+ merge?: boolean;
13790
13990
  locale?: LocaleCode$1;
13791
13991
  } & QueryParameters, ConfigParameters>;
13792
13992
  headers?: {
@@ -14791,7 +14991,6 @@ declare namespace ShopperBasketsV2ApiTypes {
14791
14991
  * Using the right properties in the right context is left to the user.
14792
14992
  */
14793
14993
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
14794
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
14795
14994
  /**
14796
14995
  * Base options that can be passed to the `ClientConfig` class.
14797
14996
  */
@@ -14803,12 +15002,12 @@ declare namespace ShopperBasketsV2ApiTypes {
14803
15002
  };
14804
15003
  parameters: Params;
14805
15004
  fetchOptions?: FetchOptions;
14806
- fetch?: FetchFunction;
14807
15005
  transformRequest?: (data: unknown, headers: {
14808
15006
  [key: string]: string;
14809
15007
  }) => Required<FetchOptions>["body"];
14810
15008
  throwOnBadResponse?: boolean;
14811
15009
  }
15010
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
14812
15011
  /**
14813
15012
  * Configuration parameters common to Commerce SDK clients
14814
15013
  */
@@ -14820,7 +15019,6 @@ declare namespace ShopperBasketsV2ApiTypes {
14820
15019
  };
14821
15020
  parameters: Params;
14822
15021
  fetchOptions: FetchOptions;
14823
- fetch?: FetchFunction;
14824
15022
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
14825
15023
  throwOnBadResponse: boolean;
14826
15024
  constructor(config: ClientConfigInit<Params>);
@@ -16147,6 +16345,7 @@ declare namespace ShopperBasketsV2ApiTypes {
16147
16345
  type transferBasketQueryParameters = {
16148
16346
  siteId: string;
16149
16347
  overrideExisting?: boolean;
16348
+ merge?: boolean;
16150
16349
  locale?: LocaleCode$0;
16151
16350
  };
16152
16351
  type transferBasketPathParameters = {
@@ -16287,7 +16486,9 @@ declare namespace ShopperBasketsV2ApiTypes {
16287
16486
  * [Shopper Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-baskets:Summary)
16288
16487
  * ==================================
16289
16488
  *
16290
- * *# API Overview
16489
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets-v2/shopper-baskets-oas-v2-public.yaml)
16490
+
16491
+ # API Overview
16291
16492
 
16292
16493
  Shopper Baskets V2 provides all Shopper Basket V1 functionality and adds support for temporary baskets.
16293
16494
  Temporary baskets can perform calculations to generate totals, line items, promotions, and item availability without affecting the shopper’s storefront cart, and you can use those calculations for temporary basket checkout. You can also use a temporary basket for an immediate order request.
@@ -16735,6 +16936,7 @@ declare namespace ShopperBasketsV2ApiTypes {
16735
16936
  "siteId",
16736
16937
  "organizationId",
16737
16938
  "overrideExisting",
16939
+ "merge",
16738
16940
  "locale"
16739
16941
  ];
16740
16942
  readonly transferBasketRequired: readonly [
@@ -17850,7 +18052,9 @@ declare namespace ShopperBasketsV2ApiTypes {
17850
18052
  };
17851
18053
  }>, rawResponse?: T): Promise<T extends true ? Response : Taxes>;
17852
18054
  /**
17853
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
18055
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
18056
+
18057
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
17854
18058
 
17855
18059
  The following information is merged:
17856
18060
  - custom attributes on the basket and on all copied records
@@ -17922,7 +18126,9 @@ declare namespace ShopperBasketsV2ApiTypes {
17922
18126
  };
17923
18127
  }>): Promise<Basket>;
17924
18128
  /**
17925
- * Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
18129
+ * ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
18130
+
18131
+ Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
17926
18132
 
17927
18133
  The following information is merged:
17928
18134
  - custom attributes on the basket and on all copied records
@@ -18329,12 +18535,16 @@ declare namespace ShopperBasketsV2ApiTypes {
18329
18535
  /**
18330
18536
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
18331
18537
 
18332
- A success response contains the transferred basket.
18538
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
18539
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
18540
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
18333
18541
 
18334
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
18542
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
18335
18543
  - Keep the current shopper's active basket.
18336
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
18337
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
18544
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
18545
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
18546
+
18547
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
18338
18548
  *
18339
18549
  * If you would like to get a raw Response object use the other transferBasket function.
18340
18550
  *
@@ -18345,6 +18555,31 @@ declare namespace ShopperBasketsV2ApiTypes {
18345
18555
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
18346
18556
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
18347
18557
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
18558
+ * @param options.parameters.merge - This parameter controls the behavior:
18559
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
18560
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
18561
+
18562
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
18563
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
18564
+
18565
+ There are four possible use cases:
18566
+
18567
+ a) Guest basket and registered basket exist
18568
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
18569
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
18570
+
18571
+ b) Guest basket exists but no registered basket exists
18572
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
18573
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
18574
+
18575
+ c) No guest basket exists but a registered basket exists
18576
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
18577
+ passed to the hook).
18578
+
18579
+ d) Neither basket exists
18580
+ The hook dw.order.mergeBasket is not called.
18581
+
18582
+ The API returns the current basket (after executing dw.order.mergeBasket).
18348
18583
  * @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.
18349
18584
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
18350
18585
  *
@@ -18355,6 +18590,7 @@ declare namespace ShopperBasketsV2ApiTypes {
18355
18590
  siteId: string;
18356
18591
  organizationId: string;
18357
18592
  overrideExisting?: boolean;
18593
+ merge?: boolean;
18358
18594
  locale?: LocaleCode$0;
18359
18595
  } & QueryParameters, ConfigParameters>;
18360
18596
  headers?: {
@@ -18364,12 +18600,16 @@ declare namespace ShopperBasketsV2ApiTypes {
18364
18600
  /**
18365
18601
  * Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
18366
18602
 
18367
- A success response contains the transferred basket.
18603
+ This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
18604
+ - `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
18605
+ - `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
18368
18606
 
18369
- If the current shopper has an active basket, and the `overrideExisting` request parameter is `false`, then the transfer request returns a BasketTransferException (HTTP status 409). You can proceed with one of these options:
18607
+ If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
18370
18608
  - Keep the current shopper's active basket.
18371
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
18372
- - Force the transfer by calling the `baskets/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
18609
+ - Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
18610
+ - Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
18611
+
18612
+ A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
18373
18613
  *
18374
18614
  * @param options - An object containing the options for this method.
18375
18615
  * @param options.parameters - An object containing the parameters for this method.
@@ -18378,6 +18618,31 @@ declare namespace ShopperBasketsV2ApiTypes {
18378
18618
  * @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
18379
18619
  - `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
18380
18620
  - `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
18621
+ * @param options.parameters.merge - This parameter controls the behavior:
18622
+ - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
18623
+ - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
18624
+
18625
+ The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
18626
+ in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
18627
+
18628
+ There are four possible use cases:
18629
+
18630
+ a) Guest basket and registered basket exist
18631
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
18632
+ dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
18633
+
18634
+ b) Guest basket exists but no registered basket exists
18635
+ The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
18636
+ dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
18637
+
18638
+ c) No guest basket exists but a registered basket exists
18639
+ The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
18640
+ passed to the hook).
18641
+
18642
+ d) Neither basket exists
18643
+ The hook dw.order.mergeBasket is not called.
18644
+
18645
+ The API returns the current basket (after executing dw.order.mergeBasket).
18381
18646
  * @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.
18382
18647
  * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
18383
18648
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
@@ -18389,6 +18654,7 @@ declare namespace ShopperBasketsV2ApiTypes {
18389
18654
  siteId: string;
18390
18655
  organizationId: string;
18391
18656
  overrideExisting?: boolean;
18657
+ merge?: boolean;
18392
18658
  locale?: LocaleCode$0;
18393
18659
  } & QueryParameters, ConfigParameters>;
18394
18660
  headers?: {
@@ -20576,6 +20842,824 @@ declare namespace ShopperBasketsV2Types {
20576
20842
  type TaxItems = ShopperBasketsV2ModelTypes.TaxItems;
20577
20843
  type Taxes = ShopperBasketsV2ModelTypes.Taxes;
20578
20844
  }
20845
+ /**
20846
+ * @type ModelConfiguration: Configuration object
20847
+ *
20848
+ * @property id: identifier
20849
+ * - **Max Length:** 255
20850
+ *
20851
+ * @property value: value for identifier
20852
+ * - **Max Length:** 255
20853
+ *
20854
+ * @property configurationType: type of configuration value
20855
+ * - **Max Length:** 255
20856
+ *
20857
+ */
20858
+ type ModelConfiguration = {
20859
+ id: string;
20860
+ value: any | null;
20861
+ configurationType?: string;
20862
+ } & {
20863
+ [key: string]: any;
20864
+ };
20865
+ /**
20866
+ * @type SiteConfiguration: Site Configuration object
20867
+ *
20868
+ * @property configurations: List configurations for the instance and site
20869
+ *
20870
+ */
20871
+ type SiteConfiguration = {
20872
+ configurations: Array<ModelConfiguration>;
20873
+ } & {
20874
+ [key: string]: any;
20875
+ };
20876
+ type getConfigurationsQueryParameters = {
20877
+ siteId: string;
20878
+ };
20879
+ type getConfigurationsPathParameters = {
20880
+ organizationId: string;
20881
+ };
20882
+ /**
20883
+ * All path parameters that are used by at least one ShopperConfigurations method.
20884
+ */
20885
+ type ShopperConfigurationsPathParameters = Partial<getConfigurationsPathParameters & {}>;
20886
+ /**
20887
+ * All query parameters that are used by at least one ShopperConfigurations method.
20888
+ */
20889
+ type ShopperConfigurationsQueryParameters = Partial<getConfigurationsQueryParameters & {}>;
20890
+ /**
20891
+ * All parameters that are used by ShopperConfigurations.
20892
+ */
20893
+ type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & BaseUriParameters & ShopperConfigurationsQueryParameters;
20894
+ /**
20895
+ * [Shopper Configurations](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-configurations:Summary)
20896
+ * ==================================
20897
+ *
20898
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-configurations/shopper-configurations-oas-v1-public.yaml)
20899
+
20900
+ # API Overview
20901
+ In commerce, there is a need to provide information to the shopper facing application to allow for making decisions on execution. This is highly cache-able data that rarely changes.
20902
+
20903
+ It encompasses toggles, preferences, and configuration that allow the application to be reactive to changes performed by the merchant, admin, or support engineer.
20904
+
20905
+ ## Use Cases
20906
+ 1. What is the site name and site status (online / offline)
20907
+ 2. What is the default and supported currencies
20908
+ 3. What is the default and supported locales
20909
+ 4. Which features are enabled
20910
+
20911
+ # Example
20912
+
20913
+ ```
20914
+ {
20915
+ "configurations":[
20916
+ {
20917
+ "configurationType":"siteConfiguration",
20918
+ "id":"id",
20919
+ "value":"TestWapi"
20920
+ },
20921
+ {
20922
+ "configurationType":"siteConfiguration",
20923
+ "id":"name",
20924
+ "value":"Test WAPI"
20925
+ },
20926
+ {
20927
+ "configurationType":"siteConfiguration",
20928
+ "id":"status",
20929
+ "value":"online"
20930
+ },
20931
+ {
20932
+ "configurationType":"siteConfiguration",
20933
+ "id":"timezone",
20934
+ "value":"Etc/UTC"
20935
+ },
20936
+ {
20937
+ "configurationType":"siteConfiguration",
20938
+ "id":"timezoneOffset",
20939
+ "value":0
20940
+ },
20941
+ {
20942
+ "configurationType":"siteConfiguration",
20943
+ "id":"defaultCurrency",
20944
+ "value":"USD"
20945
+ },
20946
+ {
20947
+ "configurationType":"siteConfiguration",
20948
+ "id":"allowedCurrencies",
20949
+ "value":[
20950
+ "USD",
20951
+ "EUR"
20952
+ ]
20953
+ },
20954
+ {
20955
+ "configurationType":"siteConfiguration",
20956
+ "id":"defaultLocale",
20957
+ "value":"default"
20958
+ },
20959
+ {
20960
+ "configurationType":"siteConfiguration",
20961
+ "id":"allowedLocales",
20962
+ "value":[
20963
+ {
20964
+ "country":"",
20965
+ "default":true,
20966
+ "displayCountry":"",
20967
+ "displayLanguage":"",
20968
+ "displayName":"default",
20969
+ "id":"default",
20970
+ "iso3Country":"",
20971
+ "iso3Language":"",
20972
+ "language":"",
20973
+ "name":"default"
20974
+ },
20975
+ {
20976
+ "country":"DE",
20977
+ "default":false,
20978
+ "displayCountry":"Deutschland",
20979
+ "displayLanguage":"Deutsch",
20980
+ "displayName":"Deutsch (Deutschland)",
20981
+ "id":"de-DE",
20982
+ "iso3Country":"DEU",
20983
+ "iso3Language":"deu",
20984
+ "language":"de",
20985
+ "name":"German (Germany)"
20986
+ },
20987
+ {
20988
+ "country":"",
20989
+ "default":false,
20990
+ "displayCountry":"",
20991
+ "displayLanguage":"Deutsch",
20992
+ "displayName":"Deutsch",
20993
+ "id":"de",
20994
+ "iso3Country":"",
20995
+ "iso3Language":"deu",
20996
+ "language":"de",
20997
+ "name":"German"
20998
+ },
20999
+ {
21000
+ "country":"US",
21001
+ "default":false,
21002
+ "displayCountry":"United States",
21003
+ "displayLanguage":"English",
21004
+ "displayName":"English (United States)",
21005
+ "id":"en-US",
21006
+ "iso3Country":"USA",
21007
+ "iso3Language":"eng",
21008
+ "language":"en",
21009
+ "name":"English (United States)"
21010
+ },
21011
+ {
21012
+ "country":"CA",
21013
+ "default":false,
21014
+ "displayCountry":"Canada",
21015
+ "displayLanguage":"English",
21016
+ "displayName":"English (Canada)",
21017
+ "id":"en-CA",
21018
+ "iso3Country":"CAN",
21019
+ "iso3Language":"eng",
21020
+ "language":"en",
21021
+ "name":"English (Canada)"
21022
+ },
21023
+ {
21024
+ "country":"",
21025
+ "default":false,
21026
+ "displayCountry":"",
21027
+ "displayLanguage":"English",
21028
+ "displayName":"English",
21029
+ "id":"en",
21030
+ "iso3Country":"",
21031
+ "iso3Language":"eng",
21032
+ "language":"en",
21033
+ "name":"English"
21034
+ },
21035
+ {
21036
+ "country":"",
21037
+ "default":false,
21038
+ "displayCountry":"",
21039
+ "displayLanguage":"español",
21040
+ "displayName":"español",
21041
+ "id":"es",
21042
+ "iso3Country":"",
21043
+ "iso3Language":"spa",
21044
+ "language":"es",
21045
+ "name":"Spanish"
21046
+ }
21047
+ ]
21048
+ },
21049
+ {
21050
+ "configurationType":"globalConfiguration",
21051
+ "id":"SalesforcePaymentsAllowed",
21052
+ "value":true
21053
+ },
21054
+ {
21055
+ "configurationType":"globalConfiguration",
21056
+ "id":"gcp",
21057
+ "value":"test-gcp-key"
21058
+ }
21059
+ ]
21060
+ }
21061
+ ```
21062
+
21063
+ ### Caching
21064
+
21065
+ Caching capabilities are available for the Shopper Configuration APIs. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)*<br />
21066
+ *
21067
+ * Simple example:
21068
+ *
21069
+ * ```typescript
21070
+ * import { ShopperConfigurations } from "commerce-sdk-isomorphic";
21071
+ *
21072
+ * const clientConfig = {
21073
+ * parameters: {
21074
+ * clientId: "XXXXXX",
21075
+ * organizationId: "XXXX",
21076
+ * shortCode: "XXX",
21077
+ * siteId: "XX"
21078
+ * }
21079
+ * };
21080
+ * const shopperConfigurationsClient = new ShopperConfigurations(clientConfig);
21081
+ * ```
21082
+ *
21083
+ * <span style="font-size:.7em; display:block; text-align: right">
21084
+ * API Version: 0.0.33<br />
21085
+ * Last Updated: <br />
21086
+ * </span>
21087
+ *
21088
+ *
21089
+ */
21090
+ declare class ShopperConfigurations<ConfigParameters extends ShopperConfigurationsParameters & Record<string, unknown>> {
21091
+ // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
21092
+ clientConfig: ClientConfig<ConfigParameters> & {
21093
+ baseUri: string;
21094
+ };
21095
+ static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/configuration/shopper-configurations/v1";
21096
+ static readonly apiPaths: {
21097
+ getConfigurations: string;
21098
+ };
21099
+ constructor(config: ClientConfigInit<ConfigParameters>);
21100
+ static readonly paramKeys: {
21101
+ readonly getConfigurations: readonly [
21102
+ "organizationId",
21103
+ "siteId"
21104
+ ];
21105
+ readonly getConfigurationsRequired: readonly [
21106
+ "organizationId",
21107
+ "siteId"
21108
+ ];
21109
+ };
21110
+ /**
21111
+ * Retrieves configurations for the specified organization and site.
21112
+ *
21113
+ * If you would like to get a raw Response object use the other getConfigurations function.
21114
+ *
21115
+ * @param options - An object containing the options for this method.
21116
+ * @param options.parameters - An object containing the parameters for this method.
21117
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
21118
+ * @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.
21119
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21120
+ *
21121
+ * @returns A promise of type SiteConfiguration.
21122
+ */
21123
+ getConfigurations(options?: RequireParametersUnlessAllAreOptional<{
21124
+ parameters?: CompositeParameters<{
21125
+ organizationId: string;
21126
+ siteId: string;
21127
+ } & QueryParameters, ConfigParameters>;
21128
+ headers?: {
21129
+ [key: string]: string;
21130
+ };
21131
+ }>): Promise<SiteConfiguration>;
21132
+ /**
21133
+ * Retrieves configurations for the specified organization and site.
21134
+ *
21135
+ * @param options - An object containing the options for this method.
21136
+ * @param options.parameters - An object containing the parameters for this method.
21137
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
21138
+ * @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.
21139
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21140
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
21141
+ *
21142
+ * @returns A promise of type Response if rawResponse is true, a promise of type SiteConfiguration otherwise.
21143
+ */
21144
+ getConfigurations<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
21145
+ parameters?: CompositeParameters<{
21146
+ organizationId: string;
21147
+ siteId: string;
21148
+ } & QueryParameters, ConfigParameters>;
21149
+ headers?: {
21150
+ [key: string]: string;
21151
+ };
21152
+ }>, rawResponse?: T): Promise<T extends true ? Response : SiteConfiguration>;
21153
+ }
21154
+ declare namespace ShopperConfigurationsApiTypes {
21155
+ /*
21156
+ * Copyright (c) 2023, Salesforce, Inc.
21157
+ * All rights reserved.
21158
+ * SPDX-License-Identifier: BSD-3-Clause
21159
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
21160
+ */
21161
+ /**
21162
+ * Makes a type easier to read.
21163
+ */
21164
+ type Prettify<T> = NonNullable<{
21165
+ [K in keyof T]: T[K];
21166
+ }>;
21167
+ /**
21168
+ * Generates the types required on a method, based on those provided in the config.
21169
+ */
21170
+ type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
21171
+ /**
21172
+ * If an object has a `parameters` property, and the `parameters` object has required properties,
21173
+ * then the `parameters` property on the root object is marked as required.
21174
+ */
21175
+ type RequireParametersUnlessAllAreOptional<T extends {
21176
+ parameters?: Record<string, unknown>;
21177
+ }> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
21178
+ /**
21179
+ * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
21180
+ * if not specified.
21181
+ */
21182
+ interface BaseUriParameters {
21183
+ shortCode: string;
21184
+ }
21185
+ type LocaleCode = {
21186
+ [key: string]: any;
21187
+ };
21188
+ /**
21189
+ * Generic interface for path parameters.
21190
+ */
21191
+ interface PathParameters {
21192
+ [key: string]: string | number | boolean;
21193
+ }
21194
+ /**
21195
+ * Generic interface for query parameters.
21196
+ */
21197
+ interface QueryParameters {
21198
+ [key: string]: string | number | boolean | string[] | number[] | LocaleCode;
21199
+ }
21200
+ /**
21201
+ * Generic interface for all parameter types.
21202
+ */
21203
+ type UrlParameters = PathParameters | QueryParameters;
21204
+ /**
21205
+ * Custom query parameter type with any string prefixed with `c_` as the key and the allowed
21206
+ * types for query parameters for the value.
21207
+ */
21208
+ type CustomQueryParameters = {
21209
+ [key in `c_${string}`]: string | number | boolean | string[] | number[];
21210
+ };
21211
+ /**
21212
+ * Custom body request type with any string prefixed with `c_` as the key and the allowed
21213
+ * types for the value.
21214
+ */
21215
+ type CustomRequestBody = {
21216
+ [key in `c_${string}`]: string | number | boolean | string[] | number[] | {
21217
+ [key: string]: unknown;
21218
+ };
21219
+ };
21220
+ /**
21221
+ * Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
21222
+ * it from the `RequestInit` provided by node-fetch.
21223
+ */
21224
+ type BrowserRequestInit = RequestInit;
21225
+ /**
21226
+ * Any properties supported in either the browser or node are accepted.
21227
+ * Using the right properties in the right context is left to the user.
21228
+ */
21229
+ type FetchOptions = NodeRequestInit & BrowserRequestInit;
21230
+ /**
21231
+ * Base options that can be passed to the `ClientConfig` class.
21232
+ */
21233
+ interface ClientConfigInit<Params extends BaseUriParameters> {
21234
+ baseUri?: string;
21235
+ proxy?: string;
21236
+ headers?: {
21237
+ [key: string]: string;
21238
+ };
21239
+ parameters: Params;
21240
+ fetchOptions?: FetchOptions;
21241
+ transformRequest?: (data: unknown, headers: {
21242
+ [key: string]: string;
21243
+ }) => Required<FetchOptions>["body"];
21244
+ throwOnBadResponse?: boolean;
21245
+ }
21246
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
21247
+ /**
21248
+ * Configuration parameters common to Commerce SDK clients
21249
+ */
21250
+ class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
21251
+ baseUri?: string;
21252
+ proxy?: string;
21253
+ headers: {
21254
+ [key: string]: string;
21255
+ };
21256
+ parameters: Params;
21257
+ fetchOptions: FetchOptions;
21258
+ transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
21259
+ throwOnBadResponse: boolean;
21260
+ constructor(config: ClientConfigInit<Params>);
21261
+ static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
21262
+ }
21263
+ /**
21264
+ * @type ErrorResponse:
21265
+ *
21266
+ * @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
21267
+ * - **Max Length:** 256
21268
+ *
21269
+ * @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.
21270
+ * - **Max Length:** 2048
21271
+ *
21272
+ * @property detail: A human-readable explanation specific to this occurrence of the problem.
21273
+ *
21274
+ * @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.
21275
+ * - **Max Length:** 2048
21276
+ *
21277
+ */
21278
+ type ErrorResponse = {
21279
+ title: string;
21280
+ type: string;
21281
+ detail: string;
21282
+ instance?: string;
21283
+ } & {
21284
+ [key: string]: any;
21285
+ };
21286
+ /**
21287
+ * @type ModelConfiguration: Configuration object
21288
+ *
21289
+ * @property id: identifier
21290
+ * - **Max Length:** 255
21291
+ *
21292
+ * @property value: value for identifier
21293
+ * - **Max Length:** 255
21294
+ *
21295
+ * @property configurationType: type of configuration value
21296
+ * - **Max Length:** 255
21297
+ *
21298
+ */
21299
+ type ModelConfiguration = {
21300
+ id: string;
21301
+ value: any | null;
21302
+ configurationType?: string;
21303
+ } & {
21304
+ [key: string]: any;
21305
+ };
21306
+ /**
21307
+ * @type SiteConfiguration: Site Configuration object
21308
+ *
21309
+ * @property configurations: List configurations for the instance and site
21310
+ *
21311
+ */
21312
+ type SiteConfiguration = {
21313
+ configurations: Array<ModelConfiguration>;
21314
+ } & {
21315
+ [key: string]: any;
21316
+ };
21317
+ type getConfigurationsQueryParameters = {
21318
+ siteId: string;
21319
+ };
21320
+ type getConfigurationsPathParameters = {
21321
+ organizationId: string;
21322
+ };
21323
+ /**
21324
+ * All path parameters that are used by at least one ShopperConfigurations method.
21325
+ */
21326
+ type ShopperConfigurationsPathParameters = Partial<getConfigurationsPathParameters & {}>;
21327
+ /**
21328
+ * All query parameters that are used by at least one ShopperConfigurations method.
21329
+ */
21330
+ type ShopperConfigurationsQueryParameters = Partial<getConfigurationsQueryParameters & {}>;
21331
+ /**
21332
+ * All parameters that are used by ShopperConfigurations.
21333
+ */
21334
+ type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & BaseUriParameters & ShopperConfigurationsQueryParameters;
21335
+ /**
21336
+ * [Shopper Configurations](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-configurations:Summary)
21337
+ * ==================================
21338
+ *
21339
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-configurations/shopper-configurations-oas-v1-public.yaml)
21340
+
21341
+ # API Overview
21342
+ In commerce, there is a need to provide information to the shopper facing application to allow for making decisions on execution. This is highly cache-able data that rarely changes.
21343
+
21344
+ It encompasses toggles, preferences, and configuration that allow the application to be reactive to changes performed by the merchant, admin, or support engineer.
21345
+
21346
+ ## Use Cases
21347
+ 1. What is the site name and site status (online / offline)
21348
+ 2. What is the default and supported currencies
21349
+ 3. What is the default and supported locales
21350
+ 4. Which features are enabled
21351
+
21352
+ # Example
21353
+
21354
+ ```
21355
+ {
21356
+ "configurations":[
21357
+ {
21358
+ "configurationType":"siteConfiguration",
21359
+ "id":"id",
21360
+ "value":"TestWapi"
21361
+ },
21362
+ {
21363
+ "configurationType":"siteConfiguration",
21364
+ "id":"name",
21365
+ "value":"Test WAPI"
21366
+ },
21367
+ {
21368
+ "configurationType":"siteConfiguration",
21369
+ "id":"status",
21370
+ "value":"online"
21371
+ },
21372
+ {
21373
+ "configurationType":"siteConfiguration",
21374
+ "id":"timezone",
21375
+ "value":"Etc/UTC"
21376
+ },
21377
+ {
21378
+ "configurationType":"siteConfiguration",
21379
+ "id":"timezoneOffset",
21380
+ "value":0
21381
+ },
21382
+ {
21383
+ "configurationType":"siteConfiguration",
21384
+ "id":"defaultCurrency",
21385
+ "value":"USD"
21386
+ },
21387
+ {
21388
+ "configurationType":"siteConfiguration",
21389
+ "id":"allowedCurrencies",
21390
+ "value":[
21391
+ "USD",
21392
+ "EUR"
21393
+ ]
21394
+ },
21395
+ {
21396
+ "configurationType":"siteConfiguration",
21397
+ "id":"defaultLocale",
21398
+ "value":"default"
21399
+ },
21400
+ {
21401
+ "configurationType":"siteConfiguration",
21402
+ "id":"allowedLocales",
21403
+ "value":[
21404
+ {
21405
+ "country":"",
21406
+ "default":true,
21407
+ "displayCountry":"",
21408
+ "displayLanguage":"",
21409
+ "displayName":"default",
21410
+ "id":"default",
21411
+ "iso3Country":"",
21412
+ "iso3Language":"",
21413
+ "language":"",
21414
+ "name":"default"
21415
+ },
21416
+ {
21417
+ "country":"DE",
21418
+ "default":false,
21419
+ "displayCountry":"Deutschland",
21420
+ "displayLanguage":"Deutsch",
21421
+ "displayName":"Deutsch (Deutschland)",
21422
+ "id":"de-DE",
21423
+ "iso3Country":"DEU",
21424
+ "iso3Language":"deu",
21425
+ "language":"de",
21426
+ "name":"German (Germany)"
21427
+ },
21428
+ {
21429
+ "country":"",
21430
+ "default":false,
21431
+ "displayCountry":"",
21432
+ "displayLanguage":"Deutsch",
21433
+ "displayName":"Deutsch",
21434
+ "id":"de",
21435
+ "iso3Country":"",
21436
+ "iso3Language":"deu",
21437
+ "language":"de",
21438
+ "name":"German"
21439
+ },
21440
+ {
21441
+ "country":"US",
21442
+ "default":false,
21443
+ "displayCountry":"United States",
21444
+ "displayLanguage":"English",
21445
+ "displayName":"English (United States)",
21446
+ "id":"en-US",
21447
+ "iso3Country":"USA",
21448
+ "iso3Language":"eng",
21449
+ "language":"en",
21450
+ "name":"English (United States)"
21451
+ },
21452
+ {
21453
+ "country":"CA",
21454
+ "default":false,
21455
+ "displayCountry":"Canada",
21456
+ "displayLanguage":"English",
21457
+ "displayName":"English (Canada)",
21458
+ "id":"en-CA",
21459
+ "iso3Country":"CAN",
21460
+ "iso3Language":"eng",
21461
+ "language":"en",
21462
+ "name":"English (Canada)"
21463
+ },
21464
+ {
21465
+ "country":"",
21466
+ "default":false,
21467
+ "displayCountry":"",
21468
+ "displayLanguage":"English",
21469
+ "displayName":"English",
21470
+ "id":"en",
21471
+ "iso3Country":"",
21472
+ "iso3Language":"eng",
21473
+ "language":"en",
21474
+ "name":"English"
21475
+ },
21476
+ {
21477
+ "country":"",
21478
+ "default":false,
21479
+ "displayCountry":"",
21480
+ "displayLanguage":"español",
21481
+ "displayName":"español",
21482
+ "id":"es",
21483
+ "iso3Country":"",
21484
+ "iso3Language":"spa",
21485
+ "language":"es",
21486
+ "name":"Spanish"
21487
+ }
21488
+ ]
21489
+ },
21490
+ {
21491
+ "configurationType":"globalConfiguration",
21492
+ "id":"SalesforcePaymentsAllowed",
21493
+ "value":true
21494
+ },
21495
+ {
21496
+ "configurationType":"globalConfiguration",
21497
+ "id":"gcp",
21498
+ "value":"test-gcp-key"
21499
+ }
21500
+ ]
21501
+ }
21502
+ ```
21503
+
21504
+ ### Caching
21505
+
21506
+ Caching capabilities are available for the Shopper Configuration APIs. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)*<br />
21507
+ *
21508
+ * Simple example:
21509
+ *
21510
+ * ```typescript
21511
+ * import { ShopperConfigurations } from "commerce-sdk-isomorphic";
21512
+ *
21513
+ * const clientConfig = {
21514
+ * parameters: {
21515
+ * clientId: "XXXXXX",
21516
+ * organizationId: "XXXX",
21517
+ * shortCode: "XXX",
21518
+ * siteId: "XX"
21519
+ * }
21520
+ * };
21521
+ * const shopperConfigurationsClient = new ShopperConfigurations(clientConfig);
21522
+ * ```
21523
+ *
21524
+ * <span style="font-size:.7em; display:block; text-align: right">
21525
+ * API Version: 0.0.33<br />
21526
+ * Last Updated: <br />
21527
+ * </span>
21528
+ *
21529
+ *
21530
+ */
21531
+ class ShopperConfigurations<ConfigParameters extends ShopperConfigurationsParameters & Record<string, unknown>> {
21532
+ // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
21533
+ clientConfig: ClientConfig<ConfigParameters> & {
21534
+ baseUri: string;
21535
+ };
21536
+ static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/configuration/shopper-configurations/v1";
21537
+ static readonly apiPaths: {
21538
+ getConfigurations: string;
21539
+ };
21540
+ constructor(config: ClientConfigInit<ConfigParameters>);
21541
+ static readonly paramKeys: {
21542
+ readonly getConfigurations: readonly [
21543
+ "organizationId",
21544
+ "siteId"
21545
+ ];
21546
+ readonly getConfigurationsRequired: readonly [
21547
+ "organizationId",
21548
+ "siteId"
21549
+ ];
21550
+ };
21551
+ /**
21552
+ * Retrieves configurations for the specified organization and site.
21553
+ *
21554
+ * If you would like to get a raw Response object use the other getConfigurations function.
21555
+ *
21556
+ * @param options - An object containing the options for this method.
21557
+ * @param options.parameters - An object containing the parameters for this method.
21558
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
21559
+ * @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.
21560
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21561
+ *
21562
+ * @returns A promise of type SiteConfiguration.
21563
+ */
21564
+ getConfigurations(options?: RequireParametersUnlessAllAreOptional<{
21565
+ parameters?: CompositeParameters<{
21566
+ organizationId: string;
21567
+ siteId: string;
21568
+ } & QueryParameters, ConfigParameters>;
21569
+ headers?: {
21570
+ [key: string]: string;
21571
+ };
21572
+ }>): Promise<SiteConfiguration>;
21573
+ /**
21574
+ * Retrieves configurations for the specified organization and site.
21575
+ *
21576
+ * @param options - An object containing the options for this method.
21577
+ * @param options.parameters - An object containing the parameters for this method.
21578
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
21579
+ * @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.
21580
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
21581
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
21582
+ *
21583
+ * @returns A promise of type Response if rawResponse is true, a promise of type SiteConfiguration otherwise.
21584
+ */
21585
+ getConfigurations<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
21586
+ parameters?: CompositeParameters<{
21587
+ organizationId: string;
21588
+ siteId: string;
21589
+ } & QueryParameters, ConfigParameters>;
21590
+ headers?: {
21591
+ [key: string]: string;
21592
+ };
21593
+ }>, rawResponse?: T): Promise<T extends true ? Response : SiteConfiguration>;
21594
+ }
21595
+ }
21596
+ declare namespace ShopperConfigurationsModelTypes {
21597
+ /**
21598
+ * @type ErrorResponse:
21599
+ *
21600
+ * @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
21601
+ * - **Max Length:** 256
21602
+ *
21603
+ * @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.
21604
+ * - **Max Length:** 2048
21605
+ *
21606
+ * @property detail: A human-readable explanation specific to this occurrence of the problem.
21607
+ *
21608
+ * @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.
21609
+ * - **Max Length:** 2048
21610
+ *
21611
+ */
21612
+ type ErrorResponse = {
21613
+ title: string;
21614
+ type: string;
21615
+ detail: string;
21616
+ instance?: string;
21617
+ } & {
21618
+ [key: string]: any;
21619
+ };
21620
+ /**
21621
+ * @type ModelConfiguration: Configuration object
21622
+ *
21623
+ * @property id: identifier
21624
+ * - **Max Length:** 255
21625
+ *
21626
+ * @property value: value for identifier
21627
+ * - **Max Length:** 255
21628
+ *
21629
+ * @property configurationType: type of configuration value
21630
+ * - **Max Length:** 255
21631
+ *
21632
+ */
21633
+ type ModelConfiguration = {
21634
+ id: string;
21635
+ value: any | null;
21636
+ configurationType?: string;
21637
+ } & {
21638
+ [key: string]: any;
21639
+ };
21640
+ /**
21641
+ * @type SiteConfiguration: Site Configuration object
21642
+ *
21643
+ * @property configurations: List configurations for the instance and site
21644
+ *
21645
+ */
21646
+ type SiteConfiguration = {
21647
+ configurations: Array<ModelConfiguration>;
21648
+ } & {
21649
+ [key: string]: any;
21650
+ };
21651
+ }
21652
+ declare namespace ShopperConfigurationsTypes {
21653
+ // API types
21654
+ type ShopperConfigurationsPathParameters = ShopperConfigurationsApiTypes.ShopperConfigurationsPathParameters;
21655
+ type ShopperConfigurationsQueryParameters = ShopperConfigurationsApiTypes.ShopperConfigurationsQueryParameters;
21656
+ type getConfigurationsQueryParameters = ShopperConfigurationsApiTypes.getConfigurationsQueryParameters;
21657
+ type getConfigurationsPathParameters = ShopperConfigurationsApiTypes.getConfigurationsPathParameters;
21658
+ // Model types
21659
+ type ErrorResponse = ShopperConfigurationsModelTypes.ErrorResponse;
21660
+ type ModelConfiguration = ShopperConfigurationsModelTypes.ModelConfiguration;
21661
+ type SiteConfiguration = ShopperConfigurationsModelTypes.SiteConfiguration;
21662
+ }
20579
21663
  /**
20580
21664
  * The consent status of the subscription as supplied or recorded by this system
20581
21665
  */
@@ -20703,9 +21787,9 @@ type ShopperConsentsParameters = ShopperConsentsPathParameters & BaseUriParamete
20703
21787
  * [Shopper Consents](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-consents:Summary)
20704
21788
  * ==================================
20705
21789
  *
20706
- * *# Shopper Consent
21790
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-consents/shopper-consents-oas-v1-public.yaml)
20707
21791
 
20708
- ## API Overview
21792
+ # API Overview
20709
21793
 
20710
21794
  The Shopper Consent API offers a centralized method for managing shopper consent. With this API, shoppers can view and update subscription preferences for marketing communications across various channels. This API controls how and where shoppers receive marketing messages while ensuring compliance with privacy regulations.
20711
21795
 
@@ -21024,7 +22108,6 @@ declare namespace ShopperConsentsApiTypes {
21024
22108
  * Using the right properties in the right context is left to the user.
21025
22109
  */
21026
22110
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
21027
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
21028
22111
  /**
21029
22112
  * Base options that can be passed to the `ClientConfig` class.
21030
22113
  */
@@ -21036,12 +22119,12 @@ declare namespace ShopperConsentsApiTypes {
21036
22119
  };
21037
22120
  parameters: Params;
21038
22121
  fetchOptions?: FetchOptions;
21039
- fetch?: FetchFunction;
21040
22122
  transformRequest?: (data: unknown, headers: {
21041
22123
  [key: string]: string;
21042
22124
  }) => Required<FetchOptions>["body"];
21043
22125
  throwOnBadResponse?: boolean;
21044
22126
  }
22127
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
21045
22128
  /**
21046
22129
  * Configuration parameters common to Commerce SDK clients
21047
22130
  */
@@ -21053,7 +22136,6 @@ declare namespace ShopperConsentsApiTypes {
21053
22136
  };
21054
22137
  parameters: Params;
21055
22138
  fetchOptions: FetchOptions;
21056
- fetch?: FetchFunction;
21057
22139
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
21058
22140
  throwOnBadResponse: boolean;
21059
22141
  constructor(config: ClientConfigInit<Params>);
@@ -21209,9 +22291,9 @@ declare namespace ShopperConsentsApiTypes {
21209
22291
  * [Shopper Consents](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-consents:Summary)
21210
22292
  * ==================================
21211
22293
  *
21212
- * *# Shopper Consent
22294
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-consents/shopper-consents-oas-v1-public.yaml)
21213
22295
 
21214
- ## API Overview
22296
+ # API Overview
21215
22297
 
21216
22298
  The Shopper Consent API offers a centralized method for managing shopper consent. With this API, shoppers can view and update subscription preferences for marketing communications across various channels. This API controls how and where shoppers receive marketing messages while ensuring compliance with privacy regulations.
21217
22299
 
@@ -21646,6 +22728,8 @@ type ShopperContextGeoLocation = {
21646
22728
  *
21647
22729
  * @property geoLocation:
21648
22730
  *
22731
+ * @property couponCodes: Array of coupon codes to be saved in the shopper context. Set the coupon codes to evaluate promotions that can be triggered by these codes.
22732
+ *
21649
22733
  */
21650
22734
  type ShopperContext = {
21651
22735
  effectiveDateTime?: string | null;
@@ -21659,6 +22743,7 @@ type ShopperContext = {
21659
22743
  };
21660
22744
  clientIp?: string;
21661
22745
  geoLocation?: ShopperContextGeoLocation;
22746
+ couponCodes?: Array<string>;
21662
22747
  } & {
21663
22748
  [key: string]: any;
21664
22749
  };
@@ -21708,7 +22793,9 @@ type ShopperContextParameters = ShopperContextPathParameters & BaseUriParameters
21708
22793
  * [Shopper Context](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-context:Summary)
21709
22794
  * ==================================
21710
22795
  *
21711
- * *# API Overview
22796
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-context/shopper-context-oas-v1-public.yaml)
22797
+
22798
+ # API Overview
21712
22799
 
21713
22800
  With the Shopper Context API, you can set any context information as a key/value pair and use it to retrieve personalized promotions, payment methods, and shipping methods. The context information that is set is evaluated against the customer group definitions to determine a customer group (shopper segment), and is then used to activate the experiences that are associated with a particular segment, such as promotions.
21714
22801
 
@@ -22186,7 +23273,6 @@ declare namespace ShopperContextsApiTypes {
22186
23273
  * Using the right properties in the right context is left to the user.
22187
23274
  */
22188
23275
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
22189
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
22190
23276
  /**
22191
23277
  * Base options that can be passed to the `ClientConfig` class.
22192
23278
  */
@@ -22198,12 +23284,12 @@ declare namespace ShopperContextsApiTypes {
22198
23284
  };
22199
23285
  parameters: Params;
22200
23286
  fetchOptions?: FetchOptions;
22201
- fetch?: FetchFunction;
22202
23287
  transformRequest?: (data: unknown, headers: {
22203
23288
  [key: string]: string;
22204
23289
  }) => Required<FetchOptions>["body"];
22205
23290
  throwOnBadResponse?: boolean;
22206
23291
  }
23292
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
22207
23293
  /**
22208
23294
  * Configuration parameters common to Commerce SDK clients
22209
23295
  */
@@ -22215,7 +23301,6 @@ declare namespace ShopperContextsApiTypes {
22215
23301
  };
22216
23302
  parameters: Params;
22217
23303
  fetchOptions: FetchOptions;
22218
- fetch?: FetchFunction;
22219
23304
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
22220
23305
  throwOnBadResponse: boolean;
22221
23306
  constructor(config: ClientConfigInit<Params>);
@@ -22296,6 +23381,8 @@ declare namespace ShopperContextsApiTypes {
22296
23381
  *
22297
23382
  * @property geoLocation:
22298
23383
  *
23384
+ * @property couponCodes: Array of coupon codes to be saved in the shopper context. Set the coupon codes to evaluate promotions that can be triggered by these codes.
23385
+ *
22299
23386
  */
22300
23387
  type ShopperContext = {
22301
23388
  effectiveDateTime?: string | null;
@@ -22309,6 +23396,7 @@ declare namespace ShopperContextsApiTypes {
22309
23396
  };
22310
23397
  clientIp?: string;
22311
23398
  geoLocation?: ShopperContextGeoLocation;
23399
+ couponCodes?: Array<string>;
22312
23400
  } & {
22313
23401
  [key: string]: any;
22314
23402
  };
@@ -22358,7 +23446,9 @@ declare namespace ShopperContextsApiTypes {
22358
23446
  * [Shopper Context](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-context:Summary)
22359
23447
  * ==================================
22360
23448
  *
22361
- * *# API Overview
23449
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-context/shopper-context-oas-v1-public.yaml)
23450
+
23451
+ # API Overview
22362
23452
 
22363
23453
  With the Shopper Context API, you can set any context information as a key/value pair and use it to retrieve personalized promotions, payment methods, and shipping methods. The context information that is set is evaluated against the customer group definitions to determine a customer group (shopper segment), and is then used to activate the experiences that are associated with a particular segment, such as promotions.
22364
23454
 
@@ -22837,6 +23927,8 @@ declare namespace ShopperContextsModelTypes {
22837
23927
  *
22838
23928
  * @property geoLocation:
22839
23929
  *
23930
+ * @property couponCodes: Array of coupon codes to be saved in the shopper context. Set the coupon codes to evaluate promotions that can be triggered by these codes.
23931
+ *
22840
23932
  */
22841
23933
  type ShopperContext = {
22842
23934
  effectiveDateTime?: string | null;
@@ -22850,6 +23942,7 @@ declare namespace ShopperContextsModelTypes {
22850
23942
  };
22851
23943
  clientIp?: string;
22852
23944
  geoLocation?: ShopperContextGeoLocation;
23945
+ couponCodes?: Array<string>;
22853
23946
  } & {
22854
23947
  [key: string]: any;
22855
23948
  };
@@ -25514,7 +26607,9 @@ type ShopperCustomersParameters = ShopperCustomersPathParameters & BaseUriParame
25514
26607
  * [Shopper Customers](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-customers:Summary)
25515
26608
  * ==================================
25516
26609
  *
25517
- * *# API Overview
26610
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-customers/shopper-customers-oas-v1-public.yaml)
26611
+
26612
+ # API Overview
25518
26613
 
25519
26614
  The Shopper Customers API enables you to develop functionality that lets customers log in, and manage their profiles and product lists. Profile management includes ability for shoppers to add or modify addresses and payment methods, and add or modify products to wishlists or favorites. Commerce Cloud provides a rich set of Authentication APIs that include logging in guest shoppers, registered shoppers, agents on behalf of customers and a trusted system authentication on behalf of customers. In all authentication scenarios involving customers, a JSON Web Token (JWT) is generated in Commerce Cloud. Using the JWT, customers can access other Shopper API resources like Orders and Baskets. The application must refresh the JWT every 30 minutes to save the shopper activity (for example, retain products in a shopper's cart) for prolonged periods of time.
25520
26615
 
@@ -27570,7 +28665,6 @@ declare namespace ShopperCustomersApiTypes {
27570
28665
  * Using the right properties in the right context is left to the user.
27571
28666
  */
27572
28667
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
27573
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
27574
28668
  /**
27575
28669
  * Base options that can be passed to the `ClientConfig` class.
27576
28670
  */
@@ -27582,12 +28676,12 @@ declare namespace ShopperCustomersApiTypes {
27582
28676
  };
27583
28677
  parameters: Params;
27584
28678
  fetchOptions?: FetchOptions;
27585
- fetch?: FetchFunction;
27586
28679
  transformRequest?: (data: unknown, headers: {
27587
28680
  [key: string]: string;
27588
28681
  }) => Required<FetchOptions>["body"];
27589
28682
  throwOnBadResponse?: boolean;
27590
28683
  }
28684
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
27591
28685
  /**
27592
28686
  * Configuration parameters common to Commerce SDK clients
27593
28687
  */
@@ -27599,7 +28693,6 @@ declare namespace ShopperCustomersApiTypes {
27599
28693
  };
27600
28694
  parameters: Params;
27601
28695
  fetchOptions: FetchOptions;
27602
- fetch?: FetchFunction;
27603
28696
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
27604
28697
  throwOnBadResponse: boolean;
27605
28698
  constructor(config: ClientConfigInit<Params>);
@@ -30302,7 +31395,9 @@ declare namespace ShopperCustomersApiTypes {
30302
31395
  * [Shopper Customers](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-customers:Summary)
30303
31396
  * ==================================
30304
31397
  *
30305
- * *# API Overview
31398
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-customers/shopper-customers-oas-v1-public.yaml)
31399
+
31400
+ # API Overview
30306
31401
 
30307
31402
  The Shopper Customers API enables you to develop functionality that lets customers log in, and manage their profiles and product lists. Profile management includes ability for shoppers to add or modify addresses and payment methods, and add or modify products to wishlists or favorites. Commerce Cloud provides a rich set of Authentication APIs that include logging in guest shoppers, registered shoppers, agents on behalf of customers and a trusted system authentication on behalf of customers. In all authentication scenarios involving customers, a JSON Web Token (JWT) is generated in Commerce Cloud. Using the JWT, customers can access other Shopper API resources like Orders and Baskets. The application must refresh the JWT every 30 minutes to save the shopper activity (for example, retain products in a shopper's cart) for prolonged periods of time.
30308
31403
 
@@ -35048,7 +36143,10 @@ type ShopperExperienceParameters = ShopperExperiencePathParameters & BaseUriPara
35048
36143
  * [Shopper Experience](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-experience:Summary)
35049
36144
  * ==================================
35050
36145
  *
35051
- * *Use the Shopper Experience API to look up page information for pages that are created in Page Designer.
36146
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-experience/shopper-experience-oas-v1-public.yaml)
36147
+
36148
+ # API Overview
36149
+ Use the Shopper Experience API to look up page information for pages that are created in Page Designer.
35052
36150
 
35053
36151
  Responses include the following:
35054
36152
 
@@ -35361,7 +36459,6 @@ declare namespace ShopperExperienceApiTypes {
35361
36459
  * Using the right properties in the right context is left to the user.
35362
36460
  */
35363
36461
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
35364
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
35365
36462
  /**
35366
36463
  * Base options that can be passed to the `ClientConfig` class.
35367
36464
  */
@@ -35373,12 +36470,12 @@ declare namespace ShopperExperienceApiTypes {
35373
36470
  };
35374
36471
  parameters: Params;
35375
36472
  fetchOptions?: FetchOptions;
35376
- fetch?: FetchFunction;
35377
36473
  transformRequest?: (data: unknown, headers: {
35378
36474
  [key: string]: string;
35379
36475
  }) => Required<FetchOptions>["body"];
35380
36476
  throwOnBadResponse?: boolean;
35381
36477
  }
36478
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
35382
36479
  /**
35383
36480
  * Configuration parameters common to Commerce SDK clients
35384
36481
  */
@@ -35390,7 +36487,6 @@ declare namespace ShopperExperienceApiTypes {
35390
36487
  };
35391
36488
  parameters: Params;
35392
36489
  fetchOptions: FetchOptions;
35393
- fetch?: FetchFunction;
35394
36490
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
35395
36491
  throwOnBadResponse: boolean;
35396
36492
  constructor(config: ClientConfigInit<Params>);
@@ -35566,7 +36662,10 @@ declare namespace ShopperExperienceApiTypes {
35566
36662
  * [Shopper Experience](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-experience:Summary)
35567
36663
  * ==================================
35568
36664
  *
35569
- * *Use the Shopper Experience API to look up page information for pages that are created in Page Designer.
36665
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-experience/shopper-experience-oas-v1-public.yaml)
36666
+
36667
+ # API Overview
36668
+ Use the Shopper Experience API to look up page information for pages that are created in Page Designer.
35570
36669
 
35571
36670
  Responses include the following:
35572
36671
 
@@ -36031,6 +37130,7 @@ type ShopperGiftCertificatesParameters = ShopperGiftCertificatesPathParameters &
36031
37130
  * ==================================
36032
37131
  *
36033
37132
  * *# API Overview
37133
+ [Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-gift-certificates/shopper-gift-certificates-oas-v1-public.yaml)
36034
37134
 
36035
37135
  Use the Shopper Gift Certificates API to obtain gift certificate details.
36036
37136
 
@@ -36221,7 +37321,6 @@ declare namespace ShopperGiftCertificatesApiTypes {
36221
37321
  * Using the right properties in the right context is left to the user.
36222
37322
  */
36223
37323
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
36224
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
36225
37324
  /**
36226
37325
  * Base options that can be passed to the `ClientConfig` class.
36227
37326
  */
@@ -36233,12 +37332,12 @@ declare namespace ShopperGiftCertificatesApiTypes {
36233
37332
  };
36234
37333
  parameters: Params;
36235
37334
  fetchOptions?: FetchOptions;
36236
- fetch?: FetchFunction;
36237
37335
  transformRequest?: (data: unknown, headers: {
36238
37336
  [key: string]: string;
36239
37337
  }) => Required<FetchOptions>["body"];
36240
37338
  throwOnBadResponse?: boolean;
36241
37339
  }
37340
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
36242
37341
  /**
36243
37342
  * Configuration parameters common to Commerce SDK clients
36244
37343
  */
@@ -36250,7 +37349,6 @@ declare namespace ShopperGiftCertificatesApiTypes {
36250
37349
  };
36251
37350
  parameters: Params;
36252
37351
  fetchOptions: FetchOptions;
36253
- fetch?: FetchFunction;
36254
37352
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
36255
37353
  throwOnBadResponse: boolean;
36256
37354
  constructor(config: ClientConfigInit<Params>);
@@ -36355,6 +37453,7 @@ declare namespace ShopperGiftCertificatesApiTypes {
36355
37453
  * ==================================
36356
37454
  *
36357
37455
  * *# API Overview
37456
+ [Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-gift-certificates/shopper-gift-certificates-oas-v1-public.yaml)
36358
37457
 
36359
37458
  Use the Shopper Gift Certificates API to obtain gift certificate details.
36360
37459
 
@@ -36611,6 +37710,12 @@ type TokenType = "Bearer";
36611
37710
  * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
36612
37711
  * - **Max Length:** 8192
36613
37712
  *
37713
+ * @property idp_refresh_token: This is the refresh token that is returned from the IDP. The IDP refresh token is returned to be able to make calls into the IDP outside of SLAS.
37714
+ * - **Max Length:** 128
37715
+ *
37716
+ * @property dnt: Do not track
37717
+ * - **Max Length:** 5
37718
+ *
36614
37719
  */
36615
37720
  type TokenResponse = {
36616
37721
  access_token: string;
@@ -36623,6 +37728,8 @@ type TokenResponse = {
36623
37728
  customer_id: string;
36624
37729
  enc_user_id: string;
36625
37730
  idp_access_token: string;
37731
+ idp_refresh_token?: string;
37732
+ dnt?: string;
36626
37733
  } & {
36627
37734
  [key: string]: any;
36628
37735
  };
@@ -36700,6 +37807,7 @@ type getPasswordLessAccessTokenBodyType = {
36700
37807
  pwdless_login_token: string;
36701
37808
  client_id?: string;
36702
37809
  code_verifier?: string;
37810
+ login_id?: string;
36703
37811
  };
36704
37812
  type getPasswordResetTokenQueryParameters = {};
36705
37813
  type getPasswordResetTokenPathParameters = {
@@ -36839,7 +37947,9 @@ type ShopperLoginParameters = ShopperLoginPathParameters & BaseUriParameters & S
36839
37947
  * [Shopper Login](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary)
36840
37948
  * ==================================
36841
37949
  *
36842
- * *# API Overview
37950
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-login/shopper-login-oas-v1-public.yaml)
37951
+
37952
+ # API Overview
36843
37953
 
36844
37954
  The Shopper Login and API Access Service (SLAS) enables secure access to Commerce Cloud’s Shopper APIs for a wide range of headless commerce applications.
36845
37955
 
@@ -36975,7 +38085,8 @@ declare class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Rec
36975
38085
  "hint",
36976
38086
  "pwdless_login_token",
36977
38087
  "client_id",
36978
- "code_verifier"
38088
+ "code_verifier",
38089
+ "login_id"
36979
38090
  ];
36980
38091
  readonly getPasswordLessAccessTokenRequired: readonly [
36981
38092
  "organizationId",
@@ -37549,6 +38660,7 @@ declare class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Rec
37549
38660
  * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
37550
38661
  * @param options.body.client_id - The public client ID.
37551
38662
  * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
38663
+ * @param options.body.login_id - The ID used by the shopper for password token request. When provided, login_id must exactly match the ID used during passwordless login. ex. If passwordless login used `samantha.sampleson@example.com`, but the passwordless login token request provides `sam.sampleson@example.com`, the request fails due to mismatch.
37552
38664
  *
37553
38665
  * @returns A promise of type TokenResponse.
37554
38666
  */
@@ -37574,6 +38686,7 @@ declare class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Rec
37574
38686
  * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
37575
38687
  * @param options.body.client_id - The public client ID.
37576
38688
  * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
38689
+ * @param options.body.login_id - The ID used by the shopper for password token request. When provided, login_id must exactly match the ID used during passwordless login. ex. If passwordless login used `samantha.sampleson@example.com`, but the passwordless login token request provides `sam.sampleson@example.com`, the request fails due to mismatch.
37577
38690
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
37578
38691
  *
37579
38692
  * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
@@ -38110,7 +39223,9 @@ declare class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Rec
38110
39223
  * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
38111
39224
  * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
38112
39225
  * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
38113
- * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
39226
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions and invalidates all refresh tokens for a shopper with the same SLAS user ID.
39227
+ This only works within the same session type. Sessions created through different authentication methods (/authorize vs. Trusted System On Behalf) are treated as separate sessions. To invalidate tokens with different SLAS User IDs, you must make explicit logout calls with each token.
39228
+ A shopper authenticated via both /authorize and TSOB has two separate sessions. You will need two logout calls (one per token) to fully log them out.
38114
39229
 
38115
39230
  If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
38116
39231
 
@@ -38144,7 +39259,9 @@ declare class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Rec
38144
39259
  * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
38145
39260
  * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
38146
39261
  * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
38147
- * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
39262
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions and invalidates all refresh tokens for a shopper with the same SLAS user ID.
39263
+ This only works within the same session type. Sessions created through different authentication methods (/authorize vs. Trusted System On Behalf) are treated as separate sessions. To invalidate tokens with different SLAS User IDs, you must make explicit logout calls with each token.
39264
+ A shopper authenticated via both /authorize and TSOB has two separate sessions. You will need two logout calls (one per token) to fully log them out.
38148
39265
 
38149
39266
  If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
38150
39267
 
@@ -38345,7 +39462,6 @@ declare namespace ShopperLoginApiTypes {
38345
39462
  * Using the right properties in the right context is left to the user.
38346
39463
  */
38347
39464
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
38348
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
38349
39465
  /**
38350
39466
  * Base options that can be passed to the `ClientConfig` class.
38351
39467
  */
@@ -38357,12 +39473,12 @@ declare namespace ShopperLoginApiTypes {
38357
39473
  };
38358
39474
  parameters: Params;
38359
39475
  fetchOptions?: FetchOptions;
38360
- fetch?: FetchFunction;
38361
39476
  transformRequest?: (data: unknown, headers: {
38362
39477
  [key: string]: string;
38363
39478
  }) => Required<FetchOptions>["body"];
38364
39479
  throwOnBadResponse?: boolean;
38365
39480
  }
39481
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
38366
39482
  /**
38367
39483
  * Configuration parameters common to Commerce SDK clients
38368
39484
  */
@@ -38374,7 +39490,6 @@ declare namespace ShopperLoginApiTypes {
38374
39490
  };
38375
39491
  parameters: Params;
38376
39492
  fetchOptions: FetchOptions;
38377
- fetch?: FetchFunction;
38378
39493
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
38379
39494
  throwOnBadResponse: boolean;
38380
39495
  constructor(config: ClientConfigInit<Params>);
@@ -38445,6 +39560,12 @@ declare namespace ShopperLoginApiTypes {
38445
39560
  * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
38446
39561
  * - **Max Length:** 8192
38447
39562
  *
39563
+ * @property idp_refresh_token: This is the refresh token that is returned from the IDP. The IDP refresh token is returned to be able to make calls into the IDP outside of SLAS.
39564
+ * - **Max Length:** 128
39565
+ *
39566
+ * @property dnt: Do not track
39567
+ * - **Max Length:** 5
39568
+ *
38448
39569
  */
38449
39570
  type TokenResponse = {
38450
39571
  access_token: string;
@@ -38457,6 +39578,8 @@ declare namespace ShopperLoginApiTypes {
38457
39578
  customer_id: string;
38458
39579
  enc_user_id: string;
38459
39580
  idp_access_token: string;
39581
+ idp_refresh_token?: string;
39582
+ dnt?: string;
38460
39583
  } & {
38461
39584
  [key: string]: any;
38462
39585
  };
@@ -38544,6 +39667,7 @@ declare namespace ShopperLoginApiTypes {
38544
39667
  pwdless_login_token: string;
38545
39668
  client_id?: string;
38546
39669
  code_verifier?: string;
39670
+ login_id?: string;
38547
39671
  };
38548
39672
  type getPasswordResetTokenQueryParameters = {};
38549
39673
  type getPasswordResetTokenPathParameters = {
@@ -38683,7 +39807,9 @@ declare namespace ShopperLoginApiTypes {
38683
39807
  * [Shopper Login](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary)
38684
39808
  * ==================================
38685
39809
  *
38686
- * *# API Overview
39810
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-login/shopper-login-oas-v1-public.yaml)
39811
+
39812
+ # API Overview
38687
39813
 
38688
39814
  The Shopper Login and API Access Service (SLAS) enables secure access to Commerce Cloud’s Shopper APIs for a wide range of headless commerce applications.
38689
39815
 
@@ -38819,7 +39945,8 @@ declare namespace ShopperLoginApiTypes {
38819
39945
  "hint",
38820
39946
  "pwdless_login_token",
38821
39947
  "client_id",
38822
- "code_verifier"
39948
+ "code_verifier",
39949
+ "login_id"
38823
39950
  ];
38824
39951
  readonly getPasswordLessAccessTokenRequired: readonly [
38825
39952
  "organizationId",
@@ -39393,6 +40520,7 @@ declare namespace ShopperLoginApiTypes {
39393
40520
  * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
39394
40521
  * @param options.body.client_id - The public client ID.
39395
40522
  * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
40523
+ * @param options.body.login_id - The ID used by the shopper for password token request. When provided, login_id must exactly match the ID used during passwordless login. ex. If passwordless login used `samantha.sampleson@example.com`, but the passwordless login token request provides `sam.sampleson@example.com`, the request fails due to mismatch.
39396
40524
  *
39397
40525
  * @returns A promise of type TokenResponse.
39398
40526
  */
@@ -39418,6 +40546,7 @@ declare namespace ShopperLoginApiTypes {
39418
40546
  * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
39419
40547
  * @param options.body.client_id - The public client ID.
39420
40548
  * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
40549
+ * @param options.body.login_id - The ID used by the shopper for password token request. When provided, login_id must exactly match the ID used during passwordless login. ex. If passwordless login used `samantha.sampleson@example.com`, but the passwordless login token request provides `sam.sampleson@example.com`, the request fails due to mismatch.
39421
40550
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
39422
40551
  *
39423
40552
  * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
@@ -39954,7 +41083,9 @@ declare namespace ShopperLoginApiTypes {
39954
41083
  * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
39955
41084
  * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
39956
41085
  * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
39957
- * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
41086
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions and invalidates all refresh tokens for a shopper with the same SLAS user ID.
41087
+ This only works within the same session type. Sessions created through different authentication methods (/authorize vs. Trusted System On Behalf) are treated as separate sessions. To invalidate tokens with different SLAS User IDs, you must make explicit logout calls with each token.
41088
+ A shopper authenticated via both /authorize and TSOB has two separate sessions. You will need two logout calls (one per token) to fully log them out.
39958
41089
 
39959
41090
  If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
39960
41091
 
@@ -39988,7 +41119,9 @@ declare namespace ShopperLoginApiTypes {
39988
41119
  * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
39989
41120
  * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
39990
41121
  * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
39991
- * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
41122
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions and invalidates all refresh tokens for a shopper with the same SLAS user ID.
41123
+ This only works within the same session type. Sessions created through different authentication methods (/authorize vs. Trusted System On Behalf) are treated as separate sessions. To invalidate tokens with different SLAS User IDs, you must make explicit logout calls with each token.
41124
+ A shopper authenticated via both /authorize and TSOB has two separate sessions. You will need two logout calls (one per token) to fully log them out.
39992
41125
 
39993
41126
  If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
39994
41127
 
@@ -40180,6 +41313,12 @@ declare namespace ShopperLoginModelTypes {
40180
41313
  * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
40181
41314
  * - **Max Length:** 8192
40182
41315
  *
41316
+ * @property idp_refresh_token: This is the refresh token that is returned from the IDP. The IDP refresh token is returned to be able to make calls into the IDP outside of SLAS.
41317
+ * - **Max Length:** 128
41318
+ *
41319
+ * @property dnt: Do not track
41320
+ * - **Max Length:** 5
41321
+ *
40183
41322
  */
40184
41323
  type TokenResponse = {
40185
41324
  access_token: string;
@@ -40192,6 +41331,8 @@ declare namespace ShopperLoginModelTypes {
40192
41331
  customer_id: string;
40193
41332
  enc_user_id: string;
40194
41333
  idp_access_token: string;
41334
+ idp_refresh_token?: string;
41335
+ dnt?: string;
40195
41336
  } & {
40196
41337
  [key: string]: any;
40197
41338
  };
@@ -41554,6 +42695,7 @@ type ShopperOrdersParameters = ShopperOrdersPathParameters & BaseUriParameters &
41554
42695
  * ==================================
41555
42696
  *
41556
42697
  * *# API Overview
42698
+ [Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-orders/shopper-orders-oas-v1-public.yaml)
41557
42699
 
41558
42700
  The Shopper Orders API enables you to:
41559
42701
 
@@ -42260,7 +43402,6 @@ declare namespace ShopperOrdersApiTypes {
42260
43402
  * Using the right properties in the right context is left to the user.
42261
43403
  */
42262
43404
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
42263
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
42264
43405
  /**
42265
43406
  * Base options that can be passed to the `ClientConfig` class.
42266
43407
  */
@@ -42272,12 +43413,12 @@ declare namespace ShopperOrdersApiTypes {
42272
43413
  };
42273
43414
  parameters: Params;
42274
43415
  fetchOptions?: FetchOptions;
42275
- fetch?: FetchFunction;
42276
43416
  transformRequest?: (data: unknown, headers: {
42277
43417
  [key: string]: string;
42278
43418
  }) => Required<FetchOptions>["body"];
42279
43419
  throwOnBadResponse?: boolean;
42280
43420
  }
43421
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
42281
43422
  /**
42282
43423
  * Configuration parameters common to Commerce SDK clients
42283
43424
  */
@@ -42289,7 +43430,6 @@ declare namespace ShopperOrdersApiTypes {
42289
43430
  };
42290
43431
  parameters: Params;
42291
43432
  fetchOptions: FetchOptions;
42292
- fetch?: FetchFunction;
42293
43433
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
42294
43434
  throwOnBadResponse: boolean;
42295
43435
  constructor(config: ClientConfigInit<Params>);
@@ -43604,6 +44744,7 @@ declare namespace ShopperOrdersApiTypes {
43604
44744
  * ==================================
43605
44745
  *
43606
44746
  * *# API Overview
44747
+ [Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-orders/shopper-orders-oas-v1-public.yaml)
43607
44748
 
43608
44749
  The Shopper Orders API enables you to:
43609
44750
 
@@ -46282,7 +47423,9 @@ type ShopperProductsParameters = ShopperProductsPathParameters & BaseUriParamete
46282
47423
  * [Shopper Products](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-products:Summary)
46283
47424
  * ==================================
46284
47425
  *
46285
- * *# API Overview
47426
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-products/shopper-products-oas-v1-public.yaml)
47427
+
47428
+ # API Overview
46286
47429
 
46287
47430
  The Shopper Products API enables you to access product details for products that are online, merchandised to a particular site catalog, and ready to be sold. You can use these product details to merchandise the product on other ecommerce channels. To set up category navigation paths on other commerce apps or storefronts, you can use the Categories API.
46288
47431
 
@@ -46830,7 +47973,6 @@ declare namespace ShopperProductsApiTypes {
46830
47973
  * Using the right properties in the right context is left to the user.
46831
47974
  */
46832
47975
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
46833
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
46834
47976
  /**
46835
47977
  * Base options that can be passed to the `ClientConfig` class.
46836
47978
  */
@@ -46842,12 +47984,12 @@ declare namespace ShopperProductsApiTypes {
46842
47984
  };
46843
47985
  parameters: Params;
46844
47986
  fetchOptions?: FetchOptions;
46845
- fetch?: FetchFunction;
46846
47987
  transformRequest?: (data: unknown, headers: {
46847
47988
  [key: string]: string;
46848
47989
  }) => Required<FetchOptions>["body"];
46849
47990
  throwOnBadResponse?: boolean;
46850
47991
  }
47992
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
46851
47993
  /**
46852
47994
  * Configuration parameters common to Commerce SDK clients
46853
47995
  */
@@ -46859,7 +48001,6 @@ declare namespace ShopperProductsApiTypes {
46859
48001
  };
46860
48002
  parameters: Params;
46861
48003
  fetchOptions: FetchOptions;
46862
- fetch?: FetchFunction;
46863
48004
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
46864
48005
  throwOnBadResponse: boolean;
46865
48006
  constructor(config: ClientConfigInit<Params>);
@@ -47647,7 +48788,9 @@ declare namespace ShopperProductsApiTypes {
47647
48788
  * [Shopper Products](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-products:Summary)
47648
48789
  * ==================================
47649
48790
  *
47650
- * *# API Overview
48791
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-products/shopper-products-oas-v1-public.yaml)
48792
+
48793
+ # API Overview
47651
48794
 
47652
48795
  The Shopper Products API enables you to access product details for products that are online, merchandised to a particular site catalog, and ready to be sold. You can use these product details to merchandise the product on other ecommerce channels. To set up category navigation paths on other commerce apps or storefronts, you can use the Categories API.
47653
48796
 
@@ -48980,6 +50123,7 @@ type ShopperPromotionsParameters = ShopperPromotionsPathParameters & BaseUriPara
48980
50123
  * ==================================
48981
50124
  *
48982
50125
  * *# API Overview
50126
+ [Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-promotions/shopper-promotions-oas-v1-public.yaml)
48983
50127
 
48984
50128
  Retrieve information about active promotions within the context of a shopper and a site. You can use this API to retrieve promotions that you configured in the commerce platform by searching for specific promotion IDs or by searching for promotions associated with a campaign.
48985
50129
 
@@ -49268,7 +50412,6 @@ declare namespace ShopperPromotionsApiTypes {
49268
50412
  * Using the right properties in the right context is left to the user.
49269
50413
  */
49270
50414
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
49271
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
49272
50415
  /**
49273
50416
  * Base options that can be passed to the `ClientConfig` class.
49274
50417
  */
@@ -49280,12 +50423,12 @@ declare namespace ShopperPromotionsApiTypes {
49280
50423
  };
49281
50424
  parameters: Params;
49282
50425
  fetchOptions?: FetchOptions;
49283
- fetch?: FetchFunction;
49284
50426
  transformRequest?: (data: unknown, headers: {
49285
50427
  [key: string]: string;
49286
50428
  }) => Required<FetchOptions>["body"];
49287
50429
  throwOnBadResponse?: boolean;
49288
50430
  }
50431
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
49289
50432
  /**
49290
50433
  * Configuration parameters common to Commerce SDK clients
49291
50434
  */
@@ -49297,7 +50440,6 @@ declare namespace ShopperPromotionsApiTypes {
49297
50440
  };
49298
50441
  parameters: Params;
49299
50442
  fetchOptions: FetchOptions;
49300
- fetch?: FetchFunction;
49301
50443
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
49302
50444
  throwOnBadResponse: boolean;
49303
50445
  constructor(config: ClientConfigInit<Params>);
@@ -49433,6 +50575,7 @@ declare namespace ShopperPromotionsApiTypes {
49433
50575
  * ==================================
49434
50576
  *
49435
50577
  * *# API Overview
50578
+ [Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-promotions/shopper-promotions-oas-v1-public.yaml)
49436
50579
 
49437
50580
  Retrieve information about active promotions within the context of a shopper and a site. You can use this API to retrieve promotions that you configured in the commerce platform by searching for specific promotion IDs or by searching for promotions associated with a campaign.
49438
50581
 
@@ -50493,7 +51636,9 @@ type ShopperSearchParameters = ShopperSearchPathParameters & BaseUriParameters &
50493
51636
  * [Shopper Search](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-search:Summary)
50494
51637
  * ==================================
50495
51638
  *
50496
- * *# API Overview
51639
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-search/shopper-search-oas-v1-public.yaml)
51640
+
51641
+ # API Overview
50497
51642
 
50498
51643
  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.
50499
51644
 
@@ -50752,11 +51897,13 @@ declare class ShopperSearch<ConfigParameters extends ShopperSearchParameters & R
50752
51897
  * @param options.parameters - An object containing the parameters for this method.
50753
51898
  * @param options.parameters.organizationId - An identifier for the organization the request is being made by
50754
51899
  * @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.
50755
- * @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.
51900
+ * @param options.parameters.select -
50756
51901
  * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
50757
- * @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) .
50758
- 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
50759
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
51902
+ * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='.<br>
51903
+ Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\"), for example: refine=c_refinementColor=red|green|blue.<br>
51904
+ Value ranges can be specified like this: refine=price=(100..500).<br>
51905
+ Multiple refine parameters can be provided by using the refine as the key, for example: refine=price=(0..10)&refine=c_refinementColor=green.<br>
51906
+ The refinements can be a collection of custom defined attributes IDs and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.<br>
50760
51907
 
50761
51908
  The following system refinement attribute ids are supported:<br>
50762
51909
  `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
@@ -50778,7 +51925,6 @@ declare class ShopperSearch<ConfigParameters extends ShopperSearchParameters & R
50778
51925
  * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
50779
51926
  By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
50780
51927
  Use none to disable all expand options.
50781
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
50782
51928
  * @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.
50783
51929
  If this flag is true, the full image model is returned. If false, only matching images are included.
50784
51930
  If no flag is passed, the `imageGroups` property is omitted from the response.
@@ -50822,11 +51968,13 @@ declare class ShopperSearch<ConfigParameters extends ShopperSearchParameters & R
50822
51968
  * @param options.parameters - An object containing the parameters for this method.
50823
51969
  * @param options.parameters.organizationId - An identifier for the organization the request is being made by
50824
51970
  * @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.
50825
- * @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.
51971
+ * @param options.parameters.select -
50826
51972
  * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
50827
- * @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) .
50828
- 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
50829
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
51973
+ * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='.<br>
51974
+ Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\"), for example: refine=c_refinementColor=red|green|blue.<br>
51975
+ Value ranges can be specified like this: refine=price=(100..500).<br>
51976
+ Multiple refine parameters can be provided by using the refine as the key, for example: refine=price=(0..10)&refine=c_refinementColor=green.<br>
51977
+ The refinements can be a collection of custom defined attributes IDs and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.<br>
50830
51978
 
50831
51979
  The following system refinement attribute ids are supported:<br>
50832
51980
  `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
@@ -50848,7 +51996,6 @@ declare class ShopperSearch<ConfigParameters extends ShopperSearchParameters & R
50848
51996
  * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
50849
51997
  By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
50850
51998
  Use none to disable all expand options.
50851
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
50852
51999
  * @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.
50853
52000
  If this flag is true, the full image model is returned. If false, only matching images are included.
50854
52001
  If no flag is passed, the `imageGroups` property is omitted from the response.
@@ -50961,7 +52108,6 @@ declare namespace ShopperSearchApiTypes {
50961
52108
  * Using the right properties in the right context is left to the user.
50962
52109
  */
50963
52110
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
50964
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
50965
52111
  /**
50966
52112
  * Base options that can be passed to the `ClientConfig` class.
50967
52113
  */
@@ -50973,12 +52119,12 @@ declare namespace ShopperSearchApiTypes {
50973
52119
  };
50974
52120
  parameters: Params;
50975
52121
  fetchOptions?: FetchOptions;
50976
- fetch?: FetchFunction;
50977
52122
  transformRequest?: (data: unknown, headers: {
50978
52123
  [key: string]: string;
50979
52124
  }) => Required<FetchOptions>["body"];
50980
52125
  throwOnBadResponse?: boolean;
50981
52126
  }
52127
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
50982
52128
  /**
50983
52129
  * Configuration parameters common to Commerce SDK clients
50984
52130
  */
@@ -50990,7 +52136,6 @@ declare namespace ShopperSearchApiTypes {
50990
52136
  };
50991
52137
  parameters: Params;
50992
52138
  fetchOptions: FetchOptions;
50993
- fetch?: FetchFunction;
50994
52139
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
50995
52140
  throwOnBadResponse: boolean;
50996
52141
  constructor(config: ClientConfigInit<Params>);
@@ -51784,7 +52929,9 @@ declare namespace ShopperSearchApiTypes {
51784
52929
  * [Shopper Search](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-search:Summary)
51785
52930
  * ==================================
51786
52931
  *
51787
- * *# API Overview
52932
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-search/shopper-search-oas-v1-public.yaml)
52933
+
52934
+ # API Overview
51788
52935
 
51789
52936
  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.
51790
52937
 
@@ -52043,11 +53190,13 @@ declare namespace ShopperSearchApiTypes {
52043
53190
  * @param options.parameters - An object containing the parameters for this method.
52044
53191
  * @param options.parameters.organizationId - An identifier for the organization the request is being made by
52045
53192
  * @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.
52046
- * @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.
53193
+ * @param options.parameters.select -
52047
53194
  * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
52048
- * @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) .
52049
- 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
52050
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
53195
+ * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='.<br>
53196
+ Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\"), for example: refine=c_refinementColor=red|green|blue.<br>
53197
+ Value ranges can be specified like this: refine=price=(100..500).<br>
53198
+ Multiple refine parameters can be provided by using the refine as the key, for example: refine=price=(0..10)&refine=c_refinementColor=green.<br>
53199
+ The refinements can be a collection of custom defined attributes IDs and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.<br>
52051
53200
 
52052
53201
  The following system refinement attribute ids are supported:<br>
52053
53202
  `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
@@ -52069,7 +53218,6 @@ declare namespace ShopperSearchApiTypes {
52069
53218
  * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
52070
53219
  By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
52071
53220
  Use none to disable all expand options.
52072
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
52073
53221
  * @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.
52074
53222
  If this flag is true, the full image model is returned. If false, only matching images are included.
52075
53223
  If no flag is passed, the `imageGroups` property is omitted from the response.
@@ -52113,11 +53261,13 @@ declare namespace ShopperSearchApiTypes {
52113
53261
  * @param options.parameters - An object containing the parameters for this method.
52114
53262
  * @param options.parameters.organizationId - An identifier for the organization the request is being made by
52115
53263
  * @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.
52116
- * @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.
53264
+ * @param options.parameters.select -
52117
53265
  * @param options.parameters.q - The query phrase to search for. For example to search for a product "shirt", type q=shirt.
52118
- * @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) .
52119
- 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
52120
- and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.
53266
+ * @param options.parameters.refine - Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='.<br>
53267
+ Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\"), for example: refine=c_refinementColor=red|green|blue.<br>
53268
+ Value ranges can be specified like this: refine=price=(100..500).<br>
53269
+ Multiple refine parameters can be provided by using the refine as the key, for example: refine=price=(0..10)&refine=c_refinementColor=green.<br>
53270
+ The refinements can be a collection of custom defined attributes IDs and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.<br>
52121
53271
 
52122
53272
  The following system refinement attribute ids are supported:<br>
52123
53273
  `cgid`: Allows refinement per single category ID. Multiple category ids are not supported.
@@ -52139,7 +53289,6 @@ declare namespace ShopperSearchApiTypes {
52139
53289
  * @param options.parameters.expand - A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`.
52140
53290
  By default, the expand parameter includes `availability, images, prices, represented_products, variations`.
52141
53291
  Use none to disable all expand options.
52142
- **The page_meta_tags expand value is optional and is available B2C Commerce version 25.2.**"
52143
53292
  * @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.
52144
53293
  If this flag is true, the full image model is returned. If false, only matching images are included.
52145
53294
  If no flag is passed, the `imageGroups` property is omitted from the response.
@@ -53047,7 +54196,9 @@ type ShopperSEOParameters = ShopperSEOPathParameters & BaseUriParameters & Shopp
53047
54196
  * [Shopper SEO](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-seo:Summary)
53048
54197
  * ==================================
53049
54198
  *
53050
- * *# API Overview
54199
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-seo/shopper-seo-oas-v1-public.yaml)
54200
+
54201
+ # API Overview
53051
54202
 
53052
54203
  The Shopper SEO API Provides access to SEO-related information, such as URL mapping information.
53053
54204
 
@@ -53253,7 +54404,6 @@ declare namespace ShopperSEOApiTypes {
53253
54404
  * Using the right properties in the right context is left to the user.
53254
54405
  */
53255
54406
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
53256
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
53257
54407
  /**
53258
54408
  * Base options that can be passed to the `ClientConfig` class.
53259
54409
  */
@@ -53265,12 +54415,12 @@ declare namespace ShopperSEOApiTypes {
53265
54415
  };
53266
54416
  parameters: Params;
53267
54417
  fetchOptions?: FetchOptions;
53268
- fetch?: FetchFunction;
53269
54418
  transformRequest?: (data: unknown, headers: {
53270
54419
  [key: string]: string;
53271
54420
  }) => Required<FetchOptions>["body"];
53272
54421
  throwOnBadResponse?: boolean;
53273
54422
  }
54423
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
53274
54424
  /**
53275
54425
  * Configuration parameters common to Commerce SDK clients
53276
54426
  */
@@ -53282,7 +54432,6 @@ declare namespace ShopperSEOApiTypes {
53282
54432
  };
53283
54433
  parameters: Params;
53284
54434
  fetchOptions: FetchOptions;
53285
- fetch?: FetchFunction;
53286
54435
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
53287
54436
  throwOnBadResponse: boolean;
53288
54437
  constructor(config: ClientConfigInit<Params>);
@@ -53393,7 +54542,9 @@ declare namespace ShopperSEOApiTypes {
53393
54542
  * [Shopper SEO](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-seo:Summary)
53394
54543
  * ==================================
53395
54544
  *
53396
- * *# API Overview
54545
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-seo/shopper-seo-oas-v1-public.yaml)
54546
+
54547
+ # API Overview
53397
54548
 
53398
54549
  The Shopper SEO API Provides access to SEO-related information, such as URL mapping information.
53399
54550
 
@@ -53786,7 +54937,9 @@ type ShopperStoresParameters = ShopperStoresPathParameters & BaseUriParameters &
53786
54937
  * [Shopper Stores](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-stores:Summary)
53787
54938
  * ==================================
53788
54939
  *
53789
- * *# API Overview
54940
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-stores/shopper-stores-oas-v1-public.yaml)
54941
+
54942
+ # API Overview
53790
54943
 
53791
54944
  Provides access to stores via search or ID lookup.
53792
54945
 
@@ -54082,7 +55235,6 @@ declare namespace ShopperStoresApiTypes {
54082
55235
  * Using the right properties in the right context is left to the user.
54083
55236
  */
54084
55237
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
54085
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
54086
55238
  /**
54087
55239
  * Base options that can be passed to the `ClientConfig` class.
54088
55240
  */
@@ -54094,12 +55246,12 @@ declare namespace ShopperStoresApiTypes {
54094
55246
  };
54095
55247
  parameters: Params;
54096
55248
  fetchOptions?: FetchOptions;
54097
- fetch?: FetchFunction;
54098
55249
  transformRequest?: (data: unknown, headers: {
54099
55250
  [key: string]: string;
54100
55251
  }) => Required<FetchOptions>["body"];
54101
55252
  throwOnBadResponse?: boolean;
54102
55253
  }
55254
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
54103
55255
  /**
54104
55256
  * Configuration parameters common to Commerce SDK clients
54105
55257
  */
@@ -54111,7 +55263,6 @@ declare namespace ShopperStoresApiTypes {
54111
55263
  };
54112
55264
  parameters: Params;
54113
55265
  fetchOptions: FetchOptions;
54114
- fetch?: FetchFunction;
54115
55266
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
54116
55267
  throwOnBadResponse: boolean;
54117
55268
  constructor(config: ClientConfigInit<Params>);
@@ -54338,7 +55489,9 @@ declare namespace ShopperStoresApiTypes {
54338
55489
  * [Shopper Stores](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-stores:Summary)
54339
55490
  * ==================================
54340
55491
  *
54341
- * *# API Overview
55492
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-stores/shopper-stores-oas-v1-public.yaml)
55493
+
55494
+ # API Overview
54342
55495
 
54343
55496
  Provides access to stores via search or ID lookup.
54344
55497
 
@@ -54873,7 +56026,6 @@ declare namespace helpers {
54873
56026
  * Using the right properties in the right context is left to the user.
54874
56027
  */
54875
56028
  type FetchOptions = NodeRequestInit & BrowserRequestInit;
54876
- type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
54877
56029
  /**
54878
56030
  * Base options that can be passed to the `ClientConfig` class.
54879
56031
  */
@@ -54885,12 +56037,12 @@ declare namespace helpers {
54885
56037
  };
54886
56038
  parameters: Params;
54887
56039
  fetchOptions?: FetchOptions;
54888
- fetch?: FetchFunction;
54889
56040
  transformRequest?: (data: unknown, headers: {
54890
56041
  [key: string]: string;
54891
56042
  }) => Required<FetchOptions>["body"];
54892
56043
  throwOnBadResponse?: boolean;
54893
56044
  }
56045
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
54894
56046
  /**
54895
56047
  * Configuration parameters common to Commerce SDK clients
54896
56048
  */
@@ -54902,22 +56054,22 @@ declare namespace helpers {
54902
56054
  };
54903
56055
  parameters: Params;
54904
56056
  fetchOptions: FetchOptions;
54905
- fetch?: FetchFunction;
54906
56057
  transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
54907
56058
  throwOnBadResponse: boolean;
54908
56059
  constructor(config: ClientConfigInit<Params>);
54909
56060
  static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
54910
56061
  }
56062
+ /*
56063
+ * Copyright (c) 2022, Salesforce, Inc.
56064
+ * All rights reserved.
56065
+ * SPDX-License-Identifier: BSD-3-Clause
56066
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
56067
+ */
54911
56068
  const isBrowser: boolean;
54912
56069
  const isNode: boolean;
54913
56070
  const globalObject: typeof globalThis;
54914
56071
  const hasFetchAvailable: boolean;
54915
- // TODO: Adopt native fetch in the next major version.
54916
- // Using the built-in fetch (Node 18+) caused downstream unit tests that rely on
54917
- // `nock` to fail because `nock` hooks into the core HTTP/HTTPS modules, while
54918
- // the native fetch implementation leverages undici instead. Until we can roll
54919
- // out a coordinated breaking change, we continue to use the node-fetch
54920
- // polyfill so existing tests keep passing.
56072
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
54921
56073
  const fetch: FetchFunction;
54922
56074
  /**
54923
56075
  * Grant Type
@@ -54987,6 +56139,12 @@ declare namespace helpers {
54987
56139
  * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
54988
56140
  * - **Max Length:** 8192
54989
56141
  *
56142
+ * @property idp_refresh_token: This is the refresh token that is returned from the IDP. The IDP refresh token is returned to be able to make calls into the IDP outside of SLAS.
56143
+ * - **Max Length:** 128
56144
+ *
56145
+ * @property dnt: Do not track
56146
+ * - **Max Length:** 5
56147
+ *
54990
56148
  */
54991
56149
  type TokenResponse = {
54992
56150
  access_token: string;
@@ -54999,6 +56157,8 @@ declare namespace helpers {
54999
56157
  customer_id: string;
55000
56158
  enc_user_id: string;
55001
56159
  idp_access_token: string;
56160
+ idp_refresh_token?: string;
56161
+ dnt?: string;
55002
56162
  } & {
55003
56163
  [key: string]: any;
55004
56164
  };
@@ -55086,6 +56246,7 @@ declare namespace helpers {
55086
56246
  pwdless_login_token: string;
55087
56247
  client_id?: string;
55088
56248
  code_verifier?: string;
56249
+ login_id?: string;
55089
56250
  };
55090
56251
  type getPasswordResetTokenQueryParameters = {};
55091
56252
  type getPasswordResetTokenPathParameters = {
@@ -55225,7 +56386,9 @@ declare namespace helpers {
55225
56386
  * [Shopper Login](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary)
55226
56387
  * ==================================
55227
56388
  *
55228
- * *# API Overview
56389
+ * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-login/shopper-login-oas-v1-public.yaml)
56390
+
56391
+ # API Overview
55229
56392
 
55230
56393
  The Shopper Login and API Access Service (SLAS) enables secure access to Commerce Cloud’s Shopper APIs for a wide range of headless commerce applications.
55231
56394
 
@@ -55361,7 +56524,8 @@ declare namespace helpers {
55361
56524
  "hint",
55362
56525
  "pwdless_login_token",
55363
56526
  "client_id",
55364
- "code_verifier"
56527
+ "code_verifier",
56528
+ "login_id"
55365
56529
  ];
55366
56530
  readonly getPasswordLessAccessTokenRequired: readonly [
55367
56531
  "organizationId",
@@ -55935,6 +57099,7 @@ declare namespace helpers {
55935
57099
  * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
55936
57100
  * @param options.body.client_id - The public client ID.
55937
57101
  * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
57102
+ * @param options.body.login_id - The ID used by the shopper for password token request. When provided, login_id must exactly match the ID used during passwordless login. ex. If passwordless login used `samantha.sampleson@example.com`, but the passwordless login token request provides `sam.sampleson@example.com`, the request fails due to mismatch.
55938
57103
  *
55939
57104
  * @returns A promise of type TokenResponse.
55940
57105
  */
@@ -55960,6 +57125,7 @@ declare namespace helpers {
55960
57125
  * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
55961
57126
  * @param options.body.client_id - The public client ID.
55962
57127
  * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
57128
+ * @param options.body.login_id - The ID used by the shopper for password token request. When provided, login_id must exactly match the ID used during passwordless login. ex. If passwordless login used `samantha.sampleson@example.com`, but the passwordless login token request provides `sam.sampleson@example.com`, the request fails due to mismatch.
55963
57129
  * @param rawResponse - Set to true to return entire Response object instead of DTO.
55964
57130
  *
55965
57131
  * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
@@ -56496,7 +57662,9 @@ declare namespace helpers {
56496
57662
  * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
56497
57663
  * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
56498
57664
  * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
56499
- * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
57665
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions and invalidates all refresh tokens for a shopper with the same SLAS user ID.
57666
+ This only works within the same session type. Sessions created through different authentication methods (/authorize vs. Trusted System On Behalf) are treated as separate sessions. To invalidate tokens with different SLAS User IDs, you must make explicit logout calls with each token.
57667
+ A shopper authenticated via both /authorize and TSOB has two separate sessions. You will need two logout calls (one per token) to fully log them out.
56500
57668
 
56501
57669
  If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
56502
57670
 
@@ -56530,7 +57698,9 @@ declare namespace helpers {
56530
57698
  * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
56531
57699
  * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
56532
57700
  * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
56533
- * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
57701
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions and invalidates all refresh tokens for a shopper with the same SLAS user ID.
57702
+ This only works within the same session type. Sessions created through different authentication methods (/authorize vs. Trusted System On Behalf) are treated as separate sessions. To invalidate tokens with different SLAS User IDs, you must make explicit logout calls with each token.
57703
+ A shopper authenticated via both /authorize and TSOB has two separate sessions. You will need two logout calls (one per token) to fully log them out.
56534
57704
 
56535
57705
  If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
56536
57706
 
@@ -57042,24 +58212,5 @@ declare namespace helpers {
57042
58212
  */
57043
58213
  const encodeSCAPISpecialCharacters: (str: string) => string;
57044
58214
  }
57045
- declare const pkg: {
57046
- ShopperBaskets: typeof ShopperBaskets;
57047
- ShopperBasketsV2: typeof ShopperBasketsV2;
57048
- ShopperConsents: typeof ShopperConsents;
57049
- ShopperContexts: typeof ShopperContexts;
57050
- ShopperCustomers: typeof ShopperCustomers;
57051
- ShopperExperience: typeof ShopperExperience;
57052
- ShopperGiftCertificates: typeof ShopperGiftCertificates;
57053
- ShopperLogin: typeof ShopperLogin;
57054
- ShopperOrders: typeof ShopperOrders;
57055
- ShopperProducts: typeof ShopperProducts;
57056
- ShopperPromotions: typeof ShopperPromotions;
57057
- ShopperSearch: typeof ShopperSearch;
57058
- ShopperSEO: typeof ShopperSEO;
57059
- ShopperStores: typeof ShopperStores;
57060
- helpers: typeof helpers;
57061
- ClientConfig: typeof ClientConfig;
57062
- TemplateURL: typeof TemplateURL;
57063
- };
57064
- export { pkg as default, ShopperBaskets, ShopperBasketsV2, ShopperConsents, ShopperContexts, ShopperCustomers, ShopperExperience, ShopperGiftCertificates, ShopperLogin, ShopperOrders, ShopperProducts, ShopperPromotions, ShopperSearch, ShopperSEO, ShopperStores, ClientConfig, TemplateURL, helpers };
57065
- export type { ShopperBasketsTypes, ShopperBasketsV2Types, ShopperConsentsTypes, ShopperContextsTypes, ShopperCustomersTypes, ShopperExperienceTypes, ShopperGiftCertificatesTypes, ShopperLoginTypes, ShopperOrdersTypes, ShopperProductsTypes, ShopperPromotionsTypes, ShopperSearchTypes, ShopperSEOTypes, ShopperStoresTypes, ClientConfigInit, FetchFunction, FetchOptions };
58215
+ export { ShopperBaskets, ShopperBasketsV2, ShopperConfigurations, ShopperConsents, ShopperContexts, ShopperCustomers, ShopperExperience, ShopperGiftCertificates, ShopperLogin, ShopperOrders, ShopperProducts, ShopperPromotions, ShopperSearch, ShopperSEO, ShopperStores, ClientConfig, TemplateURL, helpers };
58216
+ export type { ShopperBasketsTypes, ShopperBasketsV2Types, ShopperConfigurationsTypes, ShopperConsentsTypes, ShopperContextsTypes, ShopperCustomersTypes, ShopperExperienceTypes, ShopperGiftCertificatesTypes, ShopperLoginTypes, ShopperOrdersTypes, ShopperProductsTypes, ShopperPromotionsTypes, ShopperSearchTypes, ShopperSEOTypes, ShopperStoresTypes, ClientConfigInit, FetchFunction, FetchOptions };