deleteProduct( )


Deletes an existing product.

The deleteProduct() function returns a Promise that resolves when the product with the given ID is deleted.

Method Declaration
Copy
function deleteProduct(productId: string): Promise<void>;
Method Parameters
productIdstringRequired

ID of the product to delete.

Delete a product by ID
JavaScript
import wixStoresBackend from "wix-stores-backend"; export function deleteProduct(productId) { wixStoresBackend .deleteProduct(productId) .then(() => { // product has been deleted }) .catch((err) => { // there was an error deleting the product }); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?