---
title: Müşteri grupları
description: Müşteri gruplarını yönetin.
full: true
---

## CustomerGroup nesnesi [#CustomerGroup]

**`CustomerGroup`** (v1 · v2)

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `conditions` | `[CustomerGroupCondition!]` |  |
| `createdAt` | `Timestamp` | Kaydın oluşturulma zamanı (milisaniye cinsinden Unix zaman damgası). |
| `deleted` | `Boolean!` | Kaydın silinmiş olup olmadığı. |
| `id` | `String!` | Kaydın ID değeri. |
| `isAutomated` | `Boolean` |  |
| `name` | `String!` |  |
| `priceListId` | `String` |  |
| `priceListRules` | `[CustomerPriceListRule!]` |  |
| `shouldMatchAllConditions` | `Boolean` |  |
| `updatedAt` | `Timestamp` | Kaydın son güncellenme zamanı (milisaniye cinsinden Unix zaman damgası). |

Örnek (temsili):

```json
{
  "conditions": [
    {
      "conditionType": "ACCOUNT_STATUS",
      "method": "IN",
      "valueList": [
        "string"
      ]
    }
  ],
  "createdAt": 1735725600000,
  "deleted": false,
  "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
  "isAutomated": true,
  "name": "Örnek",
  "priceListId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
  "priceListRules": [
    {
      "discountRate": 20,
      "filters": null,
      "priceListId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "shouldMatchAllFilters": true,
      "value": 129.9,
      "valueType": "DISCOUNT_AMOUNT"
    }
  ],
  "shouldMatchAllConditions": true,
  "updatedAt": 1735725600000
}
```

## Müşteri gruplarını listele [#listCustomerGroup]

**`listCustomerGroup`** (query, v1 · v2)

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `id` | `StringFilterInput` | Kaydın ID değeri. |
| `name` | `StringFilterInput` |  |
| `search` (yalnızca v2) | `String` | Serbest metin araması. |
| `updatedAt` | `DateFilterInput` | Kaydın son güncellenme zamanı (milisaniye cinsinden Unix zaman damgası). |
| `includeDeleted` (yalnızca v1) | `Boolean` | `true` gönderilirse silinmiş kayıtlar da listelenir. |

Dönen değer: `[CustomerGroup!]!`

Örnek istek - Müşteri gruplarını listeleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

CRM entegrasyonunda grup adlarını ID'lerle eşleştirmek için kullanılır. `updatedAt` filtresiyle yalnızca son senkronizasyondan sonra değişen gruplar alınabilir.

```graphql
query ListCustomerGroup($updatedAt: DateFilterInput) {
  listCustomerGroup(updatedAt: $updatedAt) {
    id
    name
    isAutomated
    shouldMatchAllConditions
    priceListId
    updatedAt
  }
}
```

```json
{
  "updatedAt": {
    "gt": 1790812800000
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "listCustomerGroup": [
      {
        "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "name": "Örnek",
        "isAutomated": true,
        "shouldMatchAllConditions": true,
        "priceListId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "updatedAt": 1735725600000
      }
    ]
  }
}
```

## Müşteri grubu oluştur [#createCustomerGroup]

**`createCustomerGroup`** (mutation, v2)

CustomerGroup oluşturan mutation.

Yalnızca v2 endpoint'inde: `https://api.myikas.com/api/v2/admin/graphql`

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `input` (zorunlu) | `CreateCustomerGroupInput!` | İşlemin girdi nesnesi. |

Dönen değer: `CustomerGroup!`

Örnek istek - Müşteri grubu oluşturma (`POST https://api.myikas.com/api/v2/admin/graphql`):

Müşterileri manuel olarak atayacağınız bir grup oluşturur. Grup, kampanya ve fiyat listesi kurallarında hedef kitle olarak kullanılabilir.

```graphql
mutation CreateCustomerGroup($input: CreateCustomerGroupInput!) {
  createCustomerGroup(input: $input) {
    id
    name
    isAutomated
    createdAt
  }
}
```

```json
{
  "input": {
    "name": "Kurumsal Müşteriler",
    "isAutomated": false
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "createCustomerGroup": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "isAutomated": true,
      "createdAt": 1735725600000
    }
  }
}
```

## Müşteri grubunu güncelle [#updateCustomerGroup]

**`updateCustomerGroup`** (mutation, v2)

CustomerGroup güncelleyen mutation.

Yalnızca v2 endpoint'inde: `https://api.myikas.com/api/v2/admin/graphql`

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `input` (zorunlu) | `UpdateCustomerGroupInput!` | İşlemin girdi nesnesi. |

Dönen değer: `CustomerGroup!`

Örnek istek - Müşteri grubu güncelleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Mevcut bir müşteri grubunun adını değiştirmek için kullanılır.

```graphql
mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) {
  updateCustomerGroup(input: $input) {
    id
    name
    updatedAt
  }
}
```

```json
{
  "input": {
    "id": "df8b1e42-8225-4b1a-ac95-096197aa7149",
    "name": "Kurumsal Bayiler"
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "updateCustomerGroup": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "updatedAt": 1735725600000
    }
  }
}
```

## Müşteri grubu kaydet [#saveCustomerGroup]

**`saveCustomerGroup`** (mutation, v1)

CustomerGroup kaydeden mutation.

Yalnızca v1 endpoint'inde: `https://api.myikas.com/api/v1/admin/graphql`. v2 karşılığı: `createCustomerGroup`, `updateCustomerGroup`.

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `input` (zorunlu) | `CustomerGroupInput!` | İşlemin girdi nesnesi. |

Dönen değer: `CustomerGroup!`

Örnek istek - Müşteri grubu kaydetme (`POST https://api.myikas.com/api/v1/admin/graphql`):

```graphql
mutation SaveCustomerGroup($input: CustomerGroupInput!) {
  saveCustomerGroup(input: $input) {
    id
    name
    createdAt
  }
}
```

```json
{
  "input": {
    "name": "Sadakat Programı Üyeleri"
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "saveCustomerGroup": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "createdAt": 1735725600000
    }
  }
}
```

## Müşteri gruplarını sil [#deleteCustomerGroupList]

**`deleteCustomerGroupList`** (mutation, v1 · v2)

CustomerGroup silen mutation.

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `idList` (zorunlu) | `[String!]!` | İşlem yapılacak kayıtların ID listesi. |

Dönen değer: `Boolean!`

Örnek istek - Müşteri gruplarını silme (`POST https://api.myikas.com/api/v2/admin/graphql`):

```graphql
mutation DeleteCustomerGroupList($idList: [String!]!) {
  deleteCustomerGroupList(idList: $idList)
}
```

```json
{
  "idList": [
    "0f8d3110-9326-4477-9104-4705bf31639a"
  ]
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "deleteCustomerGroupList": true
  }
}
```
