{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "e-Fatura ve e-Arşiv — json2ubl-ts SimpleInvoiceInput",
  "description": "e-Fatura ve e-Arşiv aynı girdi tipini (SimpleInvoiceInput) kullanır; e-Arşiv için ayrı şema yoktur. POST /v1/documents gövdesindeki `document` alanının şeması; documentType: FATURA. additionalProperties:false sunucuda uygulanır: tanınmayan alan (ör. yazım hatası) 400 DOCUMENT_INVALID ile reddedilir, issues[].field alanın yolunu verir. uuid Belgeniz API'de zorunludur.",
  "$comment": "json2ubl-ts 5.3.1 tip tanımından (dist/index.d.ts, SimpleInvoiceInput) üretildi. Kaynak: https://github.com/rahat-fatura/json2ubl-ts",
  "x-json2ubl-ts-version": "5.3.1",
  "x-json2ubl-ts-type": "SimpleInvoiceInput",
  "$ref": "#/definitions/SimpleInvoiceInput",
  "definitions": {
    "SimpleInvoiceInput": {
      "type": "object",
      "properties": {
        "sender": {
          "type": "object",
          "properties": {
            "taxNumber": {
              "type": "string",
              "description": "Vergi kimlik numarası (10 hane VKN veya 11 hane TCKN) — zorunlu"
            },
            "name": {
              "type": "string",
              "description": "Firma adı veya kişi adı soyadı — zorunlu"
            },
            "taxOffice": {
              "type": "string",
              "description": "Vergi dairesi — VKN için zorunlu, TCKN için opsiyonel"
            },
            "address": {
              "type": "string",
              "description": "Adres — zorunlu"
            },
            "district": {
              "type": "string",
              "description": "İlçe — zorunlu"
            },
            "city": {
              "type": "string",
              "description": "İl — zorunlu"
            },
            "country": {
              "type": "string",
              "description": "Ülke — varsayılan: \"Türkiye\""
            },
            "zipCode": {
              "type": "string",
              "description": "Posta kodu — varsayılan: \"00000\""
            },
            "phone": {
              "type": "string",
              "description": "Telefon"
            },
            "email": {
              "type": "string",
              "description": "E-posta"
            },
            "website": {
              "type": "string",
              "description": "Web sitesi"
            },
            "identifications": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SimplePartyIdentification"
              },
              "description": "Ek taraf kimlik tanımlamaları (ör: MERSISNO, TICARETSICILNO)"
            },
            "alias": {
              "type": "string",
              "description": "e-Fatura posta kutusu etiketi (ör: \"urn:mail:defaultpk@firma.com.tr\").\n\n⚠️ **Bu alan üretilen UBL-TR Invoice XML'ine YAZILMAZ — bilerek.**\n\nEtiket, faturanın kendisine değil **zarfa** (GİB e-Fatura Paketi SBDH: `<sender identifier=\"...\" alias=\"urn:mail:...\"/>` / `<receiver identifier=\"...\" alias=\"...\"/>`) aittir. GİB UBL-TR 1.2.1 `PartyType`'ında etiket için tanımlı bir eleman yoktur; `cbc:EndpointID` şemada bulunsa da UBL-TR kılavuzunda bu amaçla kullanılmaz, dolayısıyla oraya yazmak standart dışı olurdu. e-Arşiv faturalarında etiket kavramı hiç yoktur.\n\nZarf üretimi kütüphanenin sorumluluk sınırının dışındadır (aynı sınır UBLExtensions/imza için de geçerlidir — bkz. B-101). Etiketi entegratöre gönderirken zarf tarafında siz taşımalısınız; alan burada yalnızca çağıranın veri modelini tek yerde tutabilmesi için durur (B-102 denetimi)."
            }
          },
          "additionalProperties": false,
          "description": "Gönderici (satıcı) bilgisi İsteğe bağlı: verilmeyen alanlar firmanın varsayılan göndericisinden tamamlanır; vergi numarası verilirse firmanınkiyle aynı olmalı."
        },
        "customer": {
          "$ref": "#/definitions/SimplePartyInput",
          "description": "Alıcı (müşteri) bilgisi — zorunlu"
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleLineInput"
          },
          "description": "Fatura satırları — zorunlu, en az 1 satır"
        },
        "id": {
          "type": "string",
          "description": "Fatura numarası (ör: \"ABC2025000000001\") — opsiyonel, seri/numara sistemi için"
        },
        "uuid": {
          "type": "string",
          "description": "Fatura UUID — opsiyonel, verilmezse otomatik üretilir Belgeniz API'de zorunludur: her belge için yeni bir UUID üretin."
        },
        "datetime": {
          "type": "string",
          "description": "Fatura tarihi/saati (ISO format: \"2025-01-15T10:30:00\") — opsiyonel, verilmezse şimdiki zaman"
        },
        "type": {
          "type": "string",
          "description": "Fatura tipi — opsiyonel. Verilmezse satır vergi durumlarına göre otomatik tespit edilir:   - Tevkifat varsa → TEVKIFAT   - KDV %0 ise ve istisna kodu verilmişse → ISTISNA / IHRACKAYITLI / OZELMATRAH   - Diğer → SATIS\n\nManuel override: \"SATIS\" | \"IADE\" | \"TEVKIFAT\" | \"ISTISNA\" | \"IHRACKAYITLI\" | \"OZELMATRAH\" | \"SGK\""
        },
        "profile": {
          "type": "string",
          "description": "Fatura profili — opsiyonel. Verilmezse otomatik tespit edilir. Manuel override: \"TEMELFATURA\" | \"TICARIFATURA\" | \"EARSIVFATURA\" | \"IHRACAT\" | \"KAMU\""
        },
        "currencyCode": {
          "type": "string",
          "description": "Para birimi kodu — varsayılan: \"TRY\""
        },
        "exchangeRate": {
          "type": "number",
          "description": "Döviz kuru (TRY dışı para birimlerinde zorunlu)"
        },
        "kdvExemptionCode": {
          "type": "string",
          "description": "KDV istisna kodu — ISTISNA, IHRACKAYITLI, OZELMATRAH tipleri için. İstisna kodları: 201-350 (istisna), 701-703 (ihraç kayıtlı), 801-812 (özel matrah)"
        },
        "ozelMatrah": {
          "$ref": "#/definitions/SimpleOzelMatrahInput",
          "description": "Özel matrah bilgisi — OZELMATRAH tipi faturalar için zorunlu"
        },
        "orderReference": {
          "$ref": "#/definitions/SimpleOrderReferenceInput",
          "description": "Sipariş referansı"
        },
        "billingReference": {
          "$ref": "#/definitions/SimpleBillingReferenceInput",
          "description": "Fatura referansı — TEKİL kısayol (iade faturaları için zorunlu).",
          "deprecated": "4.5.5 — çoklu iade referansı için `billingReferences` kullanın.\nGeriye uyum için SÜRESİZ korunur; `billingReferences` verilmediğinde\ntek elemanlı çoğul listeymiş gibi işlenir."
        },
        "billingReferences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleBillingReferenceInput"
          },
          "description": "Fatura referansları — ÇOĞUL (4.5.5). Bir iade faturası birden çok asıl faturayı referanslayabilir; GİB buna izin verir (XSD `cac:BillingReference` maxOccurs=\"unbounded\", şematron `IADEInvioceCheck` sayı değil ORAN denetler: her referans 16 haneli ve `DocumentTypeCode='IADE'` olmalıdır). Verildiğinde tekil `billingReference` alanının YERİNE geçer."
        },
        "despatchReferences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleDespatchReferenceInput"
          },
          "description": "İrsaliye referansları"
        },
        "additionalDocuments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleAdditionalDocumentInput"
          },
          "description": "Ek doküman referansları"
        },
        "documentAllowanceCharges": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleDocumentAllowanceChargeInput"
          },
          "description": "HKS komisyoncu masraf kalemleri → kök `cac:AllowanceCharge`.\n\n🔴 5.1.0: YALNIZ HKS masraf düzleminde geçerlidir; genel belge düzeyi iskonto/artırım kaldırıldı (bkz. `SimpleDocumentAllowanceChargeInput`). İskonto için `lines[i].allowancePercent` kullanılır.\n\n`reason` `HKS_CHARGE_CODES` kapalı kümesine bağlıdır ve SIRA ANLAMLIDIR (GİB'in XSLT'si belge sırasını izler)."
        },
        "paymentMeans": {
          "$ref": "#/definitions/SimplePaymentMeansInput",
          "description": "Ödeme bilgisi (KAMU profili için zorunlu)"
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Fatura notları"
        },
        "buyerCustomer": {
          "$ref": "#/definitions/SimpleBuyerCustomerInput",
          "description": "İhracat alıcı bilgisi (IHRACAT profili için)"
        },
        "taxRepresentativeParty": {
          "$ref": "#/definitions/SimpleTaxRepresentativeInput",
          "description": "Aracı kurum bilgisi — YOLCUBERABERFATURA profili için zorunlu (B-NEW-13). Turiste KDV iadesi işlemini yürüten aracı firma."
        },
        "sgk": {
          "$ref": "#/definitions/SimpleSgkInput",
          "description": "SGK fatura bilgisi (SGK tipi için)"
        },
        "onlineSale": {
          "$ref": "#/definitions/SimpleOnlineSaleInput",
          "description": "Online satış bilgisi (e-Arşiv internet satışları için)"
        },
        "eArchiveInfo": {
          "$ref": "#/definitions/SimpleEArchiveInput",
          "description": "e-Arşiv gönderim bilgisi"
        },
        "invoicePeriod": {
          "$ref": "#/definitions/SimplePeriodInput",
          "description": "Fatura dönemi"
        },
        "ytbNo": {
          "type": "string",
          "description": "Yatırım Teşvik Belgesi numarası (6 haneli numerik) — YATIRIMTESVIK profili için zorunlu"
        },
        "ytbIssueDate": {
          "type": "string",
          "description": "YTB belge tarihi (ISO format: \"2025-01-15\")"
        },
        "xsltTemplate": {
          "type": "string",
          "description": "XSLT şablon (Base64) — fatura görsel şablonu"
        }
      },
      "required": [
        "customer",
        "lines",
        "uuid"
      ],
      "additionalProperties": false,
      "description": "Basitleştirilmiş fatura girişi — SDK tüm hesaplamaları otomatik yapar"
    },
    "SimplePartyInput": {
      "type": "object",
      "properties": {
        "taxNumber": {
          "type": "string",
          "description": "Vergi kimlik numarası (10 hane VKN veya 11 hane TCKN) — zorunlu"
        },
        "name": {
          "type": "string",
          "description": "Firma adı veya kişi adı soyadı — zorunlu"
        },
        "taxOffice": {
          "type": "string",
          "description": "Vergi dairesi — VKN için zorunlu, TCKN için opsiyonel"
        },
        "address": {
          "type": "string",
          "description": "Adres — zorunlu"
        },
        "district": {
          "type": "string",
          "description": "İlçe — zorunlu"
        },
        "city": {
          "type": "string",
          "description": "İl — zorunlu"
        },
        "country": {
          "type": "string",
          "description": "Ülke — varsayılan: \"Türkiye\""
        },
        "zipCode": {
          "type": "string",
          "description": "Posta kodu — varsayılan: \"00000\""
        },
        "phone": {
          "type": "string",
          "description": "Telefon"
        },
        "email": {
          "type": "string",
          "description": "E-posta"
        },
        "website": {
          "type": "string",
          "description": "Web sitesi"
        },
        "identifications": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimplePartyIdentification"
          },
          "description": "Ek taraf kimlik tanımlamaları (ör: MERSISNO, TICARETSICILNO)"
        },
        "alias": {
          "type": "string",
          "description": "e-Fatura posta kutusu etiketi (ör: \"urn:mail:defaultpk@firma.com.tr\").\n\n⚠️ **Bu alan üretilen UBL-TR Invoice XML'ine YAZILMAZ — bilerek.**\n\nEtiket, faturanın kendisine değil **zarfa** (GİB e-Fatura Paketi SBDH: `<sender identifier=\"...\" alias=\"urn:mail:...\"/>` / `<receiver identifier=\"...\" alias=\"...\"/>`) aittir. GİB UBL-TR 1.2.1 `PartyType`'ında etiket için tanımlı bir eleman yoktur; `cbc:EndpointID` şemada bulunsa da UBL-TR kılavuzunda bu amaçla kullanılmaz, dolayısıyla oraya yazmak standart dışı olurdu. e-Arşiv faturalarında etiket kavramı hiç yoktur.\n\nZarf üretimi kütüphanenin sorumluluk sınırının dışındadır (aynı sınır UBLExtensions/imza için de geçerlidir — bkz. B-101). Etiketi entegratöre gönderirken zarf tarafında siz taşımalısınız; alan burada yalnızca çağıranın veri modelini tek yerde tutabilmesi için durur (B-102 denetimi)."
        }
      },
      "required": [
        "taxNumber",
        "name",
        "address",
        "district",
        "city"
      ],
      "additionalProperties": false,
      "description": "Taraf (gönderici/alıcı) basit girişi"
    },
    "SimplePartyIdentification": {
      "type": "object",
      "properties": {
        "schemeId": {
          "type": "string",
          "description": "Tanımlama şema tipi (ör: \"MERSISNO\", \"TICARETSICILNO\", \"HIZMETNO\", \"MUSTERINO\", \"TESISATNO\")"
        },
        "value": {
          "type": "string",
          "description": "Tanımlama değeri"
        }
      },
      "required": [
        "schemeId",
        "value"
      ],
      "additionalProperties": false,
      "description": "Ek taraf kimlik tanımlama"
    },
    "SimpleLineInput": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Ürün/hizmet adı — zorunlu"
        },
        "quantity": {
          "type": "number",
          "description": "Miktar — zorunlu"
        },
        "price": {
          "type": "number",
          "description": "Birim fiyat (KDV hariç) — zorunlu"
        },
        "unitCode": {
          "type": "string",
          "description": "Birim kodu (Türkçe isim veya UBL kodu: \"Adet\" veya \"C62\") — varsayılan: \"Adet\""
        },
        "kdvPercent": {
          "type": "number",
          "description": "KDV oranı (%) — zorunlu"
        },
        "kdvExemptionCode": {
          "type": "string",
          "description": "Satır bazı KDV istisna sebep kodu (B-NEW-11 / M11).\n\nKDV=0 kalem için manuel verilmeli (ör. 351). Verilmezse belge seviyesi `SimpleInvoiceInput.kdvExemptionCode` fallback olarak kullanılır.\n\nSelf-exemption tiplerinde (ISTISNA, IHRACKAYITLI, OZELMATRAH + IHRACAT, YOLCUBERABERFATURA, OZELFATURA, YATIRIMTESVIK profilleri) zorunlu değil; dışındaki tiplerde KDV=0 kaleminde zorunlu."
        },
        "allowancePercent": {
          "type": "number",
          "description": "İskonto oranı (%) — opsiyonel"
        },
        "taxes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleLineTaxInput"
          },
          "description": "Ek vergiler (ÖTV, Damga V. vb.) — opsiyonel"
        },
        "withholdingTaxCode": {
          "type": "string",
          "description": "KDV tevkifat kodu (ör: \"602\") — opsiyonel.\n\nBelgede `cac:WithholdingTaxTotal` ÜRETİR; bu yüzden fatura tipi şu küme içinde olmak zorundadır (Schematron `GeneralWithholdingTaxTotalCheck`): TEVKIFAT, YTBTEVKIFAT, IADE, YTBIADE, SGK, SARJ, SARJANLIK.\n\n⚠️ Tip OTOMATİK ZORLANMAZ. `type` verilmediyse otomatik tespit TEVKIFAT'a düşer; `type` AÇIKÇA verildiyse kullanıcı seçimi korunur (B-41) ve uyumsuz kombinasyon doğrulamada hata olarak bildirilir — sessizce düzeltilmez."
        },
        "withholdingTaxPercent": {
          "type": "number",
          "description": "Tevkifat 650 (Diğer) kodu için dinamik yüzde (0-100). Sadece 650 kodu ile kullanılır; diğer tevkifat kodlarında oran config'den gelir."
        },
        "description": {
          "type": "string",
          "description": "Ürün açıklaması — `cac:Item/cbc:Description`"
        },
        "brand": {
          "type": "string",
          "description": "Marka — `cac:Item/cbc:BrandName` (B-102)"
        },
        "model": {
          "type": "string",
          "description": "Model — `cac:Item/cbc:ModelName`"
        },
        "buyerCode": {
          "type": "string",
          "description": "Alıcı ürün kodu — `cac:Item/cac:BuyersItemIdentification/cbc:ID` (B-102)"
        },
        "sellerCode": {
          "type": "string",
          "description": "Satıcı ürün kodu — `cac:Item/cac:SellersItemIdentification/cbc:ID` (B-102)"
        },
        "manufacturerCode": {
          "type": "string",
          "description": "Üretici ürün kodu — `cac:Item/cac:ManufacturersItemIdentification/cbc:ID` (B-102)"
        },
        "origin": {
          "type": "string",
          "description": "Menşe ülke **adı** — `cac:Item/cac:OriginCountry/cbc:Name` (B-102).\n\nGİB `CountryType`'ta `cbc:Name` minOccurs=1'dir; bu yüzden değer ülke ADI olarak yazılır (ISO kodu değil). Kod da göndermek isteyen çağıran alt seviye `ItemInput.originCountryCode` alanını kullanabilir."
        },
        "note": {
          "type": "string",
          "description": "Satır notu — `cac:InvoiceLine/cbc:Note` (B-102)"
        },
        "delivery": {
          "$ref": "#/definitions/SimpleLineDeliveryInput",
          "description": "Satır seviyesi teslimat bilgisi (ihracat faturaları için)"
        },
        "itemClassificationCode": {
          "type": "string",
          "description": "Harcama tipi kodu — YATIRIMTESVIK: 01=Makine/Teçhizat, 02=Yazılım, 03=Bina İnşaat, 04=Diğer"
        },
        "productTraceId": {
          "type": "string",
          "description": "Makine Teçhizat sıra no — YATIRIMTESVIK Kod 01 için zorunlu"
        },
        "serialId": {
          "type": "string",
          "description": "Kalem seri numarası → `cac:InvoiceLine/cac:Item/cac:ItemInstance/cbc:SerialID`.\n\nİKİ ayrı kural bu tek alanı ister:  - YATIRIMTESVIK + `itemClassificationCode='01'` → GİB dilinde «Makine ID»    (`YatirimTesvikItemInstanceCheck`) — YALNIZ 01 harcama tipli kalemde.  - `SARJANLIK` (şarj anlık) → HER kalemde ESU/şarj ünitesi seri numarası    (`EnerjiItemInstanceSerialIDCheck`)."
        },
        "additionalItemIdentifications": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleItemIdentification"
          },
          "description": "Ek ürün tanımlayıcıları (ör: IMEI numarası) [{schemeId: \"TELEFON\", value: \"123456789012345\"}]"
        }
      },
      "required": [
        "name",
        "quantity",
        "price",
        "kdvPercent"
      ],
      "additionalProperties": false,
      "description": "Basit fatura satırı girişi"
    },
    "SimpleLineTaxInput": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Vergi kodu (ör: \"0071\" ÖTV 1. Liste, \"1047\" Damga V.) — zorunlu"
        },
        "percent": {
          "type": "number",
          "description": "Vergi oranı (%) — zorunlu"
        },
        "exemptionCode": {
          "type": "string",
          "description": "Bu verginin istisna sebep kodu (`TaxExemptionReasonCode`) — opsiyonel.\n\nKod bu verginin kalem ve belge alt toplamına, adıyla birlikte (`TaxExemptionReason`) yazılır. Yalnız oranı 0 olan vergide:   • ÖTV (0071, 0073–0077): 101–108 (İSTİSNA tipi) ya da 151 (istisna     olmayan diğer, 0 ÖTV'li fatura);   • konaklama vergisi (0059): 001. GİB: \"fatura tipi İSTİSNA seçilip ÖTV 0 geçilir ve ilgili ÖTV istisna kodu seçilir\". KDV istisna kodu burada değil `kdvExemptionCode`ta verilir. Seçenekler: `getAvailableExemptions(tip, getExemptionTypeForTax(code))`."
        }
      },
      "required": [
        "code",
        "percent"
      ],
      "additionalProperties": false,
      "description": "Satır seviyesi ek vergi girişi (KDV hariç — ÖTV, Damga V., ÖİV vb.)"
    },
    "SimpleLineDeliveryInput": {
      "type": "object",
      "properties": {
        "deliveryAddress": {
          "$ref": "#/definitions/SimpleAddressInput",
          "description": "Teslimat adresi"
        },
        "deliveryTermCode": {
          "type": "string",
          "description": "Teslimat şartı kodu (INCOTERMS: \"EXW\", \"FOB\", \"CIF\" vb.)"
        },
        "gtipNo": {
          "type": "string",
          "description": "GTİP numarası (12 hane, IHRACKAYITLI+702 için zorunlu)"
        },
        "alicidibsatirkod": {
          "type": "string",
          "description": "Alıcı DİB Satır Kodu (11 hane, IHRACKAYITLI+702 için zorunlu — B-07).\n\nMapper bu alanı Shipment/TransportHandlingUnit/CustomsDeclaration/ IssuerParty/PartyIdentification[schemeID='ALICIDIBSATIRKOD'] UBL ağacına eşler. Sprint 8c.2 / B-NEW-12 ile eklendi."
        },
        "saticidibsatirkod": {
          "type": "string",
          "description": "Satıcı DİB Satır Kodu — `ALICIDIBSATIRKOD`'un İZİNLİ (zorunlu DEĞİL) eşi.\n\nŞematron `IhracKayitliPartyIdentificationIDTypeCheck` (Common satır 462) kuralı OLUMSUZ kurulur: CustomsDeclaration/IssuerParty/PartyIdentification altında `$IhracKayitliPartyIdentificationIDType = ',SATICIDIBSATIRKOD,ALICIDIBSATIRKOD,'` DIŞINDA schemeID bulunmasın. Yani ikisi de geçerlidir; zorunluluk yalnız `ALICIDIBSATIRKOD`'a aittir (702 kuralı, Common satır 326).\n\n4.5.1'e kadar bu alanın kütüphanede KARŞILIĞI YOKTU: kullanıcı GİB'in izin verdiği satıcı satır kodunu hiç beyan edemiyordu.\n\nMapper bu alanı `alicidibsatirkod` ile AYNI IssuerParty altında ikinci bir `PartyIdentification[schemeID='SATICIDIBSATIRKOD']` olarak yazar.\n\n🔴 Uzunluk DAYATILMAZ: 11 hane şartı 702 kuralında yalnız `ALICIDIBSATIRKOD` için yazılıdır; `SATICIDIBSATIRKOD` şematron paketinde (20260701) yalnız kod listesinde geçer, hiçbir uzunluk/biçim şartı YOK."
        },
        "transportModeCode": {
          "type": "string",
          "description": "Taşıma modu kodu (ör: \"1\" Deniz, \"3\" Karayolu, \"4\" Havayolu)"
        },
        "packageId": {
          "type": "string",
          "description": "Paket ID — `cac:Shipment/cac:TransportHandlingUnit/cac:ActualPackage/cbc:ID` (B-102). v2.2.6'ya kadar mapper bu alanı hiç okumuyordu."
        },
        "packageQuantity": {
          "type": "number",
          "description": "Paket miktarı — `.../cac:ActualPackage/cbc:Quantity`. B-102: önceden yalnızca `packageTypeCode` ile BİRLİKTE verildiğinde yazılıyordu; artık tek başına da `cac:ActualPackage` doğurur."
        },
        "packageTypeCode": {
          "type": "string",
          "description": "Paket tipi kodu — `.../cac:ActualPackage/cbc:PackagingTypeCode`"
        }
      },
      "required": [
        "deliveryAddress"
      ],
      "additionalProperties": false,
      "description": "Satır seviyesi teslimat bilgisi"
    },
    "SimpleAddressInput": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "Adres satırı"
        },
        "district": {
          "type": "string",
          "description": "İlçe"
        },
        "city": {
          "type": "string",
          "description": "İl"
        },
        "zipCode": {
          "type": "string",
          "description": "Posta kodu"
        },
        "country": {
          "type": "string",
          "description": "Ülke — varsayılan: \"Türkiye\""
        }
      },
      "required": [
        "address",
        "district",
        "city"
      ],
      "additionalProperties": false,
      "description": "Basit adres girişi"
    },
    "SimpleItemIdentification": {
      "type": "object",
      "properties": {
        "schemeId": {
          "type": "string",
          "description": "Tanımlama şema tipi (ör: \"TELEFON\", \"TABLET_PC\")"
        },
        "value": {
          "type": "string",
          "description": "Tanımlama değeri"
        }
      },
      "required": [
        "schemeId",
        "value"
      ],
      "additionalProperties": false,
      "description": "Ek ürün tanımlayıcı (TEKNOLOJIDESTEK IMEI vb.)"
    },
    "SimpleOzelMatrahInput": {
      "type": "object",
      "properties": {
        "percent": {
          "type": "number",
          "description": "Özel matrah KDV oranı"
        },
        "taxable": {
          "type": "number",
          "description": "Özel matrah tutarı"
        },
        "amount": {
          "type": "number",
          "description": "Özel matrah KDV tutarı"
        }
      },
      "required": [
        "percent",
        "taxable",
        "amount"
      ],
      "additionalProperties": false,
      "description": "Özel matrah bilgisi (OZELMATRAH tipi faturalar için)"
    },
    "SimpleOrderReferenceInput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Sipariş numarası"
        },
        "issueDate": {
          "type": "string",
          "description": "Sipariş tarihi (ISO format: \"2025-01-15\")"
        }
      },
      "required": [
        "id",
        "issueDate"
      ],
      "additionalProperties": false,
      "description": "Sipariş referansı"
    },
    "SimpleBillingReferenceInput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Referans fatura numarası (Schematron: IADE grubu tiplerinde 16 karakter zorunlu)"
        },
        "issueDate": {
          "type": "string",
          "description": "Referans fatura tarihi"
        },
        "documentTypeCode": {
          "type": "string",
          "description": "Belge tipi kodu.\n- IADE grubu tiplerinde otomatik `'IADE'` atanır (Schematron zorunlu).\n- Diğer tiplerde serbest metin — Schematron kısıtlaması yoktur."
        }
      },
      "required": [
        "id",
        "issueDate"
      ],
      "additionalProperties": false,
      "description": "Fatura referansı (iade ve diğer referans gerektiren tipler için)"
    },
    "SimpleDespatchReferenceInput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "İrsaliye numarası"
        },
        "issueDate": {
          "type": "string",
          "description": "İrsaliye tarihi"
        }
      },
      "required": [
        "id",
        "issueDate"
      ],
      "additionalProperties": false,
      "description": "İrsaliye referansı"
    },
    "SimpleAdditionalDocumentInput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Belge ID"
        },
        "schemeId": {
          "type": "string",
          "description": "`cbc:ID/@schemeID` — Sprint 9. SARJ faturalarında `ESURaporID` değeri zorunlu (`EnerjiESURaporIDCheck`)."
        },
        "issueDate": {
          "type": "string",
          "description": "Belge tarihi"
        },
        "documentTypeCode": {
          "type": "string",
          "description": "Belge tipi kodu"
        },
        "documentType": {
          "type": "string",
          "description": "Belge tipi"
        },
        "documentDescription": {
          "type": "string",
          "description": "Belge açıklaması"
        },
        "attachment": {
          "type": "object",
          "properties": {
            "filename": {
              "type": "string"
            },
            "mimeCode": {
              "type": "string"
            },
            "data": {
              "type": "string"
            },
            "encodingCode": {
              "type": "string"
            },
            "characterSetCode": {
              "type": "string"
            }
          },
          "required": [
            "filename",
            "mimeCode",
            "data"
          ],
          "additionalProperties": false,
          "description": "Ek dosya (Base64 encoded)"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Ek doküman referansı"
    },
    "SimpleDocumentAllowanceChargeInput": {
      "type": "object",
      "properties": {
        "chargeIndicator": {
          "type": "boolean",
          "description": "`cbc:ChargeIndicator` — UBL-TR Ortak §2.2.3: *\"Iskonto ise 'false', artırım ise 'true' girilir.\"*\n\nHKS masraf düzleminde ZORUNLU olarak `false`tır (doğrulayıcı `true`yu reddeder): GİB'in kendi örneğinde blokların tamamı `false`tır ve toplam yine de ödenecekten düşülür. Bayrak toplam YÖNÜNÜ BELİRLEMEZ (bkz. `document-calculator`)."
        },
        "reason": {
          "type": "string",
          "description": "`cbc:AllowanceChargeReason` — sebep.\n\n`HKS_CHARGE_CODES` kapalı kümesinden biri olmak ZORUNDADIR; başka bir dizge GİB'in resmî görüntüsünde hiç çıkmaz."
        },
        "percent": {
          "type": "number",
          "description": "Oran (%) — ekranda \"%5\" yazılan değer `5` olarak verilir."
        },
        "amount": {
          "type": "number",
          "description": "Tutar — OTORİTE. Verilmezse `percent` ve tabandan türetilir."
        },
        "baseAmount": {
          "type": "number",
          "description": "`cbc:BaseAmount` — oranın uygulandığı taban.\n\nVerilmezse tutar türetiminde belge `LineExtensionAmount`ı kullanılır ama XML'e `BaseAmount` YAZILMAZ: GİB'in HKS örneğinde masraf kalemlerinin hiçbiri taban taşımaz, gereksiz eleman üretmeyiz."
        }
      },
      "required": [
        "chargeIndicator"
      ],
      "additionalProperties": false,
      "description": "HKS komisyoncu MASRAF kalemi → belge kökündeki `cac:AllowanceCharge`.\n\n🔴 5.1.0 — YALNIZ HKS masraf düzleminde (`HKS`+`KOMISYONCU` / `EARSIVFATURA`+`HKSKOMISYONCU`) kabul edilir. Genel belge düzeyi iskonto/artırım KALDIRILDI: 5.0.0'da KDV matrahını kaydırıp KDV'yi yeniden hesaplamıyordu (100 TL + %20 + %10 belge iskontosu → KDV 20,00; doğrusu 18,00). Başka profilde verilirse `DOCUMENT_ALLOWANCE_CHARGE_UNSUPPORTED` hatası alınır; iskonto kalemlere dağıtılıp `lines[i].allowancePercent` olarak verilmelidir. Kütüphane dağıtım yardımcısı sunmaz — hangi kaleme ne kadar düşüleceği çağıranın kararıdır.\n\nMasraf düzleminde:\n- `percent` XML'e YÜZDE olarak yazılır (`MultiplierFactorNumeric = percent`;   GİB XSLT'si yanına `%` basar).\n- Toplam `ChargeTotalAmount`a yazılır ve yalnız ÖDENECEK tutardan düşülür;   satış matrahına ve KDV'ye DOKUNMAZ (müstahsile ödenecekten düşülen masraf).\n- `reason` 18 kodluk KAPALI kümedir (`HKS_CHARGE_CODES`).\n\n🔑 **Otorite `amount`tır.** `percent` verilip `amount` verilmezse tutar türetilir (`baseAmount ?? LineExtensionAmount` üzerinden, 2 haneye yuvarlanarak); ikisi de verilirse `amount` kazanır ve oran yalnız gösterime yazılır. GİB'in kendi örneğinde oran ile tutar zaten tutarsızdır (5 ↔ 10) — yani oran denetlenebilir bir bağ taşımaz."
    },
    "SimplePaymentMeansInput": {
      "type": "object",
      "properties": {
        "meansCode": {
          "type": "string",
          "description": "Ödeme yöntemi kodu (ör: \"1\" Nakit, \"42\" Banka, \"48\" Kredi Kartı, \"ZZZ\" Diğer)"
        },
        "dueDate": {
          "type": "string",
          "description": "Son ödeme tarihi"
        },
        "channelCode": {
          "type": "string",
          "description": "Ödeme kanalı kodu"
        },
        "accountNumber": {
          "type": "string",
          "description": "Hesap numarası / IBAN"
        },
        "paymentNote": {
          "type": "string",
          "description": "Ödeme notu"
        }
      },
      "required": [
        "meansCode"
      ],
      "additionalProperties": false,
      "description": "Ödeme bilgisi"
    },
    "SimpleBuyerCustomerInput": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Alıcı adı"
        },
        "taxNumber": {
          "type": "string",
          "description": "Vergi numarası veya kimlik numarası"
        },
        "address": {
          "type": "string",
          "description": "Adres"
        },
        "city": {
          "type": "string",
          "description": "İl"
        },
        "district": {
          "type": "string",
          "description": "İlçe"
        },
        "country": {
          "type": "string",
          "description": "Ülke"
        },
        "taxOffice": {
          "type": "string",
          "description": "Vergi dairesi — 4.1.0'da eklendi.\n\n`cac:BuyerCustomerParty/cac:Party/cac:PartyTaxScheme/cac:TaxScheme/cbc:Name` alanına yazılır. Alan UBL'de zaten vardı ve `SimplePartyInput`'ta (`sender`/`customer`) mevcuttu; yalnız BU tipte eksikti, dolayısıyla IHRACAT/KAMU alıcısının vergi dairesi hiç yazılamıyordu (B-101/B-102 ile aynı \"tipte yok → XML'de yok\" sınıfı)."
        },
        "zipCode": {
          "type": "string",
          "description": "Posta kodu"
        },
        "phone": {
          "type": "string",
          "description": "Telefon"
        },
        "email": {
          "type": "string",
          "description": "E-posta"
        },
        "identifications": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "schemeId": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "schemeId",
              "value"
            ],
            "additionalProperties": false
          },
          "description": "Ek taraf tanımlayıcıları (B-83) — KAMU aracı kurum MUSTERINO/MERSISNO, IHRACAT ek tanımlayıcı vb. `party.additionalIdentifiers`'a eşlenir. schemeId PARTY_IDENTIFICATION_SCHEME_IDS seti ile kontrol edilir (B-69)."
        },
        "firstName": {
          "type": "string",
          "description": "Turistin ADI — `cac:BuyerCustomerParty/cac:Party/cac:Person/cbc:FirstName`.\n\nYOLCUBERABERFATURA'da ZORUNLUDUR: «Person/FirstName: Turistin adı zorunludur.» (Gümrük İşlemleri Kılavuzu V1.8 §4.2.1). XSD'de de `PersonType/cbc:FirstName` **1..1**'dir — `cac:Person` düğümü yazıldığı her yerde zorunludur.\n\n⚠️ `name` alanından TÜRETİLMEZ: `name` unvan alanıdır (`cac:PartyName/cbc:Name` + `PartyLegalEntity/RegistrationName`) ve \"Michael Schneider (Tourist)\" gibi serbest değerler taşır; pasaporttaki ad/soyad ayrımını ondan çıkarmak veri UYDURMAK olurdu."
        },
        "familyName": {
          "type": "string",
          "description": "Turistin SOYADI — `cac:Person/cbc:FamilyName`. «Person/FamilyName: Turistin soyadı zorunludur.» (Kılavuz V1.8 §4.2.1); XSD `PersonType/cbc:FamilyName` **1..1**."
        },
        "nationalityId": {
          "type": "string",
          "description": "Uyruk (ISO 3166-1 alpha-2 ülke kodu, ör. 'DE', 'US') — YOLCUBERABERFATURA profili için zorunlu (B-NEW-13 / Sprint 8c.4).\n\nNormatif: «Person/NationalityID: Turistin uyruğu (Pasaportunda belirtilen ülke) zorunludur. ISO 3166-1-alpha-2 Ülke Kodları Listesinden Değer Girilmelidir.» (Kılavuz V1.8 §4.2.1)"
        },
        "passportId": {
          "type": "string",
          "description": "Pasaport numarası — YOLCUBERABERFATURA profili için zorunlu (B-NEW-13). `cac:Person/cac:IdentityDocumentReference/cbc:ID`."
        },
        "passportIssueDate": {
          "type": "string",
          "description": "Pasaportun VERİLDİĞİ tarih (`YYYY-MM-DD`) — `cac:Person/cac:IdentityDocumentReference/cbc:IssueDate`.\n\n🔴 İbraz/satış tarihi DEĞİLDİR. «IdentityDocumentReference/IssueDate: Pasaportun verildiği tarih zorunludur. Tarih yazılamıyorsa 2005-01-01 sabit değeri yazılabilir.» (Kılavuz V1.8 §4.2.1). XSD `DocumentReferenceType/cbc:IssueDate` **1..1**; `passportId` verilip bu alan boş bırakılırsa üretim XSD kardinalite hatasıyla durur."
        }
      },
      "required": [
        "name",
        "taxNumber",
        "address",
        "city",
        "district",
        "country"
      ],
      "additionalProperties": false,
      "description": "İhracat alıcı bilgisi (BuyerCustomerParty)"
    },
    "SimpleTaxRepresentativeInput": {
      "type": "object",
      "properties": {
        "vknTckn": {
          "type": "string",
          "description": "ARACIKURUMVKN — VKN (10 hane) veya TCKN (11 hane)"
        },
        "label": {
          "type": "string",
          "description": "ARACIKURUMETIKET — aracı kurum posta kutusu etiketi.\n\nKılavuz V1.8 §4.2.1 tavsiyesi: gümrük onay mesajları ile gelen faturaları ayrıştırmak isteyen aracı kurumlar için `urn:mail:yolcuberaberpk@sirketkisaad.com.tr` biçimi uygundur."
        },
        "name": {
          "type": "string",
          "description": "Aracı kurum tüzel adı (unvan) — `cac:PartyName/cbc:Name` (opsiyonel)"
        },
        "address": {
          "type": "string",
          "description": "Aracı kurumun açık adresi — `cbc:StreetName`"
        },
        "district": {
          "type": "string",
          "description": "Aracı kurumun ilçesi — `cbc:CitySubdivisionName` (adres yazılıyorsa zorunlu)"
        },
        "city": {
          "type": "string",
          "description": "Aracı kurumun ili — `cbc:CityName` (adres yazılıyorsa zorunlu)"
        },
        "country": {
          "type": "string",
          "description": "Aracı kurumun ülkesi — `cac:Country/cbc:Name` (varsayılan: \"Türkiye\")"
        },
        "zipCode": {
          "type": "string",
          "description": "Aracı kurumun posta kodu — `cbc:PostalZone`"
        }
      },
      "required": [
        "vknTckn",
        "label"
      ],
      "additionalProperties": false,
      "description": "TaxRepresentativeParty — YOLCUBERABERFATURA profili aracı kurum (B-NEW-13).\n\nAracı kurum (ör. bavul ticaretinde aracı firma) turiste KDV iadesi işlemini yürütür. UBL: cac:TaxRepresentativeParty. Sprint 8c.4 ile eklendi."
    },
    "SimpleSgkInput": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/SimpleSgkType",
          "description": "SGK tipi — whitelist kontrolü runtime'da tetiklenir (B-NEW-09)"
        },
        "documentNo": {
          "type": "string",
          "description": "Döküm numarası — boş olamaz (B-NEW-10)"
        },
        "companyName": {
          "type": "string",
          "description": "Firma/Kurum adı"
        },
        "companyCode": {
          "type": "string",
          "description": "Firma/Kurum sicil kodu"
        }
      },
      "required": [
        "type",
        "documentNo",
        "companyName",
        "companyCode"
      ],
      "additionalProperties": false,
      "description": "SGK faturası bilgisi"
    },
    "SimpleSgkType": {
      "type": "string",
      "enum": [
        "SAGLIK_ECZ",
        "SAGLIK_HAS",
        "SAGLIK_OPT",
        "SAGLIK_MED",
        "ABONELIK",
        "MAL_HIZMET",
        "DIGER"
      ],
      "description": "SGK tipi literal union (B-NEW-09 / Sprint 8c.7).\n\nÖnceden `string` idi; TS tip daraltma için union'a çevrildi. Runtime validator `validateSgkInput` ayrıca set-based kontrol uygular."
    },
    "SimpleOnlineSaleInput": {
      "type": "object",
      "properties": {
        "isOnlineSale": {
          "type": "boolean",
          "description": "Online satış mı?"
        },
        "storeUrl": {
          "type": "string",
          "description": "Mağaza URL'si"
        },
        "paymentMethod": {
          "type": "string",
          "description": "Ödeme yöntemi (KREDIKARTI, BANKAHAVALESI, EFT, KAPIDAODEME vb.)"
        },
        "paymentDate": {
          "type": "string",
          "description": "Ödeme tarihi"
        },
        "carrierTaxNumber": {
          "type": "string",
          "description": "Kargo firma vergi numarası — `cac:Delivery/cac:CarrierParty/cac:PartyIdentification/cbc:ID`. 10 hane → `schemeID=\"VKN\"` (tüzel kişi), 11 hane → `schemeID=\"TCKN\"` (gerçek kişi)."
        },
        "carrierName": {
          "type": "string",
          "description": "Kargo firma adı/unvanı — `cac:CarrierParty/cac:PartyName/cbc:Name`"
        },
        "carrierDistrict": {
          "type": "string",
          "description": "Kargo firmasının ilçesi — `cac:CarrierParty/cac:PostalAddress/cbc:CitySubdivisionName`. UBL-TR `PartyType`'ta `cac:PostalAddress` **zorunludur** (minOccurs=1), içinde de CityName + CitySubdivisionName zorunludur (B-35). Bu yüzden CarrierParty emit edebilmek için il/ilçe gerekir."
        },
        "carrierCity": {
          "type": "string",
          "description": "Kargo firmasının ili — `cac:CarrierParty/cac:PostalAddress/cbc:CityName`"
        },
        "carrierAddress": {
          "type": "string",
          "description": "Kargo firmasının açık adresi — `cac:CarrierParty/cac:PostalAddress/cbc:StreetName` (opsiyonel)"
        },
        "carrierCountry": {
          "type": "string",
          "description": "Kargo firmasının ülkesi — varsayılan \"Türkiye\""
        },
        "deliveryDate": {
          "type": "string",
          "description": "Ürünün alıcıya gönderildiği/teslim edildiği tarih (YYYY-MM-DD) — `cac:Delivery/cbc:ActualDeliveryDate`. e-Arşiv raporunda `gonderiBilgileri/gonderimTarihi` karşılığıdır."
        }
      },
      "required": [
        "isOnlineSale",
        "storeUrl",
        "paymentMethod",
        "paymentDate"
      ],
      "additionalProperties": false,
      "description": "Online satış bilgisi (e-Arşiv internet satış faturaları için)"
    },
    "SimpleEArchiveInput": {
      "type": "object",
      "properties": {
        "sendType": {
          "type": "string",
          "enum": [
            "ELEKTRONIK",
            "KAGIT"
          ],
          "description": "Gönderim tipi: \"ELEKTRONIK\" veya \"KAGIT\""
        }
      },
      "required": [
        "sendType"
      ],
      "additionalProperties": false,
      "description": "e-Arşiv gönderim tipi"
    },
    "SimplePeriodInput": {
      "type": "object",
      "properties": {
        "startDate": {
          "type": "string",
          "description": "Dönem başlangıç tarihi (ISO format)"
        },
        "startTime": {
          "type": "string",
          "description": "Dönem başlangıç saati (HH:mm:ss) — Sprint 9. SARJ/SARJANLIK faturalarında zorunlu (`EnerjiInvoicePeriodCheck`)."
        },
        "endDate": {
          "type": "string",
          "description": "Dönem bitiş tarihi (ISO format)"
        },
        "endTime": {
          "type": "string",
          "description": "Dönem bitiş saati (HH:mm:ss) — Sprint 9. SARJ/SARJANLIK faturalarında zorunlu (`EnerjiInvoicePeriodCheck`)."
        }
      },
      "required": [
        "startDate",
        "endDate"
      ],
      "additionalProperties": false,
      "description": "Fatura dönemi (SGK faturaları vb.)"
    }
  }
}
