# Deleting a product variation

{% hint style="info" %}
The request returns a task identifier (`taskId`) in the [asynchronous ](https://docs.digitalriver.com/commerce-api/admin-apis/getting-started#asynchronous-and-synchronous-calls)response. You cannot delete a base or individual product. You must retire the product to make a base or individual product unavailable to the shopper. However, you can delete a [product variation](https://app.gitbook.com/s/oUderMtztdH7OKDXmYbI/commerce-api-reference-guide/admin-apis-reference/products#product-variations) or [locale](https://docs.digitalriver.com/commerce-api/admin-apis/product-management/manage-products-asynchronous-api/deleting-a-base-or-individual-products-locale).&#x20;
{% endhint %}

## Deleting a specific product variation

The following [`DELETE v1/products/{baseProductId}/variations/{variationProductId}`](https://app.gitbook.com/s/drE2RCYBuoRpd2TC2sx2/product-management/manage-products-asynchronous-api#v1-products-baseproductid-variations-variationid-1) request deletes the specified product variation. To delete a product variation for a particular base product, you must provide the  `variationProductId` or `variationERID`. If the request finds multiple products associated with the `variationERID`, the response will delete all of them.&#x20;

{% hint style="info" %}
Duplicate ERIDs are not allowed. To prevent duplicate ERIDs, [enable the Enforce Unique Value](https://app.gitbook.com/s/oUderMtztdH7OKDXmYbI/commerce-api-reference-guide/api-structure/product-external-reference-identifier-erid#enabling-the-enforce-unique-value) when [configuring company settings](https://help.digitalriver.com/internal-help/gc/Administration/Company/Configuring-company-settings.htm) in Global Commerce to ensure that you won't accidentally provide an ERID that would result in duplicate products in the response if you searched for a product by ERID.
{% endhint %}

{% tabs %}
{% tab title="cURL" %}
The following example deletes a specific product variation with a `productId`.

```http
curl --location --request DELETE 'https://api.digitalriver.com/v1/products/{baseProductId}/variations/{variationProductId}' \
--header 'Authorization: Basic <API_key>' \
...
```

An ERID request requires the `x-erid-as-pid=true` header.

```
curl --location --request DELETE 'https://api.digitalriver.com
/v1/products/variations/{variationERID}' \
--header 'Authorization: Basic <API_key>' \
--header 'header x-erid-as-pid=true' \
...
```

{% endtab %}

{% tab title="202 Accepted response" %}
The request returns a task identifier (`taskId`) in the [asynchronous ](https://docs.digitalriver.com/commerce-api/admin-apis/getting-started#asynchronous-and-synchronous-calls)response. The request returns a task identifier (`taskId`) in the [asynchronous ](https://docs.digitalriver.com/commerce-api/admin-apis/getting-started#asynchronous-and-synchronous-calls)response. The request returns a task identifier (`taskId`) in the [asynchronous ](https://docs.digitalriver.com/commerce-api/admin-apis/getting-started#asynchronous-and-synchronous-calls)response.

```json
{
    "taskId": "2496da1d-4ba7-4396-880c-760b57e732ea",
    "requestType": "DELETE_VARIATION",
    "taskStatus": "PUBLISHED",
    "receivedTime": "2022-08-24T19:55:51.690Z"
}
```

Use the `taskId` in the response to [verify the successful completion of the request](https://docs.digitalriver.com/commerce-api/admin-apis/product-management/get-the-task-status-for-a-product-synchronous-api/getting-the-latest-information-on-a-product-task). You can also verify the successful completion of the task by [checking the product history](#product-history-attributes) in [Global Commerce](https://gc.digitalriver.com/gc/ent/login.do). Note that there may be a delay before these changes appear in Global Commerce.&#x20;
{% endtab %}
{% endtabs %}

## Verifying the deletion of a product variation in Global Commerce

When you delete a product variation, that product variation will no longer appear associated with the base product in Global Commerce.

1. Sign in to [Global Commerce](https://gc.digitalriver.com/gc/ent/login.do).
2. Select **Catalog**, select **Products**, and then click **Manage Products**. The Products page appears.
3. Click the **Search** tab, select **Product** from the **Search In** drop-down list, and choose **ID** from the **Search By** list. In the **Search For** field, enter the product identifier or ERID for the base product, then click **Search**.
4. Click the link for the base product under the **Internal Product Name column**. The Edit Product page appears.
5. Click the **Details** tab and verify the deleted product variation no longer appears under the **Choose a Product** column.
