Backend API
Deleting a product that has already been sold will break any links that exist within orders. We recommend only deleting products that have not yet been sold to a customer.
⚠️
When deleting a record that has child collections such as variants and stock, the contents of those collections are also deleted.
Arguments
idobjectIdrequired
The id of the product you wish to delete.
DELETE/products/:id
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.delete('/products/{id}', {
id: '5ca24abb9c077817e5fe2b36',
});
Response
{
"id": "5ca24abb9c077817e5fe2b36",
"active": true,
"attributes": {},
"currency": "USD",
"date_created": "2019-04-01T00:00:00.000Z",
"date_updated": "2019-04-01T00:00:00.000Z",
"delivery": "shipment",
"description": null,
"images": [],
"meta_description": null,
"meta_title": null,
"name": "T-Shirt",
"options": [],
"price": 9.99,
"slug": "swell-t-shirt",
"stock_level": 0,
"stock_status": "available",
"stock_tracking": true,
"tags": [],
"type": "standard"
}