curl -X POST 'http://localhost:9000/admin/products/prod_01HXYZABCDEF/attributes/batch' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"add": [{ "id": "pattr_01HXYZABCDEF", "value_ids": ["pattrval_01HXYZABCDEF"] }],
"remove": ["pattr_01HXYZABCDEG"]
}'
{
"product": {
"id": "prod_01HXYZABCDEF",
"title": "Linen Shirt",
"status": "published",
"product_attribute_values": [
{
"id": "pattrval_01HXYZABCDEF",
"name": "Linen",
"attribute": { "id": "pattr_01HXYZABCDEF", "name": "Material", "type": "single_select" }
}
],
"scoped_attributes": []
}
}
Products
Batch Product Attributes
Add, remove, and update attributes on a product in one request.
POST
/
admin
/
products
/
{id}
/
attributes
/
batch
curl -X POST 'http://localhost:9000/admin/products/prod_01HXYZABCDEF/attributes/batch' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"add": [{ "id": "pattr_01HXYZABCDEF", "value_ids": ["pattrval_01HXYZABCDEF"] }],
"remove": ["pattr_01HXYZABCDEG"]
}'
{
"product": {
"id": "prod_01HXYZABCDEF",
"title": "Linen Shirt",
"status": "published",
"product_attribute_values": [
{
"id": "pattrval_01HXYZABCDEF",
"name": "Linen",
"attribute": { "id": "pattr_01HXYZABCDEF", "name": "Material", "type": "single_select" }
}
],
"scoped_attributes": []
}
}
Applies attribute changes to the product in the order
remove → add → update.
Path parameters
The product’s ID.
Body parameters
Attributes to attach — one of two shapes per item.
Show existing attribute (by id)
Show existing attribute (by id)
Show inline attribute (by title)
Show inline attribute (by title)
Attribute title.
One of
single_select, multi_select, unit, toggle, text; required for non-axis inline attributes unless value is a boolean.Value names to create and select.
Scalar value for non-select types.
Whether the attribute drives variant generation; only allowed on
multi_select attributes.Whether the attribute can be used as a storefront filter.
Whether a value is required on products.
Attribute description.
Custom key-value data.
IDs of attributes to detach from the product.
Changes to attributes already on the product.
Response
curl -X POST 'http://localhost:9000/admin/products/prod_01HXYZABCDEF/attributes/batch' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"add": [{ "id": "pattr_01HXYZABCDEF", "value_ids": ["pattrval_01HXYZABCDEF"] }],
"remove": ["pattr_01HXYZABCDEG"]
}'
{
"product": {
"id": "prod_01HXYZABCDEF",
"title": "Linen Shirt",
"status": "published",
"product_attribute_values": [
{
"id": "pattrval_01HXYZABCDEF",
"name": "Linen",
"attribute": { "id": "pattr_01HXYZABCDEF", "name": "Material", "type": "single_select" }
}
],
"scoped_attributes": []
}
}
⌘I