curl 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF' \
-H 'Authorization: Bearer <token>'
const { product_attribute } = await client.admin.productAttributes.$id.query({
$id: "pattr_01HXYZABCDEF",
})
{
"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 }
]
}
}
Product Attributes
Retrieve Product Attribute
Retrieve a catalog product attribute by ID.
GET
/
admin
/
product-attributes
/
{id}
curl 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF' \
-H 'Authorization: Bearer <token>'
const { product_attribute } = await client.admin.productAttributes.$id.query({
$id: "pattr_01HXYZABCDEF",
})
{
"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 }
]
}
}
Returns a single attribute with its values and linked categories.
Path parameters
The attribute’s ID.
Query parameters
Comma-separated list of fields to include, prefix with
+/- to add or remove from defaults.Response
Show properties
Show properties
The attribute’s ID.
Attribute name.
Unique URL-safe handle.
Attribute description.
One of
single_select, multi_select, unit, toggle, text.Whether a value is required on products.
Whether the attribute can be used as a storefront filter.
Whether the attribute drives variant generation.
Whether the attribute is active.
ID of the actor who created the attribute.
Owning product’s ID for product-scoped attributes, otherwise
null.Sort rank of the attribute.
Linked categories with
id, name, and handle.Custom key-value data.
Creation timestamp.
Last update timestamp.
curl 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF' \
-H 'Authorization: Bearer <token>'
const { product_attribute } = await client.admin.productAttributes.$id.query({
$id: "pattr_01HXYZABCDEF",
})
{
"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 }
]
}
}
⌘I