Update an Items Quantity

Service URL: PATCH /baskets/{basketReference}/items/{lineNumber}/quantity[?returnBasket=true]

Tokens:

basketReference – The basket reference of the basket to add the item to, or can be ‘PRIMARY’ to add to the PRIMARY basket.

lineNumber – The line number to update in the basket

Parameters:

IUpdateBasketItemQuantityRequest:

returnBasket – Boolean – If true the updated basket is returned – Defaults to false

Request Body:

quantity – Integer – The new quantity for the line

Response Body:

BasketResponse

basket – IBasket – The basket associated with the given reference

basketReference – String – the reference of the basket

basketType – String – the type of the basket

basketDescription – String – the description of the basket

basketResponseCode – String – A specific basket code to indict whether the basket was implicitly created by the server.

basketStatus – String – the status of the basket. Fresh baskets have the status NEW. Baskets in progress have the status of IN_PROGRESS. Baskets will have been submitted to retail processing have the status SUBMITTED.

Remarks:

Updates the quantity on an existing line in the basket. The line number is used to identify which line to update. Setting the quantity to zero will result in the line being deleted.

Scenarios

 ScenarioOutcomeExpected behaviourStatus CodeResponse
1Service is given a valid lineNumber and basketReference .ReturnBasket is not setSuccessThe basket items quantity is updated.200200 Success ok
2Service is given a valid lineNumber and basketReference. ReturnBasket is set to trueSuccessThe basket items quantity is updated. The basket is returned to the client200IBasketResponse: basket

Example Request:

PATCH: http://localhost:8080/WebRestApi/rest/baskets/PRIMARY/items/1/quantity 2
Content-Type: application/json 

{ 
  "quantity" : "1" 
}

Example Response:

1200 OK
Go to Top