> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Product Attributes

> Retrieve a paginated list of catalog product attributes.

Returns global (non-product-scoped) attributes, with optional filtering by type, flags, and category.

## Query parameters

<ParamField query="limit" type="number" default="50">Maximum number of records to return.</ParamField>
<ParamField query="offset" type="number" default="0">Number of records to skip.</ParamField>
<ParamField query="order" type="string">Field to sort by, prefix with `-` for descending order.</ParamField>
<ParamField query="fields" type="string">Comma-separated list of fields to include, prefix with `+`/`-` to add or remove from defaults.</ParamField>
<ParamField query="q" type="string">Search term matched against attribute fields.</ParamField>
<ParamField query="id" type="string | string[]">Filter by attribute ID(s).</ParamField>
<ParamField query="handle" type="string | string[]">Filter by attribute handle(s).</ParamField>
<ParamField query="type" type="string | string[]">Filter by type: `single_select`, `multi_select`, `unit`, `toggle`, or `text`.</ParamField>
<ParamField query="is_required" type="boolean">Filter by the required flag.</ParamField>
<ParamField query="is_variant_axis" type="boolean">Filter by the variant-axis flag.</ParamField>
<ParamField query="is_filterable" type="boolean">Filter by the filterable flag.</ParamField>
<ParamField query="is_active" type="boolean">Filter by the active flag.</ParamField>
<ParamField query="category_id" type="string | string[]">Filter to attributes linked to the given category(ies) or global to all categories.</ParamField>
<ParamField query="created_at" type="object">Filter by creation date with operators like `$gte`, `$lte`.</ParamField>
<ParamField query="updated_at" type="object">Filter by update date with operators like `$gte`, `$lte`.</ParamField>

## Response

<ResponseField name="product_attributes" 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="description" type="string">Attribute description.</ResponseField>
    <ResponseField name="type" type="string">One of `single_select`, `multi_select`, `unit`, `toggle`, `text`.</ResponseField>
    <ResponseField name="is_required" type="boolean">Whether a value is required on products.</ResponseField>
    <ResponseField name="is_filterable" type="boolean">Whether the attribute can be used as a storefront filter.</ResponseField>
    <ResponseField name="is_variant_axis" type="boolean">Whether the attribute drives variant generation.</ResponseField>
    <ResponseField name="is_active" type="boolean">Whether the attribute is active.</ResponseField>
    <ResponseField name="created_by" type="string">ID of the actor who created the attribute.</ResponseField>
    <ResponseField name="product_id" type="string">Always `null` for catalog attributes.</ResponseField>
    <ResponseField name="rank" type="number">Sort rank of the attribute.</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="metadata" type="object">Custom key-value data.</ResponseField>
    <ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
    <ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="count" type="number">Total number of matching attributes.</ResponseField>
<ResponseField name="offset" type="number">Number of records skipped.</ResponseField>
<ResponseField name="limit" type="number">Number of records returned.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl 'http://localhost:9000/admin/product-attributes?type=single_select&limit=20' \
    -H 'Authorization: Bearer <token>'
  ```

  ```ts JS Client theme={null}
  const { product_attributes, count } = await client.admin.productAttributes.query({
    type: "single_select",
    limit: 20,
  })
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "product_attributes": [
      {
        "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 }
        ]
      }
    ],
    "count": 1,
    "offset": 0,
    "limit": 20
  }
  ```
</ResponseExample>
