XM

Remove Item from Cart

Path:

PATCH /cart/{cartId}/item/{lineItemId}

While shopping, users frequently add or remove items from their cart. This API is triggered when a user removes an item from the cart. At any given point, the cart is maintained up-to-date through the PATCH /cart/{cartId}/items (update cart) API.

Headers

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : path

Name : cartID and lineItemId

Required: true

Sample Request

https://{baseurl}/api-cart/cart/5f13883765bc750008b58293/item/1

Response

Response Code: 200

Message: OK

{
"_id": "5f13883765bc750008b58293",
"deleted": false,
"registeredUser": false,
"cartId": 1534,
"items": [],
"userId": "5f138820708ffb0007e609b0",
"allPromosApplied": [],
"createdAt": "2020-07-18T23:39:35.978Z",
"updatedAt": "2020-07-18T23:46:13.408Z",
"__v": 0,
"totalAmount": {
"currency": "",
"amount": 0
},
"quantity": 0,
"errors": {
"inventory": [],
"price": [],
"promo": []
}
}

Response Code: 400

Message: Bad Request - Cart is Already Empty

Response Code: 404

Message: Cart Not Found

‚Äč

Error Code: 403

Message: Forbidden

Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

{
"message": "Forbidden"
}

Change Log

  • June - 2021

  • July - 2020 First updated