Remove Cart Item

Last updated 5 months ago

You can easily remove items from the Cart. A successful Cart item removal request will return the cart items.

delete
Remove Item from Cart

https://api.moltin.com/
v2/carts/:reference/items/:id
Request
Response
Path Parameters
id
required
string
The unique identifier for this cart item
Headers
Authorization
required
string
The Bearer token to grant access to the API
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"
}
}
}
cURL
JavaScript SDK
curl -X DELETE https://api.moltin.com/v2/carts/:reference/items/:id \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const reference = 'XXXX'
const itemId = 'XXXX'
Moltin.Cart(reference)
.RemoveItem(itemId, quantity)
.then(cart => {
// Do something
})