Product Delete Operation
Requires 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 ,
, or
.
The field provides the ID of the deleted product.
The field provides mutation errors that occurred during the operation.
Anchor to FieldsFields
- Anchor to deletedProductIddeleted•ID
Product Id The ID of the deleted product.
- •ID!non-null
A globally-unique ID.
- Anchor to productproduct•Product
The product on which the operation is being performed.
- Anchor to statusstatus•Product
Operation Status! non-null The status of this operation.
- Anchor to userErrorsuser•[User
Errors Error!]! non-null Returns mutation errors occurred during background mutation processing.
Anchor to MutationsMutations
- •mutation
Permanently deletes a product and all its associated data, including variants, media, publications, and inventory items.
Use the
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
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
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.
CautionProduct 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 tofalse
to run the deletion asynchronously, which returns athat you can monitor for completion status.
If you need more granular control over product cleanup, consider using these alternative mutations:
: Update the product status to archived or unpublished instead of deleting.
: Delete specific variants while keeping the product.
: Delete the choices available for a product, such as size, color, or material.
Learn more about the product model.
- Anchor to inputinput•Product
Delete Input! required Specifies the product to delete by its ID.
- Anchor to synchronoussynchronous•BooleanDefault:true
Specifies whether or not to run the mutation synchronously.
Arguments
- Anchor to deletedProductIddeleted•ID
Product Id The ID of the deleted product.
- Anchor to productDeleteOperationproduct•Product
Delete Operation Delete Operation The product delete operation, returned when run in asynchronous mode.
- Anchor to shopshop•Shop!non-null
The shop associated with the product.
- Anchor to userErrorsuser•[User
Errors Error!]! non-null The list of errors that occurred from executing the mutation.
Fields