**Version: 202601**

# Create member group

**POST** `/openapi/2026-01/loyalty/member-groups`

Create a new member segment for targeted operations

## Request

**application/json**

**Body | Example**

**Body (required)**

- `name` string (required)

  Group name
- `idempotency_key` string

  Optional idempotency key
- `member_condition` object (required)

  Member filter condition

  - `key` string
  - `operator` string
  - `value` GoogleProtobufValue

    Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.
  - `extra` object

    Member condition extra config (time window, categories, products, regions)

    - `time_range` string

      Time range window: all / 7d / 30d
    - `categories` object[]

      Categories filter, 2-level nested array (\[\["a","a-1"\],\["b"\]\])

      *   Array \[

      - `values` GoogleProtobufValue[]

        Repeated field of dynamically typed values.
      *   \]
    - `product_ids` string[]

      Product id list
    - `country_and_province` object

      Country+province map: key=country code, value=province codes (\["ALL"\]=whole country)

      - `property name*` ListValue

        `ListValue` is a wrapper around a repeated field of values.

        The JSON representation for `ListValue` is JSON array.

        - `values` GoogleProtobufValue[]

          Repeated field of dynamically typed values.
  - `relation` string
  - `children` undefined[]

```json
{
  "name": "string",
  "idempotency_key": "string",
  "member_condition": {
    "key": "string",
    "operator": "string",
    "extra": {
      "time_range": "string",
      "categories": [
        {
          "values": [
            null
          ]
        }
      ],
      "product_ids": [
        "string"
      ],
      "country_and_province": {}
    },
    "relation": "string",
    "children": [
      null
    ]
  }
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  Create member group response

  - `member_group_id` string
  - `name` string
  - `is_real_time` boolean
  - `member_count` int64
  - `created_at` string
  - `updated_at` string
  - `member_condition` object

    Member condition expression (recursive tree)

    - `key` string
    - `operator` string
    - `value` GoogleProtobufValue

      Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.
    - `extra` object

      Member condition extra config (time window, categories, products, regions)

      - `time_range` string

        Time range window: all / 7d / 30d
      - `categories` object[]

        Categories filter, 2-level nested array (\[\["a","a-1"\],\["b"\]\])

        *   Array \[

        - `values` GoogleProtobufValue[]

          Repeated field of dynamically typed values.
        *   \]
      - `product_ids` string[]

        Product id list
      - `country_and_province` object

        Country+province map: key=country code, value=province codes (\["ALL"\]=whole country)

        - `property name*` ListValue

          `ListValue` is a wrapper around a repeated field of values.

          The JSON representation for `ListValue` is JSON array.

          - `values` GoogleProtobufValue[]

            Repeated field of dynamically typed values.
    - `relation` string
    - `children` undefined[]

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "member_group_id": "string",
    "name": "string",
    "is_real_time": true,
    "member_count": 0,
    "created_at": "string",
    "updated_at": "string",
    "member_condition": {
      "key": "string",
      "operator": "string",
      "extra": {
        "time_range": "string",
        "categories": [
          {
            "values": [
              null
            ]
          }
        ],
        "product_ids": [
          "string"
        ],
        "country_and_province": {}
      },
      "relation": "string",
      "children": [
        null
      ]
    }
  }
}
```
