productBulkDeletePreview
Requires permission products:product:delete.
Read-only blast radius (variant count, open-document/cart references) for a bulk product delete — powers the confirmation dialog.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query ProductBulkDeletePreview($target: ProductBulkTargetInput!) {
productBulkDeletePreview(target: $target) {
buyingListLines
cartLines
defaultVariantCount
missing
openOrderLines
openQuoteLines
lastVariantViolations {
productName
productId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query ProductBulkDeletePreview($target: ProductBulkTargetInput!) {\n productBulkDeletePreview(target: $target) {\n buyingListLines\n cartLines\n defaultVariantCount\n missing\n openOrderLines\n openQuoteLines\n lastVariantViolations {\n productName\n productId\n }\n }\n}",
"variables": {
"target": {}
}
}
EOF
Variables:
{
"target": {}
}
Response:
{
"data": {
"productBulkDeletePreview": {
"buyingListLines": 0,
"cartLines": 0,
"defaultVariantCount": 0,
"missing": 0,
"openOrderLines": 0,
"openQuoteLines": 0,
"lastVariantViolations": [
{
"productName": "string",
"productId": "id"
}
]
}
}
}
productBulkDeletePreview(
target: ProductBulkTargetInput!
): ProductBulkDeletePreview!
Arguments
productBulkDeletePreview.target ● ProductBulkTargetInput! non-null input
Which products to delete.
Type
ProductBulkDeletePreview object
What a bulk delete would affect, for the confirmation dialog. It writes nothing.