# ATTRIBUTE\_KEYS\_FOR\_ATTRIBUTE\_BASED\_SHIPPING\_OPTION

**Type**: `array` (ListSerializer)\
**Default**: `[]`\
**Description**: Configuration for attribute-based shipping option grouping. Defines how products are grouped by attribute values and which grouping applies based on shipping address location.

**How It Works**:

1. Rules are evaluated in `sort_order` priority (lower values first)
2. The **first rule** that matches the shipping address determines the `group_attribute_key`
3. Products are grouped by the **VALUE** of the selected attribute key
4. Products without the attribute are grouped under `"None"`

**Entry Structure**:

* `group_attribute_key` (string or array, required): Attribute key(s) used for grouping.
  * Single key: `"warehouse_location"` â†’ groups by that attribute's value
  * Multiple keys: `["brand", "category"]` â†’ creates composite group keys like `"Nike;shoes"`
* `rule` (object, required): Location-based rule that determines when this grouping applies.
  * Available rules: `any-rule`, `country-rule`, `city-rule`, `township-rule`, `district-rule`, `postal-code-rule`, `not-rule`, `and-rule`, `or-rule`
  * Rule structure: `{"slug": "country-rule", "countries": [1, 2], "exclude": false}`
* `sort_order` (integer, required): Priority for rule evaluation (lower = higher priority)

**Example Configuration**:

```json
[
  {
    "group_attribute_key": "warehouse_location",
    "rule": {"slug": "country-rule", "countries": [1, 2], "exclude": false},
    "sort_order": 1
  },
  {
    "group_attribute_key": ["brand", "category"],
    "rule": {"slug": "city-rule", "cities": [5], "exclude": false},
    "sort_order": 2
  },
  {
    "group_attribute_key": "supplier",
    "rule": {"slug": "any-rule"},
    "sort_order": 99
  }
]
```

**Resulting Groups** (example):

* Address in country 1: Products grouped by `warehouse_location` values (e.g., `"istanbul"`, `"ankara"`, `"None"`)
* Address in city 5 (not in countries 1, 2): Products grouped by composite keys (e.g., `"Nike;shoes"`, `"Adidas;None"`)
* Other addresses: Products grouped by `supplier` values

**Used in**: `AttributeBasedShippingOptionSelectionPage` to group products by attribute values


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/checkout/dynamic-settings/attribute_keys_for_attribute_based_shipping_option.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
