Search.../

deleteProduct( )

Deletes an existing product.

Description

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

Authorization

Request

This endpoint does not take any parameters

Response Object

Fulfilled - When the product is deleted. Rejected - Error message.

Returns an empty object.

Status/Error Codes

Was this helpful?

Delete a product by ID

Copy Code
1import wixStoresBackend from 'wix-stores-backend';
2
3export function deleteProduct(productId) {
4 wixStoresBackend.deleteProduct(productId)
5 .then( () => {
6 // product has been deleted
7 })
8 .catch( (err) => {
9 // there was an error deleting the product
10 });
11}