Remove Cart Item
You can easily remove items from the Cart. A successful Cart item removal request returns the cart items.
DELETE
Remove Item from Cart
https://api.moltin.com/v2/carts/:reference/items/:id
Parameters
Path parameters
Name | Required | Type | Description |
---|---|---|---|
reference | Required | string | A unique reference for the cart created by you. |
id | Required | string | The unique identifier for this cart item. |
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. |
Request Examples
Curl
curl -X DELETE https://api.moltin.com/v2/carts/:reference/items/:id \
-H "Authorization: Bearer XXXX"
JavaScript SDK
const reference = "XXXX";
// Where `EPCC` is an authenticated client
await Moltin.Cart(reference).RemoveItem(itemId)();
Response Example
200 OK
{
"data": [],
"meta": {
"display_price": {
"with_tax": {
"amount": 0,
"currency": "",
"formatted": "0"
},
"without_tax": {
"amount": 0,
"currency": "",
"formatted": "0"
}
},
"timestamps": {
"created_at": "2018-05-08T10:25:40.02Z",
"updated_at": "2018-05-08T10:25:40.02Z",
"expires_at": "2018-05-20T10:25:40.02Z"
}
}
}