Remove item from cart

Description

This service removes a specific item from the cart for a given mileage activity.


Request

Restrictions

This service requires an authenticated user and can only be called after a successful consumer login.

Endpoint

DELETE 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 (e.g., "MPOINTS").

item_code

String

The unique code of the item to remove from the cart.

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

https://<server-url>/api/v4/mileage/MPOINTS/cart/items/CD?touchpoint=test&token=...

Request Body

This request does not have a body.


Response

✅ Successful Response: 200 OK

The item was successfully removed from the cart. The response returns the updated session context, reflecting the new cart total in the personStatus object.

JSON

{
  "context": {
    "links": [
      {
        "ref": "home",
        "href": "http://localhost:8080/thalamus/api/v1/people/home"
      },
      {
        "ref": "profile",
        "href": "http://localhost:8080/thalamus/api/v1/people/profile"
      },
      {
        "ref": "consumer",
        "href": "http://localhost:8080/thalamus/api/v1/people/consumer"
      }
    ],
    "activities": [
      {
        "links": [],
        "code": "MPOINTS",
        "name": "ML Points",
        "message": "This is a message",
        "type": "MILEAGE",
        "personStatus": {
          "accountBalance": 100,
          "accountLeft": 100,
          "cartTotal": 0,
          "quantityItemsInCart": 0
        }
      }
    ],
    "simpleProfile": {
      "firstname": "test",
      "lastname": "test",
      "email": "[email protected]"
    }
  }
}

❌ Unsuccessful Response: 400 Bad Request

Returned if the provided item_code has an invalid format.

JSON

{
  "errors": {
    "item": "InvalidID"
  }
}

❌ Unsuccessful Response: 404 Not Found

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

JSON

{
  "errors": {
    "error.message": "NOT_FOUND",
    "item": "AnyItemToDelete"
  }
}

Last updated

Was this helpful?