Skip to content

Commit 49931c7

Browse files
Release v4.2.0 (#256)
* update APIs and docs * update CHANGELOG
1 parent ac1728d commit 49931c7

File tree

108 files changed

+3132
-1133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+3132
-1133
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# CHANGELOG
22

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
36+
337
## v4.0.1
438

539
### Bug Fixes

apis/shopper-baskets-oas-1.9.0/.metadata.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

apis/shopper-baskets-oas-1.9.0/exchange.json renamed to apis/shopper-baskets-oas-1.9.1/exchange.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Shopper Baskets OAS",
44
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
55
"assetId": "shopper-baskets-oas",
6-
"version": "1.9.0",
6+
"version": "1.9.1",
77
"classifier": "oas",
88
"tags": [],
99
"descriptorVersion": "1.0.0",

apis/shopper-baskets-oas-1.9.0/shopper-baskets-oas-v1-public.yaml renamed to apis/shopper-baskets-oas-1.9.1/shopper-baskets-oas-v1-public.yaml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
openapi: 3.0.3
22
info:
3+
x-api-type: Shopper
4+
x-api-family: Checkout
35
title: Shopper Baskets
4-
version: v1
6+
version: 1.9.1
57
description: |-
8+
[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets/shopper-baskets-oas-v1-public.yaml)
9+
610
# API Overview
711
812
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:
161165
description: Thrown if the shipment with the given shipment ID is unknown.
162166
content:
163167
application/problem+json:
168+
schema:
169+
$ref: '#/components/schemas/ErrorResponse'
164170
examples:
165171
ShipmentNotFound:
166172
$ref: '#/components/examples/ShipmentNotFound'
@@ -184,30 +190,37 @@ paths:
184190
description: |-
185191
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.
186192
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.
188196
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:
190198
- 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.
193203
operationId: transferBasket
194204
summary: Transfer an existing basket.
195205
security:
196206
- ShopperToken:
197207
- sfcc.shopper-baskets-orders.rw
198208
parameters:
199209
- $ref: '#/components/parameters/overrideExisting'
210+
- $ref: '#/components/parameters/merge'
200211
- $ref: '#/components/parameters/locale'
201212
responses:
202213
'200':
203-
description: The transferred basket.
214+
description: The current basket.
204215
content:
205216
application/json:
206217
schema:
207218
$ref: '#/components/schemas/Basket'
208219
examples:
209220
BasketPost:
210221
$ref: '#/components/examples/examples-BasketPost'
222+
'204':
223+
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.
211224
'403':
212225
description: The call returns this error if no SLAS token for a registered shopper is available.
213226
content:
@@ -219,9 +232,9 @@ paths:
219232
$ref: '#/components/examples/ForbiddenMissingPrevCustomerInfo'
220233
'409':
221234
description: |-
222-
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:
223236
- 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).
225238
content:
226239
application/json:
227240
schema:
@@ -239,6 +252,8 @@ paths:
239252
operationId: mergeBasket
240253
summary: Merge baskets.
241254
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+
242257
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.
243258
244259
The following information is merged:
@@ -3901,6 +3916,14 @@ components:
39013916
default: false
39023917
type: boolean
39033918
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)."
3923+
schema:
3924+
default: false
3925+
type: boolean
3926+
example: false
39043927
createDestinationBasket:
39053928
name: createDestinationBasket
39063929
in: query

apis/shopper-baskets-oas-2.1.0/.metadata.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

apis/shopper-baskets-oas-2.1.0/exchange.json renamed to apis/shopper-baskets-oas-2.1.1/exchange.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Shopper Baskets OAS",
44
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
55
"assetId": "shopper-baskets-oas",
6-
"version": "2.1.0",
6+
"version": "2.1.1",
77
"classifier": "oas",
88
"tags": [],
99
"descriptorVersion": "1.0.0",

apis/shopper-baskets-oas-2.1.0/shopper-baskets-oas-v2-public.yaml renamed to apis/shopper-baskets-oas-2.1.1/shopper-baskets-oas-v2-public.yaml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
openapi: 3.0.3
22
info:
3+
x-api-type: Shopper
4+
x-api-family: Checkout
35
title: Shopper Baskets
4-
version: v2
6+
version: 2.1.1
57
description: |-
8+
[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets-v2/shopper-baskets-oas-v2-public.yaml)
9+
610
# API Overview
711
812
Shopper Baskets V2 provides all Shopper Basket V1 functionality and adds support for temporary baskets.
@@ -196,27 +200,34 @@ paths:
196200
description: |-
197201
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.
198202
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.
200206
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:
202208
- 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.
205213
operationId: transferBasket
206214
summary: Transfer an existing basket.
207215
parameters:
208216
- $ref: '#/components/parameters/overrideExisting'
217+
- $ref: '#/components/parameters/merge'
209218
- $ref: '#/components/parameters/locale'
210219
responses:
211220
'200':
212-
description: The transferred basket.
221+
description: The current basket.
213222
content:
214223
application/json:
215224
schema:
216225
$ref: '#/components/schemas/Basket'
217226
examples:
218227
BasketPost:
219228
$ref: '#/components/examples/examples-BasketPost'
229+
'204':
230+
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.
220231
'403':
221232
description: The call returns this error if no SLAS token for a registered shopper is available.
222233
content:
@@ -228,9 +239,9 @@ paths:
228239
$ref: '#/components/examples/ForbiddenMissingPrevCustomerInfo'
229240
'409':
230241
description: |-
231-
The call returns this response in either of these cases:
242+
The call returns this response when the `merge` request parameter is set to `false` and one of the following cases applies:
232243
- The previous shopper has no active basket.
233-
- The current shopper has an active basket and the `overrideExisting` query parameter was `false` (default value).
244+
- The current shopper has an active basket and the `overrideExisting` query parameter is set to `false` (default value).
234245
content:
235246
application/json:
236247
schema:
@@ -249,6 +260,8 @@ paths:
249260
/organizations/{organizationId}/baskets/actions/merge:
250261
post:
251262
description: |-
263+
( 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+
252265
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.
253266
254267
The following information is merged:
@@ -4012,6 +4025,14 @@ components:
40124025
default: false
40134026
type: boolean
40144027
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)."
4032+
schema:
4033+
default: false
4034+
type: boolean
4035+
example: false
40154036
createDestinationBasket:
40164037
name: createDestinationBasket
40174038
in: query
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"main": "shopper-configurations-oas-v1-public.yaml",
3+
"name": "Shopper Configurations OAS",
4+
"groupId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
5+
"assetId": "shopper-configurations-oas",
6+
"version": "1.0.0",
7+
"classifier": "oas",
8+
"tags": [],
9+
"descriptorVersion": "1.0.0",
10+
"organizationId": "893f605e-10e2-423a-bdb4-f952f56eb6d8",
11+
"apiVersion": "v1"
12+
}

0 commit comments

Comments
 (0)