Skip to main content
POST
/
admin
/
product-attributes
curl -X POST 'http://localhost:9000/admin/product-attributes' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Material",
    "type": "single_select",
    "is_filterable": true,
    "values": [{ "name": "Linen" }, { "name": "Cotton" }]
  }'
{
  "product_attribute": {
    "id": "pattr_01HXYZABCDEF",
    "name": "Material",
    "handle": "material",
    "type": "single_select",
    "is_required": false,
    "is_filterable": true,
    "is_variant_axis": false,
    "is_active": true,
    "values": [
      { "id": "pattrval_01HXYZABCDEF", "name": "Linen", "rank": 0 },
      { "id": "pattrval_01HXYZABCDEG", "name": "Cotton", "rank": 1 }
    ]
  }
}
Creates a shared attribute that products across the catalog can use.
is_variant_axis is only valid for multi_select attributes — axis attributes provide the value sets that variants are generated from.

Body parameters

name
string
required
Attribute name.
type
string
required
One of single_select, multi_select, unit, toggle, text.
handle
string
Unique URL-safe handle, generated from the name if omitted.
description
string
Attribute description.
is_required
boolean
Whether a value is required on products.
is_filterable
boolean
Whether the attribute can be used as a storefront filter.
is_variant_axis
boolean
Whether the attribute drives variant generation; only valid for multi_select.
rank
number
Sort rank of the attribute; must be non-negative.
is_active
boolean
Whether the attribute is active.
category_ids
string[]
IDs of categories to link the attribute to; omit for a global attribute.
values
object[]
Initial attribute values for select types.
metadata
object
Custom key-value data.
additional_data
object
Custom data passed to workflow hooks.

Response

product_attribute
object
curl -X POST 'http://localhost:9000/admin/product-attributes' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Material",
    "type": "single_select",
    "is_filterable": true,
    "values": [{ "name": "Linen" }, { "name": "Cotton" }]
  }'
{
  "product_attribute": {
    "id": "pattr_01HXYZABCDEF",
    "name": "Material",
    "handle": "material",
    "type": "single_select",
    "is_required": false,
    "is_filterable": true,
    "is_variant_axis": false,
    "is_active": true,
    "values": [
      { "id": "pattrval_01HXYZABCDEF", "name": "Linen", "rank": 0 },
      { "id": "pattrval_01HXYZABCDEG", "name": "Cotton", "rank": 1 }
    ]
  }
}