@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,380 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ShopperBasketsMutations = void 0;
7
+ exports.useShopperBasketsMutation = useShopperBasketsMutation;
8
+ var _useMutation = require("../useMutation");
9
+ var _useCommerceApi = _interopRequireDefault(require("../useCommerceApi"));
10
+ var _cache = require("./cache");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ /*
13
+ * Copyright (c) 2023, Salesforce, Inc.
14
+ * All rights reserved.
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
17
+ */
18
+
19
+ /** Mutations available for Shopper Baskets. */
20
+ const ShopperBasketsMutations = {
21
+ /**
22
+ * Creates a new basket.
23
+ 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.
24
+ 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).
25
+ API endpoints allowing further basket modification:
26
+ - customer information: PUT /baskets/\{basketId\}/customer
27
+ - billing address: PUT /baskets/\{basketId\}/billing-address
28
+ - shipments including shipping address and shipping method: POST /baskets/\{basketId\}/shipments
29
+ - product items: POST /baskets/\{basketId\}/items
30
+ - coupon items: POST /baskets/\{basketId\}/coupons
31
+ - gift certificate items: POST /baskets/\{basketId\}/gift-certificates
32
+ - basket taxation: PUT /baskets/\{basketId\}/taxes
33
+ - basket item taxation: PUT /baskets/\{basketId\}/items/\{itemId\}/taxes
34
+ - payment method and card type: POST /baskets/\{basketId\}/payment-instruments
35
+ - custom properties: PATCH /baskets/\{basketId\}
36
+ Related resource means with which resource you can specify the same data after the basket creation.
37
+ Identify the basket using the basketId property, which
38
+ should be integrated into the path of an update request (for example a POST to
39
+ /baskets/\{basketId\}/items).
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
+ The number of baskets which can be created per customer is limited. When a
43
+ basket is created, it is said to be open. It remains open until either an order is created from it
44
+ using a POST to resource /orders, or it is deleted using a DELETE to resource
45
+ /baskets/\{basketId\}. Each customer can have just one open basket.
46
+ Custom properties in the form c_\<CUSTOM_NAME\> are supported. A custom property must correspond to a custom
47
+ attribute (\<CUSTOM_NAME\>) defined for the basket system object, and its value must be valid for that custom
48
+ attribute.
49
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `createBasket` endpoint.
50
+ * @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.
51
+ * @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.
52
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
53
+ */
54
+ CreateBasket: 'createBasket',
55
+ /**
56
+ * 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.
57
+ A success response contains the transferred basket.
58
+ 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:
59
+ - Keep the current shopper's active basket.
60
+ - Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
61
+ - 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.
62
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `transferBasket` endpoint.
63
+ * @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.
64
+ * @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.
65
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
66
+ */
67
+ TransferBasket: 'transferBasket',
68
+ /**
69
+ * 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.
70
+ The following information is merged:
71
+ - custom attributes on the basket and on all copied records
72
+ - product items
73
+ - gift certificate items
74
+ - coupon items
75
+ - shipments
76
+ - ad-hoc price adjustments
77
+ 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):
78
+ - shipment
79
+ - productId
80
+ - option values
81
+ - wishlist reference
82
+ - inventory list id
83
+ - gift flag & message
84
+ - ad-hoc price adjustments
85
+ 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.
86
+ A success response contains the current shopper's active basket. The previous guest shopper's active basket is deleted.
87
+ 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:
88
+ - Transfer the previous shopper's active basket to the current logged-in shopper by calling the `baskets/transfer` endpoint.
89
+ - 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.
90
+ ### before merge
91
+ | Previous Shopper's Basket, SKU: Quantity, Custom Attributes | Current Shopper's Basket, SKU: Quantity, Custom Attributes |
92
+ |-------------------------------------------------------------|-------------------------------------------------------------|
93
+ | 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' |
94
+ ### after merge - (previous shopper's basket is deleted)
95
+ | productItemMergeMode | Current Shopper's Basket - SKU: Quantity, Custom Attributes |
96
+ |----------------------|--------------------------------------------------------------|
97
+ | 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' |
98
+ | 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' |
99
+ | 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' |
100
+ | 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' |
101
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `mergeBasket` endpoint.
102
+ * @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.
103
+ * @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.
104
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
105
+ */
106
+ MergeBasket: 'mergeBasket',
107
+ /**
108
+ * Removes a basket.
109
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `deleteBasket` endpoint.
110
+ * @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.
111
+ * @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.
112
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
113
+ */
114
+ DeleteBasket: 'deleteBasket',
115
+ /**
116
+ * Updates a basket. Only the currency of the basket, source code, the custom
117
+ properties of the basket, and the shipping items will be considered.
118
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateBasket` endpoint.
119
+ * @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.
120
+ * @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.
121
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
122
+ */
123
+ UpdateBasket: 'updateBasket',
124
+ /**
125
+ * Sets the billing address of a basket.
126
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateBillingAddressForBasket` endpoint.
127
+ * @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.
128
+ * @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.
129
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
130
+ */
131
+ UpdateBillingAddressForBasket: 'updateBillingAddressForBasket',
132
+ /**
133
+ * Adds a coupon to an existing basket.
134
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addCouponToBasket` endpoint.
135
+ * @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.
136
+ * @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.
137
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
138
+ */
139
+ AddCouponToBasket: 'addCouponToBasket',
140
+ /**
141
+ * Removes a coupon from the basket.
142
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeCouponFromBasket` endpoint.
143
+ * @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.
144
+ * @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.
145
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
146
+ */
147
+ RemoveCouponFromBasket: 'removeCouponFromBasket',
148
+ /**
149
+ * Sets customer information for an existing basket.
150
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateCustomerForBasket` endpoint.
151
+ * @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.
152
+ * @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.
153
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
154
+ */
155
+ UpdateCustomerForBasket: 'updateCustomerForBasket',
156
+ /**
157
+ * Adds a gift certificate item to an existing basket.
158
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addGiftCertificateItemToBasket` endpoint.
159
+ * @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.
160
+ * @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.
161
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
162
+ */
163
+ AddGiftCertificateItemToBasket: 'addGiftCertificateItemToBasket',
164
+ /**
165
+ * Deletes a gift certificate item from an existing basket.
166
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeGiftCertificateItemFromBasket` endpoint.
167
+ * @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.
168
+ * @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.
169
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
170
+ */
171
+ RemoveGiftCertificateItemFromBasket: 'removeGiftCertificateItemFromBasket',
172
+ /**
173
+ * Updates a gift certificate item of an existing basket.
174
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateGiftCertificateItemInBasket` endpoint.
175
+ * @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.
176
+ * @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.
177
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
178
+ */
179
+ UpdateGiftCertificateItemInBasket: 'updateGiftCertificateItemInBasket',
180
+ /**
181
+ * Adds new items to a basket. The added items are associated with the
182
+ specified shipment. If no shipment id is specified, the added items are associated with the default shipment.
183
+ Considered values from the request body, for each item are:
184
+ - productId: a valid product ID. This is the ID of the product to be added to the basket. If the
185
+ product is already in the basket, the API either increments the quantity of the existing product line item or
186
+ creates a new product line item, based on the site preference 'Add Product Behavior'. For option products and
187
+ product bundles containing variation masters, the API creates a new product line item regardless of the site
188
+ preference.
189
+ - shipmentId: a valid shipment ID (optional). This is the ID of the shipment in which the product item
190
+ is created.
191
+ - quantity: a number between 0.01 and 999. This is the quantity of the product to order.
192
+ - inventoryId: a valid inventory ID (optional). This is the ID of the inventory from which the item is
193
+ allocated.
194
+ - bonusDiscountLineItemId: a valid bonus discount line item ID (optional). This is the ID of the
195
+ bonus discount line item for which the added product is a selected bonus product.
196
+ - optionItems/optionValueId: a valid option value ID. This is an option value for an option item of
197
+ an option product. This is only possible if the product item is an option
198
+ product. To set option values, you must specify a collection of option items in the optionItems
199
+ property. These option items must contain optionId and optionValueId. Also,
200
+ the values you specify must be valid for the option product that this product item represents. Otherwise, the
201
+ server throws an InvalidProductOptionItemException or an
202
+ InvalidProductOptionValueItemException.
203
+ - custom properties in the form c_\<CUSTOM_NAME\>: the custom property must correspond to a custom
204
+ attribute (\<CUSTOM_NAME\>) defined for ProductLineItem. The value of this property must be valid for the
205
+ type of custom attribute defined for ProductLineItem.
206
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addItemToBasket` endpoint.
207
+ * @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.
208
+ * @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.
209
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
210
+ */
211
+ AddItemToBasket: 'addItemToBasket',
212
+ /**
213
+ * Removes a product item from the basket.
214
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeItemFromBasket` endpoint.
215
+ * @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.
216
+ * @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.
217
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
218
+ */
219
+ RemoveItemFromBasket: 'removeItemFromBasket',
220
+ /**
221
+ * Updates an item in a basket. The
222
+ following values in the request body are considered by the server:
223
+ - productId: a valid product ID. The purpose of this
224
+ value is to exchange a variation of a variation product.
225
+ - shipmentId: a valid shipment ID. The purpose of
226
+ this value is to move a product item to another shipment.
227
+ - quantity: a number between 0 and 999. The purpose of
228
+ this value is to change quantity of the product item. If quantity is 0,
229
+ the product item is removed.
230
+ - optionItems/optionValueId: a valid option value
231
+ ID. The purpose of this value is to exchange an option value for an
232
+ option item of an option product.
233
+ This is only possible if the product item is an option product. To change
234
+ option values a collection of option items to be changed need to be
235
+ provided in property optionItems. Those
236
+ optionItems need to contain optionId
237
+ and optionValueId. The provided values must be valid
238
+ for the option product that this product item represents. Otherwise
239
+ InvalidProductOptionItemException or
240
+ InvalidProductOptionValueItemException will be thrown.
241
+ custom properties c_\<CUSTOM_NAME\>: a
242
+ value corresponding to the type defined for custom attribute
243
+ \<CUSTOM_NAME\> of ProductLineItem. The purpose of this value is to
244
+ add or change the value of a custom attribute defined for
245
+ ProductLineItem.
246
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateItemInBasket` endpoint.
247
+ * @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.
248
+ * @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.
249
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
250
+ */
251
+ UpdateItemInBasket: 'updateItemInBasket',
252
+ /**
253
+ * 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.
254
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addTaxesForBasketItem` endpoint.
255
+ * @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.
256
+ * @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.
257
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
258
+ */
259
+ AddTaxesForBasketItem: 'addTaxesForBasketItem',
260
+ /**
261
+ * Adds a payment instrument to a basket.
262
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addPaymentInstrumentToBasket` endpoint.
263
+ * @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.
264
+ * @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.
265
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
266
+ */
267
+ AddPaymentInstrumentToBasket: 'addPaymentInstrumentToBasket',
268
+ /**
269
+ * Removes a payment instrument of a basket.
270
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removePaymentInstrumentFromBasket` endpoint.
271
+ * @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.
272
+ * @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.
273
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
274
+ */
275
+ RemovePaymentInstrumentFromBasket: 'removePaymentInstrumentFromBasket',
276
+ /**
277
+ * Updates payment instrument of an existing basket.
278
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updatePaymentInstrumentInBasket` endpoint.
279
+ * @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.
280
+ * @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.
281
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
282
+ */
283
+ UpdatePaymentInstrumentInBasket: 'updatePaymentInstrumentInBasket',
284
+ /**
285
+ * This method allows you to put an array of priceBookIds to an existing basket, which will be used for basket calculation.
286
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addPriceBooksToBasket` endpoint.
287
+ * @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.
288
+ * @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.
289
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
290
+ */
291
+ AddPriceBooksToBasket: 'addPriceBooksToBasket',
292
+ /**
293
+ * Creates a new shipment for a basket.
294
+ The created shipment is initialized with values provided in the body
295
+ document and can be updated with further data API calls. Considered from
296
+ the body are the following properties if specified:
297
+ - the ID
298
+ - the shipping address
299
+ - the shipping method
300
+ - gift boolean flag
301
+ - gift message
302
+ - custom properties
303
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `createShipmentForBasket` endpoint.
304
+ * @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.
305
+ * @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.
306
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
307
+ */
308
+ CreateShipmentForBasket: 'createShipmentForBasket',
309
+ /**
310
+ * Removes a specified shipment and all associated product, gift certificate,
311
+ shipping, and price adjustment line items from a basket.
312
+ It is not allowed to remove the default shipment.
313
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `removeShipmentFromBasket` endpoint.
314
+ * @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.
315
+ * @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.
316
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
317
+ */
318
+ RemoveShipmentFromBasket: 'removeShipmentFromBasket',
319
+ /**
320
+ * Updates a shipment for a basket.
321
+ The shipment is initialized with values provided in the body
322
+ document and can be updated with further data API calls. Considered from
323
+ the body are the following properties if specified:
324
+ - the ID
325
+ - the shipping address
326
+ - the shipping method
327
+ - gift boolean flag
328
+ - gift message
329
+ - custom properties
330
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateShipmentForBasket` endpoint.
331
+ * @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.
332
+ * @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.
333
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
334
+ */
335
+ UpdateShipmentForBasket: 'updateShipmentForBasket',
336
+ /**
337
+ * Sets a shipping address of a specific shipment of a basket.
338
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateShippingAddressForShipment` endpoint.
339
+ * @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.
340
+ * @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.
341
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
342
+ */
343
+ UpdateShippingAddressForShipment: 'updateShippingAddressForShipment',
344
+ /**
345
+ * Sets a shipping method to a specific shipment of a basket.
346
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `updateShippingMethodForShipment` endpoint.
347
+ * @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.
348
+ * @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.
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
+ UpdateShippingMethodForShipment: 'updateShippingMethodForShipment',
352
+ /**
353
+ * 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.
354
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Baskets `addTaxesForBasket` endpoint.
355
+ * @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.
356
+ * @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.
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
+ AddTaxesForBasket: 'addTaxesForBasket'
360
+ };
361
+
362
+ /** Mutation for Shopper Baskets. */
363
+ exports.ShopperBasketsMutations = ShopperBasketsMutations;
364
+ function useShopperBasketsMutation(mutation) {
365
+ const getCacheUpdates = _cache.cacheUpdateMatrix[mutation];
366
+
367
+ // The `Options` and `Data` types for each mutation are similar, but distinct, and the union
368
+ // type generated from `Client[Mutation]` seems to be too complex for TypeScript to handle.
369
+ // I'm not sure if there's a way to avoid the type assertions in here for the methods that
370
+ // use them. However, I'm fairly confident that they are safe to do, as they seem to be simply
371
+ // re-asserting what we already have.
372
+ const {
373
+ shopperBaskets: client
374
+ } = (0, _useCommerceApi.default)();
375
+ return (0, _useMutation.useMutation)({
376
+ client,
377
+ method: opts => client[mutation](opts),
378
+ getCacheUpdates: getCacheUpdates
379
+ });
380
+ }
@@ -0,0 +1,55 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { ApiClients, ApiQueryOptions, Argument, DataType, NullableParameters } from '../types';
3
+ declare type Client = ApiClients['shopperBaskets'];
4
+ /**
5
+ * Gets a basket.
6
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
7
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
8
+ * @returns A TanStack Query query hook with data from the Shopper Baskets `getBasket` endpoint.
9
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getBasket| Salesforce Developer Center} for more information about the API endpoint.
10
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
11
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
12
+ */
13
+ export declare const useBasket: (apiOptions: NullableParameters<Argument<Client['getBasket']>>, queryOptions?: ApiQueryOptions<Client['getBasket']>) => UseQueryResult<DataType<Client['getBasket']>>;
14
+ /**
15
+ * Gets applicable payment methods for an existing basket considering the open payment amount only.
16
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
17
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
18
+ * @returns A TanStack Query query hook with data from the Shopper Baskets `getPaymentMethodsForBasket` endpoint.
19
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getPaymentMethodsForBasket| Salesforce Developer Center} for more information about the API endpoint.
20
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getpaymentmethodsforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
21
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
22
+ */
23
+ export declare const usePaymentMethodsForBasket: (apiOptions: NullableParameters<Argument<Client['getPaymentMethodsForBasket']>>, queryOptions?: ApiQueryOptions<Client['getPaymentMethodsForBasket']>) => UseQueryResult<DataType<Client['getPaymentMethodsForBasket']>>;
24
+ /**
25
+ * Gets applicable price books for an existing basket.
26
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
27
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
28
+ * @returns A TanStack Query query hook with data from the Shopper Baskets `getPriceBooksForBasket` endpoint.
29
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getPriceBooksForBasket| Salesforce Developer Center} for more information about the API endpoint.
30
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getpricebooksforbasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
31
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
32
+ */
33
+ export declare const usePriceBooksForBasket: (apiOptions: NullableParameters<Argument<Client['getPriceBooksForBasket']>>, queryOptions?: ApiQueryOptions<Client['getPriceBooksForBasket']>) => UseQueryResult<DataType<Client['getPriceBooksForBasket']>>;
34
+ /**
35
+ * Gets the applicable shipping methods for a certain shipment of a basket.
36
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
37
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
38
+ * @returns A TanStack Query query hook with data from the Shopper Baskets `getShippingMethodsForShipment` endpoint.
39
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getShippingMethodsForShipment| Salesforce Developer Center} for more information about the API endpoint.
40
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#getshippingmethodsforshipment | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
41
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
42
+ */
43
+ export declare const useShippingMethodsForShipment: (apiOptions: NullableParameters<Argument<Client['getShippingMethodsForShipment']>>, queryOptions?: ApiQueryOptions<Client['getShippingMethodsForShipment']>) => UseQueryResult<DataType<Client['getShippingMethodsForShipment']>>;
44
+ /**
45
+ * This method gives you the external taxation data set by the PUT taxes API. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
46
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
47
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
48
+ * @returns A TanStack Query query hook with data from the Shopper Baskets `getTaxesFromBasket` endpoint.
49
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=getTaxesFromBasket| Salesforce Developer Center} for more information about the API endpoint.
50
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shopperbaskets.shopperbaskets-1.html#gettaxesfrombasket | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
51
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
52
+ */
53
+ export declare const useTaxesFromBasket: (apiOptions: NullableParameters<Argument<Client['getTaxesFromBasket']>>, queryOptions?: ApiQueryOptions<Client['getTaxesFromBasket']>) => UseQueryResult<DataType<Client['getTaxesFromBasket']>>;
54
+ export {};
55
+ //# sourceMappingURL=query.d.ts.map