Requires write_products access scope. Also: The user must have a permission to delete products.

Deletes a product, including all associated variants and media.

As of API version 2023-01, if you need to delete a large product, such as one that has many variants that are active at several locations, you may encounter timeout errors. To avoid these timeout errors, you can instead use the asynchronous ProductDeleteAsync mutation.


Specifies the product to delete by its ID.

Anchor to synchronous
synchronous
default:true

Specifies whether or not to run the mutation synchronously.


Was this section helpful?

The ID of the deleted product.

The product delete operation, returned when run in asynchronous mode.

The shop associated with the product.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
DescriptionCopy
mutation {
  productDelete(input: {id: "gid://shopify/Product/-1"}) {
    deletedProductId
    userErrors {
      field
      message
    }
  }
}
Hide code
Response
JSON
{
  "productDelete": {
    "deletedProductId": null,
    "userErrors": [
      {
        "field": [
          "id"
        ],
        "message": "Product does not exist"
      }
    ]
  }
}