# Delete a variant

Source: https://developers.swell.is/backend-api/variants/delete-a-variant

Delete a variant. Try to avoid deleting variants that have been sold to a customer, as the link to existing orders will be broken.

## Arguments

- `id` (objectId, required): The id of the variant to delete.

## Example request

`DELETE /products:variants/:id`

**cURL**

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

**Node**

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

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

**PHP**

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

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

## Example response

```json
{
  "id": "5c8fb5e1ed2faf8c79da492a",
  "parent_id": "5ca24abb9c077817e5fe2b36",
  "name": "Blue, Small",
  "active": true,
  "currency": "USD",
  "date_created": "2019-04-01T00:00:00.000Z",
  "date_updated": "2019-04-01T00:00:00.000Z",
  "price": 19.98
}
```
