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

# Attribute Groups

> Collections of Attributes that organize how custom fields appear in detail-page tabs and forms — one group per resource.

<Frame caption="Settings > Attributes & Tags">
  <img src="https://mintcdn.com/twicecommerce/Ab7tx7ih94KQsi0k/images/settings-attributes-tags.webp?fit=max&auto=format&n=Ab7tx7ih94KQsi0k&q=85&s=c098f9058a9d05a89d8efdcd1464b4f7" alt="Attribute groups in settings" width="1920" height="1080" data-path="images/settings-attributes-tags.webp" />
</Frame>

## Definition

An **Attribute Group** is a named bucket that holds related [Attributes](/docs/concepts/admin/attributes) for a single resource (Inventory, Catalog, Customer, or Order). Groups serve two purposes:

1. **Organization** — they keep your settings page legible as the number of Attributes grows
2. **UI layout** — they drive how the Attributes tab is divided on entity detail pages

<Info>
  **The analogy:** Think of an Attribute Group like a folder of related fields. The folder doesn't add new fields — it organises the ones you already have so they show up together everywhere they're used.
</Info>

## How groups affect the UI

Every entity with Attributes — Stock Item, SKU, Listing, Customer, Order — has an **Attributes** tab. That tab is organised by Group:

* Each Group renders as a labeled section on the tab
* Attributes within a Group render in their `sortOrder`
* Ungrouped Attributes fall under a default section labeled **Details**
* Groups themselves render in their own `sortOrder` — you can drag-reorder them in the settings table

System-managed Attributes have their own special groups:

| System group | Resource | Used for                                   |
| :----------- | :------- | :----------------------------------------- |
| `system`     | Customer | Built-in customer fields like contact info |

System groups can't be deleted or renamed — they exist whether you've created your own groups or not.

## Key properties

An Attribute Group carries:

| Property                  | Type         | Description                                                   |
| :------------------------ | :----------- | :------------------------------------------------------------ |
| `id`                      | UUID         | Stable identifier                                             |
| `name`                    | String       | Display name (e.g. "Technical specifications")                |
| `description`             | String       | Optional context shown in settings                            |
| `resource`                | Enum         | `inventory`, `catalog`, `customers`, or `orders`              |
| `sortOrder`               | Number       | Position relative to other groups on the same resource        |
| `attributeCount`          | Number       | Computed — how many Attributes currently belong to this group |
| `createdAt` / `updatedAt` | ISO datetime | Audit timestamps                                              |

A Group is owned by exactly one resource. There is no cross-resource sharing — if you want similar groupings on both Stock Items and Listings, you create matching groups on each resource.

## Scope: one resource, one group

Unlike some platforms, TWICE doesn't let one Group span multiple resources. The reasoning is the same as for [Attributes](/docs/concepts/admin/attributes) themselves — each resource has its own schema, and mixing groups across resources would create coupling that's hard to reason about.

In practice, this means:

| You want...                                | You do...                                                                        |
| :----------------------------------------- | :------------------------------------------------------------------------------- |
| "Specifications" group on Stock Items      | Create a group on the `inventory` resource                                       |
| The same "Specifications" idea on Listings | Create a parallel group on the `catalog` resource — independent identity         |
| Bulk-apply a group to many entities        | Use Listing Templates (for Listings) or bulk-edit (for Stock Items) — not groups |

## Lifecycle

### Creating

1. Open **Settings > Attributes & tags**
2. Pick the resource tab (Inventory, Catalog, Customer, Order)
3. In the Attribute Groups section, click **Add group**
4. Set name, optional description, and sort order
5. Assign existing Attributes to the group, or assign them later from the Attributes table

### Updating

* Rename, edit description, and reorder freely — display only, no data impact
* Drag-reorder groups in the table to change their `sortOrder`
* Move an Attribute into or out of a group at any time by editing the Attribute's `groupId`

### Deleting

* Deleting a group does **not** delete its Attributes — they simply move back to the default ("Details") section
* Bulk delete is supported from the table's row-selection tools

System groups (`system`) cannot be deleted.

## Working with groups in the API

Groups are listed and modified via the internal API:

When you create an Attribute, supply the `groupId` to place it in a specific group, or omit it to leave the Attribute in the default section.

## Relationships

```mermaid theme={null}
%%{init: {'flowchart': {'nodeSpacing': 20, 'rankSpacing': 30}}}%%
flowchart TB
    subgraph ConceptBox["Data Organization"]
        direction TB
        Concept["**Attribute Group**"]
        Resource["Resource (inventory / catalog / customer / order)"]
        Concept ~~~ Resource
    end

    Attr1["Attribute 1"]
    Attr2["Attribute 2"]
    Attr3["Attribute 3"]

    subgraph RelatedBox["Surfaces in"]
        direction TB
        AttributesTab["Entity Attributes tab"]
        SettingsPage["Settings page"]
        AttributesTab ~~~ SettingsPage
    end

    Concept -->|contains| Attr1
    Concept -->|contains| Attr2
    Concept -->|contains| Attr3
    Concept -.->|drives layout of| RelatedBox

    style ConceptBox fill:#0000000d,stroke:#888,stroke-width:2px
    style Concept fill:#3b82f633,stroke:#3b82f6,stroke-width:3px,font-weight:bold
    style Resource fill:#0000000a,stroke:#999,stroke-width:1px
    style Attr1 fill:#10b98133,stroke:#10b981,stroke-width:2px
    style Attr2 fill:#10b98133,stroke:#10b981,stroke-width:2px
    style Attr3 fill:#10b98133,stroke:#10b981,stroke-width:2px
    style RelatedBox fill:#f59e0b1a,stroke:#f59e0b,stroke-width:2px
    style AttributesTab fill:#f59e0b1a,stroke:#f59e0b,stroke-width:1px
    style SettingsPage fill:#f59e0b1a,stroke:#f59e0b,stroke-width:1px
```

## FAQs

<AccordionGroup>
  <Accordion title="Can one Attribute belong to multiple groups?">
    No. An Attribute has exactly one `groupId` (or none, in which case it appears under the default "Details" section).
  </Accordion>

  <Accordion title="What happens if I delete a group with Attributes in it?">
    The group definition is removed but the Attributes are preserved. They move to the default section. To clean up Attributes too, delete or archive them separately.
  </Accordion>

  <Accordion title="Can groups be nested?">
    No — Attribute Groups are a single level. If you need finer subdivision, create multiple groups and order them with `sortOrder`.
  </Accordion>

  <Accordion title="What's the difference between a group and a tag?">
    Groups organize Attribute definitions in Settings and on the Attributes tab. Tags are user-applied labels on records (Customers, Stock Items) used for segmentation and filtering. Tags don't affect form layout.
  </Accordion>

  <Accordion title="Are system groups counted in my plan limits?">
    No. System groups (`system`) are managed by TWICE and don't count toward any group quota on your plan.
  </Accordion>
</AccordionGroup>

## Developer Reference

Attribute groups are exposed under the `attributes` tag in the API.

<Card title="API: Attribute Groups" icon="code" href="https://server.twicecommerce.com/api/internal">
  Open the endpoint in the API reference.
</Card>

## Related

<CardGroup cols={2}>
  <Card title="Attributes" icon="tag" href="/docs/concepts/admin/attributes">
    The fields that groups contain
  </Card>

  <Card title="Attributes & Tags settings" icon="gear" href="/docs/settings/attributes-tags">
    Where you create and manage groups in the admin
  </Card>

  <Card title="Listing Templates" icon="copy" href="/docs/settings/listing-templates">
    Bulk-apply attribute sets when creating new Listings
  </Card>

  <Card title="Design Patterns" icon="shapes" href="/docs/concepts/repeating-patterns/design-patterns">
    How groups fit into the broader tab-based detail page layout
  </Card>
</CardGroup>
