{"openapi":"3.0.3","info":{"title":"Bulutmu API","version":"1.5.0","description":"> Bu sayfa **başvuru belgesidir**. Genel bakış, yetenekler ve yol haritası için [Geliştirici Merkezi](https://api.bulutmu.com/docs).\n\nBulutmu API ile kendi yazılımınızı (e-ticaret sitesi, hosting paneli, ERP, CRM, mobil uygulama…) Bulutmu ön muhasebe\nhesabınıza bağlayabilirsiniz: cari ve ürün kartlarını eşitleyin, satış/alış/iade faturası kesin, faturayı **e-Fatura / e-Arşiv**\nolarak GİB'e gönderin, resmî PDF'i alın, tahsilat ve ödeme kaydedin.\n\n## Başlarken\n\n1. Bulutmu'da **Ayarlar → Entegrasyonlar → API Erişimi** sayfasından bir anahtar oluşturun ve gereken kapsamları seçin.\n   Anahtar **yalnız bir kez** gösterilir; güvenli bir yerde saklayın.\n2. Bağlantıyı sınayın:\n\n```bash\ncurl https://api.bulutmu.com/v1/me \\\n  -H \"Authorization: Bearer bm_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n```\n\n3. İlk carinizi oluşturun:\n\n```bash\ncurl -X POST https://api.bulutmu.com/v1/contacts \\\n  -H \"Authorization: Bearer $BULUTMU_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: musteri-1042\" \\\n  -d '{\"name\":\"Örnek Yazılım Ltd. Şti.\",\"tax_number\":\"1234567890\",\"tax_office\":\"Kadıköy\",\"city\":\"İstanbul\"}'\n```\n\n## Kimlik doğrulama\n\nHer istekte `Authorization: Bearer <anahtar>` başlığı gönderilir. Anahtar **tek bir firmaya** bağlıdır ve yalnız o firmanın\nverisine erişir; birden çok firma için firma başına ayrı anahtar oluşturun.\n\n- Anahtarı yalnız **sunucu tarafında** kullanın; tarayıcıya, mobil uygulamaya ya da herkese açık depoya koymayın.\n- Anahtara **IP izin listesi** ve **son kullanma tarihi** tanımlayabilirsiniz.\n- Sızdığından şüphelendiğiniz anahtarı aynı sayfadan **hemen iptal edin**; iptal anında geçerlidir.\n- Yazılımınız **başkalarının** Bulutmu hesabına bağlanacaksa (hazır modül, SaaS) anahtar istemeyin: [OAuth uygulaması](#description/oauth-uygulamaları) kaydedin.\n- Gerçek muhasebeye dokunmadan denemek için [test ortamı](#description/test-ortamı) anahtarı (`bm_test_…`) kullanın.\n\n## Kapsamlar\n\nAnahtar yalnız seçilen kapsamlardaki işlemleri yapabilir; eksik kapsamda `403 insufficient_scope` döner.\nEntegrasyonunuza **gereken en az** kapsamı verin.\n\n| Kapsam | İzin verdiği |\n|---|---|\n| `company:read` | Firma bilgilerini okuma |\n| `contacts:read` | Carileri (müşteri/tedarikçi) okuma |\n| `contacts:write` | Cari oluşturma ve güncelleme |\n| `products:read` | Ürün ve hizmetleri okuma |\n| `products:write` | Ürün ve hizmet oluşturma ve güncelleme |\n| `accounts:read` | Kasa ve banka hesaplarını okuma |\n| `invoices:read` | Faturaları (satış, alış, iade) ve e-belge durumlarını okuma; PDF/XML indirme |\n| `invoices:write` | Fatura ve iade faturası oluşturma, silme, muhasebe iptali |\n| `e_documents:send` | e-Fatura / e-Arşiv / e-İrsaliye olarak GİB'e GÖNDERME ve e-Arşiv iptali (geri alınamaz işlemler) |\n| `payments:read` | Tahsilat ve ödemeleri okuma |\n| `payments:write` | Tahsilat ve ödeme kaydetme, silme |\n| `offers:read` | Teklif ve proformaları okuma |\n| `offers:write` | Teklif/proforma oluşturma, silme, faturalama |\n| `incoming_e_invoices:read` | Gelen e-Faturaları (tedarikçilerden) okuma; PDF/XML indirme |\n| `incoming_e_invoices:answer` | Gelen TİCARİ e-Faturayı kabul etme ya da reddetme (hukuki, geri alınamaz işlem) |\n| `expenses:read` | Masrafları ve masraf türlerini okuma |\n| `expenses:write` | Masraf kaydetme ve silme |\n| `despatches:read` | İrsaliyeleri okuma; e-İrsaliye PDF/XML indirme |\n| `despatches:write` | Giden irsaliye oluşturma ve silme (stok hareketi doğurur) |\n| `employees:read` | Çalışanları, maaş tahakkuklarını, çalışan ödemelerini ve çalışan ekstresini okuma |\n| `employees:write` | Çalışan oluşturma ve güncelleme; maaş tahakkuku, çalışan ödemesi ve avans iadesi kaydetme (ödeme kasayı değiştirir) |\n| `cheques:read` | Çek ve senetleri okuma |\n| `cheques:write` | Çek ve senet kaydetme (alınan ya da verilen evrak — cari bakiyesini değiştirir) |\n| `events:read` | Olay kaydını okuma (/v1/events) — yalnız diğer okuma kapsamlarının izin verdiği olay türleri |\n| `webhooks:manage` | Webhook uçlarını yönetme — yalnız diğer okuma kapsamlarının izin verdiği olaylara abone olunur |\n\n## İstek ve yanıt biçimi\n\n- Gövde ve yanıtlar **JSON** (`Content-Type: application/json`), karakter kümesi UTF-8.\n- Tek kayıt: `{ \"data\": { … } }` · Liste: `{ \"data\": [ … ], \"meta\": { \"page\", \"per_page\", \"total\", \"has_more\" } }`.\n- Tarih-saatler ISO 8601 (`2026-10-09T14:30:00.000Z`), tarihler `YYYY-MM-DD` (Türkiye takvim günü).\n- Tutarlar ondalık sayıdır (`1250.5`), para birimleri ISO 4217 (`TRY`, `USD`, `EUR`).\n- Her yanıtta `X-Request-Id` başlığı vardır; destek talebinde bu kimliği iletin.\n\n## Sayfalama\n\nListe uçları `page` (1'den başlar) ve `per_page` (en çok 100, varsayılan 25) alır. Tüm kayıtları çekmek için\n`meta.has_more` false olana kadar `page`'i artırın. Sıralama `sort` ile (`-` ön eki azalan).\n\n## Idempotency (güvenli tekrar)\n\nKayıt oluşturan her `POST` isteğine benzersiz bir `Idempotency-Key` başlığı ekleyin (ör. kendi sistemizdeki sipariş\nnumarası). Ağ hatasında **aynı anahtarla** tekrar gönderdiğinizde ikinci kayıt oluşmaz, ilk yanıt döner (`Idempotent-Replayed: true`).\n\n- Anahtar 24 saat saklanır; en çok 255 karakter.\n- Aynı anahtar **farklı bir gövdeyle** kullanılırsa `422 idempotency_mismatch`, ilk istek hâlâ işleniyorsa `409 idempotency_conflict`.\n- Hata alan istek anahtarı bırakır: düzeltip aynı anahtarla tekrar gönderebilirsiniz.\n\n## Hız sınırı\n\nSınır firmanın paketine göre belirlenir (varsayılan anahtar başına dakikada **120** istek); geçerli değer her yanıtta döner.\nHer yanıtta `X-RateLimit-Limit`, `X-RateLimit-Remaining`,\n`X-RateLimit-Reset` (saniye) başlıkları döner. Aşımda `429 rate_limited` ve `Retry-After` başlığı gelir; bu süre kadar bekleyin.\n\n## Hatalar\n\nTüm hatalar aynı biçimdedir:\n\n```json\n{\n  \"error\": {\n    \"code\": \"validation_failed\",\n    \"message\": \"Gönderilen alanlar geçersiz.\",\n    \"fields\": { \"tax_number\": [\"10 haneli VKN ya da 11 haneli TCKN olmalı.\"] },\n    \"request_id\": \"req_6f1c…\"\n  }\n}\n```\n\n`code` **sözleşmedir** — entegrasyonunuzu buna göre kurun. `message` insan içindir (Türkçe), `reason` (varsa) iç\nhata kodudur; bilgi amaçlıdır ve değişebilir.\n\n| Kod | Anlamı |\n|---|---|\n| `bad_request` | İstek biçimi hatalı (ör. geçersiz JSON). |\n| `unauthorized` | API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş. |\n| `forbidden` | Bu işlem bu hesapta yapılamaz. |\n| `insufficient_scope` | Anahtarda bu işlemin kapsamı yok. |\n| `ip_not_allowed` | İstek, anahtarın IP izin listesinde olmayan bir adresten geldi. |\n| `account_disabled` | Firma hesabı kapatılmış. |\n| `module_required` | API erişimi hesabın paketinde yok. |\n| `subscription_expired` | Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest). |\n| `not_found` | Kayıt bulunamadı (ya da bu firmaya ait değil). |\n| `validation_failed` | Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. |\n| `confirmation_required` | Kayıt bir uyarı taşıyor (ör. aynı VKN'li cari var); bilerek kaydetmek için `confirm: true` gönderin. |\n| `limit_reached` | Paketin kayıt limiti doldu. |\n| `conflict` | Kayıt mevcut bir kayıtla çakışıyor. |\n| `business_rule` | İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde. |\n| `e_document_not_configured` | Firmada e-Fatura entegrasyonu (NES/Uyumsoft) kurulu değil. |\n| `insufficient_credits` | e-Belge kontörü yetersiz. |\n| `idempotency_conflict` | Aynı Idempotency-Key ile bir istek hâlâ işleniyor. |\n| `idempotency_mismatch` | Aynı Idempotency-Key farklı bir istekle kullanıldı. |\n| `rate_limited` | Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin. |\n| `server_error` | Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin. |\n\n## Fatura ve e-belge akışı\n\nÖnerilen akış (ör. e-ticaret siparişi ödendiğinde):\n\n1. **Cariyi bulun ya da oluşturun:** `GET /v1/contacts?tax_number=…` → yoksa `POST /v1/contacts`. Vergi numarası\n   bilinmeyen bireysel müşteride `tax_number` boş bırakılabilir: e-Arşiv alıcısı **nihai tüketici** (`11111111111`) olarak\n   yazılır. Bu durumda müşterinin **gerçek adı ve soyadı** gerekir (`name: \"Ayşe Nur Yılmaz\"` → ad \"Ayşe Nur\", soyad\n   \"Yılmaz\"; ya da `surname` ayrı). \"Müşteri\", \"Perakende\" gibi tek kelimelik ad **kabul edilmez** (`422`) — GİB bunu yasaklar.\n2. **Faturayı oluşturun:** `POST /v1/invoices` — `Idempotency-Key` olarak sipariş numaranızı gönderin; ağ hatasında\n   tekrar denediğinizde ikinci fatura oluşmaz. Satırları `product_code` (SKU) ile verin: ürün yoksa bir kez açılır.\n   E-ticaret fiyatları KDV dahilse `prices_include_vat: true`. Ödeme alındıysa `payment.account_id`.\n3. **GİB'e gönderin:** `POST /v1/invoices/{id}/e-document` (`profile: auto`): alıcı e-Fatura mükellefiyse e-Fatura,\n   değilse e-Arşiv. ⚠️ Geri alınamaz; ayrı kapsam (`e_documents:send`).\n4. **Resmî PDF:** `GET /v1/invoices/{id}/e-document/pdf` — müşterinize gönderin. (Henüz gönderilmemiş faturanın Bulutmu\n   çıktısı `GET /v1/invoices/{id}/pdf`; resmî belge değildir.)\n\n```bash\ncurl -X POST https://api.bulutmu.com/v1/invoices \\\n  -H \"Authorization: Bearer $BULUTMU_API_KEY\" -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: siparis-100231\" \\\n  -d '{\"type\":\"sale\",\"contact_id\":42,\"prices_include_vat\":true,\n       \"lines\":[{\"product_code\":\"KLV-01\",\"product_name\":\"Kablosuz Klavye\",\"quantity\":2,\"unit_price\":1200,\"vat_rate\":20},\n                {\"product_code\":\"KARGO\",\"product_name\":\"Kargo\",\"quantity\":1,\"unit_price\":59.90,\"vat_rate\":20}],\n       \"payment\":{\"account_id\":\"…\"}}'\n```\n\n**Tutarlar sunucuda hesaplanır** (satır bazında kuruşa yuvarlama, GİB ile aynı kural). Yanıttaki `totals` resmî tutardır;\nkendi sisteminizdeki toplamla karşılaştırın. KDV dahil fiyatta iskontolu satırlarda en çok 1 kuruş fark olabilir.\n\n**İade:** `POST /v1/invoices` `type: sale_return` + `return_of_id` (asıl fatura); iade miktarı asıl faturayı aşamaz. İade\nfaturası da `/e-document` ile gönderilir.\n\n**İptal kuralları (mevzuat):**\n\n| Durum | Yapılacak |\n|---|---|\n| Fatura henüz GİB'e gönderilmedi | `DELETE /v1/invoices/{id}` |\n| e-Arşiv, gönderimden itibaren 8 gün içinde | `POST /v1/invoices/{id}/e-document/cancel` → sonra `POST /v1/invoices/{id}/cancel` (muhasebe ters kaydı) |\n| Ticari e-Fatura alıcı tarafından reddedildi | `POST /v1/invoices/{id}/cancel` (ya da düzeltip yeniden gönderin) |\n| e-Fatura geçerli / e-Arşiv 8 günü geçti | İade faturası kesin |\n\n### İnternet satışı (e-ticaret)\n\nİnternetten yapılan satışın e-Arşiv faturasında GİB bazı bilgileri **zorunlu** tutar (VUK 509): satışın yapıldığı web adresi,\nödeme şekli ve tarihi, taşıyıcı (kargo) ve gönderim tarihi, ayrıca *\"Bu satış internet üzerinden yapılmıştır.\"* ibaresi.\nFaturayı oluştururken `online_sale` nesnesini gönderin; Bulutmu bunları e-belgeye doğru yerlere yazar.\n\n```json\n\"online_sale\": {\n  \"website\": \"https://magazam.com\",\n  \"payment_method\": \"payment_agent\",\n  \"payment_agent\": \"iyzico\",\n  \"payment_date\": \"2026-10-08\",\n  \"carrier\": { \"tax_number\": \"1234567890\", \"name\": \"Örnek Kargo A.Ş.\" },\n  \"despatch_date\": \"2026-10-09\",\n  \"order_no\": \"SIP-100231\",\n  \"order_date\": \"2026-10-08\"\n}\n```\n\n| Alan | Kural |\n|---|---|\n| `payment_method` | `card` (kredi/banka kartı) · `bank_transfer` (EFT/havale) · `cash_on_delivery` (kapıda ödeme) · `payment_agent` (iyzico, PayTR… — `payment_agent` adı zorunlu) · `other` |\n| `payment_date` | Boşsa kart/EFT/aracıda fatura günü |\n| `carrier` | Boşsa **satıcının kendisi** yazılır (kendi teslimatınız ya da hizmet/dijital ürün satışı) |\n| `despatch_date` | Boşsa fatura günü |\n| `order_no` | e-belgede sipariş referansı olarak görünür |\n\n- **Ayrı seri zorunlu:** GİB, internet satışlarının e-Arşiv faturalarının yalnız bu satışlara ayrılmış bir seriyle numaralanmasını\n  ister. Seriyi entegratör portalınızda oluşturup Bulutmu'da **Ayarlar → Entegrasyonlar → e-Fatura → İnternet satışı serisi**nden seçin.\n  Seri seçilmemişse gönderim `422` döner; `document_no` verirseniz bu seriyle başlamalıdır. Normal satışlar bu seriyi kullanamaz.\n- İnternet satışı faturası e-Arşiv'de **elektronik** gönderilir; `send_type: \"paper\"` reddedilir.\n- Alıcı e-Fatura mükellefiyse (`profile: auto` → e-Fatura) bu bilgiler gerekmez; e-Fatura olarak gider.\n- ⚠️ Şimdilik yalnız **NES** entegratörüyle gönderilir; başka entegratör bağlı hesapta `422` döner.\n\n**Tevkifat ve istisna:** satıra `withholding_code` (ör. 601) ya da %0 KDV'de `vat_exemption_code` (ör. 301) ekleyin;\nkodlar `GET /v1/taxes` ve `GET /v1/tax-exemptions`. Fatura tipi (TEVKIFAT, ISTISNA, IADE) satırlardan belirlenir.\n\n## Webhook'lar\n\nBir şey olduğunda (fatura kesildi, e-belge gönderildi, alıcı reddetti, tahsilat girildi…) Bulutmu, kayıtlı adresinize **imzalı bir\nPOST** gönderir. Ucu Bulutmu'da **Ayarlar → Entegrasyonlar → API Erişimi → Webhook'lar**dan ya da modülünüz kurulurken\n`POST /v1/webhooks` ile ekleyin (`webhooks:manage` kapsamı). İmza sırrı (`whsec_…`) **yalnız oluşturulurken** döner.\n\n```json\n{\n  \"id\": \"6a8f…\",\n  \"type\": \"invoice.created\",\n  \"created_at\": \"2026-10-09T14:30:00.000Z\",\n  \"api_version\": \"1.5.0\",\n  \"data\": { \"id\": \"c41e…\", \"type\": \"sale\", \"document_no\": null, \"contact_id\": 42, \"issue_date\": \"2026-10-09T09:00:00.000Z\", \"total\": 1440 }\n}\n```\n\n`data` **yalındır** (kimlik + birkaç anahtar alan). Tam ve güncel kayıt için ilgili GET ucunu çağırın — olaylar sırayla\ngelmeyebilir, her zaman güncel durumu okuyun.\n\n| Olay | Gerekli kapsam | Ne zaman |\n|---|---|---|\n| `invoice.created` | `invoices:read` | Fatura oluşturuldu (satış, alış, iade; arayüzden, API'den, içe aktarmadan ya da tekliften). |\n| `invoice.updated` | `invoices:read` | Fatura güncellendi. |\n| `invoice.deleted` | `invoices:read` | Fatura silindi. |\n| `invoice.cancelled` | `invoices:read` | Satış muhasebe kaydıyla iptal edildi (aynı tarihli ters kayıt oluştu — o da `invoice.created`). |\n| `e_document.sent` | `invoices:read` | Fatura e-Fatura / e-Arşiv olarak GİB'e gönderildi. |\n| `e_document.accepted` | `invoices:read` | Ticari e-Faturayı alıcı KABUL etti. |\n| `e_document.rejected` | `invoices:read` | Ticari e-Faturayı alıcı REDDETTİ (`answer_note` gerekçe). |\n| `e_document.cancelled` | `invoices:read` | e-Arşiv faturası iptal edildi. |\n| `payment.created` | `payments:read` | Tahsilat ya da ödeme kaydedildi (faturanın peşin tahsilatı dahil). |\n| `payment.deleted` | `payments:read` | Tahsilat ya da ödeme silindi. |\n| `contact.created` | `contacts:read` | Cari oluşturuldu. |\n| `contact.updated` | `contacts:read` | Cari bilgileri güncellendi (bakiye değişimi bu olayı ÜRETMEZ — `updated_since` ile izleyin). |\n| `contact.deleted` | `contacts:read` | Cari silindi. |\n\nAPI'den eklenen uç yalnız anahtarın **okuma** kapsamlarının izin verdiği olaylara abone olabilir; `[\"*\"]` bunların hepsidir.\n\n**Başlıklar:** `x-bulutmu-event` (tür), `x-bulutmu-event-id` (olay kimliği), `x-bulutmu-delivery` (teslimat kimliği),\n`x-bulutmu-signature` (`t=<unix zaman>,v1=<imza>`).\n\n**İmzayı doğrulayın** — `v1 = HMAC-SHA256(sır, \"<t>.<ham gövde>\")`; `t` 5 dakikadan eskiyse reddedin. Gövdeyi JSON'a çevirmeden,\n**ham** haliyle imzalayın:\n\n```php\n<?php\n$govde = file_get_contents('php://input');\n$imza  = $_SERVER['HTTP_X_BULUTMU_SIGNATURE'] ?? '';\nif (!preg_match('/^t=(\\d+),v1=([0-9a-f]{64})$/', $imza, $m)) { http_response_code(400); exit; }\n$beklenen = hash_hmac('sha256', $m[1] . '.' . $govde, getenv('BULUTMU_WEBHOOK_SECRET'));\nif (!hash_equals($beklenen, $m[2]) || abs(time() - (int) $m[1]) > 300) { http_response_code(400); exit; }\n$olay = json_decode($govde, true);\n// $olay['id'] daha önce işlendiyse atla; işi kuyruğa al ve HEMEN 200 dön.\nhttp_response_code(200);\n```\n\n```javascript\n// Node.js / Express — gövde HAM okunmalı: app.post(\"/bulutmu/webhook\", express.raw({ type: \"application/json\" }), isle)\nimport crypto from \"node:crypto\";\nfunction isle(req, res) {\n  const [, t, v1] = /^t=(\\d+),v1=([0-9a-f]{64})$/.exec(req.get(\"x-bulutmu-signature\") ?? \"\") ?? [];\n  if (!t) return res.sendStatus(400);\n  const beklenen = crypto.createHmac(\"sha256\", process.env.BULUTMU_WEBHOOK_SECRET).update(`${t}.${req.body}`).digest(\"hex\");\n  if (!crypto.timingSafeEqual(Buffer.from(beklenen), Buffer.from(v1)) || Math.abs(Date.now() / 1000 - Number(t)) > 300) return res.sendStatus(400);\n  const olay = JSON.parse(req.body);\n  res.sendStatus(200); // işi sonra yapın\n}\n```\n\n**Teslimat kuralları**\n\n- 10 saniye içinde **2xx** dönün; işi kuyruğa alıp hemen yanıtlayın. Yönlendirme (3xx) izlenmez.\n- Başarısız teslimat 1 dk, 5 dk, 30 dk, 2 sa, 6 sa, 12 sa, 24 sa sonra yeniden denenir (toplam 8 deneme).\n- Aynı olay **birden çok kez** gelebilir — `id` ile tekilleştirin.\n- 3 gün boyunca teslim edilemeyen uç **kapatılır** ve firma sahibine bildirilir; düzelttikten sonra `PATCH /v1/webhooks/{id}`\n  `{\"enabled\": true}` ile açın. Teslimat geçmişi: `GET /v1/webhooks/{id}/deliveries`.\n- Adres **https** olmalı ve internetten erişilebilmeli; iç ağ / özel IP adresleri reddedilir.\n- Kaçırdığınız olaylar **30 gün** `GET /v1/events`te durur (`events:read`). `POST /v1/webhooks/{id}/test` bir `ping` gönderir.\n\n## Değişenleri çekme (eşitleme)\n\nCari, ürün, fatura ve tahsilat listeleri `updated_since` ve `sort=updated_at` alır; her kayıtta `updated_at` vardır.\n\n1. İlk eşitlemede tüm kayıtları sayfalayarak çekin ve **başladığınız anı** saklayın.\n2. Sonraki eşitlemelerde `updated_since` = saklanan an **eksi 5 dakika** (uzun süren işlemler kaçmasın; aynı kaydı iki kez almak\n   zararsızdır, kaçırmak değil).\n3. Silinen kayıtlar listede görünmez — `*.deleted` olaylarından (webhook ya da `/v1/events`) öğrenin.\n\nFaturanın `updated_at`'i e-belge durumunun (kabul/ret/iptal) değişimini, ürününki stok miktarını, carininki bakiyesini de kapsar.\n\n## Teklif, stok, masraf ve gelen e-faturalar\n\n| Kaynak | Uçlar | Not |\n|---|---|---|\n| **Teklif / proforma** | `/v1/offers` · `POST /v1/offers/{id}/convert` | Muhasebeyi etkilemez. `convert` **bugün tarihli yeni** satış faturası üretir; teklif `invoiced` olur ve artık silinemez. |\n| **Depo ve stok** | `/v1/warehouses` · `/v1/products/{id}/stock` · `/v1/stock-movements` | Stok **hareketlerden doğar**; doğrudan yazılamaz. Satış faturası stoğu düşer, alış artırır. Hizmet kartları stok tutmaz. |\n| **Gelen e-Faturalar** | `/v1/incoming-e-invoices` (+ `/pdf`, `/xml`, `/answer`) | Tedarikçilerinizin size kestiği e-Faturalar. Entegratörden birkaç dakikada bir eşitlenir; yeni gelenler için `received_since` ile sorgulayın. Ticari faturaya kabul/ret `POST …/{id}/answer` — **geri alınamaz**, ayrı kapsam (`incoming_e_invoices:answer`), ret 8 gün içinde. |\n| **Masraflar** | `/v1/expense-types` · `/v1/expenses` | `account_id` verilirse kasadan ödenir; verilmez ve `contact_id` verilirse tedarikçiye borç yazılır. Tutar **KDV dahildir**. |\n| **Kasa/banka hareketleri** | `/v1/accounts/{id}/transactions` | Hesap ekstresi: `amount` işaretlidir (giriş +, çıkış −), `balance_after` o hareketten sonraki bakiyedir. |\n\n## İrsaliye, çalışan ve çek/senet\n\n| Kaynak | Uçlar | Not |\n|---|---|---|\n| **İrsaliye** | `/v1/despatches` (oluştur, listele, getir, sil) | GİDEN irsaliye kaydedildiği anda **stok düşer**, silinince geri gelir. Satırlar kayıtlı ürüne `product_id` / `product_code` ile bağlanır (irsaliye ürün açmaz). Faturasını `POST /v1/invoices` gövdesinde **`despatch_ids`** ile kesin: fatura irsaliyeye bağlanır ve stoğu **ikinci kez düşürmez**. `Idempotency-Key` gönderin. |\n| **e-İrsaliye** | `POST /v1/despatches/{id}/e-document` · `…/e-document/pdf` · `…/e-document/xml` | ⚠️ **Geri alınamaz** — e-İrsaliye iptal edilemez; gönderilmiş irsaliye silinemez (hata için karşı yönde yeni irsaliye). `e_documents:send` kapsamı. Kontör gönderimden ÖNCE ayrılır: `402` alan belge GİB'e gitmemiştir. Alıcı e-İrsaliye mükellefi olmalı; adresler (adres, ilçe, il), kendi araçla plaka + şoför (ad soyad, TCKN), kargoyla taşıyıcının unvan/VKN/vergi dairesi/adresi gerekir. |\n| **Çalışanlar** | `/v1/employees` · `…/{id}/salaries` · `…/{id}/payments` · `…/{id}/transactions` | Bakiye hareketlerden doğar: **tahakkuk** çalışana borç yazar (bakiye −) ve aynı tutarda gider kaydı oluşturur, **kasayı oynatmaz**; **ödeme** kasadan çıkar (bakiye +), **avans iadesi** kasaya girer (bakiye −). Negatif bakiye = çalışana borçlusunuz. |\n| **Çek ve senetler** | `/v1/cheques` · `/v1/promissory-notes` (kaydet, listele, getir) | `received`: müşteriden alınan evrak — carinin borcu düşer, evrak portföye girer, kasa OYNAMAZ. `issued`: tedarikçiye verilen kendi evrakımız — cari bakiyesi artar. `status` para alanlarından türetilir ve okunur; tahsil, ciro, karşılıksız işlemleri şimdilik Bulutmu arayüzündedir. |\n\n## OAuth uygulamaları\n\nAPI anahtarı **tek firmanın kendi** entegrasyonu içindir. Yazılımınız birçok Bulutmu kullanıcısına hizmet veriyorsa (hazır modül,\npazaryeri entegrasyonu, SaaS) **OAuth uygulaması** kaydedin: kullanıcı anahtar kopyalamaz, Bulutmu'da *\"İzin ver\"*e basar; uygulamanız\nyalnız onaylanan kapsamlarla o firmaya erişir ve kullanıcı erişimi istediği an **Bağlı uygulamalar**dan kaldırabilir.\n\n**1. Uygulamayı kaydedin** — Bulutmu'da *Ayarlar → Entegrasyonlar → API Erişimi → OAuth uygulamalarım*:\n\n| Tür | Ne zaman | Kurallar |\n|---|---|---|\n| **Gizli** (`confidential`) | Sır saklayabilen sunucu uygulaması | `client_secret` verilir (bir kez gösterilir). `redirect_uri` kayıtlı adresle **birebir** eşleşmeli. |\n| **Açık** (`public`) | Müşterinin kendi sitesine kurulan modül, mobil/masaüstü uygulama | Sır yoktur; **PKCE zorunlu**. Modül her müşteride başka alan adında çalışacağı için adres `https://*/sabit/yol` biçiminde (alan adı joker, yol sabit) kaydedilebilir; her alan adı **ayrı** izin alır. |\n\n**2. Kullanıcıyı yetkilendirmeye gönderin**\n\n```\nhttps://api.bulutmu.com/v1/oauth/authorize?response_type=code&client_id=bmc_…&redirect_uri=https%3A%2F%2Fornek.com%2Fgeri\n  &scope=invoices%3Aread%20invoices%3Awrite&state=<rastgele>&code_challenge=<S256>&code_challenge_method=S256\n```\n\nKullanıcı Bulutmu'ya giriş yapar, **hangi firmayı** bağlayacağını seçer ve istenen kapsamları görür. Yalnız **firma sahibi** izin verebilir.\n`scope` uygulamanın kayıtlı kapsamlarının alt kümesi olmalıdır (boşsa hepsi). Karar sonrası `redirect_uri`'ye dönülür:\n`?code=bm_oac_…&state=…` ya da `?error=access_denied&state=…`. **`state`'i gönderdiğinizle karşılaştırın** (CSRF).\n\n**3. Kodu belirtece çevirin** — kod **2 dakika** geçerli ve tek kullanımlıktır:\n\n```bash\ncurl -X POST https://api.bulutmu.com/v1/oauth/token \\\n  -d grant_type=authorization_code -d code=bm_oac_… -d redirect_uri=https://ornek.com/geri \\\n  -d client_id=bmc_… -d client_secret=bms_… -d code_verifier=<PKCE doğrulayıcı>\n```\n\n```json\n{ \"access_token\": \"bm_oat_…\", \"token_type\": \"Bearer\", \"expires_in\": 3600, \"refresh_token\": \"bm_ort_…\",\n  \"scope\": \"invoices:read invoices:write\", \"company\": { \"id\": \"…\", \"name\": \"Örnek Ltd. Şti.\" } }\n```\n\n**4. API'yi çağırın** — anahtar yerine erişim belirtecini gönderin: `Authorization: Bearer bm_oat_…`. Uçlar, kapsamlar, hatalar aynıdır.\n\n**5. Yenileyin** — erişim belirteci **60 dakika** geçerlidir. Süresi dolunca (`401`):\n\n```bash\ncurl -X POST https://api.bulutmu.com/v1/oauth/token -d grant_type=refresh_token -d refresh_token=bm_ort_… -d client_id=bmc_… -d client_secret=bms_…\n```\n\n- ⚠️ Yenileme belirteci **her kullanımda değişir**: yanıttaki yeni çifti hemen saklayın. Eski yenileme belirteci sonradan bir daha\n  kullanılırsa (çalınmış sayılır) **izin tamamen iptal edilir** ve kullanıcının yeniden onay vermesi gerekir. Aynı anda iki süreç\n  yenilemesin (kilit kullanın); birkaç saniye içindeki eşzamanlı tekrar yalnız reddedilir, izni düşürmez.\n- `invalid_grant` = kod/belirteç geçersiz ya da kullanıcı erişimi kaldırmış → kullanıcıyı 2. adıma yeniden gönderin.\n- Belirteç ucunun hataları OAuth biçimindedir: `{ \"error\": \"invalid_grant\", \"error_description\": \"…\" }`.\n- Bağlantıyı kendiniz sonlandırmak için `POST /v1/oauth/revoke` (`token` + istemci kimliği): izin ve uygulamanın eklediği webhook'lar silinir.\n- Yeni kaydedilen uygulama **doğrulanmamış** görünür (onay ekranında uyarı çıkar). Yayına almadan önce Bulutmu'dan doğrulama isteyin.\n- OAuth ile eklenen webhook ucu o izne bağlıdır; izin kalkınca kendiliğinden silinir.\n\n## Test ortamı\n\nEntegrasyonunuzu **gerçek muhasebeye ve GİB'e dokunmadan** deneyin. *Ayarlar → Entegrasyonlar → API Erişimi → Test ortamı*ndan\n**test firması** oluşturun, o firmaya geçip anahtar üretin: anahtar `bm_test_` ile başlar. Aynı adres, aynı uçlar, aynı kurallar —\nyalnız e-belgeler gerçek entegratöre değil Bulutmu'nun **test entegratörüne** gider.\n\n| | Test firması | Gerçek firma |\n|---|---|---|\n| Anahtar | `bm_test_…` | `bm_live_…` |\n| e-Fatura / e-Arşiv | GİB'e **gitmez**; numara, ETTN, PDF ve XML yine üretilir | GİB'e gider |\n| Kontör | Düşmez | Düşer |\n| Veri | Ayrı firma — boş başlar, gerçek kayıtlarınız kopyalanmaz | — |\n\n- **Mükellef kuralı:** vergi numarasının **son hanesi çift** olan alıcı e-Fatura mükellefi sayılır (`profile: auto` → e-Fatura), tek ise e-Arşiv.\n  Örn. `1234567890` → e-Fatura, `1234567891` → e-Arşiv.\n- **Seriler:** e-Arşiv `TEA`, internet satışı `TEI`, e-Fatura `TEF`.\n- **Alıcı yanıtı:** ticari e-Faturanın kabul/reddini `POST /v1/test/e-documents/{id}/answer` (`{\"answer\": \"rejected\", \"note\": \"…\"}`) ile\n  benzetin; `e_document.accepted` / `e_document.rejected` olayları gerçekteki gibi oluşur.\n- `GET /v1/me` yanıtında `company.test_mode: true` döner — canlıya geçerken anahtarı değiştirmeyi unutmamak için başlangıçta denetleyin.\n- Test firması hesabınızın firma sayısı limitine girmez; hesap başına bir tanedir.\n\n## Muhasebe kuralları\n\nAPI, Bulutmu arayüzüyle **aynı kuralları** uygular: paket limitleri, abonelik süresi, VKN/TCKN kontrol hanesi, mükerrer\nkayıt uyarıları. Bakiyeler ve stok hareketlerden doğar; doğrudan yazılamaz. Abonelik süresi dolmuş hesapta yazma işlemleri\n`402 subscription_expired` döner.\n\n## Sürümleme ve kararlılık\n\n- Bu belge **v1**'dir. v1'de alanlar ve uçlar **yalnız eklenir**; mevcut bir alan kaldırılmaz, yeniden adlandırılmaz,\n  anlamı değişmez. Böyle bir değişiklik gerekirse **v2** yayımlanır ve v1 en az 12 ay çalışmaya devam eder.\n- Yanıtta tanımadığınız yeni alanları **yok sayın** (ileriye uyumluluk).\n- Makine tarafından okunabilir tanım: [`/v1/openapi.json`](https://api.bulutmu.com/v1/openapi.json) (OpenAPI 3.0). Bununla\n  istemci kütüphanesi (SDK) üretebilirsiniz.\n\n## Değişiklik günlüğü\n\n- **2026-11 — v1.5:** İrsaliyeler ve e-İrsaliye (`/v1/despatches`: giden irsaliye oluştur/sil — stok düşer; `POST /v1/despatches/{id}/e-document` ile GİB'e gönderim, resmî PDF/XML; faturada `despatch_ids` ile irsaliyeden fatura — stok ikinci kez düşmez), çalışanlar (`/v1/employees`: kart, maaş tahakkuku, ödeme ve avans iadesi, çalışan ekstresi), çek ve senetler (`/v1/cheques`, `/v1/promissory-notes`: alınan/verilen evrak kaydı, durum okunur), gelen ticari e-Faturaya kabul/ret (`POST /v1/incoming-e-invoices/{id}/answer`), pakete göre hız sınırı (`X-RateLimit-Limit` paketinizden gelir), istek günlüğü (firma sahibi API kullanımını Bulutmu'da görür; 30 gün). Yeni kapsamlar: `despatches:*`, `employees:*`, `cheques:*`, `incoming_e_invoices:answer`; e-İrsaliye gönderimi mevcut `e_documents:send` kapsamıyla.\n- **2026-10 — v1.4:** OAuth uygulamaları (bir uygulama, firma sahibinin onayıyla birçok firmaya bağlanır; PKCE, dönen yenileme belirteci), test ortamı (`bm_test_` anahtarları — e-belgeler GİB'e gitmez), yeni kaynaklar: teklif ve proforma (`/v1/offers`), depolar ve stok (`/v1/warehouses`, `/v1/products/{id}/stock`, `/v1/stock-movements`), gelen e-Faturalar (`/v1/incoming-e-invoices`), masraflar (`/v1/expenses`), kasa/banka hareketleri (`/v1/accounts/{id}/transactions`). Yeni kapsamlar: `offers:*`, `expenses:*`, `incoming_e_invoices:read`.\n- **2026-10 — v1.3:** Webhook'lar (imzalı, yeniden denemeli; `/v1/webhooks`), olay kaydı (`/v1/events`, 30 gün), değişenleri çekme (`updated_since` + `updated_at`: cari, ürün, fatura, tahsilat). Yeni kapsamlar: `events:read`, `webhooks:manage`.\n- **2026-10 — v1.2:** İnternet satışı bilgileri (`online_sale`, VUK 509) ve internet satışlarına ayrı e-Arşiv serisi; sipariş referansı; vergi numarası olmayan bireysel alıcıya nihai tüketici e-Arşiv'i; gönderilmemiş faturanın PDF'i (`GET /v1/invoices/{id}/pdf`).\n- **2026-10 — v1.1:** Faturalar (satış, alış, iade; KDV dahil fiyat, tevkifat, istisna, peşin tahsilat), e-Fatura/e-Arşiv gönderimi (otomatik profil), resmî PDF/XML, e-Arşiv iptali, muhasebe iptali, tahsilat/ödeme, birim/vergi/istisna listeleri, GİB mükellef sorgusu. Yeni kapsamlar: `invoices:*`, `e_documents:send`, `payments:*`.\n- **2026-10 — v1.0:** İlk sürüm: firma bilgisi, cariler, ürünler, kasa/banka hesapları; anahtar kapsamları, idempotency, hız sınırı.\n- **Sırada:** php sdk, hazır modüller, daha fazla kaynak, uygulama dizini.","contact":{"name":"Bulutmu Destek","url":"https://app.bulutmu.com/destek"}},"servers":[{"url":"https://api.bulutmu.com"}],"tags":[{"name":"Firma","description":"Anahtarın bağlı olduğu firma."},{"name":"Cariler","description":"Müşteri ve tedarikçi hesapları. Faturalar bir cariye kesilir."},{"name":"Ürünler","description":"Ürün ve hizmet kartları. Fatura satırları bir ürüne bağlanabilir."},{"name":"Kasa ve Bankalar","description":"Tahsilat ve ödemelerin girdiği/çıktığı hesaplar."},{"name":"Faturalar","description":"Satış, alış ve iade faturaları. Önce Bulutmu'ya kaydedilir, sonra istenirse GİB'e gönderilir."},{"name":"e-Fatura / e-Arşiv","description":"GİB'e gönderim, resmî PDF/XML, e-Arşiv iptali, mükellef sorgusu. Gönderim ve iptal GERİ ALINAMAZ."},{"name":"Teklifler ve Proformalar","description":"Teklif ve proforma; muhasebeyi etkilemez, faturalanınca satış faturası oluşur."},{"name":"Tahsilat ve Ödemeler","description":"Müşteriden tahsilat, tedarikçiye ödeme; faturaya bağlanabilir."},{"name":"İrsaliyeler","description":"Giden/gelen irsaliyeler ve e-İrsaliye. Giden irsaliye stoğu DÜŞER, gelen artırır. e-İrsaliye gönderimi GERİ ALINAMAZ (iptal edilemez)."},{"name":"Depolar ve Stok","description":"Depolar, ürünün depo bazında stoğu ve stok hareketleri."},{"name":"Gelen e-Faturalar","description":"Tedarikçilerden gelen e-Faturalar ve resmî PDF/XML'leri."},{"name":"Masraflar","description":"Masraf kayıtları ve masraf türleri."},{"name":"Çek ve Senetler","description":"Alınan ve verilen çek/senetler. Durum para alanlarından türetilir ve okunur; tahsil/ciro/karşılıksız işlemleri Bulutmu arayüzündedir."},{"name":"Çalışanlar","description":"Çalışan kartları, maaş tahakkuku, ödeme ve avans iadesi, çalışan ekstresi. Tahakkuk kasayı oynatmaz; ödeme oynatır."},{"name":"Olaylar ve Webhook'lar","description":"Değişiklikleri sisteminize anında bildiren imzalı webhook'lar ve 30 günlük olay kaydı."},{"name":"Test Ortamı","description":"Test firmasında (bm_test_ anahtarı) senaryo kurmak için yardımcı uçlar. e-Belgeler GİB'e gitmez."},{"name":"Başvuru Listeleri","description":"Birim, vergi ve istisna kodları — her geçerli anahtarla okunur."}],"x-tagGroups":[{"name":"Temel kayıtlar","tags":["Firma","Cariler","Ürünler","Kasa ve Bankalar"]},{"name":"Satış ve e-belge","tags":["Faturalar","e-Fatura / e-Arşiv","Teklifler ve Proformalar","Tahsilat ve Ödemeler","İrsaliyeler"]},{"name":"Stok ve alış","tags":["Depolar ve Stok","Gelen e-Faturalar","Masraflar"]},{"name":"Nakit ve personel","tags":["Çek ve Senetler","Çalışanlar"]},{"name":"Entegrasyon","tags":["Olaylar ve Webhook'lar","Test Ortamı"]},{"name":"Tanımlar","tags":["Başvuru Listeleri"]}],"paths":{"/v1/me":{"get":{"operationId":"getMe","tags":["Firma"],"summary":"Anahtarın bağlı olduğu firma","description":"Bağlantıyı sınamak için ilk çağrı. Anahtarın hangi firmaya bağlı olduğunu ve kapsamlarını döndürür.\n\n**Gerekli kapsam:** `company:read`","x-scopes":["company:read"],"security":[{"bearerAuth":[]},{"oauth2":["company:read"]}],"parameters":[],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Me"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contacts":{"get":{"operationId":"listContacts","tags":["Cariler"],"summary":"Carileri listele","description":"Sayfalı liste. Vergi numarasıyla tam eşleşme için `tax_number`, serbest arama için `search` kullanın.\n\n**Gerekli kapsam:** `contacts:read`","x-scopes":["contacts:read"],"security":[{"bearerAuth":[]},{"oauth2":["contacts:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"search","in":"query","required":false,"description":"Ad, kod, vergi no, e-posta, telefon içinde arar (Türkçe harf duyarsız).","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1,"maxLength":100}],"description":"Ad, kod, vergi no, e-posta, telefon içinde arar (Türkçe harf duyarsız)."}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["customer","supplier"]}]}},{"name":"tax_number","in":"query","required":false,"description":"Tam eşleşme.","schema":{"anyOf":[{"not":{}},{"type":"string"}],"description":"Tam eşleşme."}},{"name":"include_archived","in":"query","required":false,"description":"true = arşivlenmiş carileri de getir (varsayılan false).","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["true","false"]}],"description":"true = arşivlenmiş carileri de getir (varsayılan false)."}},{"name":"created_since","in":"query","required":false,"description":"Bu andan sonra oluşturulanlar (ISO 8601).","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan sonra oluşturulanlar (ISO 8601)."}},{"name":"updated_since","in":"query","required":false,"description":"Bu andan (dahil) sonra DEĞİŞENLER — eşitleme için (bkz. rehber).","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan (dahil) sonra DEĞİŞENLER — eşitleme için (bkz. rehber)."}},{"name":"sort","in":"query","required":false,"description":"Sıralama; `-` azalan.","schema":{"type":"string","enum":["id","-id","name","-name","created_at","-created_at","updated_at","-updated_at"],"default":"id","description":"Sıralama; `-` azalan."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createContact","tags":["Cariler"],"summary":"Cari oluştur","description":"Vergi numarası verilirse GİB e-Fatura mükellefiyeti otomatik sorgulanır. Kontrol hanesi tutmayan VKN/TCKN ya da aynı vergi numaralı başka bir cari varsa `409 confirmation_required` döner; bilerek kaydetmek için `confirm: true` ile tekrar gönderin. 11 haneli (TCKN) carilerde `surname` zorunludur.\n\n**Gerekli kapsam:** `contacts:write`","x-scopes":["contacts:write"],"security":[{"bearerAuth":[]},{"oauth2":["contacts:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`confirmation_required` — Kayıt bir uyarı taşıyor (ör. aynı VKN'li cari var); bilerek kaydetmek için `confirm: true` gönderin. · `idempotency_conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contacts/{id}":{"get":{"operationId":"getContact","tags":["Cariler"],"summary":"Cari getir","description":"**Gerekli kapsam:** `contacts:read`","x-scopes":["contacts:read"],"security":[{"bearerAuth":[]},{"oauth2":["contacts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği.","schema":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıt kimliği."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateContact","tags":["Cariler"],"summary":"Cari güncelle","description":"Yalnız gönderilen alanlar değişir. Bakiye ve para birimi bu uçtan değişmez (bakiye hareketlerden doğar).\n\n**Gerekli kapsam:** `contacts:write`","x-scopes":["contacts:write"],"security":[{"bearerAuth":[]},{"oauth2":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği.","schema":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıt kimliği."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdate"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`confirmation_required` — Kayıt bir uyarı taşıyor (ör. aynı VKN'li cari var); bilerek kaydetmek için `confirm: true` gönderin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products":{"get":{"operationId":"listProducts","tags":["Ürünler"],"summary":"Ürün ve hizmetleri listele","description":"**Gerekli kapsam:** `products:read`","x-scopes":["products:read"],"security":[{"bearerAuth":[]},{"oauth2":["products:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"search","in":"query","required":false,"description":"Kod, barkod, ad, GTİP içinde arar.","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1,"maxLength":100}],"description":"Kod, barkod, ad, GTİP içinde arar."}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["product","service"]}]}},{"name":"code","in":"query","required":false,"description":"Tam eşleşme.","schema":{"anyOf":[{"not":{}},{"type":"string"}],"description":"Tam eşleşme."}},{"name":"barcode","in":"query","required":false,"description":"Tam eşleşme.","schema":{"anyOf":[{"not":{}},{"type":"string"}],"description":"Tam eşleşme."}},{"name":"include_archived","in":"query","required":false,"description":"true = arşivlenmişleri de getir (varsayılan false).","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["true","false"]}],"description":"true = arşivlenmişleri de getir (varsayılan false)."}},{"name":"updated_since","in":"query","required":false,"description":"Bu andan (dahil) sonra DEĞİŞENLER (stok miktarı dahil) — eşitleme için.","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan (dahil) sonra DEĞİŞENLER (stok miktarı dahil) — eşitleme için."}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["id","-id","name","-name","code","-code","updated_at","-updated_at"],"default":"id"}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createProduct","tags":["Ürünler"],"summary":"Ürün ya da hizmet oluştur","description":"**Gerekli kapsam:** `products:write`","x-scopes":["products:write"],"security":[{"bearerAuth":[]},{"oauth2":["products:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — Kayıt mevcut bir kayıtla çakışıyor. · `idempotency_conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/{id}":{"get":{"operationId":"getProduct","tags":["Ürünler"],"summary":"Ürün getir","description":"**Gerekli kapsam:** `products:read`","x-scopes":["products:read"],"security":[{"bearerAuth":[]},{"oauth2":["products:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği.","schema":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıt kimliği."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateProduct","tags":["Ürünler"],"summary":"Ürün güncelle","description":"Yalnız gönderilen alanlar değişir. Stok bu uçtan değişmez (stok hareketlerden doğar).\n\n**Gerekli kapsam:** `products:write`","x-scopes":["products:write"],"security":[{"bearerAuth":[]},{"oauth2":["products:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği.","schema":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıt kimliği."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdate"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — Kayıt mevcut bir kayıtla çakışıyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts":{"get":{"operationId":"listAccounts","tags":["Kasa ve Bankalar"],"summary":"Kasa ve banka hesaplarını listele","description":"Tahsilat/ödeme kaydederken kullanılacak `account_id` değerleri buradan alınır.\n\n**Gerekli kapsam:** `accounts:read`","x-scopes":["accounts:read"],"security":[{"bearerAuth":[]},{"oauth2":["accounts:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["cash","bank","credit_card","pos"]}]}},{"name":"include_archived","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["true","false"]}]}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices":{"get":{"operationId":"listInvoices","tags":["Faturalar"],"summary":"Faturaları listele","description":"Satış, alış ve iade faturaları (teklif/proforma hariç). Satırlar listede gelmez; tek fatura getirilirken gelir.\n\n**Gerekli kapsam:** `invoices:read`","x-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"type","in":"query","required":false,"description":"Virgülle birden çok: `sale,sale_return`.","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^(sale|purchase|sale_return|purchase_return)(,(sale|purchase|sale_return|purchase_return))*$"}],"description":"Virgülle birden çok: `sale,sale_return`."}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}]}},{"name":"document_no","in":"query","required":false,"description":"Tam eşleşme.","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1}],"description":"Tam eşleşme."}},{"name":"issue_date_from","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"issue_date_to","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"payment_status","in":"query","required":false,"description":"unpaid = kalanı olanlar, paid = kalanı olmayanlar.","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["unpaid","paid"]}],"description":"unpaid = kalanı olanlar, paid = kalanı olmayanlar."}},{"name":"created_since","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}]}},{"name":"updated_since","in":"query","required":false,"description":"Bu andan (dahil) sonra DEĞİŞENLER — kayıt, tahsilat durumu ve e-belge durumu (kabul/ret/iptal) değişimi dahil.","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan (dahil) sonra DEĞİŞENLER — kayıt, tahsilat durumu ve e-belge durumu (kabul/ret/iptal) değişimi dahil."}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["issue_date","-issue_date","created_at","-created_at","updated_at","-updated_at"],"default":"-issue_date"}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createInvoice","tags":["Faturalar"],"summary":"Fatura oluştur","description":"Satış, alış ya da iade faturası. Tutarlar sunucuda hesaplanır (kuruş kuralı GİB ile aynı); yanıttaki `totals` resmî tutardır. Satırlar `product_id` ya da `product_code` ile ürüne bağlanır — kodla gelen ürün yoksa BİR KEZ oluşturulur. `payment` verilirse fatura peşin tahsil edilmiş/ödenmiş kaydedilir. Fatura bu uçta yalnız Bulutmu'ya kaydedilir; GİB'e göndermek için `POST /v1/invoices/{id}/e-document`. Aynı siparişin iki kez faturalanmaması için `Idempotency-Key` (ör. sipariş no) gönderin. Mal irsaliyeyle (`/v1/despatches`) çıktıysa `despatch_ids` verin: fatura irsaliyelere bağlanır ve stok İKİNCİ KEZ düşmez.\n\n**Gerekli kapsam:** `invoices:write`","x-scopes":["invoices:write"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}":{"get":{"operationId":"getInvoice","tags":["Faturalar"],"summary":"Fatura getir (satırlarıyla)","description":"**Gerekli kapsam:** `invoices:read`","x-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteInvoice","tags":["Faturalar"],"summary":"Faturayı sil","description":"Yalnız e-belge olarak GÖNDERİLMEMİŞ fatura silinir (30 gün Bulutmu'nun geri dönüşüm kutusunda durur). Gönderilmiş faturada önce e-Arşiv iptali ya da iade faturası gerekir (`business_rule`).\n\n**Gerekli kapsam:** `invoices:write`","x-scopes":["invoices:write"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":false}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/cancel":{"post":{"operationId":"cancelInvoice","tags":["Faturalar"],"summary":"Satışı muhasebede iptal et (ters kayıt)","description":"e-Belgesi iptal edilmiş (e-Arşiv) ya da alıcı tarafından REDDEDİLMİŞ (ticari) satış için: kayıt silinmez, aynı tarihli ters kayıt (sale_return) muhasebe etkisini sıfırlar. Geçerli bir e-belgesi olan satış bu yolla iptal edilemez — iade faturası kesin.\n\n**Gerekli kapsam:** `invoices:write`","x-scopes":["invoices:write"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/InvoiceCancelResult"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/pdf":{"get":{"operationId":"getInvoicePdf","tags":["Faturalar"],"summary":"Fatura PDF (Bulutmu çıktısı)","description":"GİB'e GÖNDERİLMEMİŞ faturanın (ya da alış faturasının) Bulutmu çıktısı — RESMÎ BELGE DEĞİLDİR. Gönderilmiş faturanın resmî görüntüsü için `GET /v1/invoices/{id}/e-document/pdf`.\n\n**Gerekli kapsam:** `invoices:read`","x-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/e-document":{"post":{"operationId":"sendEDocument","tags":["e-Fatura / e-Arşiv"],"summary":"Faturayı GİB'e gönder (e-Fatura / e-Arşiv)","description":"⚠️ GERİ ALINAMAZ. `profile: auto` alıcının GİB kaydına bakar: e-Fatura mükellefiyse TEMELFATURA, değilse EARSIVFATURA. Firmada e-Fatura entegrasyonu ve kontör olmalı. Alıcı carisinde VKN (10) ya da TCKN (11, şahısta ad+soyad) bulunmalı. Bir fatura bir kez gönderilir; tekrar gönderim yalnız reddedilen/iptal edilen belgede yeni numarayla yapılır.\n\n**Gerekli kapsam:** `e_documents:send`","x-scopes":["e_documents:send"],"security":[{"bearerAuth":[]},{"oauth2":["e_documents:send"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDocumentSend"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EDocument"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_credits` — e-Belge kontörü yetersiz. · `subscription_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — Kayıt mevcut bir kayıtla çakışıyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde. · `e_document_not_configured`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/e-document/pdf":{"get":{"operationId":"getEDocumentPdf","tags":["e-Fatura / e-Arşiv"],"summary":"e-Belge PDF","description":"Entegratördeki resmî görüntü. Fatura henüz gönderilmemişse 404.\n\n**Gerekli kapsam:** `invoices:read`","x-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`e_document_not_configured` — Firmada e-Fatura entegrasyonu (NES/Uyumsoft) kurulu değil.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/e-document/xml":{"get":{"operationId":"getEDocumentXml","tags":["e-Fatura / e-Arşiv"],"summary":"e-Belge XML (UBL-TR)","description":"**Gerekli kapsam:** `invoices:read`","x-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/xml":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`e_document_not_configured` — Firmada e-Fatura entegrasyonu (NES/Uyumsoft) kurulu değil.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}/e-document/cancel":{"post":{"operationId":"cancelEDocument","tags":["e-Fatura / e-Arşiv"],"summary":"e-Arşiv faturayı iptal et","description":"⚠️ GERİ ALINAMAZ. Yalnız gönderdiğiniz e-ARŞİV fatura, gönderimden itibaren 8 gün içinde. e-Fatura (TEMEL/TICARI) iptal edilemez — iade faturası kesin. İptalden sonra muhasebe etkisini sıfırlamak için `POST /v1/invoices/{id}/cancel`.\n\n**Gerekli kapsam:** `e_documents:send`","x-scopes":["e_documents:send"],"security":[{"bearerAuth":[]},{"oauth2":["e_documents:send"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EDocument"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde. · `e_document_not_configured`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/e-invoice-taxpayers/{tax_number}":{"get":{"operationId":"lookupEInvoiceTaxpayer","tags":["e-Fatura / e-Arşiv"],"summary":"GİB e-Fatura mükellef sorgusu","description":"Alıcı e-Fatura sistemine kayıtlı mı? Firmanın e-Fatura entegrasyonu üzerinden sorgulanır.\n\n**Gerekli kapsam:** `contacts:read`","x-scopes":["contacts:read"],"security":[{"bearerAuth":[]},{"oauth2":["contacts:read"]}],"parameters":[{"name":"tax_number","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{10,11}$"}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EInvoiceTaxpayer"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `e_document_not_configured`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments":{"get":{"operationId":"listPayments","tags":["Tahsilat ve Ödemeler"],"summary":"Tahsilat ve ödemeleri listele","description":"Açılış bakiyesi ve borç/alacak dekontları listede yer almaz.\n\n**Gerekli kapsam:** `payments:read`","x-scopes":["payments:read"],"security":[{"bearerAuth":[]},{"oauth2":["payments:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["collection","payment"]}]}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}]}},{"name":"invoice_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","format":"uuid"}]}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"updated_since","in":"query","required":false,"description":"Bu andan (dahil) sonra DEĞİŞENLER — eşitleme için.","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan (dahil) sonra DEĞİŞENLER — eşitleme için."}},{"name":"sort","in":"query","required":false,"description":"Varsayılan: en yeni tarih önce.","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["date","-date","updated_at","-updated_at"]}],"description":"Varsayılan: en yeni tarih önce."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createPayment","tags":["Tahsilat ve Ödemeler"],"summary":"Tahsilat ya da ödeme kaydet","description":"`invoice_id` verilirse o faturaya bağlanır (aynı carinin faturası olmalı); verilmezse carinin en eski açık faturalarından düşülür. Cari ile hesap farklı para birimindeyse kur gönderin ya da işlem tarihinin TCMB kuru kullanılır.\n\n**Gerekli kapsam:** `payments:write`","x-scopes":["payments:write"],"security":[{"bearerAuth":[]},{"oauth2":["payments:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Payment"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/payments/{id}":{"delete":{"operationId":"deletePayment","tags":["Tahsilat ve Ödemeler"],"summary":"Tahsilat/ödemeyi sil","description":"Kasa ve cari bakiyesi geri alınır.\n\n**Gerekli kapsam:** `payments:write`","x-scopes":["payments:write"],"security":[{"bearerAuth":[]},{"oauth2":["payments:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":false}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/units":{"get":{"operationId":"listUnits","tags":["Başvuru Listeleri"],"summary":"Ölçü birimleri","description":"**Gerekli kapsam:** yok — her geçerli anahtar okuyabilir.","x-scopes":[],"security":[{"bearerAuth":[]},{"oauth2":[]}],"parameters":[],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/taxes":{"get":{"operationId":"listTaxes","tags":["Başvuru Listeleri"],"summary":"Vergi kodları (KDV, tevkifat, ÖTV…)","description":"**Gerekli kapsam:** yok — her geçerli anahtar okuyabilir.","x-scopes":[],"security":[{"bearerAuth":[]},{"oauth2":[]}],"parameters":[],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tax"}}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tax-exemptions":{"get":{"operationId":"listTaxExemptions","tags":["Başvuru Listeleri"],"summary":"Vergi istisna kodları","description":"**Gerekli kapsam:** yok — her geçerli anahtar okuyabilir.","x-scopes":[],"security":[{"bearerAuth":[]},{"oauth2":[]}],"parameters":[],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxExemption"}}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"operationId":"listEvents","tags":["Olaylar ve Webhook'lar"],"summary":"Olay kaydını listele","description":"Son 30 günün olayları (en yeni önce). Yalnız anahtarın OKUMA kapsamlarının izin verdiği türler döner (ör. `invoice.*` için `invoices:read`). Webhook kullanmadan değişiklikleri izlemek ya da kaçırılan bildirimleri tamamlamak için.\n\n**Gerekli kapsam:** `events:read`","x-scopes":["events:read"],"security":[{"bearerAuth":[]},{"oauth2":["events:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"type","in":"query","required":false,"description":"Tek bir olay türü.","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["invoice.created","invoice.updated","invoice.deleted","invoice.cancelled","e_document.sent","e_document.accepted","e_document.rejected","e_document.cancelled","payment.created","payment.deleted","contact.created","contact.updated","contact.deleted"]}],"description":"Tek bir olay türü."}},{"name":"created_since","in":"query","required":false,"description":"Bu andan (dahil) sonraki olaylar.","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time","description":"ISO 8601 tarih-saat."}],"description":"Bu andan (dahil) sonraki olaylar."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}":{"get":{"operationId":"getEvent","tags":["Olaylar ve Webhook'lar"],"summary":"Olayı getir","description":"**Gerekli kapsam:** `events:read`","x-scopes":["events:read"],"security":[{"bearerAuth":[]},{"oauth2":["events:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Event"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","tags":["Olaylar ve Webhook'lar"],"summary":"Webhook uçlarını listele","description":"Firmanın tüm uçları (Bulutmu arayüzünden eklenenler dahil). İmza sırrı dönmez.\n\n**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWebhook","tags":["Olaylar ve Webhook'lar"],"summary":"Webhook ucu ekle","description":"Seçilen olaylarda adrese imzalı POST gönderilir. İmza sırrı (`secret`) YALNIZ bu yanıtta döner. Adres https olmalı ve internetten erişilebilmeli (iç ağ / özel IP reddedilir). Firma başına en çok 10 uç. Modülünüz kurulurken kendini kaydetmesi için.\n\n**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WebhookCreated"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"get":{"operationId":"getWebhook","tags":["Olaylar ve Webhook'lar"],"summary":"Webhook ucunu getir","description":"**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateWebhook","tags":["Olaylar ve Webhook'lar"],"summary":"Webhook ucunu güncelle","description":"Yalnız gönderilen alanlar değişir. `enabled: true` kapatılmış ucu açar. Sır değişmez (yeni sır için silip yeniden ekleyin).\n\n**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdate"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteWebhook","tags":["Olaylar ve Webhook'lar"],"summary":"Webhook ucunu sil","description":"Bekleyen teslimatlar da silinir; olay kaydı (/v1/events) kalır.\n\n**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":false}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"operationId":"testWebhook","tags":["Olaylar ve Webhook'lar"],"summary":"Test bildirimi gönder","description":"`ping` olayını HEMEN gönderir ve alıcının yanıtını döner (kuyruğa, olay kaydına girmez). İmza doğrulamanızı sınamak için.\n\n**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WebhookTestResult"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Olaylar ve Webhook'lar"],"summary":"Teslimat geçmişi","description":"Uca yapılan teslimatlar (en yeni önce): durum, deneme sayısı, alıcının yanıt kodu, sonraki deneme zamanı.\n\n**Gerekli kapsam:** `webhooks:manage`","x-scopes":["webhooks:manage"],"security":[{"bearerAuth":[]},{"oauth2":["webhooks:manage"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/test/e-documents/{id}/answer":{"post":{"operationId":"testAnswerEDocument","tags":["Test Ortamı"],"summary":"Alıcı yanıtını benzet (yalnız test firması)","description":"TEST firmasında gönderilmiş TİCARİ e-Faturaya alıcının kabul/ret yanıtını benzetir; `e_document.accepted` / `e_document.rejected` olayları ve fatura durumu gerçek akıştaki gibi oluşur. `{id}` fatura kimliğidir. Gerçek firmada 403 döner.\n\n**Gerekli kapsam:** `e_documents:send`","x-scopes":["e_documents:send"],"security":[{"bearerAuth":[]},{"oauth2":["e_documents:send"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string","enum":["accepted","rejected"]},"note":{"type":"string","maxLength":250,"description":"Ret gerekçesi (alıcının notu)."}},"required":["answer"],"additionalProperties":false}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EDocument"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — Kayıt mevcut bir kayıtla çakışıyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/offers":{"get":{"operationId":"listOffers","tags":["Teklifler ve Proformalar"],"summary":"Teklif ve proformaları listele","description":"**Gerekli kapsam:** `offers:read`","x-scopes":["offers:read"],"security":[{"bearerAuth":[]},{"oauth2":["offers:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["offer","proforma"]}]}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}]}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["pending","sent","accepted","rejected","invoiced"]}]}},{"name":"updated_since","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}]}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["issue_date","-issue_date","updated_at","-updated_at"],"default":"-issue_date"}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createOffer","tags":["Teklifler ve Proformalar"],"summary":"Teklif ya da proforma oluştur","description":"Muhasebeyi (cari bakiye, stok) etkilemez. Satırlar faturadaki gibi `product_code` ile verilebilir. Numara boşsa sıradaki verilir.\n\n**Gerekli kapsam:** `offers:write`","x-scopes":["offers:write"],"security":[{"bearerAuth":[]},{"oauth2":["offers:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Offer"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/offers/{id}":{"get":{"operationId":"getOffer","tags":["Teklifler ve Proformalar"],"summary":"Teklifi getir (satırlarıyla)","description":"**Gerekli kapsam:** `offers:read`","x-scopes":["offers:read"],"security":[{"bearerAuth":[]},{"oauth2":["offers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Offer"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteOffer","tags":["Teklifler ve Proformalar"],"summary":"Teklifi sil","description":"Faturalanmış teklif/proforma ve avans tahsilatı bağlı proforma silinemez.\n\n**Gerekli kapsam:** `offers:write`","x-scopes":["offers:write"],"security":[{"bearerAuth":[]},{"oauth2":["offers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":false}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/offers/{id}/convert":{"post":{"operationId":"convertOffer","tags":["Teklifler ve Proformalar"],"summary":"Teklifi faturala","description":"BUGÜN tarihli yeni bir satış faturası oluşturur (teklif `invoiced` olur, kendisi değişmez). Süresi dolmuş teklif için `confirm_expired: true` gerekir. Paket fatura limiti uygulanır.\n\n**Gerekli kapsam:** `offers:write`","x-scopes":["offers:write"],"security":[{"bearerAuth":[]},{"oauth2":["offers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Oluşacak faturanın vadesi (varsayılan: bugün)."},"confirm_expired":{"type":"boolean","description":"Süresi dolmuş teklifi faturalamak için true."}},"additionalProperties":false}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Invoice"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde. · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/warehouses":{"get":{"operationId":"listWarehouses","tags":["Depolar ve Stok"],"summary":"Depoları listele","description":"**Gerekli kapsam:** `products:read`","x-scopes":["products:read"],"security":[{"bearerAuth":[]},{"oauth2":["products:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Warehouse"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/{id}/stock":{"get":{"operationId":"getProductStock","tags":["Depolar ve Stok"],"summary":"Ürünün depo bazında stoğu","description":"**Gerekli kapsam:** `products:read`","x-scopes":["products:read"],"security":[{"bearerAuth":[]},{"oauth2":["products:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği.","schema":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıt kimliği."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ProductStock"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/stock-movements":{"get":{"operationId":"listStockMovements","tags":["Depolar ve Stok"],"summary":"Stok hareketlerini listele","description":"En yeni önce. Fatura, irsaliye, açılış, sayım ve depolar arası transferden doğan giriş/çıkışlar.\n\n**Gerekli kapsam:** `products:read`","x-scopes":["products:read"],"security":[{"bearerAuth":[]},{"oauth2":["products:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"product_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}]}},{"name":"warehouse_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","format":"uuid"}]}},{"name":"created_since","in":"query","required":false,"description":"Bu andan (dahil) sonraki hareketler.","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan (dahil) sonraki hareketler."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockMovement"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/incoming-e-invoices":{"get":{"operationId":"listIncomingEInvoices","tags":["Gelen e-Faturalar"],"summary":"Gelen e-Faturaları listele","description":"Tedarikçilerden gelen e-Faturalar; entegratörden düzenli eşitlenir. Yeni gelenleri `received_since` ile çekin.\n\n**Gerekli kapsam:** `incoming_e_invoices:read`","x-scopes":["incoming_e_invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["incoming_e_invoices:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["received","waiting_response","accepted","rejected"]}]}},{"name":"supplier_tax_number","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{10,11}$"}]}},{"name":"issue_date_from","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"issue_date_to","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"received_since","in":"query","required":false,"description":"Bu andan (dahil) sonra Bulutmu'ya ulaşanlar — yeni gelenleri çekmek için.","schema":{"anyOf":[{"not":{}},{"type":"string","format":"date-time"}],"description":"Bu andan (dahil) sonra Bulutmu'ya ulaşanlar — yeni gelenleri çekmek için."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IncomingEInvoice"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`e_document_not_configured` — Firmada e-Fatura entegrasyonu (NES/Uyumsoft) kurulu değil.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/incoming-e-invoices/{id}":{"get":{"operationId":"getIncomingEInvoice","tags":["Gelen e-Faturalar"],"summary":"Gelen e-Faturayı getir","description":"**Gerekli kapsam:** `incoming_e_invoices:read`","x-scopes":["incoming_e_invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["incoming_e_invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/IncomingEInvoice"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/incoming-e-invoices/{id}/pdf":{"get":{"operationId":"getIncomingEInvoicePdf","tags":["Gelen e-Faturalar"],"summary":"Gelen e-Faturanın PDF'i","description":"**Gerekli kapsam:** `incoming_e_invoices:read`","x-scopes":["incoming_e_invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["incoming_e_invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/incoming-e-invoices/{id}/xml":{"get":{"operationId":"getIncomingEInvoiceXml","tags":["Gelen e-Faturalar"],"summary":"Gelen e-Faturanın XML'i (UBL-TR)","description":"**Gerekli kapsam:** `incoming_e_invoices:read`","x-scopes":["incoming_e_invoices:read"],"security":[{"bearerAuth":[]},{"oauth2":["incoming_e_invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/xml":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/incoming-e-invoices/{id}/answer":{"post":{"operationId":"answerIncomingEInvoice","tags":["Gelen e-Faturalar"],"summary":"Gelen ticari e-Faturayı kabul et / reddet","description":"Yalnız `TICARIFATURA` profilli ve yanıt bekleyen (`waiting_response`) belge yanıtlanır; temel faturaya yanıt verilmez. **Ret**, faturanın size ulaşmasından itibaren 8 gün içinde (TTK 21/2) ve belgeden alış/masraf kaydı OLUŞTURULMADIYSA yapılabilir. Yanıt GİB'e iletilir, **geri alınamaz** — ayrı `incoming_e_invoices:answer` kapsamı gerekir.\n\n**Gerekli kapsam:** `incoming_e_invoices:answer`","x-scopes":["incoming_e_invoices:answer"],"security":[{"bearerAuth":[]},{"oauth2":["incoming_e_invoices:answer"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncomingEInvoiceAnswer"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/IncomingEInvoice"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `e_document_not_configured` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/transactions":{"get":{"operationId":"listAccountTransactions","tags":["Kasa ve Bankalar"],"summary":"Kasa/banka hesabının hareketleri (ekstre)","description":"En yeni önce. Tahsilat, ödeme, virman, masraf, çek/senet, personel ödemesi, açılış ve düzeltme satırları; tutar işaretlidir.\n\n**Gerekli kapsam:** `accounts:read`","x-scopes":["accounts:read"],"security":[{"bearerAuth":[]},{"oauth2":["accounts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountTransaction"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/expense-types":{"get":{"operationId":"listExpenseTypes","tags":["Masraflar"],"summary":"Masraf türlerini listele","description":"**Gerekli kapsam:** `expenses:read`","x-scopes":["expenses:read"],"security":[{"bearerAuth":[]},{"oauth2":["expenses:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseType"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/expenses":{"get":{"operationId":"listExpenses","tags":["Masraflar"],"summary":"Masrafları listele","description":"Maaş tahakkuklarının otomatik ayna satırları da listede yer alır.\n\n**Gerekli kapsam:** `expenses:read`","x-scopes":["expenses:read"],"security":[{"bearerAuth":[]},{"oauth2":["expenses:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"expense_type_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","format":"uuid"}]}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}]}},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","format":"uuid"}]}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["date","-date","created_at","-created_at"],"default":"-date"}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Expense"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createExpense","tags":["Masraflar"],"summary":"Masraf kaydet","description":"`account_id` verilirse masraf o kasa/bankadan ÖDENMİŞ kaydedilir (kasa bakiyesi düşer). Verilmez ve `contact_id` verilirse tutar tedarikçiye borç yazılır. Tutar KDV dahildir.\n\n**Gerekli kapsam:** `expenses:write`","x-scopes":["expenses:write"],"security":[{"bearerAuth":[]},{"oauth2":["expenses:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Expense"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/expenses/{id}":{"delete":{"operationId":"deleteExpense","tags":["Masraflar"],"summary":"Masrafı sil","description":"Kasa ve cari etkisi geri alınır.\n\n**Gerekli kapsam:** `expenses:write`","x-scopes":["expenses:write"],"security":[{"bearerAuth":[]},{"oauth2":["expenses:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":false}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/despatches":{"get":{"operationId":"listDespatches","tags":["İrsaliyeler"],"summary":"İrsaliyeleri listele","description":"Giden ve gelen irsaliyeler (en yeni önce). Kalemler listede gelmez; tek irsaliye getirilirken gelir.\n\n**Gerekli kapsam:** `despatches:read`","x-scopes":["despatches:read"],"security":[{"bearerAuth":[]},{"oauth2":["despatches:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"direction","in":"query","required":false,"description":"outgoing = giden, incoming = gelen.","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["outgoing","incoming"]}],"description":"outgoing = giden, incoming = gelen."}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}]}},{"name":"issue_date_from","in":"query","required":false,"description":"Düzenleme tarihi bu günden (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Düzenleme tarihi bu günden (Türkiye günü, dahil)."}},{"name":"issue_date_to","in":"query","required":false,"description":"Düzenleme tarihi bu güne kadar (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Düzenleme tarihi bu güne kadar (Türkiye günü, dahil)."}},{"name":"sort","in":"query","required":false,"description":"Sıralama; `-` azalan.","schema":{"type":"string","enum":["issue_date","-issue_date","despatch_date","-despatch_date"],"default":"-issue_date","description":"Sıralama; `-` azalan."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Despatch"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createDespatch","tags":["İrsaliyeler"],"summary":"Giden irsaliye oluştur","description":"Kaydedildiği anda STOK DÜŞER (kalem başına, seçilen ya da varsayılan depodan). Faturası ayrıca kesilir: `POST /v1/invoices` gövdesinde `despatch_ids` verin — fatura irsaliyeye bağlanır ve stoğu İKİNCİ KEZ düşürmez. Satırlar kayıtlı ürüne `product_id` ya da `product_code` ile bağlanır — irsaliye ürün OLUŞTURMAZ. Bu uç yalnız Bulutmu'ya kaydeder; GİB'e göndermek için `POST /v1/despatches/{id}/e-document`. Aynı sevkin iki kez kaydedilip stoğun iki kez düşmemesi için `Idempotency-Key` gönderin.\n\n**Gerekli kapsam:** `despatches:write`","x-scopes":["despatches:write"],"security":[{"bearerAuth":[]},{"oauth2":["despatches:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DespatchCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Despatch"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/despatches/{id}":{"get":{"operationId":"getDespatch","tags":["İrsaliyeler"],"summary":"İrsaliye getir (kalemleriyle)","description":"**Gerekli kapsam:** `despatches:read`","x-scopes":["despatches:read"],"security":[{"bearerAuth":[]},{"oauth2":["despatches:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Despatch"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteDespatch","tags":["İrsaliyeler"],"summary":"İrsaliyeyi sil","description":"Stok hareketi geri alınır. GİB'e e-İrsaliye olarak iletilmiş irsaliye (e-İrsaliye iptal edilemez — karşı yönde yeni irsaliye düzenleyin) ve faturalanmış irsaliye silinemez (`business_rule`).\n\n**Gerekli kapsam:** `despatches:write`","x-scopes":["despatches:write"],"security":[{"bearerAuth":[]},{"oauth2":["despatches:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"additionalProperties":false}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/despatches/{id}/e-document":{"post":{"operationId":"sendDespatchEDocument","tags":["İrsaliyeler"],"summary":"İrsaliyeyi GİB'e gönder (e-İrsaliye)","description":"⚠️ GERİ ALINAMAZ — e-İrsaliye iptal edilemez. Yalnız GİDEN irsaliye; bir irsaliye bir kez gönderilir (ikincisi `409 conflict`). Firmada e-İrsaliye entegrasyonu (NES e-İrsaliye modülü ya da Uyumsoft) ve kontör olmalı; kontör gönderimden ÖNCE ayrılır, `402 insufficient_credits` alan belge GİB'e GİTMEMİŞTİR. Alıcı cari e-İrsaliye mükellefi olmalı (değilse kâğıt irsaliye düzenleyin); teslimat/çıkış adresi (adres, ilçe, il), kendi araçla gönderimde plaka + şoför (ad soyad, TCKN), kargoyla gönderimde taşıyıcının unvan/VKN/vergi dairesi/adresi gerekir. Fiili sevk tarihi düzenleme tarihinden önce olamaz.\n\n**Gerekli kapsam:** `e_documents:send`","x-scopes":["e_documents:send"],"security":[{"bearerAuth":[]},{"oauth2":["e_documents:send"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EDespatchSend"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EDespatch"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_credits` — e-Belge kontörü yetersiz. · `subscription_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — Kayıt mevcut bir kayıtla çakışıyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`business_rule` — İşlem bir muhasebe kuralına takıldı; açıklama `message` içinde. · `e_document_not_configured`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/despatches/{id}/e-document/pdf":{"get":{"operationId":"getDespatchEDocumentPdf","tags":["İrsaliyeler"],"summary":"e-İrsaliye PDF","description":"Entegratördeki resmî görüntü. İrsaliye henüz gönderilmemişse 404.\n\n**Gerekli kapsam:** `despatches:read`","x-scopes":["despatches:read"],"security":[{"bearerAuth":[]},{"oauth2":["despatches:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`e_document_not_configured` — Firmada e-Fatura entegrasyonu (NES/Uyumsoft) kurulu değil.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/despatches/{id}/e-document/xml":{"get":{"operationId":"getDespatchEDocumentXml","tags":["İrsaliyeler"],"summary":"e-İrsaliye XML (UBL-TR DespatchAdvice)","description":"**Gerekli kapsam:** `despatches:read`","x-scopes":["despatches:read"],"security":[{"bearerAuth":[]},{"oauth2":["despatches:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/xml":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`e_document_not_configured` — Firmada e-Fatura entegrasyonu (NES/Uyumsoft) kurulu değil.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/employees":{"get":{"operationId":"listEmployees","tags":["Çalışanlar"],"summary":"Çalışanları listele","description":"**Gerekli kapsam:** `employees:read`","x-scopes":["employees:read"],"security":[{"bearerAuth":[]},{"oauth2":["employees:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"search","in":"query","required":false,"description":"Ad, departman, telefon, e-posta, TCKN içinde arar (Türkçe harf duyarsız).","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1,"maxLength":100}],"description":"Ad, departman, telefon, e-posta, TCKN içinde arar (Türkçe harf duyarsız)."}},{"name":"department","in":"query","required":false,"description":"Tam eşleşme.","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1,"maxLength":64}],"description":"Tam eşleşme."}},{"name":"include_archived","in":"query","required":false,"description":"true = arşivlenmiş (ayrılmış) çalışanları da getir (varsayılan false).","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["true","false"]}],"description":"true = arşivlenmiş (ayrılmış) çalışanları da getir (varsayılan false)."}},{"name":"sort","in":"query","required":false,"description":"Sıralama; `-` azalan.","schema":{"type":"string","enum":["full_name","-full_name","created_at","-created_at"],"default":"full_name","description":"Sıralama; `-` azalan."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Employee"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createEmployee","tags":["Çalışanlar"],"summary":"Çalışan oluştur","description":"TCKN kontrol hanesi tutmuyorsa ya da aynı ad/TCKN'li çalışan varsa `409 confirmation_required` döner; bilerek kaydetmek için `confirm: true` ile tekrar gönderin. IBAN kontrol hanesi tutmazsa reddedilir. Açılış bakiyesi ekstrede hareket olarak görünür. Paket limiti uygulanır.\n\n**Gerekli kapsam:** `employees:write`","x-scopes":["employees:write"],"security":[{"bearerAuth":[]},{"oauth2":["employees:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Employee"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok. · `limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`confirmation_required` — Kayıt bir uyarı taşıyor (ör. aynı VKN'li cari var); bilerek kaydetmek için `confirm: true` gönderin. · `idempotency_conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/employees/{id}":{"get":{"operationId":"getEmployee","tags":["Çalışanlar"],"summary":"Çalışan getir","description":"**Gerekli kapsam:** `employees:read`","x-scopes":["employees:read"],"security":[{"bearerAuth":[]},{"oauth2":["employees:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Employee"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateEmployee","tags":["Çalışanlar"],"summary":"Çalışan güncelle","description":"Yalnız gönderilen alanlar değişir. Bakiye ve para birimi bu uçtan değişmez (bakiye hareketlerden doğar). `archived: true` ayrılan çalışanı listeden gizler.\n\n**Gerekli kapsam:** `employees:write`","x-scopes":["employees:write"],"security":[{"bearerAuth":[]},{"oauth2":["employees:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeUpdate"}}}},"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Employee"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`confirmation_required` — Kayıt bir uyarı taşıyor (ör. aynı VKN'li cari var); bilerek kaydetmek için `confirm: true` gönderin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/employees/{id}/transactions":{"get":{"operationId":"listEmployeeTransactions","tags":["Çalışanlar"],"summary":"Çalışan ekstresi (hareketler)","description":"En yeni önce: tahakkuk, ödeme, avans iadesi, çalışanın cebinden ödediği masraf, açılış ve düzeltme. `amount` bakiyeye etkisiyle işaretlidir, `balance_after` o hareketten sonraki bakiyedir (− = çalışana borçluyuz).\n\n**Gerekli kapsam:** `employees:read`","x-scopes":["employees:read"],"security":[{"bearerAuth":[]},{"oauth2":["employees:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"date_from","in":"query","required":false,"description":"Bu günden (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Bu günden (Türkiye günü, dahil)."}},{"name":"date_to","in":"query","required":false,"description":"Bu güne kadar (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Bu güne kadar (Türkiye günü, dahil)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeTransaction"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/employees/{id}/salaries":{"get":{"operationId":"listEmployeeSalaries","tags":["Çalışanlar"],"summary":"Maaş tahakkuklarını listele","description":"En yeni önce. `paid_amount` tahakkukun ödemelerle kapanan kısmıdır.\n\n**Gerekli kapsam:** `employees:read`","x-scopes":["employees:read"],"security":[{"bearerAuth":[]},{"oauth2":["employees:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"date_from","in":"query","required":false,"description":"Bu günden (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Bu günden (Türkiye günü, dahil)."}},{"name":"date_to","in":"query","required":false,"description":"Bu güne kadar (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Bu güne kadar (Türkiye günü, dahil)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmployeeSalary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createEmployeeSalary","tags":["Çalışanlar"],"summary":"Maaş / prim tahakkuku kaydet","description":"Çalışana borç yazar (bakiye −) ve aynı tutarda seçilen türde gider kaydı oluşturur; KASAYI OYNATMAZ — para çıkışı ödemeyle olur (`POST /v1/employees/{id}/payments`). Ödemeler eski tahakkuklardan başlayarak eşleşir. Aynı tahakkukun iki kez yazılmaması için `Idempotency-Key` gönderin.\n\n**Gerekli kapsam:** `employees:write`","x-scopes":["employees:write"],"security":[{"bearerAuth":[]},{"oauth2":["employees:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeSalaryCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmployeeSalary"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/employees/{id}/payments":{"get":{"operationId":"listEmployeePayments","tags":["Çalışanlar"],"summary":"Çalışan ödemelerini listele","description":"En yeni önce: ödemeler ve avans iadeleri.\n\n**Gerekli kapsam:** `employees:read`","x-scopes":["employees:read"],"security":[{"bearerAuth":[]},{"oauth2":["employees:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"date_from","in":"query","required":false,"description":"Bu günden (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Bu günden (Türkiye günü, dahil)."}},{"name":"date_to","in":"query","required":false,"description":"Bu güne kadar (Türkiye günü, dahil).","schema":{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}],"description":"Bu güne kadar (Türkiye günü, dahil)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmployeePayment"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createEmployeePayment","tags":["Çalışanlar"],"summary":"Çalışana ödeme / avans iadesi kaydet","description":"`payment`: kasadan/bankadan ÇIKIŞ, çalışan bakiyesi + (önce açık tahakkukları kapatır, fazlası avanstır). `advance_refund`: çalışan avansı geri öder, kasaya GİRİŞ, bakiye −. Hesap çalışanla aynı para biriminde olmalı. `Idempotency-Key` gönderin (ağ hatasında ödeme iki kez yazılmasın).\n\n**Gerekli kapsam:** `employees:write`","x-scopes":["employees:write"],"security":[{"bearerAuth":[]},{"oauth2":["employees:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeePaymentCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EmployeePayment"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cheques":{"get":{"operationId":"listCheques","tags":["Çek ve Senetler"],"summary":"Çekleri listele","description":"**Gerekli kapsam:** `cheques:read`","x-scopes":["cheques:read"],"security":[{"bearerAuth":[]},{"oauth2":["cheques:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"direction","in":"query","required":false,"description":"received = alınan, issued = verilen.","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["received","issued"]}],"description":"received = alınan, issued = verilen."}},{"name":"contact_id","in":"query","required":false,"description":"Evrakı veren YA DA evrakın verildiği cari.","schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}],"description":"Evrakı veren YA DA evrakın verildiği cari."}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["in_portfolio","in_collection","pledged","transferred","settled","bounced","protested","cancelled"]}]}},{"name":"number","in":"query","required":false,"description":"Evrak numarası (tam eşleşme).","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1,"maxLength":64}],"description":"Evrak numarası (tam eşleşme)."}},{"name":"sort","in":"query","required":false,"description":"Sıralama; `-` azalan.","schema":{"type":"string","enum":["due_date","-due_date","issue_date","-issue_date"],"default":"-issue_date","description":"Sıralama; `-` azalan."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Cheque"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCheque","tags":["Çek ve Senetler"],"summary":"Çek kaydet (alınan ya da verilen)","description":"`received`: müşteriden alınan çek — carinin borcu düşer, çek portföye girer, KASA OYNAMAZ (para tahsil edilince girer). `issued`: tedarikçiye verilen kendi çekimiz — cari bakiyesi artar (ödeme yapılmış sayılır). Tahsil, ciro, bankaya verme, karşılıksız ve iptal işlemleri şimdilik yalnız Bulutmu arayüzündedir; API durumu (`status`) okur.\n\n**Gerekli kapsam:** `cheques:write`","x-scopes":["cheques:write"],"security":[{"bearerAuth":[]},{"oauth2":["cheques:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChequeCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Cheque"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cheques/{id}":{"get":{"operationId":"getCheque","tags":["Çek ve Senetler"],"summary":"Çek getir","description":"**Gerekli kapsam:** `cheques:read`","x-scopes":["cheques:read"],"security":[{"bearerAuth":[]},{"oauth2":["cheques:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Cheque"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/promissory-notes":{"get":{"operationId":"listPromissoryNotes","tags":["Çek ve Senetler"],"summary":"Senetleri listele","description":"**Gerekli kapsam:** `cheques:read`","x-scopes":["cheques:read"],"security":[{"bearerAuth":[]},{"oauth2":["cheques:read"]}],"parameters":[{"name":"page","in":"query","required":false,"description":"Sayfa numarası (1'den başlar).","schema":{"type":"integer","minimum":1,"default":1,"description":"Sayfa numarası (1'den başlar)."}},{"name":"per_page","in":"query","required":false,"description":"Sayfa başına kayıt (en çok 100).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25,"description":"Sayfa başına kayıt (en çok 100)."}},{"name":"direction","in":"query","required":false,"description":"received = alınan, issued = verilen.","schema":{"anyOf":[{"not":{}},{"type":"string","enum":["received","issued"]}],"description":"received = alınan, issued = verilen."}},{"name":"contact_id","in":"query","required":false,"description":"Evrakı veren YA DA evrakın verildiği cari.","schema":{"anyOf":[{"not":{}},{"type":"integer","exclusiveMinimum":true,"minimum":0}],"description":"Evrakı veren YA DA evrakın verildiği cari."}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"not":{}},{"type":"string","enum":["in_portfolio","in_collection","pledged","transferred","settled","bounced","protested","cancelled"]}]}},{"name":"number","in":"query","required":false,"description":"Evrak numarası (tam eşleşme).","schema":{"anyOf":[{"not":{}},{"type":"string","minLength":1,"maxLength":64}],"description":"Evrak numarası (tam eşleşme)."}},{"name":"sort","in":"query","required":false,"description":"Sıralama; `-` azalan.","schema":{"type":"string","enum":["due_date","-due_date","issue_date","-issue_date"],"default":"-issue_date","description":"Sıralama; `-` azalan."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PromissoryNote"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createPromissoryNote","tags":["Çek ve Senetler"],"summary":"Senet kaydet (alınan ya da verilen)","description":"`received`: müşteriden alınan senet — carinin borcu düşer, senet portföye girer, KASA OYNAMAZ. `issued`: tedarikçiye verilen kendi senedimiz — cari bakiyesi artar. Tahsil, ciro, bankaya verme, karşılıksız ve iptal işlemleri şimdilik yalnız Bulutmu arayüzündedir; API durumu (`status`) okur.\n\n**Gerekli kapsam:** `cheques:write`","x-scopes":["cheques:write"],"security":[{"bearerAuth":[]},{"oauth2":["cheques:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Güvenli tekrar için benzersiz anahtar (ör. kendi sipariş numaranız). 24 saat saklanır.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromissoryNoteCreate"}}}},"responses":{"201":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/PromissoryNote"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`subscription_expired` — Aboneliğin süresi dolmuş; yazma işlemleri kapalı (okuma serbest).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict` — Aynı Idempotency-Key ile bir istek hâlâ işleniyor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_failed` — Gönderilen alanlar geçersiz; ayrıntı `fields` içinde. · `business_rule` · `idempotency_mismatch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/promissory-notes/{id}":{"get":{"operationId":"getPromissoryNote","tags":["Çek ve Senetler"],"summary":"Senet getir","description":"**Gerekli kapsam:** `cheques:read`","x-scopes":["cheques:read"],"security":[{"bearerAuth":[]},{"oauth2":["cheques:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Kayıt kimliği (UUID).","schema":{"type":"string","format":"uuid","description":"Kayıt kimliği (UUID)."}}],"responses":{"200":{"description":"Başarılı","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"İstek kimliği (destek için)."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Bu dakikada kalan istek."}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/PromissoryNote"}}}}}},"401":{"description":"`unauthorized` — API anahtarı yok, geçersiz, iptal edilmiş ya da süresi dolmuş.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`insufficient_scope` — Anahtarda bu işlemin kapsamı yok.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — Kayıt bulunamadı (ya da bu firmaya ait değil).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — Hız sınırı aşıldı; `Retry-After` saniye sonra yeniden deneyin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`server_error` — Beklenmeyen bir hata oluştu; `request_id` ile destek ekibine iletin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"bm_live_…","description":"Ayarlar → Entegrasyonlar → API Erişimi'nden oluşturulan anahtar (bm_live_… / test firmasında bm_test_…)."},"oauth2":{"type":"oauth2","description":"OAuth uygulamaları: bir uygulama, firma sahibinin ONAYIYLA birçok Bulutmu firmasına bağlanır (Authorization Code + PKCE). Erişim belirteci (bm_oat_…) 1 saat geçerlidir; yenileme belirteci her kullanımda yenisiyle değişir. Rehberde \"OAuth uygulamaları\".","flows":{"authorizationCode":{"authorizationUrl":"https://api.bulutmu.com/v1/oauth/authorize","tokenUrl":"https://api.bulutmu.com/v1/oauth/token","refreshUrl":"https://api.bulutmu.com/v1/oauth/token","scopes":{"company:read":"Firma bilgilerini okuma","contacts:read":"Carileri (müşteri/tedarikçi) okuma","contacts:write":"Cari oluşturma ve güncelleme","products:read":"Ürün ve hizmetleri okuma","products:write":"Ürün ve hizmet oluşturma ve güncelleme","accounts:read":"Kasa ve banka hesaplarını okuma","invoices:read":"Faturaları (satış, alış, iade) ve e-belge durumlarını okuma; PDF/XML indirme","invoices:write":"Fatura ve iade faturası oluşturma, silme, muhasebe iptali","e_documents:send":"e-Fatura / e-Arşiv / e-İrsaliye olarak GİB'e GÖNDERME ve e-Arşiv iptali (geri alınamaz işlemler)","payments:read":"Tahsilat ve ödemeleri okuma","payments:write":"Tahsilat ve ödeme kaydetme, silme","offers:read":"Teklif ve proformaları okuma","offers:write":"Teklif/proforma oluşturma, silme, faturalama","incoming_e_invoices:read":"Gelen e-Faturaları (tedarikçilerden) okuma; PDF/XML indirme","incoming_e_invoices:answer":"Gelen TİCARİ e-Faturayı kabul etme ya da reddetme (hukuki, geri alınamaz işlem)","expenses:read":"Masrafları ve masraf türlerini okuma","expenses:write":"Masraf kaydetme ve silme","despatches:read":"İrsaliyeleri okuma; e-İrsaliye PDF/XML indirme","despatches:write":"Giden irsaliye oluşturma ve silme (stok hareketi doğurur)","employees:read":"Çalışanları, maaş tahakkuklarını, çalışan ödemelerini ve çalışan ekstresini okuma","employees:write":"Çalışan oluşturma ve güncelleme; maaş tahakkuku, çalışan ödemesi ve avans iadesi kaydetme (ödeme kasayı değiştirir)","cheques:read":"Çek ve senetleri okuma","cheques:write":"Çek ve senet kaydetme (alınan ya da verilen evrak — cari bakiyesini değiştirir)","events:read":"Olay kaydını okuma (/v1/events) — yalnız diğer okuma kapsamlarının izin verdiği olay türleri","webhooks:manage":"Webhook uçlarını yönetme — yalnız diğer okuma kapsamlarının izin verdiği olaylara abone olunur"}}}}},"schemas":{"Me":{"type":"object","properties":{"company":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true,"description":"Görünen firma adı."},"tax_number":{"type":"string","nullable":true,"description":"VKN (10 hane) ya da TCKN (11 hane)."},"tax_office":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"district":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"test_mode":{"type":"boolean","description":"true = TEST firması: e-belgeler GİB'e gitmez, kontör düşmez (bm_test_ anahtarı)."}},"required":["id","name","tax_number","tax_office","email","phone","address","district","city","test_mode"],"additionalProperties":false},"api_key":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"API anahtarında anahtarın, OAuth'ta iznin kimliği."},"name":{"type":"string","description":"API anahtarının adı; OAuth'ta uygulamanın adı."},"type":{"type":"string","enum":["api_key","oauth"],"description":"api_key = firma API anahtarı · oauth = OAuth uygulamasının erişim belirteci."},"scopes":{"type":"array","items":{"type":"string"},"description":"Bu anahtarın / iznin kapsamları."}},"required":["id","name","type","scopes"],"additionalProperties":false}},"required":["company","api_key"],"additionalProperties":false,"description":"Anahtarın bağlı olduğu firma ve anahtar bilgisi."},"Contact":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["customer","supplier"],"description":"customer = müşteri, supplier = tedarikçi."},"code":{"type":"string","nullable":true,"description":"Cari kodu (boş bırakılırsa otomatik üretilir)."},"name":{"type":"string","description":"Firma ünvanı ya da kişinin adı."},"surname":{"type":"string","nullable":true,"description":"Şahıs carilerde soyadı (TCKN'li carilerde zorunlu)."},"display_name":{"type":"string","nullable":true,"description":"Görünen ad (ad + soyad)."},"short_name":{"type":"string","nullable":true},"is_company":{"type":"boolean","description":"true = tüzel kişi (VKN), false = şahıs (TCKN)."},"tax_number":{"type":"string","nullable":true,"description":"VKN (10 hane) ya da TCKN (11 hane)."},"tax_office":{"type":"string","nullable":true,"description":"Vergi dairesi."},"e_invoice_registered":{"type":"boolean","description":"GİB e-Fatura mükellefi mi (vergi numarasından sorgulanır)."},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"fax":{"type":"string","nullable":true},"iban":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"district":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"currency":{"type":"string","description":"Carinin para birimi (ISO 4217, ör. TRY)."},"balance":{"type":"number","description":"Bakiye. Pozitif = cari BİZE borçlu (alacağımız), negatif = BİZ cariye borçluyuz."},"balance_status":{"type":"string","enum":["receivable","payable","settled"],"description":"receivable = alacak, payable = borç, settled = kapalı."},"category_id":{"type":"string","format":"uuid","nullable":true},"note":{"type":"string","nullable":true},"archived":{"type":"boolean"},"created_at":{"type":"string","description":"ISO 8601 tarih-saat."},"updated_at":{"type":"string","description":"Son değişiklik anı — `updated_since` ile eşitleme için."}},"required":["id","type","code","name","surname","display_name","short_name","is_company","tax_number","tax_office","e_invoice_registered","email","phone","fax","iban","address","district","city","postal_code","currency","balance","balance_status","category_id","note","archived","created_at","updated_at"],"additionalProperties":false,"description":"Cari hesap (müşteri ya da tedarikçi)."},"ContactCreate":{"type":"object","properties":{"type":{"type":"string","enum":["customer","supplier"],"description":"Varsayılan: customer."},"code":{"type":"string","minLength":1,"maxLength":16,"nullable":true,"description":"Boş bırakılırsa otomatik üretilir."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"Firma ünvanı ya da kişinin adı."},"surname":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Şahıs (TCKN) carilerde zorunlu."},"short_name":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"tax_number":{"type":"string","pattern":"^\\d{10,11}$","nullable":true},"tax_office":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"email":{"type":"string","format":"email","maxLength":128,"nullable":true},"phone":{"type":"string","minLength":1,"maxLength":32,"nullable":true},"fax":{"type":"string","minLength":1,"maxLength":32,"nullable":true},"iban":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"address":{"type":"string","minLength":1,"nullable":true},"district":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"city":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"postal_code":{"type":"string","minLength":1,"maxLength":16,"nullable":true},"category_id":{"type":"string","format":"uuid","nullable":true},"note":{"type":"string","minLength":1,"nullable":true},"confirm":{"type":"boolean","description":"Uyarılı kaydı onayla (ör. aynı VKN'li başka cari var, kontrol hanesi tutmuyor). Bkz. confirmation_required."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 (varsayılan TRY). Sonradan değiştirilemez."},"opening_balance":{"type":"number","description":"Açılış bakiyesi (geçiş için). Pozitif = cari bize borçlu."},"opening_balance_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Açılış bakiyesinin tarihi (YYYY-MM-DD). Verilmezse bugün."}},"required":["name"],"additionalProperties":false},"ContactUpdate":{"type":"object","properties":{"type":{"type":"string","enum":["customer","supplier"],"description":"Varsayılan: customer."},"code":{"type":"string","minLength":1,"maxLength":16,"nullable":true,"description":"Boş bırakılırsa otomatik üretilir."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"Firma ünvanı ya da kişinin adı."},"surname":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Şahıs (TCKN) carilerde zorunlu."},"short_name":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"tax_number":{"type":"string","pattern":"^\\d{10,11}$","nullable":true},"tax_office":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"email":{"type":"string","format":"email","maxLength":128,"nullable":true},"phone":{"type":"string","minLength":1,"maxLength":32,"nullable":true},"fax":{"type":"string","minLength":1,"maxLength":32,"nullable":true},"iban":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"address":{"type":"string","minLength":1,"nullable":true},"district":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"city":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"postal_code":{"type":"string","minLength":1,"maxLength":16,"nullable":true},"category_id":{"type":"string","format":"uuid","nullable":true},"note":{"type":"string","minLength":1,"nullable":true},"confirm":{"type":"boolean","description":"Uyarılı kaydı onayla (ör. aynı VKN'li başka cari var, kontrol hanesi tutmuyor). Bkz. confirmation_required."},"archived":{"type":"boolean"}},"additionalProperties":false},"Product":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["product","service"],"description":"product = stok takipli ürün, service = hizmet (stok tutulmaz)."},"code":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"gtip":{"type":"string","nullable":true,"description":"Gümrük tarife istatistik pozisyonu (ihracat)."},"name":{"type":"string"},"invoice_title":{"type":"string","nullable":true,"description":"Faturada görünecek ad (boşsa name)."},"unit":{"type":"string","nullable":true,"description":"Birim kodu (UN/ECE Rec 20, ör. C62 = adet, KGM = kg, LTR = litre, HUR = saat)."},"vat_rate":{"type":"integer","nullable":true,"description":"KDV oranı (%)."},"currency":{"type":"string","nullable":true},"selling_price":{"type":"number","nullable":true,"description":"Satış fiyatı."},"selling_price_vat_included":{"type":"boolean","description":"Satış fiyatına KDV dahil mi."},"selling_price_2":{"type":"number","nullable":true},"selling_price_2_vat_included":{"type":"boolean"},"buying_price":{"type":"number","nullable":true},"buying_price_vat_included":{"type":"boolean"},"stock_quantity":{"type":"number","nullable":true,"description":"Tüm depolardaki toplam stok (yalnız product)."},"critical_stock_quantity":{"type":"number","nullable":true},"category_id":{"type":"string","format":"uuid","nullable":true},"note":{"type":"string","nullable":true},"archived":{"type":"boolean"},"created_at":{"type":"string","description":"ISO 8601 tarih-saat."},"updated_at":{"type":"string","description":"Son değişiklik anı — `updated_since` ile eşitleme için."}},"required":["id","type","code","barcode","gtip","name","invoice_title","unit","vat_rate","currency","selling_price","selling_price_vat_included","selling_price_2","selling_price_2_vat_included","buying_price","buying_price_vat_included","stock_quantity","critical_stock_quantity","category_id","note","archived","created_at","updated_at"],"additionalProperties":false,"description":"Ürün ya da hizmet."},"ProductCreate":{"type":"object","properties":{"type":{"type":"string","enum":["product","service"],"description":"Varsayılan: product."},"code":{"type":"string","minLength":1,"maxLength":24,"nullable":true,"description":"Boş bırakılırsa otomatik üretilir."},"barcode":{"type":"string","minLength":1,"maxLength":128,"nullable":true},"gtip":{"type":"string","minLength":1,"maxLength":12,"nullable":true},"name":{"type":"string","minLength":1,"maxLength":128},"invoice_title":{"type":"string","minLength":1,"maxLength":128,"nullable":true},"unit":{"type":"string","minLength":1,"maxLength":5,"description":"UN/ECE birim kodu (varsayılan C62 = adet)."},"vat_rate":{"type":"integer","minimum":0,"maximum":100},"selling_price":{"type":"number","minimum":0},"selling_price_vat_included":{"type":"boolean"},"selling_price_2":{"type":"number","minimum":0},"selling_price_2_vat_included":{"type":"boolean"},"buying_price":{"type":"number","minimum":0},"buying_price_vat_included":{"type":"boolean"},"critical_stock_quantity":{"type":"number"},"category_id":{"type":"string","format":"uuid","nullable":true},"note":{"type":"string","minLength":1,"nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 (varsayılan TRY)."},"opening_stock":{"type":"number","description":"Açılış stoğu (yalnız product). Varsayılan depoya yazılır."}},"required":["name"],"additionalProperties":false},"ProductUpdate":{"type":"object","properties":{"type":{"type":"string","enum":["product","service"],"description":"Varsayılan: product."},"code":{"type":"string","minLength":1,"maxLength":24,"nullable":true,"description":"Boş bırakılırsa otomatik üretilir."},"barcode":{"type":"string","minLength":1,"maxLength":128,"nullable":true},"gtip":{"type":"string","minLength":1,"maxLength":12,"nullable":true},"name":{"type":"string","minLength":1,"maxLength":128},"invoice_title":{"type":"string","minLength":1,"maxLength":128,"nullable":true},"unit":{"type":"string","minLength":1,"maxLength":5,"description":"UN/ECE birim kodu (varsayılan C62 = adet)."},"vat_rate":{"type":"integer","minimum":0,"maximum":100},"selling_price":{"type":"number","minimum":0},"selling_price_vat_included":{"type":"boolean"},"selling_price_2":{"type":"number","minimum":0},"selling_price_2_vat_included":{"type":"boolean"},"buying_price":{"type":"number","minimum":0},"buying_price_vat_included":{"type":"boolean"},"critical_stock_quantity":{"type":"number"},"category_id":{"type":"string","format":"uuid","nullable":true},"note":{"type":"string","minLength":1,"nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"archived":{"type":"boolean"}},"additionalProperties":false},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["cash","bank","credit_card","pos"],"description":"cash = kasa, bank = banka, credit_card = şirket kredi kartı, pos = POS."},"currency":{"type":"string"},"balance":{"type":"number","description":"Tutar (ondalık; kuruş hassasiyetinde)."},"bank_name":{"type":"string","nullable":true},"branch":{"type":"string","nullable":true},"account_no":{"type":"string","nullable":true},"iban":{"type":"string","nullable":true},"archived":{"type":"boolean"}},"required":["id","name","type","currency","balance","bank_name","branch","account_no","iban","archived"],"additionalProperties":false,"description":"Kasa / banka / kredi kartı / POS hesabı. Tahsilat ve ödemelerde `account_id` olarak kullanılır."},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["sale","purchase","sale_return","purchase_return","legacy_return"]},"document_no":{"type":"string","nullable":true,"description":"Belge numarası (e-belge gönderilmişse GİB numarası e_document.number'dadır)."},"issue_date":{"type":"string","description":"Düzenleme tarih-saati (ISO 8601)."},"due_date":{"type":"string","nullable":true},"contact_id":{"type":"integer"},"currency":{"type":"string","description":"Faturanın para birimi = carinin para birimi."},"exchange_rate":{"type":"number","nullable":true,"description":"Dövizli faturada 1 birim döviz kaç TL (TCMB, fatura tarihi)."},"description":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"category_id":{"type":"string","format":"uuid","nullable":true},"return_of_id":{"type":"string","format":"uuid","nullable":true,"description":"İade faturasının dayandığı asıl fatura."},"payment_status":{"type":"string","enum":["unpaid","partially_paid","paid"]},"totals":{"type":"object","properties":{"gross":{"type":"number","description":"İskonto öncesi tutar."},"discount":{"type":"number"},"net":{"type":"number","description":"Matrah (KDV hariç)."},"vat":{"type":"number"},"vat_withholding":{"type":"number","description":"KDV tevkifatı."},"total":{"type":"number","description":"Vergiler dahil toplam."},"payable":{"type":"number","description":"Ödenecek tutar (tevkifat düşülmüş)."},"unpaid":{"type":"number","description":"Kalan (tahsil edilmemiş/ödenmemiş)."}},"required":["gross","discount","net","vat","vat_withholding","total","payable","unpaid"],"additionalProperties":false},"cancelled":{"type":"boolean","description":"Satış iptal edildi (ters kayıt oluşturuldu)."},"online_sale":{"type":"object","properties":{"website":{"type":"string","minLength":3,"maxLength":255,"description":"Satışın yapıldığı web adresi (ör. https://magaza.com)."},"payment_method":{"type":"string","enum":["card","bank_transfer","cash_on_delivery","payment_agent","other"],"description":"Ödeme şekli (GİB): card = KREDIKARTI/BANKAKARTI · bank_transfer = EFT/HAVALE · cash_on_delivery = KAPIDAODEME · payment_agent = ODEMEARACISI (ör. iyzico, PayTR — `payment_agent` zorunlu) · other = DIGER (`payment_agent` açıklama olur)."},"payment_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"Ödeme tarihi (YYYY-MM-DD). Kart/EFT/aracıda boşsa fatura günü."},"payment_agent":{"type":"string","minLength":1,"maxLength":128,"nullable":true,"description":"Ödeme aracısının adı (payment_agent'ta zorunlu)."},"carrier":{"type":"object","properties":{"tax_number":{"type":"string","pattern":"^\\d{10,11}$","description":"Taşıyıcının VKN/TCKN'si."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"Taşıyıcının unvanı (ör. Yurtiçi Kargo A.Ş.)."}},"required":["tax_number","name"],"additionalProperties":false,"nullable":true,"description":"Gönderiyi taşıyan. Boşsa satıcının kendisi yazılır (kendi teslimatı / hizmet satışı)."},"despatch_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"Gönderim (kargoya veriliş) tarihi; boşsa fatura günü."},"order_no":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Sipariş numarası (e-belgede sipariş referansı)."},"order_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"Sipariş tarihi."}},"required":["website","payment_method"],"additionalProperties":false,"description":"İnternet satışı bilgileri (varsa).","nullable":true},"e_document":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ETTN (GİB evrensel belge kimliği)."},"number":{"type":"string","nullable":true,"description":"GİB belge numarası (ör. ABC2026000000001)."},"profile":{"type":"string","description":"TEMELFATURA, TICARIFATURA, EARSIVFATURA, IHRACAT…"},"invoice_type":{"type":"string","nullable":true,"description":"SATIS, IADE, TEVKIFAT, ISTISNA, IHRACKAYITLI…"},"status":{"type":"string","enum":["sent","waiting_response","accepted","rejected","error","cancelled"],"description":"sent = iletildi · waiting_response = ticari faturada alıcı yanıtı bekleniyor · accepted/rejected = alıcı yanıtı · error = entegratör hatası · cancelled = iptal edildi (e-Arşiv)."},"answer_note":{"type":"string","nullable":true,"description":"Alıcının kabul/red açıklaması (ticari fatura)."},"sent_at":{"type":"string","description":"Gönderim anı (ISO 8601)."},"cancelled_at":{"type":"string","nullable":true}},"required":["id","number","profile","invoice_type","status","answer_note","sent_at","cancelled_at"],"additionalProperties":false,"description":"Faturanın GİB'e gönderilmiş resmî e-belgesi.","nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"integer","nullable":true},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unit_price":{"type":"number","description":"KDV HARİÇ birim fiyat."},"discount_rates":{"type":"array","items":{"type":"number"},"description":"Kademeli iskonto yüzdeleri."},"vat_rate":{"type":"number","nullable":true},"net_amount":{"type":"number","description":"İskonto sonrası matrah."},"vat_amount":{"type":"number"},"total":{"type":"number","description":"Vergiler dahil satır toplamı."},"taxes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"GİB vergi kodu (bkz. GET /v1/taxes): 0015 = KDV, 601… = KDV tevkifatı, 0071… = ÖTV…"},"kind":{"type":"string","description":"VAT, WHT_VAT (tevkifat), WHT_NET (stopaj), SUR_NET, SUR_PLUS."},"rate":{"type":"number"},"exemption_code":{"type":"string","nullable":true,"description":"İstisna kodu (bkz. GET /v1/tax-exemptions)."}},"required":["code","kind","rate","exemption_code"],"additionalProperties":false}}},"required":["id","product_id","description","quantity","unit","unit_price","discount_rates","vat_rate","net_amount","vat_amount","total","taxes"],"additionalProperties":false},"description":"Yalnız tek fatura getirilirken."},"created_at":{"type":"string"},"updated_at":{"type":"string","description":"Son değişiklik anı — `updated_since` ile eşitleme için."}},"required":["id","type","document_no","issue_date","due_date","contact_id","currency","exchange_rate","description","note","category_id","return_of_id","payment_status","totals","cancelled","online_sale","e_document","created_at","updated_at"],"additionalProperties":false,"description":"Satış, alış ya da iade faturası."},"InvoiceCreate":{"type":"object","properties":{"type":{"type":"string","enum":["sale","purchase","sale_return","purchase_return"],"description":"sale = satış, purchase = alış, sale_return = müşteriden iade, purchase_return = tedarikçiye iade."},"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Cari (bkz. /v1/contacts). Para birimi cariden gelir."},"issue_date":{"type":"string","description":"YYYY-MM-DD ya da ISO tarih-saat (varsayılan: şimdi). Gelecek tarihli fatura e-belge olarak gönderilemez."},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Vade (YYYY-MM-DD)."},"document_no":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Belge no. Alışta tedarikçinin fatura numarası; satışta boş bırakılabilir (e-belgede GİB no verilir)."},"description":{"type":"string","minLength":1,"maxLength":1000,"nullable":true,"description":"Faturada görünen açıklama/not."},"note":{"type":"string","minLength":1,"maxLength":1000,"nullable":true,"description":"İç not (faturada görünmez)."},"category_id":{"type":"string","format":"uuid","nullable":true},"exchange_rate":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000,"description":"Dövizli faturada kur; boşsa fatura tarihinin TCMB kuru."},"return_of_id":{"type":"string","format":"uuid","description":"İade faturalarında ZORUNLU değil ama önerilir: asıl fatura. Miktar asıl faturayı aşamaz."},"prices_include_vat":{"type":"boolean","description":"true = `unit_price` KDV DAHİL (e-ticaret fiyatları). Sunucu KDV hariç fiyatı kuruşu tutacak şekilde hesaplar."},"lines":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıtlı ürün kimliği. Verilmezse `product_code` zorunlu."},"product_code":{"type":"string","minLength":1,"maxLength":24,"description":"Ürün kodu (SKU). Bu kodla ürün varsa ona bağlanır; yoksa `product_name` ile BİR KEZ oluşturulur (her faturada yeni ürün açılmaz)."},"product_name":{"type":"string","minLength":1,"maxLength":128,"description":"Ürün yoksa oluşturulacak ürünün adı."},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true,"description":"Satır açıklaması (faturada ürün adının altında)."},"quantity":{"type":"number","exclusiveMinimum":true,"minimum":0},"unit":{"type":"string","minLength":1,"maxLength":5,"description":"UN/ECE birim kodu (varsayılan C62 = adet; bkz. GET /v1/units)."},"unit_price":{"type":"number","minimum":0,"description":"Birim fiyat. `prices_include_vat: true` ise KDV DAHİL kabul edilir."},"discount_rate":{"type":"number","minimum":0,"maximum":100,"description":"İskonto yüzdesi (0–100)."},"vat_rate":{"type":"integer","minimum":0,"maximum":100,"description":"KDV oranı (%). İzin verilenler: 0, 1, 8, 10, 18, 20."},"vat_exemption_code":{"type":"string","minLength":1,"maxLength":8,"nullable":true,"description":"%0 KDV'de istisna kodu (ör. 301 ihracat; bkz. GET /v1/tax-exemptions)."},"withholding_code":{"type":"string","minLength":1,"maxLength":8,"nullable":true,"description":"KDV tevkifat kodu (ör. 601; oran koddan gelir)."},"warehouse_id":{"type":"string","format":"uuid","nullable":true,"description":"Stoğun düşeceği depo (boş = varsayılan depo)."}},"required":["quantity","unit_price","vat_rate"],"additionalProperties":false},"minItems":1,"maxItems":500},"online_sale":{"type":"object","properties":{"website":{"type":"string","minLength":3,"maxLength":255,"description":"Satışın yapıldığı web adresi (ör. https://magaza.com)."},"payment_method":{"type":"string","enum":["card","bank_transfer","cash_on_delivery","payment_agent","other"],"description":"Ödeme şekli (GİB): card = KREDIKARTI/BANKAKARTI · bank_transfer = EFT/HAVALE · cash_on_delivery = KAPIDAODEME · payment_agent = ODEMEARACISI (ör. iyzico, PayTR — `payment_agent` zorunlu) · other = DIGER (`payment_agent` açıklama olur)."},"payment_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"Ödeme tarihi (YYYY-MM-DD). Kart/EFT/aracıda boşsa fatura günü."},"payment_agent":{"type":"string","minLength":1,"maxLength":128,"nullable":true,"description":"Ödeme aracısının adı (payment_agent'ta zorunlu)."},"carrier":{"type":"object","properties":{"tax_number":{"type":"string","pattern":"^\\d{10,11}$","description":"Taşıyıcının VKN/TCKN'si."},"name":{"type":"string","minLength":1,"maxLength":128,"description":"Taşıyıcının unvanı (ör. Yurtiçi Kargo A.Ş.)."}},"required":["tax_number","name"],"additionalProperties":false,"nullable":true,"description":"Gönderiyi taşıyan. Boşsa satıcının kendisi yazılır (kendi teslimatı / hizmet satışı)."},"despatch_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"Gönderim (kargoya veriliş) tarihi; boşsa fatura günü."},"order_no":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Sipariş numarası (e-belgede sipariş referansı)."},"order_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"Sipariş tarihi."}},"required":["website","payment_method"],"additionalProperties":false,"description":"İnternet satışı (VUK 509). Verilirse e-belgeye web adresi, ödeme, taşıyıcı, gönderim tarihi ve \"Bu satış internet üzerinden yapılmıştır.\" ibaresi yazılır; e-Arşiv ELEKTRONİK gönderilir."},"payment":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"Paranın girdiği/çıktığı kasa-banka (bkz. /v1/accounts)."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Tahsilat/ödeme tarihi (varsayılan: fatura tarihi)."}},"required":["account_id"],"additionalProperties":false,"description":"Verilirse fatura PEŞİN tahsil edilmiş/ödenmiş kaydedilir (tam tutar)."},"despatch_ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":50,"description":"Bu faturanın irsaliyeleri (bkz. /v1/despatches). Stok irsaliyeyle zaten hareket ettiği için fatura STOK HAREKETİ YAPMAZ. İrsaliyeler faturanın carisine ait, doğru yönde (satış ↔ giden, alış ↔ gelen) ve henüz faturalanmamış olmalı; faturalanan irsaliye silinemez."}},"required":["type","contact_id","lines"],"additionalProperties":false},"InvoiceCancelResult":{"type":"object","properties":{"reversal_invoice_id":{"type":"string","format":"uuid","description":"Aynı tarihli ters kayıt (sale_return)."},"collected_amount":{"type":"number","description":"İptal edilen satıştan önce tahsil edilmiş tutar — müşteriye iade/mahsup gerekir."}},"required":["reversal_invoice_id","collected_amount"],"additionalProperties":false},"EDocument":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ETTN (GİB evrensel belge kimliği)."},"number":{"type":"string","nullable":true,"description":"GİB belge numarası (ör. ABC2026000000001)."},"profile":{"type":"string","description":"TEMELFATURA, TICARIFATURA, EARSIVFATURA, IHRACAT…"},"invoice_type":{"type":"string","nullable":true,"description":"SATIS, IADE, TEVKIFAT, ISTISNA, IHRACKAYITLI…"},"status":{"type":"string","enum":["sent","waiting_response","accepted","rejected","error","cancelled"],"description":"sent = iletildi · waiting_response = ticari faturada alıcı yanıtı bekleniyor · accepted/rejected = alıcı yanıtı · error = entegratör hatası · cancelled = iptal edildi (e-Arşiv)."},"answer_note":{"type":"string","nullable":true,"description":"Alıcının kabul/red açıklaması (ticari fatura)."},"sent_at":{"type":"string","description":"Gönderim anı (ISO 8601)."},"cancelled_at":{"type":"string","nullable":true}},"required":["id","number","profile","invoice_type","status","answer_note","sent_at","cancelled_at"],"additionalProperties":false,"description":"Faturanın GİB'e gönderilmiş resmî e-belgesi."},"EDocumentSend":{"type":"object","properties":{"profile":{"type":"string","enum":["auto","TEMELFATURA","TICARIFATURA","EARSIVFATURA","IHRACAT"],"default":"auto","description":"auto = alıcı GİB'de e-Fatura mükellefiyse TEMELFATURA (posta kutusuna), değilse EARSIVFATURA."},"invoice_type":{"type":"string","enum":["SATIS","IADE","TEVKIFAT","TEVKIFATIADE","ISTISNA","OZELMATRAH","IHRACKAYITLI","SGK","KONAKLAMAVERGISI"],"description":"Boşsa satırlardaki vergilerden belirlenir (tevkifat → TEVKIFAT, istisna kodu → ISTISNA, iade → IADE)."},"receiver_alias":{"type":"string","minLength":1,"description":"e-Fatura alıcı posta kutusu (auto'da otomatik)."},"send_type":{"type":"string","enum":["electronic","paper"],"default":"electronic","description":"e-Arşivde teslim şekli."},"payment_method":{"type":"string","enum":["cash","cheque","bank_transfer","card","promissory_note"],"description":"e-Belgede ödeme şekli."},"document_no":{"type":"string","pattern":"^[A-Z0-9]{3}\\d{13}$","description":"Belge numarasını kendiniz vermek için (3 karakter seri + yıl + 9 hane). Boşsa sıradaki numara."}},"additionalProperties":false},"EInvoiceTaxpayer":{"type":"object","properties":{"tax_number":{"type":"string"},"e_invoice_registered":{"type":"boolean","description":"GİB e-Fatura sistemine kayıtlı mı (posta kutusu var mı)."},"title":{"type":"string","nullable":true},"aliases":{"type":"array","items":{"type":"string"},"description":"Posta kutusu etiketleri (urn:mail:…)."},"recommended_profile":{"type":"string","enum":["TEMELFATURA","EARSIVFATURA"],"description":"Bu alıcıya kesilecek belge türü."}},"required":["tax_number","e_invoice_registered","title","aliases","recommended_profile"],"additionalProperties":false,"description":"GİB e-Fatura mükellef sorgusu."},"Payment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["collection","payment"],"description":"collection = tahsilat (müşteriden), payment = ödeme (tedarikçiye)."},"contact_id":{"type":"integer"},"account_id":{"type":"string","format":"uuid","nullable":true},"invoice_id":{"type":"string","format":"uuid","nullable":true},"amount":{"type":"number","description":"Kasaya giren/çıkan tutar (hesabın para biriminde)."},"currency":{"type":"string","nullable":true,"description":"Hesabın para birimi."},"exchange_rate":{"type":"number","nullable":true},"date":{"type":"string"},"description":{"type":"string","nullable":true},"from_invoice":{"type":"boolean","description":"Faturayla birlikte oluşan peşin tahsilat/ödeme."},"created_at":{"type":"string"},"updated_at":{"type":"string","description":"Son değişiklik anı — `updated_since` ile eşitleme için."}},"required":["id","type","contact_id","account_id","invoice_id","amount","currency","exchange_rate","date","description","from_invoice","created_at","updated_at"],"additionalProperties":false,"description":"Tahsilat ya da ödeme."},"PaymentCreate":{"type":"object","properties":{"type":{"type":"string","enum":["collection","payment"]},"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0},"account_id":{"type":"string","format":"uuid","description":"Kasa/banka (bkz. /v1/accounts)."},"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"description":"Hesabın para biriminde tutar."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Varsayılan: bugün."},"invoice_id":{"type":"string","format":"uuid","description":"Bağlanacak fatura (aynı carinin). Boşsa en eski açık faturalardan düşülür."},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true},"exchange_rate":{"type":"number","exclusiveMinimum":true,"minimum":0,"description":"Cari ile hesap farklı para birimindeyse kur; boşsa işlem tarihinin TCMB kuru."}},"required":["type","contact_id","account_id","amount"],"additionalProperties":false},"Unit":{"type":"object","properties":{"code":{"type":"string","description":"UN/ECE Rec 20 kodu."},"name":{"type":"string"}},"required":["code","name"],"additionalProperties":false,"description":"Ölçü birimi."},"Tax":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","description":"VAT, WHT_VAT (tevkifat), WHT_NET (stopaj), SUR_NET, SUR_PLUS."},"rates":{"type":"array","items":{"type":"number"},"description":"İzin verilen oranlar (boş = serbest)."}},"required":["code","name","kind","rates"],"additionalProperties":false,"description":"GİB vergi kodu."},"TaxExemption":{"type":"object","properties":{"tax_code":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}},"required":["tax_code","code","name"],"additionalProperties":false,"description":"Vergi istisna/muafiyet kodu."},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Olay kimliği — webhook'ta `x-bulutmu-event-id` başlığı. Aynı olay birden çok kez gelebilir; bununla tekilleştirin."},"type":{"type":"string","enum":["invoice.created","invoice.updated","invoice.deleted","invoice.cancelled","e_document.sent","e_document.accepted","e_document.rejected","e_document.cancelled","payment.created","payment.deleted","contact.created","contact.updated","contact.deleted"],"description":"`invoice.created`: Fatura oluşturuldu (satış, alış, iade; arayüzden, API'den, içe aktarmadan ya da tekliften). · `invoice.updated`: Fatura güncellendi. · `invoice.deleted`: Fatura silindi. · `invoice.cancelled`: Satış muhasebe kaydıyla iptal edildi (aynı tarihli ters kayıt oluştu — o da `invoice.created`). · `e_document.sent`: Fatura e-Fatura / e-Arşiv olarak GİB'e gönderildi. · `e_document.accepted`: Ticari e-Faturayı alıcı KABUL etti. · `e_document.rejected`: Ticari e-Faturayı alıcı REDDETTİ (`answer_note` gerekçe). · `e_document.cancelled`: e-Arşiv faturası iptal edildi. · `payment.created`: Tahsilat ya da ödeme kaydedildi (faturanın peşin tahsilatı dahil). · `payment.deleted`: Tahsilat ya da ödeme silindi. · `contact.created`: Cari oluşturuldu. · `contact.updated`: Cari bilgileri güncellendi (bakiye değişimi bu olayı ÜRETMEZ — `updated_since` ile izleyin). · `contact.deleted`: Cari silindi."},"created_at":{"type":"string","description":"ISO 8601 tarih-saat."},"data":{"type":"object","additionalProperties":{},"description":"YALIN kayıt (kimlik + anahtar alanlar). Tam ve güncel kayıt için ilgili GET ucunu çağırın."}},"required":["id","type","created_at","data"],"additionalProperties":false},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","description":"Bildirimlerin POST edildiği https adresi."},"description":{"type":"string","nullable":true},"events":{"type":"array","items":{"type":"string","enum":["invoice.created","invoice.updated","invoice.deleted","invoice.cancelled","e_document.sent","e_document.accepted","e_document.rejected","e_document.cancelled","payment.created","payment.deleted","contact.created","contact.updated","contact.deleted"]},"description":"Abone olunan olay türleri."},"secret_prefix":{"type":"string","description":"İmza sırrının görünür öneki (whsec_…). Sırrın tamamı yalnız oluşturulurken döner."},"enabled":{"type":"boolean","description":"false: kapatıldı (elle ya da 3 gün boyunca teslim edilemediği için) — `PATCH {\"enabled\": true}` ile açılır."},"disabled_reason":{"type":"string","nullable":true},"created_via":{"type":"string","enum":["api","web"]},"last_success_at":{"type":"string","nullable":true,"description":"ISO 8601 tarih-saat."},"last_failure_at":{"type":"string","nullable":true,"description":"ISO 8601 tarih-saat."},"last_error":{"type":"string","nullable":true},"created_at":{"type":"string","description":"ISO 8601 tarih-saat."}},"required":["id","url","description","events","secret_prefix","enabled","disabled_reason","created_via","last_success_at","last_failure_at","last_error","created_at"],"additionalProperties":false},"WebhookCreate":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"https:// ile başlayan, internetten erişilebilir adres."},"events":{"type":"array","items":{"type":"string","enum":["invoice.created","invoice.updated","invoice.deleted","invoice.cancelled","e_document.sent","e_document.accepted","e_document.rejected","e_document.cancelled","payment.created","payment.deleted","contact.created","contact.updated","contact.deleted","*"]},"minItems":1,"description":"Olay türleri; `[\"*\"]` = anahtarın görebildiği TÜM türler (oluşturma anında açılır — sonradan eklenen türlere otomatik abone olunmaz)."},"description":{"type":"string","maxLength":200,"nullable":true}},"required":["url","events"],"additionalProperties":false},"WebhookCreated":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","description":"Bildirimlerin POST edildiği https adresi."},"description":{"type":"string","nullable":true},"events":{"type":"array","items":{"type":"string","enum":["invoice.created","invoice.updated","invoice.deleted","invoice.cancelled","e_document.sent","e_document.accepted","e_document.rejected","e_document.cancelled","payment.created","payment.deleted","contact.created","contact.updated","contact.deleted"]},"description":"Abone olunan olay türleri."},"secret_prefix":{"type":"string","description":"İmza sırrının görünür öneki (whsec_…). Sırrın tamamı yalnız oluşturulurken döner."},"enabled":{"type":"boolean","description":"false: kapatıldı (elle ya da 3 gün boyunca teslim edilemediği için) — `PATCH {\"enabled\": true}` ile açılır."},"disabled_reason":{"type":"string","nullable":true},"created_via":{"type":"string","enum":["api","web"]},"last_success_at":{"type":"string","nullable":true,"description":"ISO 8601 tarih-saat."},"last_failure_at":{"type":"string","nullable":true,"description":"ISO 8601 tarih-saat."},"last_error":{"type":"string","nullable":true},"created_at":{"type":"string","description":"ISO 8601 tarih-saat."},"secret":{"type":"string","description":"İmza sırrı (whsec_…). YALNIZ bu yanıtta döner — saklayın. İmza doğrulaması için gerekir."}},"required":["id","url","description","events","secret_prefix","enabled","disabled_reason","created_via","last_success_at","last_failure_at","last_error","created_at","secret"],"additionalProperties":false},"WebhookUpdate":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048},"events":{"type":"array","items":{"type":"string","enum":["invoice.created","invoice.updated","invoice.deleted","invoice.cancelled","e_document.sent","e_document.accepted","e_document.rejected","e_document.cancelled","payment.created","payment.deleted","contact.created","contact.updated","contact.deleted","*"]},"minItems":1,"description":"Olay türleri; `[\"*\"]` = anahtarın görebildiği TÜM türler (oluşturma anında açılır — sonradan eklenen türlere otomatik abone olunmaz)."},"description":{"type":"string","maxLength":200,"nullable":true},"enabled":{"type":"boolean","description":"true: kapatılmış ucu yeniden açar; false: kapatır."}},"additionalProperties":false},"WebhookTestResult":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"integer","nullable":true,"description":"Alıcının HTTP durum kodu."},"duration_ms":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true}},"required":["ok","status","duration_ms","error"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Teslimat kimliği — `x-bulutmu-delivery` başlığı."},"event_id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed"],"description":"pending = sırada/yeniden denenecek, failed = 8 deneme sonunda vazgeçildi."},"attempts":{"type":"integer"},"response_status":{"type":"integer","nullable":true},"last_error":{"type":"string","nullable":true},"next_attempt_at":{"type":"string","nullable":true,"description":"ISO 8601 tarih-saat."},"delivered_at":{"type":"string","nullable":true,"description":"ISO 8601 tarih-saat."},"created_at":{"type":"string","description":"ISO 8601 tarih-saat."}},"required":["id","event_id","event_type","status","attempts","response_status","last_error","next_attempt_at","delivered_at","created_at"],"additionalProperties":false},"Offer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["offer","proforma"],"description":"offer = teklif, proforma = proforma fatura."},"document_no":{"type":"string","nullable":true,"description":"Teklif/proforma numarası (otomatik: TKL-/PRF-yıl-sıra)."},"issue_date":{"type":"string"},"valid_until":{"type":"string","nullable":true,"description":"Geçerlilik tarihi. Geçmişse `expired` true olur."},"status":{"type":"string","enum":["pending","sent","accepted","rejected","invoiced"],"description":"pending = beklemede · sent = müşteriye gönderildi · accepted/rejected = müşteri yanıtı · invoiced = faturalandı."},"expired":{"type":"boolean","description":"Süresi dolmuş (açık durumda ve geçerlilik tarihi geçmiş)."},"contact_id":{"type":"integer"},"currency":{"type":"string"},"description":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"totals":{"type":"object","properties":{"gross":{"type":"number"},"discount":{"type":"number"},"net":{"type":"number"},"vat":{"type":"number"},"total":{"type":"number"}},"required":["gross","discount","net","vat","total"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"integer","nullable":true},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unit_price":{"type":"number","description":"KDV HARİÇ birim fiyat."},"discount_rates":{"type":"array","items":{"type":"number"},"description":"Kademeli iskonto yüzdeleri."},"vat_rate":{"type":"number","nullable":true},"net_amount":{"type":"number","description":"İskonto sonrası matrah."},"vat_amount":{"type":"number"},"total":{"type":"number","description":"Vergiler dahil satır toplamı."},"taxes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"GİB vergi kodu (bkz. GET /v1/taxes): 0015 = KDV, 601… = KDV tevkifatı, 0071… = ÖTV…"},"kind":{"type":"string","description":"VAT, WHT_VAT (tevkifat), WHT_NET (stopaj), SUR_NET, SUR_PLUS."},"rate":{"type":"number"},"exemption_code":{"type":"string","nullable":true,"description":"İstisna kodu (bkz. GET /v1/tax-exemptions)."}},"required":["code","kind","rate","exemption_code"],"additionalProperties":false}}},"required":["id","product_id","description","quantity","unit","unit_price","discount_rates","vat_rate","net_amount","vat_amount","total","taxes"],"additionalProperties":false},"description":"Yalnız tek fatura getirilirken."},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","document_no","issue_date","valid_until","status","expired","contact_id","currency","description","note","totals","created_at","updated_at"],"additionalProperties":false,"description":"Teklif ya da proforma. Muhasebeyi (cari bakiye, stok) ETKİLEMEZ; faturalanınca fatura oluşur."},"OfferCreate":{"type":"object","properties":{"type":{"type":"string","enum":["offer","proforma"],"default":"offer"},"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0},"issue_date":{"type":"string"},"valid_until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Geçerlilik tarihi (varsayılan: firma ayarındaki gün sayısı, 15 gün)."},"document_no":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Boşsa sıradaki numara verilir."},"description":{"type":"string","minLength":1,"maxLength":1000,"nullable":true},"note":{"type":"string","minLength":1,"maxLength":1000,"nullable":true,"description":"İç not (müşteriye gösterilmez)."},"prices_include_vat":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıtlı ürün kimliği. Verilmezse `product_code` zorunlu."},"product_code":{"type":"string","minLength":1,"maxLength":24,"description":"Ürün kodu (SKU). Bu kodla ürün varsa ona bağlanır; yoksa `product_name` ile BİR KEZ oluşturulur (her faturada yeni ürün açılmaz)."},"product_name":{"type":"string","minLength":1,"maxLength":128,"description":"Ürün yoksa oluşturulacak ürünün adı."},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true,"description":"Satır açıklaması (faturada ürün adının altında)."},"quantity":{"type":"number","exclusiveMinimum":true,"minimum":0},"unit":{"type":"string","minLength":1,"maxLength":5,"description":"UN/ECE birim kodu (varsayılan C62 = adet; bkz. GET /v1/units)."},"unit_price":{"type":"number","minimum":0,"description":"Birim fiyat. `prices_include_vat: true` ise KDV DAHİL kabul edilir."},"discount_rate":{"type":"number","minimum":0,"maximum":100,"description":"İskonto yüzdesi (0–100)."},"vat_rate":{"type":"integer","minimum":0,"maximum":100,"description":"KDV oranı (%). İzin verilenler: 0, 1, 8, 10, 18, 20."},"vat_exemption_code":{"type":"string","minLength":1,"maxLength":8,"nullable":true,"description":"%0 KDV'de istisna kodu (ör. 301 ihracat; bkz. GET /v1/tax-exemptions)."},"withholding_code":{"type":"string","minLength":1,"maxLength":8,"nullable":true,"description":"KDV tevkifat kodu (ör. 601; oran koddan gelir)."},"warehouse_id":{"type":"string","format":"uuid","nullable":true,"description":"Stoğun düşeceği depo (boş = varsayılan depo)."}},"required":["quantity","unit_price","vat_rate"],"additionalProperties":false},"minItems":1,"maxItems":500}},"required":["contact_id","lines"],"additionalProperties":false},"Warehouse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"is_default":{"type":"boolean","description":"Depo belirtilmeyen stok hareketleri bu depoya yazılır."},"city":{"type":"string","nullable":true},"archived":{"type":"boolean"}},"required":["id","name","is_default","city","archived"],"additionalProperties":false},"ProductStock":{"type":"object","properties":{"product_id":{"type":"integer"},"total":{"type":"number","description":"Tüm depolardaki toplam."},"warehouses":{"type":"array","items":{"type":"object","properties":{"warehouse_id":{"type":"string","format":"uuid"},"quantity":{"type":"number"}},"required":["warehouse_id","quantity"],"additionalProperties":false},"description":"Depo bazında miktar (hareket görmemiş depo listede olmayabilir)."}},"required":["product_id","total","warehouses"],"additionalProperties":false},"StockMovement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"integer"},"warehouse_id":{"type":"string","format":"uuid"},"quantity":{"type":"number","description":"İşaretli: + giriş, − çıkış."},"source":{"type":"string","enum":["invoice","despatch","opening","count","transfer","manual"],"description":"invoice = fatura · despatch = irsaliye · opening = açılış · count = sayım · transfer = depolar arası · manual = elle."},"invoice_id":{"type":"string","format":"uuid","nullable":true,"description":"Hareket bir faturadan doğduysa o fatura."},"note":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","product_id","warehouse_id","quantity","source","invoice_id","note","created_at"],"additionalProperties":false},"IncomingEInvoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ETTN."},"number":{"type":"string","nullable":true,"description":"GİB belge numarası."},"profile":{"type":"string","description":"TEMELFATURA, TICARIFATURA…"},"invoice_type":{"type":"string","nullable":true,"description":"SATIS, IADE, TEVKIFAT…"},"status":{"type":"string","enum":["received","waiting_response","accepted","rejected","error"],"description":"waiting_response = ticari fatura, kabul/ret bekliyor."},"issue_date":{"type":"string"},"supplier":{"type":"object","properties":{"tax_number":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["tax_number","name"],"additionalProperties":false},"payable_amount":{"type":"number"},"currency":{"type":"string"},"invoice_id":{"type":"string","format":"uuid","nullable":true,"description":"Bu belgeden oluşturulmuş alış faturası (varsa)."},"received_at":{"type":"string"}},"required":["id","number","profile","invoice_type","status","issue_date","supplier","payable_amount","currency","invoice_id","received_at"],"additionalProperties":false,"description":"Tedarikçilerden gelen e-Fatura (entegratörden eşitlenir)."},"IncomingEInvoiceAnswer":{"type":"object","properties":{"answer":{"type":"string","enum":["accept","reject"],"description":"accept = kabul, reject = ret (itiraz)."},"note":{"type":"string","minLength":1,"maxLength":500,"description":"Ret gerekçesi (isteğe bağlı) — tedarikçiye iletilir."}},"required":["answer"],"additionalProperties":false,"description":"Gelen ticari e-faturaya kabul/ret yanıtı."},"AccountTransaction":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"type":{"type":"string","description":"Hareket türü: collection, payment, transfer, opening, adjustment, deposit, withdrawal, cheque_collection, cheque_payment, promissory_collection, promissory_payment, employee_payment, expense_payment (yeni türler eklenebilir — tanımadığınızı \"diğer\" sayın)."},"amount":{"type":"number","description":"Hesabın para biriminde, İŞARETLİ: + hesaba giren, − hesaptan çıkan."},"balance_after":{"type":"number","nullable":true,"description":"Bu hareketten sonraki hesap bakiyesi."},"description":{"type":"string","nullable":true},"counterparty":{"type":"string","nullable":true,"description":"Karşı taraf (cari, çalışan, masraf türü, virman hesabı)."},"source":{"type":"object","properties":{"kind":{"type":"string","description":"Kaydın kaynağı (ör. contact_operations = tahsilat/ödeme)."},"id":{"type":"string","nullable":true}},"required":["kind","id"],"additionalProperties":false}},"required":["id","date","type","amount","balance_after","description","counterparty","source"],"additionalProperties":false,"description":"Kasa/banka hesabının ekstre satırı."},"ExpenseType":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","name","archived"],"additionalProperties":false,"description":"Masraf türü (kira, elektrik…)."},"Expense":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"expense_type_id":{"type":"string","format":"uuid"},"expense_type":{"type":"string","nullable":true},"date":{"type":"string","description":"Belge/tahakkuk tarihi."},"payment_date":{"type":"string","nullable":true,"description":"Ödeme tarihi (kasadan çıkış)."},"amount":{"type":"number","description":"KDV DAHİL tutar."},"vat_rate":{"type":"number","nullable":true,"description":"KDV oranı; çok satırlı ve karışık oranlı masrafta null."},"vat_deductible":{"type":"boolean","description":"false = KDV indirilemez (gidere yazılır)."},"currency":{"type":"string","description":"Ödendiği hesabın para birimi; hesap yoksa TRY."},"account_id":{"type":"string","format":"uuid","nullable":true,"description":"Ödendiği kasa/banka. Boş = ödenmedi (cariye borç) ya da çalışan ödedi."},"contact_id":{"type":"integer","nullable":true,"description":"Tedarikçi (varsa)."},"document_no":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"paid":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","expense_type_id","expense_type","date","payment_date","amount","vat_rate","vat_deductible","currency","account_id","contact_id","document_no","description","paid","created_at"],"additionalProperties":false,"description":"Masraf kaydı."},"ExpenseCreate":{"type":"object","properties":{"expense_type_id":{"type":"string","format":"uuid","description":"Masraf türü (bkz. GET /v1/expense-types)."},"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"description":"KDV DAHİL tutar."},"vat_rate":{"type":"integer","minimum":0,"maximum":100,"description":"KDV oranı (%)."},"vat_deductible":{"type":"boolean","description":"Varsayılan true. false = KDV indirilemez."},"date":{"type":"string","description":"Belge tarihi (varsayılan: bugün)."},"account_id":{"type":"string","format":"uuid","description":"Verilirse masraf bu kasa/bankadan ÖDENMİŞ kaydedilir."},"payment_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Ödeme tarihi (varsayılan: belge tarihi)."},"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Tedarikçi. `account_id` yoksa tutar cariye borç yazılır."},"document_no":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true}},"required":["expense_type_id","amount"],"additionalProperties":false},"Despatch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["outgoing","incoming"],"description":"outgoing = GİDEN irsaliye (mal çıkışı — stok DÜŞER) · incoming = GELEN irsaliye (mal girişi — stok ARTAR)."},"contact_id":{"type":"integer"},"warehouse_id":{"type":"string","format":"uuid","nullable":true,"description":"Stok hareketinin deposu (boş = varsayılan depo)."},"issue_date":{"type":"string","description":"Düzenleme tarih-saati (ISO 8601)."},"despatch_date":{"type":"string","description":"Fiili sevk tarih-saati (ISO 8601)."},"delivery_address":{"type":"object","properties":{"address":{"type":"string","nullable":true,"description":"Açık adres (cadde, sokak, no)."},"district":{"type":"string","nullable":true,"description":"İlçe."},"city":{"type":"string","nullable":true,"description":"İl."},"postal_code":{"type":"string","nullable":true}},"required":["address","district","city","postal_code"],"additionalProperties":false,"description":"Teslimat adresi."},"origin_address":{"type":"object","properties":{"address":{"type":"string","nullable":true,"description":"Açık adres (cadde, sokak, no)."},"district":{"type":"string","nullable":true,"description":"İlçe."},"city":{"type":"string","nullable":true,"description":"İl."},"postal_code":{"type":"string","nullable":true}},"required":["address","district","city","postal_code"],"additionalProperties":false,"description":"Çıkış (sevk) adresi."},"carrier":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"Taşıyıcı (kargo) firmanın unvanı."},"tax_number":{"type":"string","nullable":true,"description":"Taşıyıcının VKN/TCKN'si."},"tax_office":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}},"required":["name","tax_number","tax_office","address"],"additionalProperties":false,"nullable":true,"description":"Kargoyla gönderimde taşıyıcı firma; kendi aracınızla gönderimde null."},"plate_number":{"type":"string","nullable":true,"description":"Araç plakası (kendi aracınızla gönderimde)."},"drivers":{"type":"array","items":{"type":"object","properties":{"full_name":{"type":"string","description":"Ad soyad (e-İrsaliyede son kelime soyadı sayılır)."},"national_id":{"type":"string","nullable":true,"description":"TCKN (yabancı uyrukluda pasaport no)."},"is_foreign":{"type":"boolean"}},"required":["full_name","national_id","is_foreign"],"additionalProperties":false},"description":"Şoförler (kendi aracınızla gönderimde)."},"description":{"type":"string","nullable":true,"description":"Açıklama — iç kullanım; e-İrsaliyeye yazılmaz."},"note":{"type":"string","nullable":true,"description":"Not — e-İrsaliyede belge notu olarak görünür."},"e_document":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ETTN (GİB evrensel belge kimliği)."},"number":{"type":"string","nullable":true,"description":"GİB belge numarası (ör. IRS2026000000001)."},"profile":{"type":"string","description":"TEMELIRSALIYE…"},"status":{"type":"string","enum":["sent","waiting_response","accepted","partially_accepted","rejected","error"],"description":"sent = iletildi · waiting_response = yanıt bekleniyor · accepted / partially_accepted / rejected = alıcının yanıtı · error = entegratör hatası. ⚠️ GİDEN e-İrsaliyede alıcının yanıtı şimdilik Bulutmu'ya eşitlenmez — gönderilen belge `sent` kalır."},"issue_date":{"type":"string","description":"Belgenin düzenleme tarih-saati (ISO 8601)."}},"required":["id","number","profile","status","issue_date"],"additionalProperties":false,"description":"GİB'e gönderildiyse e-İrsaliye.","nullable":true},"invoice_id":{"type":"string","format":"uuid","nullable":true,"description":"Bağlı fatura (irsaliyeden fatura ya da e-İrsaliye eşleştirmesi). Yalnız tek irsaliye getirilirken."},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":"integer"},"product_code":{"type":"string","nullable":true},"product_name":{"type":"string","nullable":true},"quantity":{"type":"number"},"unit":{"type":"string","description":"UN/ECE birim kodu."},"description":{"type":"string","nullable":true,"description":"Satır açıklaması."}},"required":["id","product_id","product_code","product_name","quantity","unit","description"],"additionalProperties":false},"description":"Yalnız tek irsaliye getirilirken."}},"required":["id","direction","contact_id","warehouse_id","issue_date","despatch_date","delivery_address","origin_address","carrier","plate_number","drivers","description","note","e_document"],"additionalProperties":false,"description":"İrsaliye (sevk irsaliyesi). Stok irsaliyeyle hareket eder: giden irsaliye stoğu düşer, gelen artırır."},"DespatchCreate":{"type":"object","properties":{"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Alıcı cari (bkz. /v1/contacts). e-İrsaliyede carinin VKN/TCKN'si gerekir."},"issue_date":{"type":"string","description":"Düzenleme tarihi: YYYY-MM-DD ya da ISO tarih-saat (varsayılan: şimdi)."},"despatch_date":{"type":"string","description":"Fiili sevk tarihi (varsayılan: düzenleme tarihi). e-İrsaliyede düzenleme tarihinden önce olamaz."},"warehouse_id":{"type":"string","format":"uuid","nullable":true,"description":"Stoğun düşeceği depo (boş = varsayılan depo; bkz. /v1/warehouses)."},"delivery_address":{"type":"object","properties":{"address":{"type":"string","minLength":1,"maxLength":500,"nullable":true},"district":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"city":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"postal_code":{"type":"string","minLength":1,"maxLength":16,"nullable":true}},"additionalProperties":false,"description":"Teslimat adresi. e-İrsaliye göndermek için `address`, `district`, `city` zorunlu."},"origin_address":{"type":"object","properties":{"address":{"type":"string","minLength":1,"maxLength":500,"nullable":true},"district":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"city":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"postal_code":{"type":"string","minLength":1,"maxLength":16,"nullable":true}},"additionalProperties":false,"description":"Çıkış (sevk) adresi. e-İrsaliye göndermek için `address`, `district`, `city` zorunlu."},"carrier":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128,"description":"Taşıyıcının unvanı."},"tax_number":{"type":"string","pattern":"^\\d{10,11}$","description":"Taşıyıcının VKN/TCKN'si."},"tax_office":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"address":{"type":"string","minLength":1,"maxLength":500,"nullable":true}},"required":["name","tax_number"],"additionalProperties":false,"description":"Kargoyla gönderim. e-İrsaliyede unvan, VKN, vergi dairesi ve adres zorunlu; taşıyıcı e-İrsaliye mükellefi olmalı."},"plate_number":{"type":"string","minLength":1,"maxLength":32,"nullable":true,"description":"Kendi aracınızla gönderimde plaka."},"drivers":{"type":"array","items":{"type":"object","properties":{"full_name":{"type":"string","minLength":1,"maxLength":128},"national_id":{"type":"string","minLength":1,"maxLength":16,"nullable":true,"description":"TCKN (yabancı uyrukluda pasaport no). e-İrsaliyede zorunlu."},"is_foreign":{"type":"boolean","description":"Yabancı uyruklu (varsayılan false)."}},"required":["full_name"],"additionalProperties":false},"maxItems":10,"description":"Kendi aracınızla gönderimde şoförler (e-İrsaliyede en az biri)."},"description":{"type":"string","minLength":1,"maxLength":1000,"nullable":true,"description":"Açıklama — iç kullanım."},"note":{"type":"string","minLength":1,"maxLength":1000,"nullable":true,"description":"Not — e-İrsaliyede belge notu olarak görünür."},"lines":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Kayıtlı ürün kimliği. Verilmezse `product_code` zorunlu."},"product_code":{"type":"string","minLength":1,"maxLength":24,"description":"Kayıtlı ürünün kodu (SKU). İrsaliye ürün OLUŞTURMAZ — kod bulunamazsa 422 (önce faturayla ya da POST /v1/products ile açın)."},"quantity":{"type":"number","exclusiveMinimum":true,"minimum":0},"unit":{"type":"string","minLength":1,"maxLength":5,"description":"UN/ECE birim kodu (bkz. GET /v1/units). Boşsa ürün kartındaki birim."},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true,"description":"Satır açıklaması."}},"required":["quantity"],"additionalProperties":false},"minItems":1,"maxItems":500}},"required":["contact_id","lines"],"additionalProperties":false,"description":"GİDEN irsaliye. Kaydedildiği anda stok düşer; GİB'e göndermek ayrı adımdır (POST /v1/despatches/{id}/e-document)."},"EDespatch":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ETTN (GİB evrensel belge kimliği)."},"number":{"type":"string","nullable":true,"description":"GİB belge numarası (ör. IRS2026000000001)."},"profile":{"type":"string","description":"TEMELIRSALIYE…"},"status":{"type":"string","enum":["sent","waiting_response","accepted","partially_accepted","rejected","error"],"description":"sent = iletildi · waiting_response = yanıt bekleniyor · accepted / partially_accepted / rejected = alıcının yanıtı · error = entegratör hatası. ⚠️ GİDEN e-İrsaliyede alıcının yanıtı şimdilik Bulutmu'ya eşitlenmez — gönderilen belge `sent` kalır."},"issue_date":{"type":"string","description":"Belgenin düzenleme tarih-saati (ISO 8601)."}},"required":["id","number","profile","status","issue_date"],"additionalProperties":false,"description":"İrsaliyenin GİB'e iletilmiş resmî e-İrsaliyesi."},"EDespatchSend":{"type":"object","properties":{"receiver_alias":{"type":"string","minLength":1,"maxLength":255,"description":"Alıcının e-İrsaliye posta kutusu etiketi (urn:mail:…). Boşsa GİB kaydındaki ilk etiket."}},"additionalProperties":false,"description":"e-İrsaliye gönderim seçenekleri."},"Employee":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"full_name":{"type":"string"},"national_id":{"type":"string","nullable":true,"description":"TC kimlik numarası."},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"iban":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"birth_date":{"type":"string","nullable":true,"description":"Doğum tarihi (YYYY-MM-DD)."},"hire_date":{"type":"string","nullable":true,"description":"İşe giriş tarihi (YYYY-MM-DD)."},"termination_date":{"type":"string","nullable":true,"description":"İşten çıkış tarihi (YYYY-MM-DD). Çıkış ayından sonra toplu/otomatik maaş tahakkukuna girmez."},"salary":{"type":"number","description":"Karttaki aylık maaş (toplu/otomatik tahakkukta önerilen tutar)."},"currency":{"type":"string","description":"Çalışanın para birimi (ISO 4217). Ödemeler aynı para birimindeki kasa/bankadan yapılır."},"balance":{"type":"number","description":"Bakiye. Pozitif = çalışan BİZE borçlu (verilen avans), negatif = BİZ çalışana borçluyuz (ödenecek maaş/masraf)."},"balance_status":{"type":"string","enum":["receivable","payable","settled"],"description":"receivable = çalışan borçlu (avans), payable = ödenecek, settled = kapalı."},"category_id":{"type":"string","format":"uuid","nullable":true},"archived":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","full_name","national_id","email","phone","department","iban","address","note","birth_date","hire_date","termination_date","salary","currency","balance","balance_status","category_id","archived","created_at"],"additionalProperties":false,"description":"Çalışan kartı. Bakiye hareketlerden doğar (tahakkuk, ödeme, çalışanın ödediği masraf)."},"EmployeeCreate":{"type":"object","properties":{"full_name":{"type":"string","minLength":1,"maxLength":128,"description":"Ad soyad."},"national_id":{"type":"string","minLength":1,"maxLength":16,"nullable":true,"description":"TC kimlik numarası. Kontrol hanesi tutmuyorsa ya da aynı TCKN'li çalışan varsa `409 confirmation_required`."},"email":{"type":"string","format":"email","maxLength":128,"nullable":true},"phone":{"type":"string","minLength":1,"maxLength":32,"nullable":true},"department":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"iban":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"IBAN — kontrol hanesi tutmuyorsa reddedilir (`business_rule`)."},"address":{"type":"string","minLength":1,"maxLength":500,"nullable":true},"note":{"type":"string","minLength":1,"maxLength":1000,"nullable":true},"birth_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true},"hire_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true},"termination_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"İşten çıkış tarihi; işe giriş tarihinden önce olamaz."},"salary":{"type":"number","minimum":0,"description":"Aylık maaş (yalnız kart bilgisi — tahakkuk yazmaz)."},"category_id":{"type":"string","format":"uuid","nullable":true},"confirm":{"type":"boolean","description":"Uyarılı kaydı onayla (aynı ad/TCKN'li çalışan var, TCKN kontrol hanesi tutmuyor). Bkz. confirmation_required."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 (varsayılan TRY). Sonradan değiştirilemez."},"opening_balance":{"type":"number","description":"Açılış bakiyesi (geçiş için): + = çalışan bize borçlu (avans), − = biz borçluyuz. Ekstrede 'opening' hareketi olur."},"opening_balance_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Açılış bakiyesinin tarihi (varsayılan: bugün)."}},"required":["full_name"],"additionalProperties":false},"EmployeeUpdate":{"type":"object","properties":{"full_name":{"type":"string","minLength":1,"maxLength":128,"description":"Ad soyad."},"national_id":{"type":"string","minLength":1,"maxLength":16,"nullable":true,"description":"TC kimlik numarası. Kontrol hanesi tutmuyorsa ya da aynı TCKN'li çalışan varsa `409 confirmation_required`."},"email":{"type":"string","format":"email","maxLength":128,"nullable":true},"phone":{"type":"string","minLength":1,"maxLength":32,"nullable":true},"department":{"type":"string","minLength":1,"maxLength":64,"nullable":true},"iban":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"IBAN — kontrol hanesi tutmuyorsa reddedilir (`business_rule`)."},"address":{"type":"string","minLength":1,"maxLength":500,"nullable":true},"note":{"type":"string","minLength":1,"maxLength":1000,"nullable":true},"birth_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true},"hire_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true},"termination_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","nullable":true,"description":"İşten çıkış tarihi; işe giriş tarihinden önce olamaz."},"salary":{"type":"number","minimum":0,"description":"Aylık maaş (yalnız kart bilgisi — tahakkuk yazmaz)."},"category_id":{"type":"string","format":"uuid","nullable":true},"confirm":{"type":"boolean","description":"Uyarılı kaydı onayla (aynı ad/TCKN'li çalışan var, TCKN kontrol hanesi tutmuyor). Bkz. confirmation_required."},"archived":{"type":"boolean"}},"additionalProperties":false},"EmployeeTransaction":{"type":"object","properties":{"id":{"type":"string","description":"Kaynak kaydın kimliği (tahakkuk, ödeme, masraf ya da düzeltme)."},"type":{"type":"string","description":"salary_accrual = maaş/prim tahakkuku · payment = ödeme · advance_refund = avans iadesi (çalışandan tahsilat) · expense = çalışanın cebinden ödediği masraf · opening = açılış bakiyesi · adjustment = bakiye düzeltmesi (yeni türler eklenebilir — tanımadığınızı \"diğer\" sayın)."},"date":{"type":"string"},"amount":{"type":"number","description":"Bakiyeye etkisi, İŞARETLİ: + (ödeme, avans), − (tahakkuk, çalışanın ödediği masraf, avans iadesi)."},"balance_after":{"type":"number","description":"Bu hareketten sonraki çalışan bakiyesi."},"currency":{"type":"string"},"description":{"type":"string","nullable":true},"account_id":{"type":"string","format":"uuid","nullable":true,"description":"Ödeme/avans iadesinde kasa-banka."}},"required":["id","type","date","amount","balance_after","currency","description","account_id"],"additionalProperties":false,"description":"Çalışan ekstresinin satırı."},"EmployeeSalary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"employee_id":{"type":"string","format":"uuid"},"date":{"type":"string","description":"Tahakkuk tarihi."},"amount":{"type":"number","description":"Tahakkuk tutarı (çalışanın para biriminde)."},"currency":{"type":"string"},"description":{"type":"string","nullable":true},"paid_amount":{"type":"number","description":"Ödemelerle eşleşmiş kısmı (eski tarihli tahakkuk önce kapanır; avans mahsubu dahil). Ödeme kaydından birkaç saniye sonra güncellenir."}},"required":["id","employee_id","date","amount","currency","description","paid_amount"],"additionalProperties":false,"description":"Maaş / prim tahakkuku: çalışana borç yazar (bakiye −), KASAYI OYNATMAZ; aynı tutarda gider (masraf) kaydı da oluşur."},"EmployeeSalaryCreate":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000000000,"description":"Tahakkuk tutarı (çalışanın para biriminde)."},"expense_type_id":{"type":"string","format":"uuid","description":"Gider türü (bkz. GET /v1/expense-types, ör. \"Personel Maaşları\") — aynı tutarda bu türde masraf kaydı oluşur."},"date":{"type":"string","description":"Tahakkuk tarihi (varsayılan: şimdi)."},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true,"description":"Ör. \"Ekim 2026 maaşı\"."}},"required":["amount","expense_type_id"],"additionalProperties":false,"description":"Maaş/prim tahakkuku."},"EmployeePayment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"employee_id":{"type":"string","format":"uuid"},"account_id":{"type":"string","format":"uuid","description":"Paranın çıktığı (ödeme) / girdiği (avans iadesi) kasa-banka."},"type":{"type":"string","enum":["payment","advance_refund"],"description":"payment = çalışana ödeme (kasadan ÇIKIŞ) · advance_refund = avans iadesi (kasaya GİRİŞ)."},"amount":{"type":"number","description":"Tutar (pozitif; yönü `type` belirler)."},"currency":{"type":"string"},"date":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","employee_id","account_id","type","amount","currency","date","description"],"additionalProperties":false,"description":"Çalışana ödeme ya da çalışandan avans iadesi. Kasa bakiyesini değiştirir."},"EmployeePaymentCreate":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid","description":"Kasa/banka (bkz. /v1/accounts) — çalışanla AYNI para biriminde olmalı."},"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000000000},"type":{"type":"string","enum":["payment","advance_refund"],"default":"payment","description":"payment = çalışana ödeme (kasadan çıkış, bakiye +) · advance_refund = çalışan avansı geri ödedi (kasaya giriş, bakiye −)."},"date":{"type":"string","description":"Varsayılan: şimdi."},"description":{"type":"string","minLength":1,"maxLength":500,"nullable":true}},"required":["account_id","amount"],"additionalProperties":false,"description":"Çalışan ödemesi / avans iadesi."},"Cheque":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["received","issued"],"description":"received = cariden ALINAN çek (müşteri evrakı) · issued = cariye VERİLEN kendi çekimiz."},"number":{"type":"string","nullable":true,"description":"Çek numarası."},"bank_name":{"type":"string","nullable":true,"description":"Çekin bankası."},"amount":{"type":"number"},"currency":{"type":"string","description":"Evrakın para birimi (ISO 4217)."},"issue_date":{"type":"string","description":"Düzenleme (keşide) tarih-saati."},"due_date":{"type":"string","description":"Vade (ISO 8601)."},"from_contact_id":{"type":"integer","nullable":true,"description":"Evrakı BİZE veren cari (alınan evrakta)."},"to_contact_id":{"type":"integer","nullable":true,"description":"Evrakı VERDİĞİMİZ cari (ciro ya da kendi evrakımızla ödeme)."},"status":{"type":"string","enum":["in_portfolio","in_collection","pledged","transferred","settled","bounced","protested","cancelled"],"description":"Para alanlarından TÜRETİLİR (yazılamaz). in_portfolio = elimizde · in_collection = tahsil için bankaya verildi (para henüz hareket etmedi) · pledged = bankaya teminat verildi (para hareket etmedi) · transferred = bir cariye verildi (alınan evrak ciro edildi ya da kendi evrakımız lehtara verildi) · settled = para hareket etti (alınan evrak kasaya tahsil edildi / kendi evrakımız hesaptan ödendi — `account_id`) · bounced = karşılıksız (borç cariye geri yazıldı) · protested = protesto edildi · cancelled = iptal."},"account_id":{"type":"string","format":"uuid","nullable":true,"description":"Paranın girdiği/çıktığı kasa-banka (tahsil/ödeme gerçekleştiyse)."},"collection_account_id":{"type":"string","format":"uuid","nullable":true,"description":"Tahsile/teminata verildiği banka hesabı (para henüz hareket etmedi)."},"invoice_id":{"type":"string","format":"uuid","nullable":true,"description":"Bağlı fatura (varsa)."},"collected_at":{"type":"string","nullable":true,"description":"Paranın gerçekten hareket ettiği an."},"sent_to_bank_at":{"type":"string","nullable":true,"description":"Tahsile/teminata verildiği an."},"protested_at":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","direction","number","bank_name","amount","currency","issue_date","due_date","from_contact_id","to_contact_id","status","account_id","collection_account_id","invoice_id","collected_at","sent_to_bank_at","protested_at","created_at"],"additionalProperties":false,"description":"Çek. Durum ve para etkisi tetikleyicide doğar; API durumu yalnız okur."},"ChequeCreate":{"type":"object","properties":{"direction":{"type":"string","enum":["received","issued"],"description":"received = cariden ALDIĞIMIZ çek (müşteri ödemesi: carinin borcu düşer, evrak portföye girer, kasa OYNAMAZ) · issued = cariye VERDİĞİMİZ kendi çekimiz (tedarikçiye ödeme: cari bakiyesi artar, kasa vadede ödenince oynar)."},"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Evrakı veren (received) ya da alan (issued) cari."},"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000000000},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 (varsayılan: carinin para birimi). Farklıysa kur, düzenleme tarihinin TCMB kurundan alınır."},"issue_date":{"type":"string","description":"Düzenleme (keşide) tarihi (varsayılan: şimdi)."},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Vade (YYYY-MM-DD)."},"number":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Çek numarası (mükerrer numara REDDEDİLMEZ — kendi tarafınızda denetleyin)."},"bank_name":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Çekin bankası."}},"required":["direction","contact_id","amount","due_date"],"additionalProperties":false,"description":"Çek kaydı (alınan ya da verilen)."},"PromissoryNote":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["received","issued"],"description":"received = cariden ALINAN senet (müşteri evrakı) · issued = cariye VERİLEN kendi senetimiz."},"number":{"type":"string","nullable":true,"description":"Senet numarası."},"bank_name":{"type":"string","nullable":true,"description":"Banka (senetlerde genellikle boş)."},"amount":{"type":"number"},"currency":{"type":"string","description":"Evrakın para birimi (ISO 4217)."},"issue_date":{"type":"string","description":"Düzenleme (keşide) tarih-saati."},"due_date":{"type":"string","description":"Vade (ISO 8601)."},"from_contact_id":{"type":"integer","nullable":true,"description":"Evrakı BİZE veren cari (alınan evrakta)."},"to_contact_id":{"type":"integer","nullable":true,"description":"Evrakı VERDİĞİMİZ cari (ciro ya da kendi evrakımızla ödeme)."},"status":{"type":"string","enum":["in_portfolio","in_collection","pledged","transferred","settled","bounced","protested","cancelled"],"description":"Para alanlarından TÜRETİLİR (yazılamaz). in_portfolio = elimizde · in_collection = tahsil için bankaya verildi (para henüz hareket etmedi) · pledged = bankaya teminat verildi (para hareket etmedi) · transferred = bir cariye verildi (alınan evrak ciro edildi ya da kendi evrakımız lehtara verildi) · settled = para hareket etti (alınan evrak kasaya tahsil edildi / kendi evrakımız hesaptan ödendi — `account_id`) · bounced = karşılıksız (borç cariye geri yazıldı) · protested = protesto edildi · cancelled = iptal."},"account_id":{"type":"string","format":"uuid","nullable":true,"description":"Paranın girdiği/çıktığı kasa-banka (tahsil/ödeme gerçekleştiyse)."},"collection_account_id":{"type":"string","format":"uuid","nullable":true,"description":"Tahsile/teminata verildiği banka hesabı (para henüz hareket etmedi)."},"invoice_id":{"type":"string","format":"uuid","nullable":true,"description":"Bağlı fatura (varsa)."},"collected_at":{"type":"string","nullable":true,"description":"Paranın gerçekten hareket ettiği an."},"sent_to_bank_at":{"type":"string","nullable":true,"description":"Tahsile/teminata verildiği an."},"protested_at":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","direction","number","bank_name","amount","currency","issue_date","due_date","from_contact_id","to_contact_id","status","account_id","collection_account_id","invoice_id","collected_at","sent_to_bank_at","protested_at","created_at"],"additionalProperties":false,"description":"Senet. Durum ve para etkisi tetikleyicide doğar; API durumu yalnız okur."},"PromissoryNoteCreate":{"type":"object","properties":{"direction":{"type":"string","enum":["received","issued"],"description":"received = cariden ALDIĞIMIZ senet (müşteri ödemesi: carinin borcu düşer, evrak portföye girer, kasa OYNAMAZ) · issued = cariye VERDİĞİMİZ kendi senetimiz (tedarikçiye ödeme: cari bakiyesi artar, kasa vadede ödenince oynar)."},"contact_id":{"type":"integer","exclusiveMinimum":true,"minimum":0,"description":"Evrakı veren (received) ya da alan (issued) cari."},"amount":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":1000000000000},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 (varsayılan: carinin para birimi). Farklıysa kur, düzenleme tarihinin TCMB kurundan alınır."},"issue_date":{"type":"string","description":"Düzenleme (keşide) tarihi (varsayılan: şimdi)."},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Vade (YYYY-MM-DD)."},"number":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Senet numarası (mükerrer numara REDDEDİLMEZ — kendi tarafınızda denetleyin)."},"bank_name":{"type":"string","minLength":1,"maxLength":64,"nullable":true,"description":"Banka (senette genellikle boş)."}},"required":["direction","contact_id","amount","due_date"],"additionalProperties":false,"description":"Senet kaydı (alınan ya da verilen)."},"PageMeta":{"type":"object","required":["page","per_page","total","has_more"],"properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer","description":"Süzgece uyan toplam kayıt."},"has_more":{"type":"boolean","description":"Sonraki sayfa var mı."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","enum":["bad_request","unauthorized","forbidden","insufficient_scope","ip_not_allowed","account_disabled","module_required","subscription_expired","not_found","validation_failed","confirmation_required","limit_reached","conflict","business_rule","e_document_not_configured","insufficient_credits","idempotency_conflict","idempotency_mismatch","rate_limited","server_error"],"description":"Sözleşme — buna göre dallanın."},"message":{"type":"string","description":"İnsan için açıklama (Türkçe)."},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Alan bazında doğrulama hataları."},"warnings":{"type":"array","items":{"type":"string"},"description":"confirmation_required: onay gerektiren uyarılar."},"required_scope":{"type":"string","description":"insufficient_scope: gereken kapsam."},"reason":{"type":"string","description":"İç hata kodu — bilgi amaçlı, değişebilir."},"request_id":{"type":"string"}}}}}}},"x-scopes":{"company:read":"Firma bilgilerini okuma","contacts:read":"Carileri (müşteri/tedarikçi) okuma","contacts:write":"Cari oluşturma ve güncelleme","products:read":"Ürün ve hizmetleri okuma","products:write":"Ürün ve hizmet oluşturma ve güncelleme","accounts:read":"Kasa ve banka hesaplarını okuma","invoices:read":"Faturaları (satış, alış, iade) ve e-belge durumlarını okuma; PDF/XML indirme","invoices:write":"Fatura ve iade faturası oluşturma, silme, muhasebe iptali","e_documents:send":"e-Fatura / e-Arşiv / e-İrsaliye olarak GİB'e GÖNDERME ve e-Arşiv iptali (geri alınamaz işlemler)","payments:read":"Tahsilat ve ödemeleri okuma","payments:write":"Tahsilat ve ödeme kaydetme, silme","offers:read":"Teklif ve proformaları okuma","offers:write":"Teklif/proforma oluşturma, silme, faturalama","incoming_e_invoices:read":"Gelen e-Faturaları (tedarikçilerden) okuma; PDF/XML indirme","incoming_e_invoices:answer":"Gelen TİCARİ e-Faturayı kabul etme ya da reddetme (hukuki, geri alınamaz işlem)","expenses:read":"Masrafları ve masraf türlerini okuma","expenses:write":"Masraf kaydetme ve silme","despatches:read":"İrsaliyeleri okuma; e-İrsaliye PDF/XML indirme","despatches:write":"Giden irsaliye oluşturma ve silme (stok hareketi doğurur)","employees:read":"Çalışanları, maaş tahakkuklarını, çalışan ödemelerini ve çalışan ekstresini okuma","employees:write":"Çalışan oluşturma ve güncelleme; maaş tahakkuku, çalışan ödemesi ve avans iadesi kaydetme (ödeme kasayı değiştirir)","cheques:read":"Çek ve senetleri okuma","cheques:write":"Çek ve senet kaydetme (alınan ya da verilen evrak — cari bakiyesini değiştirir)","events:read":"Olay kaydını okuma (/v1/events) — yalnız diğer okuma kapsamlarının izin verdiği olay türleri","webhooks:manage":"Webhook uçlarını yönetme — yalnız diğer okuma kapsamlarının izin verdiği olaylara abone olunur"}}