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