Skip to main content

Asynchronous product deletion through the GraphQL API

Major Upgrade


In this release, we are introducing the ability to asynchronously delete products through our GraphQL APIs. This feature enables the deletion of either single or many products through GraphQL while ensuring that all dependencies and associated product data are cleaned up.

πŸ“ Note: Due to infrastructure limitations, the feature will not be available for some customers. For more information on feature availability, contact your AppDirect technical representative.

Customer impacts​

  • Headless commerce support
    Enables complete product lifecycle management through the GraphQL APIs without UI dependency.
  • Improved reliability
    Asynchronous processing ensures deletion operations are resilient to system failures, with automatic retries and comprehensive error tracking.
  • Data integrity
    Guarantees full cleanup of product-related data including pricing, files, variants, and custom attributes.
  • Operational visibility
    Real-time status tracking allows customers to monitor deletion progress and handle errors appropriately in their integrations.
  • Bulk deletion support
    Efficient concurrent processing for large-scale catalog operations.
  • Validation and safety controls
    Comprehensive pre-deletion validation prevents accidental deletion of published products or products in transitional states.

Key changes and enhancements​

AspectChanges
API accessIntroduced GraphQL mutation triggerProductDeletionProcess and query productDeletionProcess.
Processing modelAsynchronous.
ValidationMulti-layered validation covering publication status, dependency integrity, and state transitions.
Data cleanupComplete removal of product dependencies across all systems (applications, editions, pricing, files, variants, custom attributes).
Error handlingStructured error responses with specific error types: DuplicateDeletionTriggeredError, InternalServerDeletionError, InvalidDeletionError.
Process trackingProcess tracking with status transitions (STARTED β†’ DELETING β†’ COMPLETED/ERRORED).
Bulk supportAccepts multiple product IDs for deletion; processes each with individual tracking.
AuthorizationRole-based access control: ROLE_CHANNEL_ADMIN, ROLE_PARTNER, ROLE_DEVELOPER.

GraphQL API changes​

New mutation:​

triggerProductDeletionProcess

  • Purpose: Initiates asynchronous deletion for one or more products.
  • Input:
    • TriggerProductDeletionProcessInput: Includes an array of productIds.
  • Response:
    • TriggerProductDeletionProcessPayload: Returns process tracking information.

New query:​

productDeletionProcess

  • Purpose: Retrieves the status and results of a deletion process by processId.
  • Response: Provides real-time status updates and error information.

Validation enhancements​

  • Products must be unpublished before deletion.
  • Products in the publication or unpublication process cannot be deleted.
  • Duplicate deletion requests are detected and prevented.
  • Permission enforcement based on:
    • User role (as defined above)
    • Product ownership and access scope

Feature enablement

No feature enablement is required.

Setting enablement

No setting enablement is required.

Documentation

Refer to GraphQL reference documentation.

Was this page helpful?