Update item quantity in cart

Description

This service updates the quantity of a specific item already in the cart for a given mileage activity.


Request

Restrictions

This service requires an authenticated user. The logged-in consumer or operator must have the necessary permissions enabled for this service.

Endpoint

PUT https://<server-url>/api/v4/mileage/{activity_code}/cart/items/{item_code}

Path Parameters

Parameter
Type
Description

activity_code

String

The unique code for the mileage activity.

item_code

String

The unique code of the item in the cart to update.

Parameters

Parameter
Location
Description

touchpoint

Query / Header

The identifier for the touchpoint. Use Thalamus-Touchpoint for the header.

token

Query / Header

The authentication token for the API session. Use Thalamus-Token for the header.

Full URL Example

Request Body

The body of the request must specify the new quantity for the item.

Field
Type
Description

quantity

Integer

The new number of units for the item. A quantity of 0 will remove the item from the cart.

JSON


Response

✅ Successful Response: 201 Created

The item's quantity was successfully updated. The response returns the updated session context, reflecting the new cartTotal and accountBalance in the personStatus object.

JSON

❌ Unsuccessful Response: 400 Bad Request

Returned if the item is invalid (e.g., requested quantity exceeds stock) or the consumer has insufficient points for the new total.

JSON

❌ Unsuccessful Response: 404 Not Found

Returned if the specified activity_code or item_code does not exist in the cart.

JSON

Last updated

Was this helpful?