Skip to main content

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:

mutation BulkUpdateProductStatus($status: ProductStatus!, $target: ProductBulkTargetInput!) {
bulkUpdateProductStatus(status: $status, target: $target)
}

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.