bulkUpdateProductStatus
Requires permission products:product:update.
Sets the status of a validated set of products (explicit ids, or all-matching-filter with expectedTotal), optionally with all their variants. Products already at that status are skipped. Returns how many products changed (their status or their variants).
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
mutation BulkUpdateProductStatus($status: ProductStatus!, $target: ProductBulkTargetInput!) {
bulkUpdateProductStatus(status: $status, target: $target)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation BulkUpdateProductStatus($status: ProductStatus!, $target: ProductBulkTargetInput!) {\n bulkUpdateProductStatus(status: $status, target: $target)\n}",
"variables": {
"status": "ACTIVE",
"target": {}
}
}
EOF
Variables:
{
"status": "ACTIVE",
"target": {}
}
Response:
{
"data": {
"bulkUpdateProductStatus": 0
}
}
bulkUpdateProductStatus(
includeVariants: Boolean = false
status: ProductStatus!
target: ProductBulkTargetInput!
): Int!
Arguments
bulkUpdateProductStatus.includeVariants ● Boolean scalar
Also set every variant of these products active (status ACTIVE) or inactive (any other status).
bulkUpdateProductStatus.status ● ProductStatus! non-null enum
The status to set.
bulkUpdateProductStatus.target ● ProductBulkTargetInput! non-null input
Which products to change.
Type
Int scalar
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.