Skip to main content
Anchor to ProductDeleteOperation

ProductDeleteOperation

object

Requires read_products access scope.

An entity that represents details of an asynchronous ProductDelete mutation.

By querying this entity with the productOperation query using the ID that was returned when the product was deleted, this can be used to check the status of an operation.

The status field indicates whether the operation is CREATED, ACTIVE, or COMPLETE.

The deletedProductId field provides the ID of the deleted product.

The userErrors field provides mutation errors that occurred during the operation.

•ID

The ID of the deleted product.

•ID!
non-null

A globally-unique ID.

•Product

The product on which the operation is being performed.

•ProductOperationStatus!
non-null

The status of this operation.

•[UserError!]!
non-null

Returns mutation errors occurred during background mutation processing.


Was this section helpful?

•mutation

Permanently deletes a product and all its associated data, including variants, media, publications, and inventory items.

Use the productDelete mutation to programmatically remove products from your store when they need to be permanently deleted from your catalog, such as when removing discontinued items, cleaning up test data, or synchronizing with external inventory management systems.

The productDelete mutation removes the product from all associated collections, and removes all associated data for the product, including:

  • All product variants and their inventory items
  • Product media (images, videos) that are not referenced by other products
  • Product options and option values
  • Product publications across all sales channels
  • Product tags and metadata associations

The productDelete mutation also has the following effects on existing orders and transactions:

  • Draft orders: Existing draft orders that reference this product will retain the product information as stored data, but the product reference will be removed. Draft orders can still be completed with the stored product details.
  • Completed orders and refunds: Previously completed orders that included this product aren't affected. The product information in completed orders is preserved for record-keeping, and existing refunds for this product remain valid and processable.

Caution

Product deletion is irreversible. After a product is deleted, it can't be recovered. Consider archiving or unpublishing products instead if you might need to restore them later.


If you need to delete a large product, such as one that has many variants that are active at several locations, you might encounter timeout errors. To avoid these timeout errors, you can set the synchronous parameter to false to run the deletion asynchronously, which returns a ProductDeleteOperation that you can monitor for completion status.

If you need more granular control over product cleanup, consider using these alternative mutations:

Learn more about the product model.

Arguments

•ProductDeleteInput!
required

Specifies the product to delete by its ID.

•Boolean
Default:true

Specifies whether or not to run the mutation synchronously.


Fields

•ID

The ID of the deleted product.

Anchor to productDeleteOperationproductDeleteOperation
•ProductDeleteOperation

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

•Shop!
non-null

The shop associated with the product.

•[UserError!]!
non-null

The list of errors that occurred from executing the mutation.


Was this section helpful?


Was this section helpful?
OSZAR »