Deleting a product variation
Learn how to delete a product programmatically.
The request returns a task identifier (taskId
) in the asynchronous 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 or locale.
Deleting a specific product variation
The following DELETE /v1/products/variations/{variationProductId or variationERID}
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.
Duplicate ERIDs are not allowed. To prevent duplicate ERIDs, enable the Enforce Unique Value when configuring company settings 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.
The following example deletes a specific product variation with a productId
.
An ERID request requires the x-erid-as-pid=true
header.
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.
Sign in to Global Commerce.
Select Catalog, select Products, and then click Manage Products. The Products page appears.
Click the Search tab, select Product from the Search In drop-down list, and choose ID from the Search By list. Enter the product identifier or ERID for the base product in the Search For field, then click Search.
Click the link for the base product under the Internal Product Name column. The Edit Product page appears.
Click the Details tab and verify the deleted product variation no longer appears under the Choose a Product column.
Last updated