Product Attributes
Retrieve Product Attribute
Retrieve a product attribute by its ID.
GET
/
vendor
/
product-attributes
/
{id}
curl 'http://localhost:9000/vendor/product-attributes/pattr_01HXYZ' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>'
const { product_attribute } = await client.vendor.productAttributes.$id.query({
$id: "pattr_01HXYZ",
})
{
"product_attribute": {
"id": "pattr_01HXYZ",
"name": "Color",
"handle": "color",
"type": "multi_select",
"is_variant_axis": true,
"values": [
{ "id": "pattrval_01HXYZ", "name": "Red", "rank": 0 },
{ "id": "pattrval_01HABC", "name": "Blue", "rank": 1 }
]
}
}
Returns a single attribute definition with its values and category assignments.
Path parameters
string
required
The attribute’s ID.
Query parameters
string
Comma-separated fields to include in the response. Prefix with
+/- to add to or remove from the defaults.Response
object
Show properties
Show properties
string
The attribute’s ID.
string
The attribute’s name.
string
The attribute’s handle.
string
The attribute’s description.
string
One of
single_select, multi_select, unit, toggle, text.boolean
Whether a value is required on products.
boolean
Whether the attribute can be used for filtering.
boolean
Whether the attribute drives variant combinations.
boolean
Whether the attribute is active.
number
Sort rank of the attribute.
object
Custom key-value pairs.
object[]
The attribute’s values with
id, name, handle, and rank.object[]
Assigned categories with
id, name, and handle.curl 'http://localhost:9000/vendor/product-attributes/pattr_01HXYZ' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>'
const { product_attribute } = await client.vendor.productAttributes.$id.query({
$id: "pattr_01HXYZ",
})
{
"product_attribute": {
"id": "pattr_01HXYZ",
"name": "Color",
"handle": "color",
"type": "multi_select",
"is_variant_axis": true,
"values": [
{ "id": "pattrval_01HXYZ", "name": "Red", "rank": 0 },
{ "id": "pattrval_01HABC", "name": "Blue", "rank": 1 }
]
}
}
⌘I
curl 'http://localhost:9000/vendor/product-attributes/pattr_01HXYZ' \
-H 'Authorization: Bearer <token>' \
-H 'x-seller-id: <seller_id>'
const { product_attribute } = await client.vendor.productAttributes.$id.query({
$id: "pattr_01HXYZ",
})
{
"product_attribute": {
"id": "pattr_01HXYZ",
"name": "Color",
"handle": "color",
"type": "multi_select",
"is_variant_axis": true,
"values": [
{ "id": "pattrval_01HXYZ", "name": "Red", "rank": 0 },
{ "id": "pattrval_01HABC", "name": "Blue", "rank": 1 }
]
}
}