## Delete a specific product exclusion list

### cURL

```bash
curl --request DELETE \
  --url https://api.fabric.inc/v3/product-exclusion-lists/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>'
```

### Python

```python
import requests

url = "https://api.fabric.inc/v3/product-exclusion-lists/{id}"

headers = {
    "x-fabric-tenant-id": "<x-fabric-tenant-id>",
    "Authorization": "Bearer <token>"
}

response = requests.delete(url, headers=headers)

print(response.text)
```

### JavaScript

```javascript
const options = {
  method: 'DELETE',
  headers: {'x-fabric-tenant-id': '<x-fabric-tenant-id>', Authorization: 'Bearer <token>'}
};

fetch('https://api.fabric.inc/v3/product-exclusion-lists/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### PHP

```php
$curl = curl_init();

curl_setopt_array($curl, [\
  CURLOPT_URL => "https://api.fabric.inc/v3/product-exclusion-lists/{id}",\
  CURLOPT_RETURNTRANSFER => true,\
  CURLOPT_ENCODING => "",\
  CURLOPT_MAXREDIRS => 10,\
  CURLOPT_TIMEOUT => 30,\
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
  CURLOPT_CUSTOMREQUEST => "DELETE",\
  CURLOPT_HTTPHEADER => [\
    "Authorization: Bearer <token>",\
    "x-fabric-tenant-id: <x-fabric-tenant-id>"\
  ],\
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

url := "https://api.fabric.inc/v3/product-exclusion-lists/{id}"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
	req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}
```

### Unirest (Java)

```java
HttpResponse<String> response = Unirest.delete("https://api.fabric.inc/v3/product-exclusion-lists/{id}")
  .header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### Ruby

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fabric.inc/v3/product-exclusion-lists/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

### Response Status Codes

- `200`: OK
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `500`: Internal Server Error

### Example Response

```json
{
  "id": "614b58924e92f6861ac9d43b",
  "name": "Gucci handbags",
  "startAt": "2022-05-04T09:23:51.459Z",
  "endAt": "2099-12-31T00:00:00.000Z",
  "scopes": ["PRODUCT_PRICE"],
  "isDeleted": true,
  "listType": "GLOBAL_EXCLUSION",
  "createdAt": "2019-08-20T14:15:22Z",
  "updatedAt": "2019-08-20T14:15:22Z"
}
```

### Error Responses

```json
{
  "type": "SKU_LIST_ID_NOT_VALID",
  "message": "Specify a valid product exclusion list ID"
}
```

```json
{
  "type": "UNAUTHORIZED",
  "message": "Invalid credentials"
}
```

```json
{
  "type": "SKU_LIST_NOT_FOUND",
  "message": "Product exclusion List not found."
}
```

```json
{
  "type": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error"
}
```

### Required Headers

- **Authorization**: `Bearer <token>`  
  Required for the API authentication.  
  Example: `Bearer <token>`.

- **x-fabric-tenant-id**:  
  Required for identifying the tenant making the request.  
  Required string length: `24`.

### Path Parameters

- **id**:  
  Required. Product exclusion list ID.  
  Example: "614b58924e92f6861ac9d43b".

### Response Structure

- **id**: string (required)
- **name**: string (required)
- **startAt**: string<date-time> (required)
- **endAt**: string<date-time> (required)
- **scopes**: enum<string>[] (required)
- **isDeleted**: boolean (required)
- **listType**: enum<string> (required)
- **createdAt**: string<date-time> (required)
- **updatedAt**: string<date-time> (required)
