---
title: Ürün özellikleri
description: Ürün özelliklerini (attribute) yönetin.
full: true
---

## ProductAttribute nesnesi [#ProductAttribute]

**`ProductAttribute`** (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ığı. |
| `description` | `String` | Özelliğin açıklaması |
| `id` | `String!` | Kaydın ID değeri. |
| `name` | `String!` | Özelliğin adı. |
| `options` | `[ProductAttributeOption!]` | Özelliğin seçenekleri. |
| `tableTemplate` | `ProductAttributeTableTemplate` | Ürün özelliği için tablo şablonu açıklaması |
| `translations` | `[ProductAttributeTranslation!]` | Özelliğin çevirileri |
| `type` | `ProductAttributeTypeEnum!` | Özelliğin tipi Değerler: `BOOLEAN`, `CHOICE`, `COLOR_THUMBNAIL_MULTIPLE_CHOICE`, `DATE`, `DATETIME`, `HTML`, `IMAGE`, `MULTIPLE_CHOICE`, `NUMERIC`, `PRODUCT`, `TABLE`, `TEXT`. |
| `updatedAt` | `Timestamp` | Kaydın son güncellenme zamanı (milisaniye cinsinden Unix zaman damgası). |

Örnek (temsili):

```json
{
  "createdAt": 1735725600000,
  "deleted": false,
  "description": "Örnek açıklama",
  "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
  "name": "Örnek",
  "options": [
    {
      "colorCode": "string",
      "createdAt": 1735725600000,
      "deleted": false,
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "thumbnailImageId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "updatedAt": 1735725600000
    }
  ],
  "tableTemplate": {
    "columns": null,
    "rows": null
  },
  "translations": [
    {
      "description": "Örnek açıklama",
      "locale": "tr",
      "name": "Örnek",
      "options": null
    }
  ],
  "type": "BOOLEAN",
  "updatedAt": 1735725600000
}
```

## Ürün özelliklerini listele [#listProductAttribute]

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

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `id` | `StringFilterInput` | Kaydın ID değeri. |
| `name` | `StringFilterInput` |  |
| `updatedAt` | `DateFilterInput` | Kaydın son güncellenme zamanı (milisaniye cinsinden Unix zaman damgası). |

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

Örnek istek - Ürün özelliklerini listeleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

```graphql
{
  listProductAttribute {
    id
    name
    createdAt
  }
}
```

Örnek yanıt:

```json
{
  "data": {
    "listProductAttribute": [
      {
        "id": "8cf68e80-82ac-437f-9dd5-dc88cfef8293",
        "name": "Product attribute name",
        "createdAt": 1634019877744
      }
    ]
  }
}
```

## Ürün özelliği oluştur [#createProductAttribute]

**`createProductAttribute`** (mutation, v2)

ProductAttribute oluşturan mutation.

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

Parametreler:

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

Dönen değer: `ProductAttribute!`

Örnek istek - Ürün özelliği oluşturma (`POST https://api.myikas.com/api/v2/admin/graphql`):

Çoktan seçmeli bir ürün özelliğini seçenekleriyle birlikte oluşturur. Dönen seçenek `id` değerlerini ürünlere özellik değeri atarken kullanabilirsiniz.

```graphql
mutation CreateProductAttribute($input: CreateProductAttributeInput!) {
  createProductAttribute(input: $input) {
    id
    name
    description
    type
    options {
      id
      name
    }
    createdAt
  }
}
```

```json
{
  "input": {
    "name": "Kumaş Tipi",
    "description": "Ürünün ana kumaş içeriği.",
    "type": "MULTIPLE_CHOICE",
    "options": [
      {
        "name": "Pamuk"
      },
      {
        "name": "Keten"
      },
      {
        "name": "Viskon"
      }
    ],
    "translations": [
      {
        "locale": "en",
        "name": "Fabric Type",
        "description": "Main fabric content of the product."
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "createProductAttribute": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "description": "Örnek açıklama",
      "type": "BOOLEAN",
      "options": [
        {
          "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
          "name": "Örnek"
        }
      ],
      "createdAt": 1735725600000
    }
  }
}
```

## Ürün özelliğini güncelle [#updateProductAttribute]

**`updateProductAttribute`** (mutation, v2)

ProductAttribute güncelleyen mutation.

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

Parametreler:

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

Dönen değer: `ProductAttribute!`

Örnek istek - Ürün özelliğini güncelleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Mevcut bir ürün özelliğinin açıklamasını ve İngilizce çevirisini günceller. Yalnızca gönderdiğiniz field'lar değişir.

```graphql
mutation UpdateProductAttribute($input: UpdateProductAttributeInput!) {
  updateProductAttribute(input: $input) {
    id
    name
    description
    type
    translations {
      locale
      name
      description
    }
    updatedAt
  }
}
```

```json
{
  "input": {
    "id": "a87fe188-f40c-4fdd-afb0-20b65877b6c6",
    "description": "Ürünün ana kumaş içeriği. Karışım oranları ürün açıklamasında yer alır.",
    "translations": [
      {
        "locale": "en",
        "name": "Fabric Type",
        "description": "Main fabric content of the product. Blend ratios are listed in the product description."
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "updateProductAttribute": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "description": "Örnek açıklama",
      "type": "BOOLEAN",
      "translations": [
        {
          "locale": "tr",
          "name": "Örnek",
          "description": "Örnek açıklama"
        }
      ],
      "updatedAt": 1735725600000
    }
  }
}
```

## Ürün özelliği kaydet [#saveProductAttribute]

**`saveProductAttribute`** (mutation, v1)

Sağlanan input değerleriyle ürün özellikleri oluşturmak veya güncellemek için bu mutation'ı kullanın.

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

Parametreler:

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

Dönen değer: `ProductAttribute!`

Örnek istek - Ürün özelliği kaydetme (`POST https://api.myikas.com/api/v1/admin/graphql`):

v1 sürümünde ürün özelliği oluşturur; `id` gönderildiğinde aynı mutation mevcut özelliği günceller.

```graphql
mutation SaveProductAttribute($input: ProductAttributeInput!) {
  saveProductAttribute(input: $input) {
    id
    name
    description
    type
    updatedAt
  }
}
```

```json
{
  "input": {
    "name": "Yıkama Talimatı",
    "description": "Ürün detay sayfasında gösterilen bakım ve yıkama bilgisi.",
    "type": "TEXT"
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "saveProductAttribute": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "name": "Örnek",
      "description": "Örnek açıklama",
      "type": "BOOLEAN",
      "updatedAt": 1735725600000
    }
  }
}
```

## Ürün özelliklerini sil [#deleteProductAttributeList]

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

ProductAttribute 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 - Ürün özelliklerini silme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Artık kullanılmayan ürün özelliklerini tek istekte siler.

```graphql
mutation DeleteProductAttributeList($idList: [String!]!) {
  deleteProductAttributeList(idList: $idList)
}
```

```json
{
  "idList": [
    "c48c5d42-ef84-4eef-9242-a6d248ab8111",
    "fef7e414-7812-4506-b540-fb3b8430bca5"
  ]
}
```

Örnek yanıt (temsili):

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