bulkDeleteBrands
Requires permission products:brand:delete.
Deletes several brands at once, up to 500. Each brand follows the same rule as deleting it on its own: a brand that still has products is skipped and reported, and so is an ID that is not in your organization. The rest are deleted. Needs the brands delete permission.
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 BulkDeleteBrands($ids: [ID!]!) {
bulkDeleteBrands(ids: $ids) {
deleted
deletedIds
requested
failures {
id
code
name
reason
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation BulkDeleteBrands($ids: [ID!]!) {\n bulkDeleteBrands(ids: $ids) {\n deleted\n deletedIds\n requested\n failures {\n id\n code\n name\n reason\n }\n }\n}",
"variables": {
"ids": [
"id"
]
}
}
EOF
Variables:
{
"ids": [
"id"
]
}
Response:
{
"data": {
"bulkDeleteBrands": {
"deleted": 0,
"deletedIds": [
"id"
],
"requested": 0,
"failures": [
{
"id": "id",
"code": "string",
"name": "string",
"reason": "string"
}
]
}
}
}
bulkDeleteBrands(
ids: [ID!]!
): CatalogBulkDeleteResult!
Arguments
bulkDeleteBrands.ids ● [ID!]! non-null scalar
The IDs of the brands to delete, at most 500. Duplicates count once.
Type
CatalogBulkDeleteResult object
The outcome of a bulk delete of brands or categories: what was deleted and what was refused.