Delete a Cart
You can delete a cart, including the items, name, description, and remove all associations.
DELETE
Delete cart by Reference
https://api.moltin.com/v2/carts/:reference
Path Parameters:
Name | Required | Type | Description |
---|---|---|---|
cartId | Required | string | The system generated ID for the cart that the customer created. |
Headers:
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. |
204 No Content
curl -X DELETE https://api.moltin.com/v2/carts/:reference \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const reference = 'XXXX'
Moltin.Cart(reference)
.Delete()
.then(cart => {
// Do something
})
const { MoltinClient } = require('@moltin/request')
const client = new MoltinClient({
client_id: 'X'
})
const reference = 'XXXX'
client
.delete(`carts/${reference}`)
.then(cart => {
// Do something...
})
.catch(console.error)