Products
Batch Product Attributes
Stage attribute additions, removals, and updates on a product.
POST
/
vendor
/
products
/
{id}
/
attributes
/
batch
curl -X POST 'http://localhost:9000/vendor/products/prod_01HXYZ/attributes/batch' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>' \
-H 'Content-Type: application/json' \
-d '{
"add": [{ "id": "pattr_01HXYZ", "value_ids": ["pattrval_01HXYZ"] }],
"remove": ["pattr_01HABC"]
}'
const { product_change } =
await client.vendor.products.$id.attributes.batch.mutate({
$id: "prod_01HXYZ",
add: [{ id: "pattr_01HXYZ", value_ids: ["pattrval_01HXYZ"] }],
remove: ["pattr_01HABC"],
})
{
"product_change": {
"id": "prodch_01HXYZ",
"product_id": "prod_01HXYZ",
"status": "pending",
"actions": [
{
"id": "prodchact_01HXYZ",
"action": "ATTRIBUTE_ADD",
"details": { "id": "pattr_01HXYZ", "value_ids": ["pattrval_01HXYZ"] },
"applied": false
}
]
}
}
Stages attribute operations as a pending change request instead of applying them directly.
The endpoint responds with
202 Accepted and a product_change record containing ATTRIBUTE_ADD / ATTRIBUTE_REMOVE / ATTRIBUTE_UPDATE actions.Path parameters
string
required
The product’s ID.
Body parameters
object[]
Attributes to attach; each entry references an existing attribute by
id or defines one inline by title.Show properties
Show properties
string
Existing attribute ID (referencing form).
string[]
IDs of attribute values to select (referencing form).
string | number | boolean
Scalar value for
text, unit, or toggle attributes.string
Attribute title (inline form).
string
One of
single_select, multi_select, text, toggle, unit. Required for inline non-axis attributes unless value is a boolean.string[]
Value names to create and select (inline form).
boolean
Whether the attribute drives variant combinations; only allowed on
multi_select attributes.boolean
Whether the attribute is filterable (inline form).
boolean
Whether the attribute is required (inline form).
string
Attribute description (inline form).
object
Custom key-value pairs (inline form).
string[]
IDs of attributes to detach from the product.
object[]
Changes to attributes already attached to the product.
Show properties
Show properties
string
required
The attribute’s ID.
string
New attribute title.
(string | object)[]
Values to select, plain strings or
{ "value": "..." } objects.string[]
Value IDs to deselect.
string[]
The complete set of value IDs the product should hold for this attribute. Resolved into the equivalent
add / remove delta, so it cannot be combined with either.string | number | boolean
New scalar value for
text, unit, or toggle attributes.Response
object
curl -X POST 'http://localhost:9000/vendor/products/prod_01HXYZ/attributes/batch' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>' \
-H 'Content-Type: application/json' \
-d '{
"add": [{ "id": "pattr_01HXYZ", "value_ids": ["pattrval_01HXYZ"] }],
"remove": ["pattr_01HABC"]
}'
const { product_change } =
await client.vendor.products.$id.attributes.batch.mutate({
$id: "prod_01HXYZ",
add: [{ id: "pattr_01HXYZ", value_ids: ["pattrval_01HXYZ"] }],
remove: ["pattr_01HABC"],
})
{
"product_change": {
"id": "prodch_01HXYZ",
"product_id": "prod_01HXYZ",
"status": "pending",
"actions": [
{
"id": "prodchact_01HXYZ",
"action": "ATTRIBUTE_ADD",
"details": { "id": "pattr_01HXYZ", "value_ids": ["pattrval_01HXYZ"] },
"applied": false
}
]
}
}
⌘I
curl -X POST 'http://localhost:9000/vendor/products/prod_01HXYZ/attributes/batch' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>' \
-H 'Content-Type: application/json' \
-d '{
"add": [{ "id": "pattr_01HXYZ", "value_ids": ["pattrval_01HXYZ"] }],
"remove": ["pattr_01HABC"]
}'
const { product_change } =
await client.vendor.products.$id.attributes.batch.mutate({
$id: "prod_01HXYZ",
add: [{ id: "pattr_01HXYZ", value_ids: ["pattrval_01HXYZ"] }],
remove: ["pattr_01HABC"],
})
{
"product_change": {
"id": "prodch_01HXYZ",
"product_id": "prod_01HXYZ",
"status": "pending",
"actions": [
{
"id": "prodchact_01HXYZ",
"action": "ATTRIBUTE_ADD",
"details": { "id": "pattr_01HXYZ", "value_ids": ["pattrval_01HXYZ"] },
"applied": false
}
]
}
}