---
title: Vergiler
description: Ürün ve ülke bazlı vergi ayarlarını yönetin.
full: true
---

<Callout type="info" title="Vergi ayarları silinemez">
Vergi ayarları ve genel vergi ayarları Admin API ile silinemez. Bir ayarı değiştirmek için güncelleme işlemlerini kullanın.
</Callout>

## Vergi ayarlarını listele [#listTaxSettings]

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

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `countryId` | `StringFilterInput` |  |
| `id` | `StringFilterInput` | Kaydın ID değeri. |
| `includeDeleted` | `Boolean` | `true` gönderilirse silinmiş kayıtlar da listelenir. |

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

Örnek istek - Ülke vergi ayarlarını listeleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Türkiye için tanımlı vergi ayarlarını; varsayılan KDV oranını, ürün etiketi bazlı istisnaları ve kargo vergi oranını getirir.

```graphql
query ListTaxSettings($countryId: StringFilterInput) {
  listTaxSettings(countryId: $countryId) {
    id
    countryId
    taxRate
    productOverrides {
      productTagIds
      taxRate
    }
    shippingTaxRates {
      taxRate
    }
    giftPackageTaxRates {
      taxRate
    }
    updatedAt
  }
}
```

```json
{
  "countryId": {
    "eq": "0ec75c16-fa7a-4f37-b67f-882dd5bc2d20"
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "listTaxSettings": [
      {
        "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "countryId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "taxRate": 20,
        "productOverrides": [
          {
            "productTagIds": [
              "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21"
            ],
            "taxRate": 20
          }
        ],
        "shippingTaxRates": [
          {
            "taxRate": 20
          }
        ],
        "giftPackageTaxRates": [
          {
            "taxRate": 20
          }
        ],
        "updatedAt": 1735725600000
      }
    ]
  }
}
```

## Vergi ayarı oluştur [#createTaxSettings]

**`createTaxSettings`** (mutation, v2)

TaxSettings oluşturan mutation.

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

Parametreler:

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

Dönen değer: `TaxSettings!`

Örnek istek - Ülke vergi ayarı oluşturma (`POST https://api.myikas.com/api/v2/admin/graphql`):

Türkiye için varsayılan KDV oranını %20 olarak tanımlar; "KDV %10" etiketli ürünlere %10 oran uygular. Kargo ve hediye paketi ücretleri için de %20 KDV belirlenir.

```graphql
mutation CreateTaxSettings($input: CreateTaxSettingsInput!) {
  createTaxSettings(input: $input) {
    id
    countryId
    taxRate
    productOverrides {
      productTagIds
      taxRate
    }
    shippingTaxRates {
      taxRate
    }
    giftPackageTaxRates {
      taxRate
    }
  }
}
```

```json
{
  "input": {
    "countryId": "0ec75c16-fa7a-4f37-b67f-882dd5bc2d20",
    "taxRate": 20,
    "productOverrides": [
      {
        "productTagIds": [
          "ae2bdaf0-26a8-4670-b64e-927d272eba40"
        ],
        "taxRate": 10
      }
    ],
    "shippingTaxRates": [
      {
        "taxRate": 20
      }
    ],
    "giftPackageTaxRates": [
      {
        "taxRate": 20
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "createTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "countryId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "taxRate": 20,
      "productOverrides": [
        {
          "productTagIds": [
            "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21"
          ],
          "taxRate": 20
        }
      ],
      "shippingTaxRates": [
        {
          "taxRate": 20
        }
      ],
      "giftPackageTaxRates": [
        {
          "taxRate": 20
        }
      ]
    }
  }
}
```

## Vergi ayarını güncelle [#updateTaxSettings]

**`updateTaxSettings`** (mutation, v2)

TaxSettings güncelleyen mutation.

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

Parametreler:

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

Dönen değer: `TaxSettings!`

Örnek istek - Ürün vergi istisnalarını güncelleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Mevcut vergi ayarına, %10 KDV'ye tabi yeni bir ürün grubu için etiket bazlı istisna ekler.

```graphql
mutation UpdateTaxSettings($input: UpdateTaxSettingsInput!) {
  updateTaxSettings(input: $input) {
    id
    taxRate
    productOverrides {
      productTagIds
      taxRate
    }
    updatedAt
  }
}
```

```json
{
  "input": {
    "id": "bf3d0d5b-aad7-4ce6-88ca-9af6de036b6d",
    "productOverrides": [
      {
        "productTagIds": [
          "ae2bdaf0-26a8-4670-b64e-927d272eba40"
        ],
        "taxRate": 10
      },
      {
        "productTagIds": [
          "8e3515bd-1e3e-4fad-ab5b-83fbf8c29c9d"
        ],
        "taxRate": 10
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "updateTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "taxRate": 20,
      "productOverrides": [
        {
          "productTagIds": [
            "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21"
          ],
          "taxRate": 20
        }
      ],
      "updatedAt": 1735725600000
    }
  }
}
```

## Vergi ayarı kaydet [#saveTaxSettings]

**`saveTaxSettings`** (mutation, v1)

TaxSettings kaydeden mutation.

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

Parametreler:

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

Dönen değer: `TaxSettings!`

Örnek istek - Ülke vergi ayarı kaydetme (`POST https://api.myikas.com/api/v1/admin/graphql`):

Türkiye için %20 varsayılan KDV ve "KDV %10" etiketli ürünler için %10 oranla vergi ayarını kaydeder. `id` gönderilmezse yeni kayıt oluşturulur, gönderilirse mevcut kayıt güncellenir.

```graphql
mutation SaveTaxSettings($input: TaxSettingsInput!) {
  saveTaxSettings(input: $input) {
    id
    countryId
    taxRate
    productOverrides {
      productTagIds
      taxRate
    }
  }
}
```

```json
{
  "input": {
    "countryId": "0ec75c16-fa7a-4f37-b67f-882dd5bc2d20",
    "taxRate": 20,
    "productOverrides": [
      {
        "productTagIds": [
          "ae2bdaf0-26a8-4670-b64e-927d272eba40"
        ],
        "taxRate": 10
      }
    ],
    "shippingTaxRates": [
      {
        "taxRate": 20
      }
    ]
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "saveTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "countryId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "taxRate": 20,
      "productOverrides": [
        {
          "productTagIds": [
            "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21"
          ],
          "taxRate": 20
        }
      ]
    }
  }
}
```

## Genel vergi ayarlarını getir [#getGlobalTaxSettings]

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

Mağazanın genel vergi ayarlarını getirmek için bu query'yi kullanın.

Parametreler:

_Parametre yok._

Dönen değer: `GlobalTaxSettings`

Örnek istek - Genel vergi ayarlarını getirme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Mağazanın genel vergi ayarlarını getirir. Fiyatların KDV dahil mi hariç mi girildiğini öğrenmek, örneğin ERP veya fatura entegrasyonunda tutarları doğru hesaplamak için kullanılır.

```graphql
query GetGlobalTaxSettings {
  getGlobalTaxSettings {
    id
    isTaxExcludedOnPrices
    isTaxExcludedOnShippingPrices
    storefrontId
    updatedAt
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "getGlobalTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "isTaxExcludedOnPrices": true,
      "isTaxExcludedOnShippingPrices": true,
      "storefrontId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "updatedAt": 1735725600000
    }
  }
}
```

## Genel vergi ayarlarını listele [#listGlobalTaxSettings]

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

Parametreler:

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `id` | `StringFilterInput` | Kaydın ID değeri. |
| `includeDeleted` | `Boolean` | `true` gönderilirse silinmiş kayıtlar da listelenir. |
| `storefrontId` | `StringFilterInput` |  |

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

Örnek istek - Satış kanalının genel vergi ayarlarını listeleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Belirli bir satış kanalına (storefront) ait genel vergi ayarlarını listeler.

```graphql
query ListGlobalTaxSettings($storefrontId: StringFilterInput) {
  listGlobalTaxSettings(storefrontId: $storefrontId) {
    id
    storefrontId
    isTaxExcludedOnPrices
    isTaxExcludedOnShippingPrices
    updatedAt
  }
}
```

```json
{
  "storefrontId": {
    "eq": "c8445c65-ba53-42f1-b463-2251891ab4fb"
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "listGlobalTaxSettings": [
      {
        "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "storefrontId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
        "isTaxExcludedOnPrices": true,
        "isTaxExcludedOnShippingPrices": true,
        "updatedAt": 1735725600000
      }
    ]
  }
}
```

## Genel vergi ayarı oluştur [#createGlobalTaxSettings]

**`createGlobalTaxSettings`** (mutation, v2)

GlobalTaxSettings oluşturan mutation.

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

Parametreler:

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

Dönen değer: `GlobalTaxSettings!`

Örnek istek - Genel vergi ayarı oluşturma (`POST https://api.myikas.com/api/v2/admin/graphql`):

Bayi ve kurumsal müşterilere hizmet veren bir satış kanalında ürün fiyatlarının KDV hariç girildiğini tanımlar; kargo ücretleri KDV dahil kalır.

```graphql
mutation CreateGlobalTaxSettings($input: CreateGlobalTaxSettingsInput!) {
  createGlobalTaxSettings(input: $input) {
    id
    storefrontId
    isTaxExcludedOnPrices
    isTaxExcludedOnShippingPrices
    createdAt
  }
}
```

```json
{
  "input": {
    "storefrontId": "c8445c65-ba53-42f1-b463-2251891ab4fb",
    "isTaxExcludedOnPrices": true,
    "isTaxExcludedOnShippingPrices": false
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "createGlobalTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "storefrontId": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "isTaxExcludedOnPrices": true,
      "isTaxExcludedOnShippingPrices": true,
      "createdAt": 1735725600000
    }
  }
}
```

## Genel vergi ayarını güncelle [#updateGlobalTaxSettings]

**`updateGlobalTaxSettings`** (mutation, v2)

GlobalTaxSettings güncelleyen mutation.

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

Parametreler:

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

Dönen değer: `GlobalTaxSettings!`

Örnek istek - Genel vergi ayarını güncelleme (`POST https://api.myikas.com/api/v2/admin/graphql`):

Kargo ücretlerinin de KDV hariç girildiğini belirtmek için mevcut genel vergi ayarını günceller.

```graphql
mutation UpdateGlobalTaxSettings($input: UpdateGlobalTaxSettingsInput!) {
  updateGlobalTaxSettings(input: $input) {
    id
    isTaxExcludedOnPrices
    isTaxExcludedOnShippingPrices
    updatedAt
  }
}
```

```json
{
  "input": {
    "id": "ecdf28ce-4405-4a2b-a6f9-d494493eb973",
    "isTaxExcludedOnShippingPrices": true
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "updateGlobalTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "isTaxExcludedOnPrices": true,
      "isTaxExcludedOnShippingPrices": true,
      "updatedAt": 1735725600000
    }
  }
}
```

## Genel vergi ayarı kaydet [#saveGlobalTaxSettings]

**`saveGlobalTaxSettings`** (mutation, v1)

GlobalTaxSettings kaydeden mutation.

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

Parametreler:

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

Dönen değer: `GlobalTaxSettings!`

Örnek istek - Genel vergi ayarı kaydetme (`POST https://api.myikas.com/api/v1/admin/graphql`):

Ürün ve kargo fiyatlarının KDV dahil girildiği genel vergi ayarını kaydeder. Türkiye'de tüketiciye satış yapan mağazalar için yaygın kurulumdur.

```graphql
mutation SaveGlobalTaxSettings($input: GlobalTaxSettingsInput!) {
  saveGlobalTaxSettings(input: $input) {
    id
    isTaxExcludedOnPrices
    isTaxExcludedOnShippingPrices
    updatedAt
  }
}
```

```json
{
  "input": {
    "isTaxExcludedOnPrices": false,
    "isTaxExcludedOnShippingPrices": false
  }
}
```

Örnek yanıt (temsili):

```json
{
  "data": {
    "saveGlobalTaxSettings": {
      "id": "0f9d2c3e-6b1a-4c7e-9a52-3d8e1f4b7c21",
      "isTaxExcludedOnPrices": true,
      "isTaxExcludedOnShippingPrices": true,
      "updatedAt": 1735725600000
    }
  }
}
```
