@salesforce/commerce-sdk-react 1.0.0-preview.0 → 1.0.0-preview.2

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 (72) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -0
  3. package/auth/index.d.ts +19 -4
  4. package/auth/index.js +49 -1
  5. package/auth/storage.d.ts +1 -1
  6. package/components/ShopperExperience/Component/index.d.ts +1 -1
  7. package/components/ShopperExperience/Page/index.d.ts +2 -2
  8. package/components/ShopperExperience/types.d.ts +5 -5
  9. package/hooks/ShopperBaskets/cache.d.ts +1 -1
  10. package/hooks/ShopperBaskets/mutation.d.ts +63 -282
  11. package/hooks/ShopperBaskets/mutation.js +60 -254
  12. package/hooks/ShopperBaskets/query.d.ts +11 -1
  13. package/hooks/ShopperBaskets/query.js +10 -0
  14. package/hooks/ShopperBaskets/queryKeyHelpers.d.ts +4 -4
  15. package/hooks/ShopperContexts/cache.d.ts +1 -1
  16. package/hooks/ShopperContexts/mutation.d.ts +18 -13
  17. package/hooks/ShopperContexts/mutation.js +16 -11
  18. package/hooks/ShopperContexts/query.d.ts +4 -2
  19. package/hooks/ShopperContexts/query.js +3 -1
  20. package/hooks/ShopperContexts/queryKeyHelpers.d.ts +4 -4
  21. package/hooks/ShopperCustomers/cache.d.ts +1 -1
  22. package/hooks/ShopperCustomers/mutation.d.ts +22 -82
  23. package/hooks/ShopperCustomers/mutation.js +20 -81
  24. package/hooks/ShopperCustomers/query.d.ts +28 -3
  25. package/hooks/ShopperCustomers/query.js +28 -2
  26. package/hooks/ShopperCustomers/queryKeyHelpers.d.ts +4 -4
  27. package/hooks/ShopperExperience/query.d.ts +13 -9
  28. package/hooks/ShopperExperience/query.js +12 -8
  29. package/hooks/ShopperExperience/queryKeyHelpers.d.ts +4 -4
  30. package/hooks/ShopperGiftCertificates/query.d.ts +3 -1
  31. package/hooks/ShopperGiftCertificates/query.js +2 -0
  32. package/hooks/ShopperGiftCertificates/queryKeyHelpers.d.ts +4 -4
  33. package/hooks/ShopperLogin/mutation.d.ts +21 -49
  34. package/hooks/ShopperLogin/mutation.js +19 -41
  35. package/hooks/ShopperLogin/query.d.ts +9 -1
  36. package/hooks/ShopperLogin/query.js +8 -0
  37. package/hooks/ShopperLogin/queryKeyHelpers.d.ts +4 -4
  38. package/hooks/ShopperOrders/cache.d.ts +1 -1
  39. package/hooks/ShopperOrders/mutation.d.ts +21 -25
  40. package/hooks/ShopperOrders/mutation.js +19 -21
  41. package/hooks/ShopperOrders/query.d.ts +7 -1
  42. package/hooks/ShopperOrders/query.js +7 -1
  43. package/hooks/ShopperOrders/queryKeyHelpers.d.ts +4 -4
  44. package/hooks/ShopperProducts/query.d.ts +9 -1
  45. package/hooks/ShopperProducts/query.js +8 -0
  46. package/hooks/ShopperProducts/queryKeyHelpers.d.ts +4 -4
  47. package/hooks/ShopperPromotions/query.d.ts +5 -1
  48. package/hooks/ShopperPromotions/query.js +4 -0
  49. package/hooks/ShopperPromotions/queryKeyHelpers.d.ts +4 -4
  50. package/hooks/ShopperSearch/query.d.ts +12 -4
  51. package/hooks/ShopperSearch/query.js +11 -3
  52. package/hooks/ShopperSearch/queryKeyHelpers.d.ts +4 -4
  53. package/hooks/types.d.ts +30 -27
  54. package/hooks/useAccessToken.d.ts +6 -0
  55. package/hooks/useAccessToken.js +8 -0
  56. package/hooks/useAuthHelper.d.ts +15 -1
  57. package/hooks/useAuthHelper.js +19 -0
  58. package/hooks/useCommerceApi.d.ts +2 -0
  59. package/hooks/useCommerceApi.js +2 -0
  60. package/hooks/useCustomerId.d.ts +2 -0
  61. package/hooks/useCustomerId.js +2 -0
  62. package/hooks/useCustomerType.d.ts +5 -2
  63. package/hooks/useCustomerType.js +12 -1
  64. package/hooks/useEncUserId.d.ts +3 -0
  65. package/hooks/useEncUserId.js +3 -0
  66. package/hooks/useLocalStorage.d.ts +1 -1
  67. package/hooks/useUsid.d.ts +2 -0
  68. package/hooks/useUsid.js +2 -0
  69. package/package.json +15 -13
  70. package/provider.d.ts +27 -1
  71. package/provider.js +27 -1
  72. package/scripts/build-and-release-docs.js +1 -0
@@ -1,381 +1,162 @@
1
1
  import { ApiClients, Argument, DataType } from '../types';
2
2
  import { UseMutationResult } from '@tanstack/react-query';
3
- declare type Client = ApiClients['shopperBaskets'];
4
- /** Mutations available for Shopper Baskets. */
3
+ type Client = ApiClients['shopperBaskets'];
4
+ /**
5
+ * Mutations available for Shopper Baskets.
6
+ * @group ShopperBaskets
7
+ * @category Mutation
8
+ * @enum
9
+ */
5
10
  export declare const ShopperBasketsMutations: {
6
11
  /**
7
- * Creates a new basket.
12
+ * Creates a new basket.
8
13
 
9
- The created basket is initialized with default values. Data provided in the body document is populated into the created basket. It can be updated with API endpoints listed below.
10
-
11
- The taxMode query parameter can be used to choose the basket tax mode. The default is internal, in which case the tax calculation is done automatically based on internal tax tables. Alternatively, external taxation mode can be set which allows manual modification of the tax rates and values. External tax data is mandatory for product line items, option line items, shipping line items, coupon line items, and bonus discount line item. Gift certificate line items are optional and use zero tax rate per default, which can be overwritten. Price adjustments cannot be set because they are either calculated or inherited (depending on the type, the tax rate is either obtained from the related line item or computed as prorate of the basket).
12
-
13
- API endpoints allowing further basket modification:
14
-
15
- - customer information: PUT /baskets/\{basketId\}/customer
16
-
17
- - billing address: PUT /baskets/\{basketId\}/billing-address
18
-
19
- - shipments including shipping address and shipping method: POST /baskets/\{basketId\}/shipments
20
-
21
- - product items: POST /baskets/\{basketId\}/items
22
-
23
- - coupon items: POST /baskets/\{basketId\}/coupons
24
-
25
- - gift certificate items: POST /baskets/\{basketId\}/gift-certificates
26
-
27
- - basket taxation: PUT /baskets/\{basketId\}/taxes
28
-
29
- - basket item taxation: PUT /baskets/\{basketId\}/items/\{itemId\}/taxes
30
-
31
- - payment method and card type: POST /baskets/\{basketId\}/payment-instruments
32
-
33
- - custom properties: PATCH /baskets/\{basketId\}
34
-
35
- Related resource means with which resource you can specify the same data after the basket creation.
36
- Identify the basket using the basketId property, which
37
- should be integrated into the path of an update request (for example a POST to
38
- /baskets/\{basketId\}/items).
39
-
40
- A customer must provide a JSON Web Token (JWT), which specifies exactly one customer (it can be a guest or a registered
41
- customer). In this case, the resource creates a basket for this customer.
42
-
43
- The number of baskets which can be created per customer is limited. When a
44
- basket is created, it is said to be open. It remains open until either an order is created from it
45
- using a POST to resource /orders, or it is deleted using a DELETE to resource
46
- /baskets/\{basketId\}. Each customer can have just one open basket.
47
-
48
- Custom properties in the form c_\<CUSTOM_NAME\> are supported. A custom property must correspond to a custom
49
- attribute (\<CUSTOM_NAME\>) defined for the basket system object, and its value must be valid for that custom
50
- attribute.
51
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `createBasket` endpoint.
52
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=createBasket| Salesforce Developer Center} for more information about the API endpoint.
53
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#createbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
54
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
55
- */
14
+ The created basket is initialized with default values.
15
+ */
56
16
  readonly CreateBasket: "createBasket";
57
17
  /**
58
- * 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.
18
+ * 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.
59
19
 
60
- A success response contains the transferred basket.
20
+ A success response contains the transferred basket.
61
21
 
62
- 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:
63
- - Keep the current shopper's active basket.
64
- - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
65
- - 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.
66
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `transferBasket` endpoint.
67
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=transferBasket| Salesforce Developer Center} for more information about the API endpoint.
68
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#transferbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
69
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
22
+ 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:
23
+ - Keep the current shopper's active basket.
24
+ - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
25
+ - 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.
70
26
  */
71
27
  readonly TransferBasket: "transferBasket";
72
28
  /**
73
- * 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.
74
-
75
- The following information is merged:
76
- - custom attributes on the basket and on all copied records
77
- - product items
78
- - gift certificate items
79
- - coupon items
80
- - shipments
81
- - ad-hoc price adjustments
82
-
83
- To control the merging of products that exist in both baskets, use the `productItemMergeMode` parameter. By default, the higher of the two basket quantities is used for each product. Products in both baskets are considered to be the same when all of the following values match (if one product doesn't have a value, the other product is a match only if it also doesn't have that value):
84
- - shipment
85
- - productId
86
- - option values
87
- - wishlist reference
88
- - inventory list id
89
- - gift flag & message
90
- - ad-hoc price adjustments
91
-
92
- If any of the listed values don't match, then the item in the previous shopper's basket is copied to a new line item in the current shopper's basket. If the listed values all match, but the matching products have different values for any custom attribute, the merged line item keeps the custom attribute value from the current shopper's basket.
93
-
94
- A success response contains the current shopper's active basket. The previous guest shopper's active basket is deleted.
95
-
96
- If the current shopper doesn't have an active basket, and the createDestinationBasket request parameter is false, then the merge request returns a BasketMergeException (HTTP status 409). You can proceed with one of these options:
97
- - Transfer the previous shopper's active basket to the current logged-in shopper by calling the `baskets/transfer` endpoint.
98
- - Force the merge by calling the `baskets/merge` endpoint again, with the parameter `createDestinationBasket=true`. Forcing the merge creates a new basket for the current shopper and copies information from the previous shopper's basket into it. Because the merge doesn't copy all basket data, a forced merge is not the same as a transfer. For example, the new basket doesn't contain any Personally Identifiable Information (PII) from the previous basket.
99
-
100
- ### before merge
101
- | Previous Shopper's Basket, SKU: Quantity, Custom Attributes | Current Shopper's Basket, SKU: Quantity, Custom Attributes |
102
- |-------------------------------------------------------------|-------------------------------------------------------------|
103
- | SKU_A: 5\<br\> SKU_B: 3\<br\> SKU_C: 4\<br\> c_customAttr_1: 'ABC' \<br\> c_customAttr_2: 'DEF' | SKU_A: 2\<br\> SKU_D: 6\<br\> SKU_E: 7\<br\> c_customAttr_1: 'UVW' \<br\> c_customAttr_3: 'XYZ' |
104
-
105
- ### after merge - (previous shopper's basket is deleted)
106
- | productItemMergeMode | Current Shopper's Basket - SKU: Quantity, Custom Attributes |
107
- |----------------------|--------------------------------------------------------------|
108
- | sum_quantities | SKU_A: 7\<br\> SKU_B: 3\<br\> SKU_C: 4\<br\> SKU_D: 6\<br\> SKU_E: 7\<br\> c_customAttr_1: 'UVW' \<br\> c_customAttr_2: 'DEF' \<br\> c_customAttr_3: 'XYZ' |
109
- | higher_quantity | SKU_A: 5\<br\> SKU_B: 3\<br\> SKU_C: 4\<br\> SKU_D: 6\<br\> SKU_E: 7\<br\> c_customAttr_1: 'UVW' \<br\> c_customAttr_2: 'DEF' \<br\> c_customAttr_3: 'XYZ' |
110
- | saved_quantity | SKU_A: 2\<br\> SKU_B: 3\<br\> SKU_C: 4\<br\> SKU_D: 6\<br\> SKU_E: 7\<br\> c_customAttr_1: 'UVW' \<br\> c_customAttr_2: 'DEF' \<br\> c_customAttr_3: 'XYZ' |
111
- | separate_item | SKU_A: 5\<br\> SKU_B: 3\<br\> SKU_C: 4\<br\> SKU_A: 2\<br\> SKU_D: 6\<br\> SKU_E: 7\<br\> c_customAttr_1: 'UVW' \<br\> c_customAttr_2: 'DEF' \<br\> c_customAttr_3: 'XYZ' |
112
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `mergeBasket` endpoint.
113
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=mergeBasket| Salesforce Developer Center} for more information about the API endpoint.
114
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#mergebasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
115
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
116
- */
29
+ * 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.
30
+ */
117
31
  readonly MergeBasket: "mergeBasket";
118
32
  /**
119
33
  * Removes a basket.
120
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `deleteBasket` endpoint.
121
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=deleteBasket| Salesforce Developer Center} for more information about the API endpoint.
122
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#deletebasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
123
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
124
34
  */
125
35
  readonly DeleteBasket: "deleteBasket";
126
36
  /**
127
- * Updates a basket. Only the currency of the basket, source code, the custom
128
- properties of the basket, and the shipping items will be considered.
129
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateBasket` endpoint.
130
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateBasket| Salesforce Developer Center} for more information about the API endpoint.
131
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updatebasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
132
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
133
- */
37
+ * Updates a basket. Only the currency of the basket, source code, the custom
38
+ properties of the basket, and the shipping items will be considered.
39
+ */
134
40
  readonly UpdateBasket: "updateBasket";
135
41
  /**
136
42
  * Sets the billing address of a basket.
137
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateBillingAddressForBasket` endpoint.
138
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateBillingAddressForBasket| Salesforce Developer Center} for more information about the API endpoint.
139
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updatebillingaddressforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
140
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
141
43
  */
142
44
  readonly UpdateBillingAddressForBasket: "updateBillingAddressForBasket";
143
45
  /**
144
46
  * Adds a coupon to an existing basket.
145
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addCouponToBasket` endpoint.
146
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addCouponToBasket| Salesforce Developer Center} for more information about the API endpoint.
147
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#addcoupontobasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
148
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
149
47
  */
150
48
  readonly AddCouponToBasket: "addCouponToBasket";
151
49
  /**
152
50
  * Removes a coupon from the basket.
153
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeCouponFromBasket` endpoint.
154
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=removeCouponFromBasket| Salesforce Developer Center} for more information about the API endpoint.
155
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#removecouponfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
156
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
157
51
  */
158
52
  readonly RemoveCouponFromBasket: "removeCouponFromBasket";
159
53
  /**
160
54
  * Sets customer information for an existing basket.
161
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateCustomerForBasket` endpoint.
162
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateCustomerForBasket| Salesforce Developer Center} for more information about the API endpoint.
163
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updatecustomerforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
164
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
165
55
  */
166
56
  readonly UpdateCustomerForBasket: "updateCustomerForBasket";
167
57
  /**
168
58
  * Adds a gift certificate item to an existing basket.
169
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addGiftCertificateItemToBasket` endpoint.
170
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addGiftCertificateItemToBasket| Salesforce Developer Center} for more information about the API endpoint.
171
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#addgiftcertificateitemtobasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
172
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
173
59
  */
174
60
  readonly AddGiftCertificateItemToBasket: "addGiftCertificateItemToBasket";
175
61
  /**
176
62
  * Deletes a gift certificate item from an existing basket.
177
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeGiftCertificateItemFromBasket` endpoint.
178
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=removeGiftCertificateItemFromBasket| Salesforce Developer Center} for more information about the API endpoint.
179
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#removegiftcertificateitemfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
180
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
181
63
  */
182
64
  readonly RemoveGiftCertificateItemFromBasket: "removeGiftCertificateItemFromBasket";
183
65
  /**
184
66
  * Updates a gift certificate item of an existing basket.
185
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateGiftCertificateItemInBasket` endpoint.
186
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateGiftCertificateItemInBasket| Salesforce Developer Center} for more information about the API endpoint.
187
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updategiftcertificateiteminbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
188
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
189
67
  */
190
68
  readonly UpdateGiftCertificateItemInBasket: "updateGiftCertificateItemInBasket";
191
69
  /**
192
- * Adds new items to a basket. The added items are associated with the
193
- specified shipment. If no shipment id is specified, the added items are associated with the default shipment.
194
- Considered values from the request body, for each item are:
195
-
196
- - productId: a valid product ID. This is the ID of the product to be added to the basket. If the
197
- product is already in the basket, the API either increments the quantity of the existing product line item or
198
- creates a new product line item, based on the site preference 'Add Product Behavior'. For option products and
199
- product bundles containing variation masters, the API creates a new product line item regardless of the site
200
- preference.
201
- - shipmentId: a valid shipment ID (optional). This is the ID of the shipment in which the product item
202
- is created.
203
- - quantity: a number between 0.01 and 999. This is the quantity of the product to order.
204
- - inventoryId: a valid inventory ID (optional). This is the ID of the inventory from which the item is
205
- allocated.
206
- - bonusDiscountLineItemId: a valid bonus discount line item ID (optional). This is the ID of the
207
- bonus discount line item for which the added product is a selected bonus product.
208
- - optionItems/optionValueId: a valid option value ID. This is an option value for an option item of
209
- an option product. This is only possible if the product item is an option
210
- product. To set option values, you must specify a collection of option items in the optionItems
211
- property. These option items must contain optionId and optionValueId. Also,
212
- the values you specify must be valid for the option product that this product item represents. Otherwise, the
213
- server throws an InvalidProductOptionItemException or an
214
- InvalidProductOptionValueItemException.
215
- - custom properties in the form c_\<CUSTOM_NAME\>: the custom property must correspond to a custom
216
- attribute (\<CUSTOM_NAME\>) defined for ProductLineItem. The value of this property must be valid for the
217
- type of custom attribute defined for ProductLineItem.
218
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addItemToBasket` endpoint.
219
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addItemToBasket| Salesforce Developer Center} for more information about the API endpoint.
220
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#additemtobasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
221
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
222
- */
70
+ * Adds new items to a basket.
71
+ */
223
72
  readonly AddItemToBasket: "addItemToBasket";
224
73
  /**
225
74
  * Removes a product item from the basket.
226
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeItemFromBasket` endpoint.
227
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=removeItemFromBasket| Salesforce Developer Center} for more information about the API endpoint.
228
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#removeitemfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
229
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
230
75
  */
231
76
  readonly RemoveItemFromBasket: "removeItemFromBasket";
232
77
  /**
233
- * Updates an item in a basket. The
234
- following values in the request body are considered by the server:
235
-
236
- - productId: a valid product ID. The purpose of this
237
- value is to exchange a variation of a variation product.
238
- - shipmentId: a valid shipment ID. The purpose of
239
- this value is to move a product item to another shipment.
240
- - quantity: a number between 0 and 999. The purpose of
241
- this value is to change quantity of the product item. If quantity is 0,
242
- the product item is removed.
243
- - optionItems/optionValueId: a valid option value
244
- ID. The purpose of this value is to exchange an option value for an
245
- option item of an option product.
246
- This is only possible if the product item is an option product. To change
247
- option values a collection of option items to be changed need to be
248
- provided in property optionItems. Those
249
- optionItems need to contain optionId
250
- and optionValueId. The provided values must be valid
251
- for the option product that this product item represents. Otherwise
252
- InvalidProductOptionItemException or
253
- InvalidProductOptionValueItemException will be thrown.
254
- custom properties c_\<CUSTOM_NAME\>: a
255
- value corresponding to the type defined for custom attribute
256
- \<CUSTOM_NAME\> of ProductLineItem. The purpose of this value is to
257
- add or change the value of a custom attribute defined for
258
- ProductLineItem.
259
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateItemInBasket` endpoint.
260
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateItemInBasket| Salesforce Developer Center} for more information about the API endpoint.
261
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updateiteminbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
262
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
263
- */
78
+ * Updates an item in a basket.
79
+ */
264
80
  readonly UpdateItemInBasket: "updateItemInBasket";
265
81
  /**
266
82
  * This method allows you to apply external taxation data to an existing basket to be able to pass tax rates and optional values for a specific taxable line item. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
267
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addTaxesForBasketItem` endpoint.
268
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addTaxesForBasketItem| Salesforce Developer Center} for more information about the API endpoint.
269
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#addtaxesforbasketitem | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
270
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
271
83
  */
272
84
  readonly AddTaxesForBasketItem: "addTaxesForBasketItem";
273
85
  /**
274
86
  * Adds a payment instrument to a basket.
275
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addPaymentInstrumentToBasket` endpoint.
276
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addPaymentInstrumentToBasket| Salesforce Developer Center} for more information about the API endpoint.
277
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#addpaymentinstrumenttobasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
278
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
279
87
  */
280
88
  readonly AddPaymentInstrumentToBasket: "addPaymentInstrumentToBasket";
281
89
  /**
282
90
  * Removes a payment instrument of a basket.
283
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removePaymentInstrumentFromBasket` endpoint.
284
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=removePaymentInstrumentFromBasket| Salesforce Developer Center} for more information about the API endpoint.
285
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#removepaymentinstrumentfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
286
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
287
91
  */
288
92
  readonly RemovePaymentInstrumentFromBasket: "removePaymentInstrumentFromBasket";
289
93
  /**
290
94
  * Updates payment instrument of an existing basket.
291
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updatePaymentInstrumentInBasket` endpoint.
292
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updatePaymentInstrumentInBasket| Salesforce Developer Center} for more information about the API endpoint.
293
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updatepaymentinstrumentinbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
294
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
295
95
  */
296
96
  readonly UpdatePaymentInstrumentInBasket: "updatePaymentInstrumentInBasket";
297
97
  /**
298
98
  * This method allows you to put an array of priceBookIds to an existing basket, which will be used for basket calculation.
299
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addPriceBooksToBasket` endpoint.
300
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addPriceBooksToBasket| Salesforce Developer Center} for more information about the API endpoint.
301
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#addpricebookstobasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
302
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
303
99
  */
304
100
  readonly AddPriceBooksToBasket: "addPriceBooksToBasket";
305
101
  /**
306
- * Creates a new shipment for a basket.
102
+ * Creates a new shipment for a basket.
307
103
 
308
- The created shipment is initialized with values provided in the body
309
- document and can be updated with further data API calls. Considered from
310
- the body are the following properties if specified:
104
+ The created shipment is initialized with values provided in the body
105
+ document and can be updated with further data API calls. Considered from
106
+ the body are the following properties if specified:
311
107
 
312
- - the ID
313
- - the shipping address
314
- - the shipping method
315
- - gift boolean flag
316
- - gift message
317
- - custom properties
318
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `createShipmentForBasket` endpoint.
319
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=createShipmentForBasket| Salesforce Developer Center} for more information about the API endpoint.
320
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#createshipmentforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
321
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
322
- */
108
+ - the ID
109
+ - the shipping address
110
+ - the shipping method
111
+ - gift boolean flag
112
+ - gift message
113
+ - custom properties
114
+ */
323
115
  readonly CreateShipmentForBasket: "createShipmentForBasket";
324
116
  /**
325
- * Removes a specified shipment and all associated product, gift certificate,
326
- shipping, and price adjustment line items from a basket.
327
- It is not allowed to remove the default shipment.
328
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeShipmentFromBasket` endpoint.
329
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=removeShipmentFromBasket| Salesforce Developer Center} for more information about the API endpoint.
330
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#removeshipmentfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
331
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
332
- */
117
+ * Removes a specified shipment and all associated product, gift certificate,
118
+ shipping, and price adjustment line items from a basket.
119
+ It is not allowed to remove the default shipment.
120
+ */
333
121
  readonly RemoveShipmentFromBasket: "removeShipmentFromBasket";
334
122
  /**
335
- * Updates a shipment for a basket.
336
-
337
- The shipment is initialized with values provided in the body
338
- document and can be updated with further data API calls. Considered from
339
- the body are the following properties if specified:
340
- - the ID
341
- - the shipping address
342
- - the shipping method
343
- - gift boolean flag
344
- - gift message
345
- - custom properties
346
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateShipmentForBasket` endpoint.
347
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateShipmentForBasket| Salesforce Developer Center} for more information about the API endpoint.
348
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updateshipmentforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
349
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
350
- */
123
+ * Updates a shipment for a basket.
124
+
125
+ The shipment is initialized with values provided in the body
126
+ document and can be updated with further data API calls. Considered from
127
+ the body are the following properties if specified:
128
+ - the ID
129
+ - the shipping address
130
+ - the shipping method
131
+ - gift boolean flag
132
+ - gift message
133
+ - custom properties
134
+ */
351
135
  readonly UpdateShipmentForBasket: "updateShipmentForBasket";
352
136
  /**
353
137
  * Sets a shipping address of a specific shipment of a basket.
354
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateShippingAddressForShipment` endpoint.
355
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateShippingAddressForShipment| Salesforce Developer Center} for more information about the API endpoint.
356
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updateshippingaddressforshipment | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
357
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
358
138
  */
359
139
  readonly UpdateShippingAddressForShipment: "updateShippingAddressForShipment";
360
140
  /**
361
141
  * Sets a shipping method to a specific shipment of a basket.
362
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateShippingMethodForShipment` endpoint.
363
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=updateShippingMethodForShipment| Salesforce Developer Center} for more information about the API endpoint.
364
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#updateshippingmethodforshipment | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
365
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
366
142
  */
367
143
  readonly UpdateShippingMethodForShipment: "updateShippingMethodForShipment";
368
144
  /**
369
145
  * This method allows you to apply external taxation data to an existing basket to be able to pass tax rates and optional values for all taxable line items. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
370
- * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addTaxesForBasket` endpoint.
371
- * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=addTaxesForBasket| Salesforce Developer Center} for more information about the API endpoint.
372
- * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#addtaxesforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
373
- * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
374
146
  */
375
147
  readonly AddTaxesForBasket: "addTaxesForBasket";
376
148
  };
377
- /** Mutation for Shopper Baskets. */
378
- export declare type ShopperBasketsMutation = (typeof ShopperBasketsMutations)[keyof typeof ShopperBasketsMutations];
149
+ /**
150
+ * Type for Shopper Baskets Mutation.
151
+ * @group ShopperBaskets
152
+ * @category Mutation
153
+ */
154
+ export type ShopperBasketsMutation = (typeof ShopperBasketsMutations)[keyof typeof ShopperBasketsMutations];
155
+ /**
156
+ * Mutation hook for Shopper Baskets.
157
+ * @group ShopperBaskets
158
+ * @category Mutation
159
+ */
379
160
  export declare function useShopperBasketsMutation<Mutation extends ShopperBasketsMutation>(mutation: Mutation): UseMutationResult<DataType<Client[Mutation]>, unknown, Argument<Client[Mutation]>>;
380
161
  export {};
381
162
  //# sourceMappingURL=mutation.d.ts.map