{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "e-SMM — json2ubl-ts SimpleSelfEmployedVoucherInput",
  "description": "e-Serbest Meslek Makbuzu girdisi (SimpleSelfEmployedVoucherInput). POST /v1/documents gövdesindeki `document` alanının şeması; documentType: SMM. 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, SimpleSelfEmployedVoucherInput) üretildi. Kaynak: https://github.com/rahat-fatura/json2ubl-ts",
  "x-json2ubl-ts-version": "5.3.1",
  "x-json2ubl-ts-type": "SimpleSelfEmployedVoucherInput",
  "$ref": "#/definitions/SimpleSelfEmployedVoucherInput",
  "definitions": {
    "SimpleSelfEmployedVoucherInput": {
      "type": "object",
      "properties": {
        "documentNumber": {
          "type": "string",
          "description": "Makbuz numarası — `^[A-Z0-9]{3}20\\d{2}\\d{9}$`. Oturum aşamasında BOŞ olabilir; numarayı gönderim anında seri motoru verir."
        },
        "uuid": {
          "type": "string",
          "description": "ETTN — verilmezse üretilir. Belgeniz API'de zorunludur: her belge için yeni bir UUID üretin."
        },
        "datetime": {
          "type": "string",
          "description": "Düzenleme tarihi+saati: `YYYY-MM-DDTHH:mm:ss`. Saat e-SMM'de ZORUNLUDUR (509 VUK GT IV.4.3-c) — verilmezse \"şimdi\" alınır."
        },
        "currencyCode": {
          "type": "string",
          "description": "Para birimi — varsayılan `TRY`."
        },
        "exchangeRate": {
          "type": "number",
          "description": "Kur — TRY dışı belgede ZORUNLU (şematron `CurrencyCodeCheck`, 6 ondalık)."
        },
        "supplier": {
          "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": "Serbest meslek erbabı. İ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": "Hizmeti alan."
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SimpleSelfEmployedVoucherLineInput"
          },
          "description": "Kalemler."
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Belge notları."
        },
        "incomeTaxWithholdingPercent": {
          "type": "number",
          "description": "Belge seviyesi gelir vergisi stopajı oranı (%) — kalem oranı önceliklidir."
        },
        "vatWithholdingPercent": {
          "type": "number",
          "description": "Belge seviyesi KDV tevkifatı oranı (%) — kalem oranı önceliklidir."
        },
        "kdvExemptionCode": {
          "type": "string",
          "description": "Belge seviyesi KDV istisna sebep kodu — kalem kodu önceliklidir."
        },
        "kdvExemptionReason": {
          "type": "string",
          "description": "Belge seviyesi KDV istisna sebep metni — kalem metni önceliklidir."
        },
        "sendMethod": {
          "$ref": "#/definitions/SelfEmployedVoucherSendMethod",
          "description": "Gönderim şekli — rapor eşlemesinde `gonderimSekli` alanını besler. Verilirse `DocumentTypeCode=EXT_SEND_METHOD` taşıyan bir `cac:AdditionalDocumentReference` yazılır (prod deseni; 12/12 belgede var)."
        }
      },
      "required": [
        "customer",
        "lines",
        "uuid"
      ],
      "additionalProperties": false,
      "description": "e-SMM belgesi (basit)."
    },
    "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"
    },
    "SimpleSelfEmployedVoucherLineInput": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Hizmet adı — zorunlu."
        },
        "quantity": {
          "type": "number",
          "description": "Miktar — zorunlu."
        },
        "price": {
          "type": "number",
          "description": "Birim brüt ücret (KDV hariç) — zorunlu."
        },
        "unitCode": {
          "type": "string",
          "description": "Birim kodu (Türkçe ad ya da UBL kodu: \"Adet\" / \"C62\") — varsayılan \"Adet\"."
        },
        "kdvPercent": {
          "type": "number",
          "description": "KDV oranı (%) — zorunlu. `0` ise istisna açıklaması ZORUNLU olur."
        },
        "incomeTaxWithholdingPercent": {
          "type": "number",
          "description": "Gelir vergisi stopajı oranı (%) — `TaxSubtotal[0003]`.\n\n🔴 ORAN SABİT DEĞİLDİR, KULLANICIDAN ALINIR. GVK 94 oranları belirler, Cumhurbaşkanı sıfıra kadar indirebilir ve noterler istisnadır; kütüphane varsayılan bir oran DAYATMAZ. Verilmezse belge seviyesindeki değer, o da yoksa stopaj HİÇ yazılmaz (stopajsız e-SMM meşrudur — 12/12 prod belge stopajsızdır)."
        },
        "vatWithholdingPercent": {
          "type": "number",
          "description": "KDV tevkifatı oranı (%) — `TaxSubtotal[9015]`.\n\n⚠️ Matrah **hesaplanan KDV**'dir, brüt ücret değil. Oran KDV'nin kesridir (`602 → 9/10` gibi); bkz. `TaxDefinition.baseIsCalculatedVat`."
        },
        "allowancePercent": {
          "type": "number",
          "description": "İskonto oranı (%)."
        },
        "kdvExemptionCode": {
          "type": "string",
          "description": "KDV istisna sebep KODU — üretimde `351`. ⚠️ Şematron `TaxExemptionReasonCheck` METNİ ister; kod tek başına yetmez. Kod verilip metin verilmezse metin kod listesinden çözülür."
        },
        "kdvExemptionReason": {
          "type": "string",
          "description": "KDV istisna sebep METNİ — verilirse koddan türetmeye tercih edilir."
        },
        "description": {
          "type": "string",
          "description": "Hizmet açıklaması — `cac:Item/cbc:Description`."
        },
        "note": {
          "type": "string",
          "description": "Satır notu — `cac:InvoiceLine/cbc:Note`."
        }
      },
      "required": [
        "name",
        "quantity",
        "price",
        "kdvPercent"
      ],
      "additionalProperties": false,
      "description": "e-SMM kalemi (basit)."
    },
    "SelfEmployedVoucherSendMethod": {
      "type": "string",
      "enum": [
        "ELEKTRONIK",
        "KAGIT"
      ],
      "description": "Gönderim şekli — `AdditionalDocumentReference/cbc:DocumentTypeCode=EXT_SEND_METHOD`."
    }
  }
}
