FacetFlux
pim.products.attributes.set
Set or merge attribute values on a product (or a specific variant). `mode=merge` (default) upserts only the provided values; existing values for other attributes are left untouched. `mode=replace` upserts the provided values AND deletes any other existing attribute values on the entity, leaving exactly the provided set. Each value is sent as native JSON matching its definition's DataType (string for Text, number for Number/Decimal, bool for Boolean, ["..."] for MultiEnum / arrays, {"en":"...","de":"..."} for translatable Text). When `variantId` is set, the variant must belong to `productId` and the same tenant; attribute scope must match the target entity (product-scoped defs onto product, variantDefining/perVariant defs onto variant) — mismatches are reported in `skipped` with reason `scope_mismatch`. Other skip reasons: `missing_attribute_definition_id`, `definition_not_in_schema`, `value_parse_error: <detail>`. In `mode=replace`, attributes the caller listed but whose value couldn't parse are NOT deleted — only attributes the caller didn't mention at all. Response: { productId, variantId, applied, deleted, skipped: [{ attributeDefinitionId, reason }] }. Errors: { error: { code: 'not_found' | 'bad_input' | 'unprocessable', ... } }.
Other tools also called pim.products.attributes.set?
See providers with this name
Input Schema
{
"type": "object",
"properties": {
"productId": {
"description": "Product id to write to.",
"type": "string"
},
"variantId": {
"description": "Optional variant id. When set, values are written to the variant rather than the product.",
"type": [
"string",
"null"
]
},
"mode": {
"description": "merge: upsert provided values only. replace: upsert provided values, delete the rest.",
"type": "string",
"enum": [
"Merge",
"Replace"
]
},
"values": {
"description": "List of attribute values to write. `value` is native JSON matching the attribute definition's DataType.",
"type": "array",
"items": {
"type": "object",
"properties": {
"attributeDefinitionId": {
"description": "Attribute definition id (from pim.attributeDefinitions.list).",
"type": "string"
},
"value": {
"description": "Value as native JSON. Examples: \"hello\", 42, 3.14, true, [\"red\",\"blue\"], {\"en\":\"hello\",\"de\":\"hallo\"}."
},
"unit": {
"description": "Optional unit override. Defaults to the attribute definition's unit.",
"type": [
"string",
"null"
]
}
}
}
}
},
"required": [
"productId",
"variantId",
"mode",
"values"
]
}