# Delete a product

Source: https://developers.swell.is/backend-api/products/delete-a-product

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.

> **Warning:** When deleting a record that has child collections such as `variants` and `stock`, the contents of those collections are also deleted.

## Arguments

- `id` (objectId, required): The id of the product you wish to delete.

## Example request

`DELETE /products/:id`

**cURL**

```bash
$ curl https://api.swell.store/products/5ca24abb9c077817e5fe2b36 \
  -u store-id:secret-key \
  -X DELETE
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.delete('/products/{id}', {
  id: '5ca24abb9c077817e5fe2b36',
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->delete('/products/{id}', [
  'id' => '5ca24abb9c077817e5fe2b36',
]);
```

## Example response

```json
{
  "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"
}
```
