deleteProduct

Version 2024-04-01

Overview

Delete a Product.

ℹ️

Required scope(s)

View & Edit Catalog Data

Response

Return type DeleteProductResponse

Arguments

ArgumentDescription
identifier (ProductIdentifierInput)

Product identifiers to locate a product.

Examples


Delete Product By Sku

Request

mutation deleteProduct {
    deleteProduct(identifier: {
        sku: "example-sku"
    }) {
        id
    }
}

Response

{
  "data": {
    "deleteProduct": {
      "id": "abcdef01234567"
    }
  }
}

Delete Product By Product Id

Request

mutation deleteProduct {
    deleteProduct(identifier: {
        productId: "abcdef01234567"
    }) {
        id
    }
}

Response

{
  "data": {
    "deleteProduct": {
      "id": "abcdef01234567"
    }
  }
}

Delete Product By External Id

Request

mutation deleteProduct {
    deleteProduct(identifier: {
        externalId: "example-external-id"
    }) {
        id
    }
}

Response

{
  "data": {
    "deleteProduct": {
      "id": "abcdef01234567"
    }
  }
}

Delete Product By Amazon Sku

Request

mutation deleteProduct {
    deleteProduct(identifier: {
        amazonSku: { value: "example-amazon-sku" }
    }) {
        id
    }
}

Response

{
  "data": {
    "deleteProduct": {
      "id": "abcdef01234567"
    }
  }
}

Delete Product Does Not Exist

Request

mutation deleteProduct {
    deleteProduct(identifier: {
        productId: "abcdef01234567"
    }) {
        id
    }
}

Response

{
  "errors": [
    {
      "message": "Request references a resource which does not exist.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "deleteProduct"
      ],
      "extensions": {
        "classification": {
          "type": "ResourceNotFoundError",
          "errorType": "ResourceNotFoundException",
          "errorCode": 404
        }
      }
    }
  ],
  "data": {
    "deleteProduct": null
  }
}