> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Product

> Delete a product from the catalog

<Warning>
  Deleting a product is irreversible. Products with existing orders cannot be deleted and must be archived instead.
</Warning>

### Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the product to delete
</ParamField>

### Response

<ResponseField name="id" type="string">
  The ID of the deleted product
</ResponseField>

<ResponseField name="object" type="string">
  Always "product"
</ResponseField>

<ResponseField name="deleted" type="boolean">
  Always true for successful deletion
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request DELETE 'https://api.stateset.com/v1/products/prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
  --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```graphQL GraphQL theme={null}
  mutation DeleteProduct($id: ID!) {
    deleteProduct(id: $id) {
      id
      deleted
    }
  }
  ```

  ```javascript Node.js theme={null}
  const result = await stateset.products.delete(
    'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  );
  ```

  ```python Python theme={null}
  result = stateset.products.delete(
      'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "product",
    "deleted": true
  }
  ```
</ResponseExample>

### Error Responses

<ResponseField name="error" type="object">
  Error object when deletion fails

  <Expandable title="Error object properties">
    <ResponseField name="type" type="string">
      Type of error (e.g., "invalid\_request", "product\_has\_orders")
    </ResponseField>

    <ResponseField name="message" type="string">
      Human-readable error message
    </ResponseField>

    <ResponseField name="code" type="string">
      Error code for programmatic handling
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Error Response theme={null}
  {
    "error": {
      "type": "product_has_orders",
      "message": "Cannot delete product with existing orders. Archive the product instead.",
      "code": "PRODUCT_HAS_ORDERS"
    }
  }
  ```
</ResponseExample>
