Copy/Move All Items to another Basket

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

ScenarioOutcomeExpected behaviourStatus CodeResponse
1A user wants to copy over items from their primary basket to a wishlist basket.SuccessThe items are copied over from the source to the target basket.200ModifyBasketItemsResponse
2A user wants to move over items from their primary basket to a wishlist basket.SuccessThe items are moved over from the source to the target basket. The source (primary) should have it’s basket emptied.200ModifyBasketItemsResponse
3A user wants to move over items from a wishlist basket to a primary basket.SuccessThe items are moved over from the source to the target basket. The source (wishlist) should be removed.200ModifyBasketItemsResponse

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"
}
Go to Top