Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

3.1 KB
Raw Blame
---
title: "Update Product Attribute"
api: "POST /admin/product-attributes/{id}"
description: "Update a catalog product attribute."
---

Updates the attribute's details; only the provided fields are changed.

<Note>
`type` is immutable. Sending a `type` different from the attribute's current type returns an error.
</Note>

## Path parameters

<ParamField path="id" type="string" required>The attribute's ID.</ParamField>

## Body parameters

<ParamField body="name" type="string">Attribute name.</ParamField>
<ParamField body="handle" type="string">Unique URL-safe handle.</ParamField>
<ParamField body="description" type="string">Attribute description.</ParamField>
<ParamField body="type" type="string">Must match the current type: `single_select`, `multi_select`, `unit`, `toggle`, or `text`.</ParamField>
<ParamField body="is_required" type="boolean">Whether a value is required on products.</ParamField>
<ParamField body="is_filterable" type="boolean">Whether the attribute can be used as a storefront filter.</ParamField>
<ParamField body="is_variant_axis" type="boolean">Whether the attribute drives variant generation; only valid for `multi_select`.</ParamField>
<ParamField body="rank" type="number">Sort rank of the attribute; must be non-negative.</ParamField>
<ParamField body="is_active" type="boolean">Whether the attribute is active.</ParamField>
<ParamField body="category_ids" type="string[]">IDs of categories to link the attribute to; replaces the existing links.</ParamField>
<ParamField body="metadata" type="object">Custom key-value data.</ParamField>
<ParamField body="additional_data" type="object">Custom data passed to workflow hooks.</ParamField>

## Response

<ResponseField name="product_attribute" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">The attribute's ID.</ResponseField>
    <ResponseField name="name" type="string">Attribute name.</ResponseField>
    <ResponseField name="handle" type="string">Unique URL-safe handle.</ResponseField>
    <ResponseField name="type" type="string">The attribute's type.</ResponseField>
    <ResponseField name="values" type="object[]">The attribute's values.</ResponseField>
    <ResponseField name="categories" type="object[]">Linked categories with `id`, `name`, and `handle`.</ResponseField>
    <ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
```bash cURL
curl -X POST 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Fabric", "is_filterable": true}'
```

```ts JS Client
const { product_attribute } = await client.admin.productAttributes.$id.mutate({
  $id: "pattr_01HXYZABCDEF",
  name: "Fabric",
  is_filterable: true,
})
```
</RequestExample>

<ResponseExample>
```json 200
{
  "product_attribute": {
    "id": "pattr_01HXYZABCDEF",
    "name": "Fabric",
    "handle": "material",
    "type": "single_select",
    "is_filterable": true,
    "updated_at": "2026-06-02T09:00:00.000Z"
  }
}
```
</ResponseExample>