Service URLs
- Copy: POST /baskets/manager/copy
- Move: POST /baskets/manager/move
Request Body:
ModifyBasketItemsRequest
sourceBasketReference – String – the basket reference of the source basket to copy/move the items from.
targetBasketReference – String – The basketReference of the basket to copy/move the items to.
Response Body:
IModifyBasketItemsResponse
sourceLocation – String – location of the URL for the destination basket
destinationLocation – String – location of the URL for the destination basket
Remarks:
Copies all Line Items from the source basket (BasketReference) to the Basket identified by the targetBasketReference. If the Copy operation is specified, the source basket is retained with all its items. If the Move operation is specified, all items of the source basket are deleted and in all cases except the PRIMARY Basket, the source basket is also deleted.
Scenarios
Scenario | Outcome | Expected behaviour | Status Code | Response | |
---|---|---|---|---|---|
1 | A user wants to copy over items from their primary basket to a wishlist basket. | Success | The items are copied over from the source to the target basket. | 200 | ModifyBasketItemsResponse |
2 | A user wants to move over items from their primary basket to a wishlist basket. | Success | The items are moved over from the source to the target basket. The source (primary) should have it’s basket emptied. | 200 | ModifyBasketItemsResponse |
3 | A user wants to move over items from a wishlist basket to a primary basket. | Success | The items are moved over from the source to the target basket. The source (wishlist) should be removed. | 200 | ModifyBasketItemsResponse |
Example Request
POST /baskets/manager/copy
{
"sourceBasketReference": "WWNOGKK4FVCOZJMKGDE6ZSIQA4",
"targetBasketReference": "PRIMARY"
}
Example Response
{
"sourceBasketLocation": "http://localhost:8080/WebRestApi/rest/baskets/WWNOGKK4FVCOZJMKGDE6ZSIQA4",
"destinationBasketLocation": "http://localhost:8080/WebRestApi/rest/baskets/PRIMARY"
}