XM

Remove Item from Cart

Path:

PATCH https://{baseurl}/api-cart/cart/{cartId}/item/{lineItemId}

While shopping, users frequently add or remove items from their cart. This API enables your customers to remove of an item from the cart, anytime before the billing.

Headers

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

Consumes

  • application/json

Produces

  • application/json

Parameters

Type : path

Name : The lineItemId to be removed and the cart ID from the Add Items to Cart or Retrieve Cart by userAuthToken API).

Required: true

Sample Request

Path:

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

Response

Suc Code: 200

Message: OK

{
"_id": "607f8a8f0118960009a8e6ee",
"deleted": false,
"registeredUser": true,
"cartId": 1475,
"items": [
{
"price": {
"discount": {
"discountAmount": 0,
"price": 0,
"promosApplied": []
},
"sale": 0,
"base": 900,
"currency": "USD"
},
"sample": false,
"discountedQuantity": 0,
"group": [
"123123123123123213212222"
],
"weightUnit": "lb",
"isPickup": false,
"createdAt": "2021-04-21T02:14:38.620Z",
"updatedAt": "2021-04-21T17:52:54.081Z",
"_id": "607f8a8f0118960009a8e6ef",
"itemId": 1000000051,
"quantity": 2,
"priceListId": 100269,
"sku": "1538910",
"taxCode": "PH060771",
"title": "Luminous Cushion Lagoon",
"weight": 1,
"lineItemId": 1,
"attributeTotalPrice": 0,
"totalPrice": {
"currency": "USD",
"amount": 1800
},
"attributes": [],
"id": "607f8a8f0118960009a8e6ef"
},
{
"price": {
"discount": {
"discountAmount": 0,
"price": 0,
"promosApplied": []
},
"sale": 48,
"base": 148,
"currency": "USD"
},
"sample": false,
"discountedQuantity": 0,
"group": [
"123123123123123213212222"
],
"weightUnit": "lb",
"isPickup": false,
"createdAt": "2021-04-21T02:14:38.620Z",
"updatedAt": "2021-04-21T17:52:54.081Z",
"_id": "607f8a8f0118960009a8e6f0",
"itemId": 1000000052,
"quantity": 2,
"priceListId": 100269,
"sku": "1583908",
"taxCode": "PH060771",
"title": "Embellished Pillow Pink",
"weight": 1,
"lineItemId": 2,
"attributeTotalPrice": 0,
"totalPrice": {
"currency": "USD",
"amount": 96
},
"attributes": [],
"id": "607f8a8f0118960009a8e6f0"
}
],
"userId": "600a56593245200007982fac",
"allPromosApplied": [],
"attributes": [],
"createdAt": "2021-04-21T02:14:39.048Z",
"updatedAt": "2021-04-21T17:52:54.102Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 1896
},
"quantity": 4,
"errors": {
"inventory": [],
"price": [],
"promo": []
}
}

Response Code: 404

Message: Not found

Description: You will see this error when the cart ID doesn't exist in the system.

{
"code": "CART_NOT_FOUND",
"message": "Cart not found."
}

Response Code: 400

Message: Request validation

Description: You will see this error when the cart ID is lesser or greater than 24 characters.

{
"code": "REQUEST_VALIDATION",
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
}

Response Code: 400

Message: Bad request

Description: You will see this error when the requested cart is already empty.

{
"code": "EMPTY_CART_ERROR",
"message": "The cart is already empty."
}

Changelog

  • June - 2021

  • May - 2021

  • April - 2021

  • July - 2020 First updated