---
title: Ürün seçenek setleri
description: Ürünlere eklenen kişiselleştirme seçeneklerini yönetin.
full: true
---

## ProductOptionSet nesnesi [#ProductOptionSet]

**`ProductOptionSet`** (v1 · v2)

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `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. |
| `name` | `String!` |  |
| `options` | `[ProductOption!]!` |  |
| `translations` | `[ProductOptionSetTranslations!]` |  |
| `updatedAt` | `Timestamp` | Kaydın son güncellenme zamanı (milisaniye cinsinden Unix zaman damgası). |

Örnek (temsili):

```json
{
  "createdAt": 1735725600000,
  "deleted": false,
  "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
  "name": "Örnek",
  "options": [
    {
      "applyAfterCampaign": true,
      "createdAt": 1735725600000,
      "dateSettings": null,
      "deleted": false,
      "fileSettings": null,
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "isOptional": true,
      "name": "Örnek",
      "optionalText": "string",
      "order": 1,
      "otherPrices": null,
      "price": 129.9,
      "priceType": "AMOUNT",
      "requiredOptionId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "requiredOptionValueIds": [
        "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21"
      ],
      "selectSettings": null,
      "textSettings": null,
      "type": "CHECKBOX",
      "updatedAt": 1735725600000
    }
  ],
  "translations": [
    {
      "locale": "tr",
      "options": null
    }
  ],
  "updatedAt": 1735725600000
}
```

## Ürün seçenek setlerini listele [#listProductOptionSet]

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

Bu API ile ürünlerin seçenek setlerini görüntüleyebilirsiniz.
Arama şu alanda yapılabilir: `name`.
Örnek: search='test' ise bu alanda 'test' içeren kayıtlarla eşleşir.

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `id` | `StringFilterInput` | Kaydın ID değeri. |
| `name` (yalnızca v2) | `StringFilterInput` | Ürün seçenek seti adına göre filtreleyebilirsiniz. |
| `search` | `String` | Listeleme API'lerinde belirtilen alanlarda arama yapılmasını sağlar. Örnek: searchableFields=['name', 'description'] ve search='AAA' ise, API name veya description alanında 'AAA' içeren kayıtları döndürür. |
| `updatedAt` | `DateFilterInput` | Kaydın son güncellenme zamanı (milisaniye cinsinden Unix zaman damgası). |

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

Örnek istek - Ürün seçenek setlerini listeleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Belirli bir tarihten sonra değişen seçenek setlerini, seçenekleriyle birlikte getirir. Kişiselleştirme seçeneklerini kendi sisteminizle eşitlerken kullanabilirsiniz.

```graphql
query ListProductOptionSet($updatedAt: DateFilterInput) {
  listProductOptionSet(updatedAt: $updatedAt) {
    id
    name
    options {
      id
      name
      type
      order
      isOptional
      price
      priceType
    }
    updatedAt
  }
}
```

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

Örnek yanıt (temsili):

```json
{
  "data": {
    "listProductOptionSet": [
      {
        "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "name": "Örnek",
        "options": [
          {
            "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
            "name": "Örnek",
            "type": "CHECKBOX",
            "order": 1,
            "isOptional": true,
            "price": 129.9,
            "priceType": "AMOUNT"
          }
        ],
        "updatedAt": 1735725600000
      }
    ]
  }
}
```

## Ürün seçenek seti kaydet [#saveProductOptionSet]

**`saveProductOptionSet`** (mutation, v2)

Bu API ile ürün seçenek setleri oluşturabilir veya güncelleyebilirsiniz.

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

Parametreler:

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

Dönen değer: `ProductOptionSet!`

Örnek istek - Hediye paketi seçenek seti kaydetme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Ürüne ücretli bir hediye paketi seçeneği ve yalnızca bu seçenek işaretlendiğinde görünen bir hediye notu alanı ekler. Seçenek `id` değerlerini istemci tarafında UUID olarak üretirsiniz; `requiredOptionId` notu hediye paketi seçeneğine bağlar.

```graphql
mutation SaveProductOptionSet($input: ProductOptionSetInput!) {
  saveProductOptionSet(input: $input) {
    id
    name
    options {
      id
      name
      type
      isOptional
      price
      priceType
      requiredOptionId
    }
    createdAt
  }
}
```

```json
{
  "input": {
    "name": "Hediye Paketi",
    "options": [
      {
        "id": "4a7a1873-de77-4a66-b853-6e2511f43347",
        "name": "Hediye paketi istiyorum",
        "type": "CHECKBOX",
        "order": 1,
        "isOptional": true,
        "price": 49.9,
        "priceType": "AMOUNT",
        "deleted": false
      },
      {
        "id": "81ab4cbb-c447-4ef0-976e-cc5be255c5eb",
        "name": "Hediye notu",
        "type": "TEXT_AREA",
        "order": 2,
        "isOptional": true,
        "textSettings": {
          "max": 200
        },
        "requiredOptionId": "4a7a1873-de77-4a66-b853-6e2511f43347",
        "deleted": false
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "saveProductOptionSet": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "options": [
        {
          "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
          "name": "Örnek",
          "type": "CHECKBOX",
          "isOptional": true,
          "price": 129.9,
          "priceType": "AMOUNT",
          "requiredOptionId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21"
        }
      ],
      "createdAt": 1735725600000
    }
  }
}
```

Örnek istek - Gravür seçenek seti kaydetme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Takı veya kalem gibi ürünlerde müşterinin gravür metnini ve yazı tipini seçmesini sağlar. Seçim listesi olan seçeneklerde değerler `selectSettings.values` içinde tanımlanır.

```graphql
mutation SaveProductOptionSet($input: ProductOptionSetInput!) {
  saveProductOptionSet(input: $input) {
    id
    name
    options {
      id
      name
      type
      price
      textSettings {
        min
        max
      }
      selectSettings {
        type
        values {
          id
          value
        }
      }
    }
    updatedAt
  }
}
```

```json
{
  "input": {
    "name": "Gravür",
    "options": [
      {
        "id": "feff495e-9536-451c-9bdc-aec82d9723c1",
        "name": "Gravür metni",
        "type": "TEXT",
        "order": 1,
        "textSettings": {
          "min": 1,
          "max": 20
        },
        "price": 75,
        "priceType": "AMOUNT",
        "deleted": false
      },
      {
        "id": "bd9e3f23-dbd1-4476-9a0e-6eb173dc8b43",
        "name": "Yazı tipi",
        "type": "CHOICE",
        "order": 2,
        "deleted": false,
        "selectSettings": {
          "type": "BOX",
          "minSelect": 1,
          "maxSelect": 1,
          "values": [
            {
              "id": "fa9b34f2-9fcb-4c0c-8289-7e92120585ae",
              "value": "Klasik",
              "order": 1,
              "deleted": false
            },
            {
              "id": "ac1e2e71-b24a-42f2-8ed7-939892ca3de5",
              "value": "El yazısı",
              "order": 2,
              "deleted": false
            }
          ]
        }
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "saveProductOptionSet": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "options": [
        {
          "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
          "name": "Örnek",
          "type": "CHECKBOX",
          "price": 129.9,
          "textSettings": {
            "min": 1,
            "max": 1
          },
          "selectSettings": {
            "type": "BOX",
            "values": [
              {
                "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
                "value": "string"
              }
            ]
          }
        }
      ],
      "updatedAt": 1735725600000
    }
  }
}
```

## Ürün seçenek setlerini sil [#deleteProductOptionSetList]

**`deleteProductOptionSetList`** (mutation, v2)

Bu API ile ürün seçenek setlerini silebilirsiniz.

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

Parametreler:

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

Dönen değer: `Boolean!`

Örnek istek - Ürün seçenek setlerini silme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Kullanılmayan seçenek setlerini siler. Silinen setler bağlı oldukları ürünlerden de kaldırılır.

```graphql
mutation DeleteProductOptionSetList($idList: [String!]!) {
  deleteProductOptionSetList(idList: $idList)
}
```

```json
{
  "idList": [
    "8d0ea4bb-c84b-48cd-82b9-54c322a6828e"
  ]
}
```

Örnek yanıt (temsili):

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