@salesforce/commerce-sdk-react 1.0.0-preview.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 (143) hide show
  1. package/.eslintrc.js +10 -0
  2. package/CHANGELOG.md +35 -0
  3. package/LICENSE +14 -0
  4. package/README.md +327 -0
  5. package/auth/index.d.ts +220 -0
  6. package/auth/index.js +472 -0
  7. package/auth/storage.d.ts +48 -0
  8. package/auth/storage.js +122 -0
  9. package/components/ShopperExperience/Component/index.d.ts +17 -0
  10. package/components/ShopperExperience/Component/index.js +49 -0
  11. package/components/ShopperExperience/Page/index.d.ts +28 -0
  12. package/components/ShopperExperience/Page/index.js +97 -0
  13. package/components/ShopperExperience/Region/index.d.ts +41 -0
  14. package/components/ShopperExperience/Region/index.js +64 -0
  15. package/components/ShopperExperience/index.d.ts +5 -0
  16. package/components/ShopperExperience/index.js +49 -0
  17. package/components/ShopperExperience/prop-types.d.ts +39 -0
  18. package/components/ShopperExperience/prop-types.js +46 -0
  19. package/components/ShopperExperience/types.d.ts +8 -0
  20. package/components/ShopperExperience/types.js +5 -0
  21. package/components/index.d.ts +2 -0
  22. package/components/index.js +16 -0
  23. package/hooks/ShopperBaskets/cache.d.ts +5 -0
  24. package/hooks/ShopperBaskets/cache.js +351 -0
  25. package/hooks/ShopperBaskets/index.d.ts +3 -0
  26. package/hooks/ShopperBaskets/index.js +27 -0
  27. package/hooks/ShopperBaskets/mutation.d.ts +381 -0
  28. package/hooks/ShopperBaskets/mutation.js +380 -0
  29. package/hooks/ShopperBaskets/query.d.ts +55 -0
  30. package/hooks/ShopperBaskets/query.js +215 -0
  31. package/hooks/ShopperBaskets/queryKeyHelpers.d.ts +72 -0
  32. package/hooks/ShopperBaskets/queryKeyHelpers.js +49 -0
  33. package/hooks/ShopperContexts/cache.d.ts +5 -0
  34. package/hooks/ShopperContexts/cache.js +45 -0
  35. package/hooks/ShopperContexts/index.d.ts +3 -0
  36. package/hooks/ShopperContexts/index.js +27 -0
  37. package/hooks/ShopperContexts/mutation.d.ts +35 -0
  38. package/hooks/ShopperContexts/mutation.js +68 -0
  39. package/hooks/ShopperContexts/query.d.ts +15 -0
  40. package/hooks/ShopperContexts/query.js +59 -0
  41. package/hooks/ShopperContexts/queryKeyHelpers.d.ts +30 -0
  42. package/hooks/ShopperContexts/queryKeyHelpers.js +25 -0
  43. package/hooks/ShopperCustomers/cache.d.ts +5 -0
  44. package/hooks/ShopperCustomers/cache.js +387 -0
  45. package/hooks/ShopperCustomers/index.d.ts +3 -0
  46. package/hooks/ShopperCustomers/index.js +27 -0
  47. package/hooks/ShopperCustomers/mutation.d.ts +163 -0
  48. package/hooks/ShopperCustomers/mutation.js +203 -0
  49. package/hooks/ShopperCustomers/query.d.ts +115 -0
  50. package/hooks/ShopperCustomers/query.js +489 -0
  51. package/hooks/ShopperCustomers/queryKeyHelpers.d.ts +142 -0
  52. package/hooks/ShopperCustomers/queryKeyHelpers.js +91 -0
  53. package/hooks/ShopperExperience/index.d.ts +2 -0
  54. package/hooks/ShopperExperience/index.js +16 -0
  55. package/hooks/ShopperExperience/query.d.ts +31 -0
  56. package/hooks/ShopperExperience/query.js +104 -0
  57. package/hooks/ShopperExperience/queryKeyHelpers.d.ts +38 -0
  58. package/hooks/ShopperExperience/queryKeyHelpers.js +31 -0
  59. package/hooks/ShopperGiftCertificates/index.d.ts +2 -0
  60. package/hooks/ShopperGiftCertificates/index.js +16 -0
  61. package/hooks/ShopperGiftCertificates/query.d.ts +15 -0
  62. package/hooks/ShopperGiftCertificates/query.js +70 -0
  63. package/hooks/ShopperGiftCertificates/queryKeyHelpers.d.ts +29 -0
  64. package/hooks/ShopperGiftCertificates/queryKeyHelpers.js +25 -0
  65. package/hooks/ShopperLogin/cache.d.ts +3 -0
  66. package/hooks/ShopperLogin/cache.js +33 -0
  67. package/hooks/ShopperLogin/index.d.ts +3 -0
  68. package/hooks/ShopperLogin/index.js +27 -0
  69. package/hooks/ShopperLogin/mutation.d.ts +119 -0
  70. package/hooks/ShopperLogin/mutation.js +138 -0
  71. package/hooks/ShopperLogin/query.d.ts +45 -0
  72. package/hooks/ShopperLogin/query.js +176 -0
  73. package/hooks/ShopperLogin/queryKeyHelpers.d.ts +53 -0
  74. package/hooks/ShopperLogin/queryKeyHelpers.js +43 -0
  75. package/hooks/ShopperOrders/cache.d.ts +5 -0
  76. package/hooks/ShopperOrders/cache.js +54 -0
  77. package/hooks/ShopperOrders/index.d.ts +3 -0
  78. package/hooks/ShopperOrders/index.js +27 -0
  79. package/hooks/ShopperOrders/mutation.d.ts +54 -0
  80. package/hooks/ShopperOrders/mutation.js +83 -0
  81. package/hooks/ShopperOrders/query.d.ts +37 -0
  82. package/hooks/ShopperOrders/query.js +139 -0
  83. package/hooks/ShopperOrders/queryKeyHelpers.d.ts +50 -0
  84. package/hooks/ShopperOrders/queryKeyHelpers.js +37 -0
  85. package/hooks/ShopperProducts/index.d.ts +2 -0
  86. package/hooks/ShopperProducts/index.js +16 -0
  87. package/hooks/ShopperProducts/query.d.ts +47 -0
  88. package/hooks/ShopperProducts/query.js +178 -0
  89. package/hooks/ShopperProducts/queryKeyHelpers.d.ts +55 -0
  90. package/hooks/ShopperProducts/queryKeyHelpers.js +43 -0
  91. package/hooks/ShopperPromotions/index.d.ts +2 -0
  92. package/hooks/ShopperPromotions/index.js +16 -0
  93. package/hooks/ShopperPromotions/query.d.ts +29 -0
  94. package/hooks/ShopperPromotions/query.js +102 -0
  95. package/hooks/ShopperPromotions/queryKeyHelpers.d.ts +38 -0
  96. package/hooks/ShopperPromotions/queryKeyHelpers.js +31 -0
  97. package/hooks/ShopperSearch/index.d.ts +2 -0
  98. package/hooks/ShopperSearch/index.js +16 -0
  99. package/hooks/ShopperSearch/query.d.ts +26 -0
  100. package/hooks/ShopperSearch/query.js +99 -0
  101. package/hooks/ShopperSearch/queryKeyHelpers.d.ts +37 -0
  102. package/hooks/ShopperSearch/queryKeyHelpers.js +31 -0
  103. package/hooks/index.d.ts +18 -0
  104. package/hooks/index.js +188 -0
  105. package/hooks/types.d.ts +128 -0
  106. package/hooks/types.js +5 -0
  107. package/hooks/useAccessToken.d.ts +11 -0
  108. package/hooks/useAccessToken.js +43 -0
  109. package/hooks/useAuthContext.d.ts +9 -0
  110. package/hooks/useAuthContext.js +30 -0
  111. package/hooks/useAuthHelper.d.ts +23 -0
  112. package/hooks/useAuthHelper.js +66 -0
  113. package/hooks/useAuthorizationHeader.d.ts +9 -0
  114. package/hooks/useAuthorizationHeader.js +45 -0
  115. package/hooks/useCommerceApi.d.ts +9 -0
  116. package/hooks/useCommerceApi.js +26 -0
  117. package/hooks/useConfig.d.ts +7 -0
  118. package/hooks/useConfig.js +24 -0
  119. package/hooks/useCustomerId.d.ts +7 -0
  120. package/hooks/useCustomerId.js +38 -0
  121. package/hooks/useCustomerType.d.ts +21 -0
  122. package/hooks/useCustomerType.js +43 -0
  123. package/hooks/useEncUserId.d.ts +9 -0
  124. package/hooks/useEncUserId.js +36 -0
  125. package/hooks/useLocalStorage.d.ts +8 -0
  126. package/hooks/useLocalStorage.js +40 -0
  127. package/hooks/useMutation.d.ts +12 -0
  128. package/hooks/useMutation.js +38 -0
  129. package/hooks/useQuery.d.ts +15 -0
  130. package/hooks/useQuery.js +57 -0
  131. package/hooks/useUsid.d.ts +7 -0
  132. package/hooks/useUsid.js +34 -0
  133. package/hooks/utils.d.ts +32 -0
  134. package/hooks/utils.js +125 -0
  135. package/index.d.ts +5 -0
  136. package/index.js +40 -0
  137. package/package.json +88 -0
  138. package/provider.d.ts +36 -0
  139. package/provider.js +124 -0
  140. package/scripts/build-and-release-docs.js +48 -0
  141. package/scripts/version.js +22 -0
  142. package/utils.d.ts +5 -0
  143. package/utils.js +18 -0
@@ -0,0 +1,381 @@
1
+ import { ApiClients, Argument, DataType } from '../types';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ declare type Client = ApiClients['shopperBaskets'];
4
+ /** Mutations available for Shopper Baskets. */
5
+ export declare const ShopperBasketsMutations: {
6
+ /**
7
+ * Creates a new basket.
8
+
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
+ */
56
+ readonly CreateBasket: "createBasket";
57
+ /**
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.
59
+
60
+ A success response contains the transferred basket.
61
+
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.
70
+ */
71
+ readonly TransferBasket: "transferBasket";
72
+ /**
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
+ */
117
+ readonly MergeBasket: "mergeBasket";
118
+ /**
119
+ * 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
+ */
125
+ readonly DeleteBasket: "deleteBasket";
126
+ /**
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
+ */
134
+ readonly UpdateBasket: "updateBasket";
135
+ /**
136
+ * 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
+ */
142
+ readonly UpdateBillingAddressForBasket: "updateBillingAddressForBasket";
143
+ /**
144
+ * 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
+ */
150
+ readonly AddCouponToBasket: "addCouponToBasket";
151
+ /**
152
+ * 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
+ */
158
+ readonly RemoveCouponFromBasket: "removeCouponFromBasket";
159
+ /**
160
+ * 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
+ */
166
+ readonly UpdateCustomerForBasket: "updateCustomerForBasket";
167
+ /**
168
+ * 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
+ */
174
+ readonly AddGiftCertificateItemToBasket: "addGiftCertificateItemToBasket";
175
+ /**
176
+ * 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
+ */
182
+ readonly RemoveGiftCertificateItemFromBasket: "removeGiftCertificateItemFromBasket";
183
+ /**
184
+ * 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
+ */
190
+ readonly UpdateGiftCertificateItemInBasket: "updateGiftCertificateItemInBasket";
191
+ /**
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
+ */
223
+ readonly AddItemToBasket: "addItemToBasket";
224
+ /**
225
+ * 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
+ */
231
+ readonly RemoveItemFromBasket: "removeItemFromBasket";
232
+ /**
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
+ */
264
+ readonly UpdateItemInBasket: "updateItemInBasket";
265
+ /**
266
+ * 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
+ */
272
+ readonly AddTaxesForBasketItem: "addTaxesForBasketItem";
273
+ /**
274
+ * 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
+ */
280
+ readonly AddPaymentInstrumentToBasket: "addPaymentInstrumentToBasket";
281
+ /**
282
+ * 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
+ */
288
+ readonly RemovePaymentInstrumentFromBasket: "removePaymentInstrumentFromBasket";
289
+ /**
290
+ * 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
+ */
296
+ readonly UpdatePaymentInstrumentInBasket: "updatePaymentInstrumentInBasket";
297
+ /**
298
+ * 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
+ */
304
+ readonly AddPriceBooksToBasket: "addPriceBooksToBasket";
305
+ /**
306
+ * Creates a new shipment for a basket.
307
+
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:
311
+
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
+ */
323
+ readonly CreateShipmentForBasket: "createShipmentForBasket";
324
+ /**
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
+ */
333
+ readonly RemoveShipmentFromBasket: "removeShipmentFromBasket";
334
+ /**
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
+ */
351
+ readonly UpdateShipmentForBasket: "updateShipmentForBasket";
352
+ /**
353
+ * 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
+ */
359
+ readonly UpdateShippingAddressForShipment: "updateShippingAddressForShipment";
360
+ /**
361
+ * 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
+ */
367
+ readonly UpdateShippingMethodForShipment: "updateShippingMethodForShipment";
368
+ /**
369
+ * 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
+ */
375
+ readonly AddTaxesForBasket: "addTaxesForBasket";
376
+ };
377
+ /** Mutation for Shopper Baskets. */
378
+ export declare type ShopperBasketsMutation = (typeof ShopperBasketsMutations)[keyof typeof ShopperBasketsMutations];
379
+ export declare function useShopperBasketsMutation<Mutation extends ShopperBasketsMutation>(mutation: Mutation): UseMutationResult<DataType<Client[Mutation]>, unknown, Argument<Client[Mutation]>>;
380
+ export {};
381
+ //# sourceMappingURL=mutation.d.ts.map