You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,39 @@
1
1
# CHANGELOG
2
2
3
+
## v4.2.0
4
+
5
+
### API Versions
6
+
7
+
New APIs:
8
+
- Shopper Configurations
9
+
10
+
| API Name | API Version |
11
+
|----------|-------------|
12
+
| shopper-baskets | 1.9.1 |
13
+
| shopper-baskets | 2.1.1 |
14
+
| shopper-configurations | 1.0.0 |
15
+
| shopper-consents | 1.1.2 |
16
+
| shopper-context | 1.1.2 |
17
+
| shopper-customers | 1.1.2 |
18
+
| shopper-experience | 1.0.9 |
19
+
| shopper-gift-certificates | 1.0.27 |
20
+
| shopper-login | 1.40.0 |
21
+
| shopper-orders | 1.5.1 |
22
+
| shopper-products | 1.0.39 |
23
+
| shopper-promotions | 1.0.37 |
24
+
| shopper-search | 1.5.1 |
25
+
| shopper-seo | 1.0.14 |
26
+
| shopper-stores | 1.0.18 |
27
+
28
+
## v4.1.0 (DEPRECATED)
29
+
30
+
### Enhancements
31
+
32
+
- Use native node fetch available in node 18+ instead of `node-fetch` polyfill [#214](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/214)
33
+
- Support subpath imports for individual APIs and named imports [#219](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/219)
34
+
35
+
NOTE: This release is deprecated. The features introduced in v4.1.0 were experimental and were removed in v4.2.0
Copy file name to clipboardExpand all lines: apis/shopper-baskets-oas-1.9.1/shopper-baskets-oas-v1-public.yaml
+31-8Lines changed: 31 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,12 @@
1
1
openapi: 3.0.3
2
2
info:
3
+
x-api-type: Shopper
4
+
x-api-family: Checkout
3
5
title: Shopper Baskets
4
-
version: v1
6
+
version: 1.9.1
5
7
description: |-
8
+
[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets/shopper-baskets-oas-v1-public.yaml)
9
+
6
10
# API Overview
7
11
8
12
Use the Shopper Baskets API to create a basket in the B2C Commerce system and populate it with all the data required to ready the basket for checkout.
@@ -161,6 +165,8 @@ paths:
161
165
description: Thrown if the shipment with the given shipment ID is unknown.
162
166
content:
163
167
application/problem+json:
168
+
schema:
169
+
$ref: '#/components/schemas/ErrorResponse'
164
170
examples:
165
171
ShipmentNotFound:
166
172
$ref: '#/components/examples/ShipmentNotFound'
@@ -184,30 +190,37 @@ paths:
184
190
description: |-
185
191
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.
186
192
187
-
A success response contains the transferred basket.
193
+
This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
194
+
- `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
195
+
- `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
188
196
189
-
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:
197
+
If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
190
198
- Keep the current shopper's active basket.
191
-
- Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
192
-
- 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.
199
+
- Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
200
+
- Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
201
+
202
+
A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
description: The operation was successful. No current basket was returned because neither the previous nor current shopper had an active basket attached that could be transferred.
211
224
'403':
212
225
description: The call returns this error if no SLAS token for a registered shopper is available.
The call returns this response in either of these cases:
235
+
The call returns this response when the `merge` request parameter is set to `false` and one of the following cases applies:
223
236
- The previous shopper has no active basket.
224
-
- The current shopper has an active basket and the `overrideExisting` query parameter was `false` (default value).
237
+
- The current shopper has an active basket and the `overrideExisting` query parameter is set to `false` (default value).
225
238
content:
226
239
application/json:
227
240
schema:
@@ -239,6 +252,8 @@ paths:
239
252
operationId: mergeBasket
240
253
summary: Merge baskets.
241
254
description: |-
255
+
( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
256
+
242
257
Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
243
258
244
259
The following information is merged:
@@ -3901,6 +3916,14 @@ components:
3901
3916
default: false
3902
3917
type: boolean
3903
3918
example: false
3919
+
merge:
3920
+
name: merge
3921
+
in: query
3922
+
description: "This parameter controls the behavior:\n - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).\n - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.\n\nThe hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown \nin this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).\n\nThere are four possible use cases:\n\na) Guest basket and registered basket exist\nThe guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook \ndw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).\n\nb) Guest basket exists but no registered basket exists\nThe guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook \ndw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).\n\nc) No guest basket exists but a registered basket exists\nThe registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null \npassed to the hook).\n\nd) Neither basket exists\nThe hook dw.order.mergeBasket is not called.\n\nThe API returns the current basket (after executing dw.order.mergeBasket)."
Copy file name to clipboardExpand all lines: apis/shopper-baskets-oas-2.1.1/shopper-baskets-oas-v2-public.yaml
+29-8Lines changed: 29 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,12 @@
1
1
openapi: 3.0.3
2
2
info:
3
+
x-api-type: Shopper
4
+
x-api-family: Checkout
3
5
title: Shopper Baskets
4
-
version: v2
6
+
version: 2.1.1
5
7
description: |-
8
+
[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets-v2/shopper-baskets-oas-v2-public.yaml)
9
+
6
10
# API Overview
7
11
8
12
Shopper Baskets V2 provides all Shopper Basket V1 functionality and adds support for temporary baskets.
@@ -196,27 +200,34 @@ paths:
196
200
description: |-
197
201
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.
198
202
199
-
A success response contains the transferred basket.
203
+
This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
204
+
- `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
205
+
- `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
200
206
201
-
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:
207
+
If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
202
208
- Keep the current shopper's active basket.
203
-
- Merge the previous and current shoppers' baskets by calling the `baskets/merge` endpoint.
204
-
- 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.
209
+
- Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
210
+
- Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
211
+
212
+
A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
description: The operation was successful. No current basket was returned because neither the previous nor current shopper had an active basket attached that could be transferred.
220
231
'403':
221
232
description: The call returns this error if no SLAS token for a registered shopper is available.
( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
264
+
252
265
Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
253
266
254
267
The following information is merged:
@@ -4012,6 +4025,14 @@ components:
4012
4025
default: false
4013
4026
type: boolean
4014
4027
example: false
4028
+
merge:
4029
+
name: merge
4030
+
in: query
4031
+
description: "This parameter controls the behavior: \n - `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).\n - `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.\n\nThe hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown \nin this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).\n\nThere are four possible use cases:\n\na) Guest basket and registered basket exist\nThe guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook \ndw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).\n\nb) Guest basket exists but no registered basket exists\nThe guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook \ndw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).\n\nc) No guest basket exists but a registered basket exists\nThe registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null \npassed to the hook).\n\nd) Neither basket exists\nThe hook dw.order.mergeBasket is not called.\n\nThe API returns the current basket (after executing dw.order.mergeBasket)."
0 commit comments