Menu
bulkUpdateVariants
Apply the same set of variant update actions to many product variants in one call.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the bulkUpdateVariants action (under Bulk).
- Fill in the fields below, then reference the result from later steps as
{{bulkupdatevariants.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation BulkUpdateVariants($input: BulkUpdateVariantsInput!) {
bulkUpdateVariants(input: $input) {
successCount
failureCount
results {
status
resource {
id
version
}
errors {
code
message
}
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"input": {
"items": [
{
"id": "string",
"key": "string",
"version": "string"
}
],
"actions": [
{
"publish": "string",
"unpublish": "string"
}
],
"versionControl": "On"
}
}
Response
Read the result with {{bulkupdatevariants.response.data.data.bulkUpdateVariants}}. If the API returns errors, the step fails and they are at {{bulkupdatevariants.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?