Why this matters
This lesson is learning text, not legal advice; counsel and tax sign-off are pending (issue 3, OD-05). A Turkish marketing platform touches regulated personal data, commercial messages, third-party marketplace money and business-to-business taxes on every screen, so one shortcut can trigger administrative fines or unlicensed-payment enforcement. In Wave 45, an independent review found that hashing every address field broke Google's plain-text address contract, forcing an explicit owner decision (OD-15) instead of a quiet engineering guess. Nothing here is deployed yet, zero live Turkish personal data is stored and zero live marketplace money moves until written legal and sworn financial adviser (YMM) sign-offs close on issue 3. After reading this lesson, you will be able to compute the withholding on a Turkish marketing invoice by hand and list the exact questions counsel must answer before launch.
The ideas
Turkish privacy, messaging, payment and tax statutes decide where the database sits, what data may leave the server, whose bank account touches marketplace money and which sellers may join.
KVKK: controller, processor, consent and why hashing is not anonymisation
Every Turkish store tracking orders or buyer phone numbers falls under KVKK (Law No. 6698, Kişisel Verilerin Korunması Kanunu), which separates three roles:
- The data subject (ilgili kişi) is the living individual—the shopper or clinic patient.
- The data controller (veri sorumlusu) decides why and how data is used. For a store's buyer list, the store is the controller.
- The data processor (veri işleyen) acts strictly on the controller's instructions under a written data processing agreement (Veri İşleme Sözleşmesi), so Meta or Google event forwarding happens strictly on the store's instruction.
Before forwarding shopper details for marketing measurement, the controller must show a privacy notice (Aydınlatma Metni) and record explicit consent (açık rıza): informed, freely given permission for one stated purpose. Pre-ticked boxes and bundled terms never qualify, and per-purpose consent keeps purposes separate—order updates never authorise promotional WhatsApp messages or ad-conversion uploads.
Many server-side tracking vendors falsely claim that SHA-256 hashing makes an e-mail or phone number "anonymous and consent-free". Under KVKK and GDPR, hashing is pseudonymisation (takma adlandırma): it hides plaintext in a leaked table, yet remains regulated personal data because Meta and Google match the same hash straight back to real user accounts. True anonymisation (anonim hale getirme) breaks linkability permanently—for instance, reporting that 120 unnamed buyers bought boots in November.
In plain words
The consent gate and platform hashing code live in Lesson 07.
Cross-border transfers and database residency
Recurring transfers of personal data outside Turkey trigger KVKK Article 9 (reformed by Law No. 7499, effective 1 June 2024). With no adequacy decision covering the EU or US as of late 2026, continuous hosting abroad cannot use an incidental-transfer exception. Each Turkish controller must execute the authority's unmodifiable standard contractual clauses (SCC, standart sözleşme) and notify standartsozlesme.kvkk.gov.tr within five business days; failing to notify carries a revalued 2026 administrative fine band of ₺90,308 to ₺1,806,177 (docs/COUNSEL-BRIEF.md).
That is why data residency (OD-04) is a commercial choice as well as an infrastructure choice. Hosting live Turkish tenant databases in Germany (~€44/month) forces every online sign-up to file a five-day KVKK standard contract. Hosting live Turkish tenant databases in Turkey (TR_LOCAL) keeps storage domestic while leaving non-PII staging on a cheap European server with sample data only.
Two caveats stay open for counsel (C1–C3): edge hostnames (track.<domain>) traverse Cloudflare Workers and transactional e-mails traverse Resend, so counsel must confirm whether ephemeral transit or zero-PII relays need sub-processor SCCs; and when a store connects Meta or Google, consented hashed events still leave Turkey on the store's controller instruction.
Erasure against statutory retention duties
Under KVKK Article 7, a data subject can request erasure (silme) when consent is withdrawn. A naive SQL DELETE causes resurrection: the next storefront sync re-imports the old order and revives the deleted contact. Wiping encrypted e-mail and phone ciphertexts while leaving a minimal erasure tombstone (erased_at) blocks future feedback and merges permanently with zero raw personal data stored.
Meanwhile, Turkish statutes mandate statutory retention: five years for tax records (Tax Procedure Law, VUK Article 253) and ten years for commercial books (Turkish Commercial Code, TTK Article 82). When a workspace asks for full erasure during an unsettled payment or open tax duty, a fiscal hold blocks destructive key shredding and offboarding while still permitting consent revocation or pseudonymisation so marketing stops immediately. Counsel must confirm the exact reconciliation on issue 3.
Commercial messages under ETK, İYS and WhatsApp windows
Promotional SMS, e-mails, voice calls and messaging-app campaigns are governed by ETK (Law No. 6563). Senders must record opt-ins and check refusals in Turkey's Message Management System, İYS, before sending any commercial electronic message; opt-outs must be free, unconditional and override any open chat window.
WhatsApp Business Cloud API adds two separate clocks that teams routinely mix up:
| Rule | Window | What it allows | Common mistake |
|---|---|---|---|
Customer service window (CSW) | 24h from customer's last message | Free-form text without a template | Assuming a free entry point extends free-form chat past 24h |
Free entry point (FEP) | 72h after replying within 24h to a Click-to-WhatsApp ad | Waives per-message template fees for 72h | Sending free-form text at hour 30 instead of a template |
| Quiet hours (product rule) | 21:00–09:00 fixed Turkey time (UTC+3) | Defers promotional templates until 09:00 TRT | Night-time blasts that trigger user blocks and pauses |
If a buyer clicks a Click-to-WhatsApp ad Monday 10:00 and the business replies at 10:15, the 24-hour CSW closes Tuesday 10:00 while the 72-hour FEP fee waiver runs until Thursday 10:15. At Tuesday 16:00 (hour 30), free-form text is forbidden—only an approved message template may go out, at ₺0 WhatsApp fee. Under per-message pricing, paid templates accrue cost strictly upon confirmed carrier delivery (carrier_delivered or read_confirmed), never when queued or HTTP 200 accepted.
Law 6493: why the company never pools money and how safeguarded payments work
Under Law 6493, supervised by the Central Bank of Turkey (TCMB), holding or forwarding third-party funds without a payment-institution licence is unlawful. Taking custody of funds—collecting a client's ₺22,000 retainer into the company bank account and wiring the marketer later—crosses that line immediately. Even relying on Law 6493's narrow m.12/2-b commercial-agent exemption carries enforcement risk under m.12/5 and triggers mandatory TCMB reporting above ₺50,000,000 rolling volume.
All marketplace checkouts therefore route through a TCMB-licensed split-payment API: iyzico Pazaryeri in Release 1 (PayTR planned for Release 2; Stripe Connect Express deferred to Release 3 under a foreign entity per OD-11). In a safeguarded payment (korumalı ödeme):
SMB card checkout (₺25,080.00)
|
v
iyzico Pazaryeri protection account (koruma hesabı — off our balance sheet, ₺0 float)
|
+-- Owner approves milestone (or T+5 business days with no dispute)
| +--> Marketer IBAN: ₺22,748.00 (subMerchantPrice)
| +--> Platform IBAN: ₺2,112.00 (₺1,760 fee + ₺352 VAT)
| + ₺220.00 segregated 1% stopaj liability (GİB 360 Muhtasar)
+-- Owner disputes before T+5 -> item disapprove -> funds stay heldBuyer funds never sit on the software company's balance sheet (₺0 float income), and under OD-13 all public surfaces say "safeguarded payments" (korumalı ödeme) rather than unqualified custody promises until counsel signs off on issue 3.
Who may sell on the marketplace: VUK 234 commercial entities only
A business cannot lawfully pay an unregistered freelancer a recurring monthly retainer via an expense voucher (gider pusulası, VUK Article 234). VUK 234 covers occasional non-recurring work (arızi kazanç); monthly ad retainers create tax continuity (süreklilik), exposing buyer and platform to reclassification and special irregularity fines (recorded in docs/COUNSEL-BRIEF.md as starting at ₺17,000 per document in 2026). Additionally, iyzico locks sub-merchant types immutably at creation, and VUK 589 makes e-Arşiv mandatory for all commercial invoices from 1 January 2027.
Release 1 therefore accepts verified commercial entities only:
- Allowed: Active Turkish sole proprietorships (
Şahıs Şirketi→PRIVATE_COMPANY, typically NACE73.11.01) and companies (Ltd. Şti./A.Ş.→LIMITED_OR_JOINT_STOCK_COMPANY), with verified tax registration, activee-Faturaore-Arşiv, corporate IBAN and MFA. - Rejected in Release 1: Unregistered
PERSONALaccounts, gider pusulası applicants and independent e-SMM profiles (whose separate 20% buyer-withheld income tax breaks uniform checkout math; questionC10). - 2026 honesty rule: Never advertise sole-proprietorship setup as "free Bağ-Kur". Law No. 7566 abolished the one-year Treasury Bağ-Kur subsidy effective 1 January 2026, leaving only the
₺400,000/yearthree-year income-tax exemption for eligible under-29 founders.
Turkish marketplace tax math: KDV, 3/10 VAT withholding and 1% e-commerce withholding
Three Turkish taxes combine on every milestone, computed server-side in exact BigInt kuruş and integer basis points (10,000 = 100%)—never binary floats (Lesson 03):
- 20% VAT (
KDV,2,000bps): On the VAT-excluded tax base (matrah). - 3/10 VAT withholding (
KDV tevkifatı,3,000bps, GİB code624): Commercial ad management billed to KDV-registered businesses triggers3/10partial VAT withholding whenever the VAT-inclusive total exceeds₺12,000(1,200,000kuruş in 2026). The buyer pays3/10of the VAT directly on a KDV-2 return and7/10at checkout. Below₺12,000VAT-inclusive, withholding is0. - 1% e-commerce withholding (
%1 e-ticaret stopajı,100bps): Under Presidential Decree 9284 and Communiqué 330, intermediary platforms withhold1%strictly on the VAT-excluded matrah, before deducting platform or card fees, remitting monthly via Muhtasar; the marketer credits (mahsup) it against income or corporate tax.
Compare a ₺22,000 Month-1 retainer (above ₺12,000 VAT-inclusive) against a ₺9,500 7-day sprint (below ₺12,000 VAT-inclusive):
| Line item | ₺22,000 M1–3 Retainer (8% fee) | ₺9,500 7-Day Sprint (10% fee) | Exact formula (integer kuruş) |
|---|---|---|---|
| Service ex-VAT (matrah) | ₺22,000.00 (2,200,000) | ₺9,500.00 (950,000) | gross_service_minor |
Calculated VAT (20%) | ₺4,400.00 (440,000) | ₺1,900.00 (190,000) | mulBpsHalfUp(matrah, 2000) |
VAT-inclusive check (> ₺12,000) | ₺26,400.00 (active) | ₺11,400.00 (off) | gross_incl_vat > 1_200_000n |
Less 3/10 VAT withholding (KDV-2) | −₺1,320.00 (132,000) | ₺0.00 (0) | mulBpsHalfUp(vat, 3000) or 0n |
| Payable VAT at checkout | ₺3,080.00 (308,000) | ₺1,900.00 (190,000) | vat_total - kdv_tevkifat |
Exact iyzico checkout charge | ₺25,080.00 (2,508,000) | ₺11,400.00 (1,140,000) | matrah + kdv_payable |
Less 1% e-commerce withholding | −₺220.00 (22,000) | −₺95.00 (9,500) | mulBpsHalfUp(matrah, 100) |
| Less platform fee (ex-VAT) | −₺1,760.00 (176,000) | −₺950.00 (95,000) | min(mulBpsHalfUp(matrah, bps), cap) |
Less 20% VAT on platform fee | −₺352.00 (35,200) | −₺190.00 (19,000) | mulBpsHalfUp(platform_fee, 2000) |
| Net cash to marketer IBAN | ₺22,748.00 (2,274,800) | ₺10,165.00 (1,016,500) | checkout - stopaj - fee - fee_vat |
| Balance check | ₺25,080.00 (0 drift) | ₺11,400.00 (0 drift) | Must equal checkout_charge_minor |
Under two-leg invoicing, the marketer issues Leg 1 (e-Fatura/e-Arşiv) directly to the store for ₺22,000 (₺1,320 KDV-2, ₺25,080 payable), while the platform issues Leg 2 (20% standard VAT, zero advertising withholding) to the marketer for its ₺1,760 commission (+ ₺352 VAT = ₺2,112), keeping gross marketer GMV off platform revenue. On an ₺80,000 Founding Cohort (4.5%) retainer, uncapped ₺3,600 hits the ₺3,500 monthly cap (+ ₺700 VAT), paying ₺86,200 to the marketer.
Honest billing: one-click cancellation and zero ad-spend markup
Two product rules bridge legal trust and business design (R6, N3, N11, OD-09): one-click subscription cancellation with zero phone calls or trial auto-charges, and 0% markup on customer ad spend. Pricing and unit economics sit in Lesson 14.
How this repository does it
All controls below are built and verified locally on this branch; none is deployed, and external sign-offs remain open on issue 3.
- Tax math, VUK 234 gate and two-leg drafts (
built,verifiedlocally):packages/payments/src/tr-tax-ledger.tsandpackages/shared/src/turkish-tax.tsimplementcalculateTurkishTaxBreakdown,assertMilestoneTaxInvariants,evaluateCommercialTaxEligibility,mapToIyzicoSubMerchantType,buildTwoLegInvoiceDraftsandSafeguardedPaymentLedgerin pureBigIntkuruş. RemovingassertMilestoneTaxInvariantswould permit checkout-to-invoice drift; SQLCHECKconstraints onescrow_milestonesindocs/schema.sqldouble-check the same three identities. - Payment port and live-GMV lock (
built,verifiedlocally in sandbox):packages/payments/src/iyzico-adapter.tsimplementsSafeguardedPaymentProvider(iyzico_pazaryerisandbox adapter withX-IYZ-SIGNATURE-V3HMAC check and 300-second skew cap, pluspaytr_pazaryeriandstripe_connectstubs). Live mode without two distinct written sign-off references (counselSignOffRefandymmSignOffRef) throwsLiveGmvGateError. - KVKK consent, erasure pre-flight and retention (
built,verifiedlocally):docs/schema.sqldefinesworkspaces.kvkk_residency,consent_grants,crm_contacts.erased_at,enforce_conversion_feedback_consent()andvault.sub_merchants(blockingPERSONALrows).apps/api/src/routes/settings-kvkk-consent-erasure-preflight.tsenforces an ordered HTTP422refusal hierarchy with zero DB writes;apps/api/src/routes/audit-log-retention-ledger.tstracks 5-year VUK and 10-year TTK floors;packages/vault/src/crypto-shred.tshandles key destruction. - WhatsApp windows, ETK consent and ad-copy guardrails (
built,verifiedlocally):packages/signals/src/whatsapp-window-state.tsenforces24hCSW,72hFEP pricing waiver, delivered-only PMP billing,21:00–09:00 TRTquiet hours,2/24hand5/7dcaps and reassignment suppression.packages/signals/src/delivery-state-machine.tsenforces per-purpose consent and the dual-approvedtransactional_legalexception.packages/ai/src/ad-copy-guardrails.tschecks Turkish clinic and consumer copy against Law 6502 and Ministry of Health rules. - Finance-copy gate and compliance views (
built,verifiedlocally):tools/check-turkish-finance-copy.mjsblocks unqualified custody words, guaranteed-ROAS promises, float money math and fabricated sign-offs, and pins450 bpsand350_000n. Read-only surfaces live inapps/api/src/routes/marketers-settlement-readiness.ts,apps/api/src/routes/settlement-reconcile.ts,apps/api/src/routes/exports.tsandapps/web/src/app/compliance/page.tsx.
Not built yet
Before Gate A (SaaS) or Gate B (marketplace GMV) opens under OD-05, external advisers must sign off on C1–C10 in docs/COUNSEL-BRIEF.md: C1–C3 (KVKK counsel: Turkey DB plus Cloudflare/Resend transit, EU fallback SCCs, DPA and Meta/Google controller instructions) and C4–C10 (fintech counsel and YMM: Law 6493 plus 1% stopaj slice, T+5 release and disputes, 3/10 VAT scope, two-leg invoicing, ETAHS/ETBİS and Muhtasar refunds, VUK 234 entity-only rule, and Release 1 e-SMM exclusion).
What went wrong once
Three real Wave 45–48 defects showed how privacy rules collide with ad-platform protocols in code.
1. Hashing every field broke Google's address format (CS-06, OD-15)
- What happened: The pipeline SHA-256-hashed
regionCodeandpostalCodeand sent partial addresses to Google Data Manager, violating Google's requirement for plain country/postal codes and all four address fields together. - How it was noticed: The Wave 45 independent review (
docs/INDEPENDENT-REVIEW-2026-12-02.md,S-1) compared the payload to Google's specification. - Fix:
docs/wave45/reports/B-REPORT.mdrestricted addresses to complete four-field sets passed only in flight (never stored), keeping persisted rows to hashed e-mail and phone and throwing if a 64-hex hash enters a plain slot. - Lesson: When privacy minimisation and matching collide, escalate as an explicit owner decision (
OD-15, still open on its safe default) rather than guessing silently.
2. An unused split phone hash dropped valid batches (CS-08)
- What happened: The edge collector forwarded browser-sent
phone_country_code_hashandphone_local_hashfields verbatim, causing the strict ingest schema to reject entire batches with HTTP400. - How it was noticed: Two of four Wave 45 end-to-end cases failed (
docs/wave45/reports/B-REPORT.md). - Fix: Because pre-split hashes can never rebuild Meta's or Google's combined phone digest, the collector validates and drops them at the edge while ingest stays strict.
- Lesson: KVKK data minimisation means never forwarding fields with no stated purpose, and testing both sides of strict schemas together.
3. A real Chrome user agent tripped the raw-IP privacy guard (CS-49)
- What happened: Meta requires unhashed
client_user_agenton website events (S-5). Real Chrome strings (Chrome/120.0.0.0) matched an IPv4 regex, causing the raw-PII scanner and collector guard to block valid events asraw_ip. - How it was noticed: A Wave 48 probe test with a real Chrome user agent failed immediately (
docs/wave48/reports/A-REPORT.md). - Fix: The scanner carved a one-key exception for IPv4 patterns under
client_user_agentonly, paired with<= 512char, control-character, e-mail, phone and IBAN guards, storing the string only on consented Meta web rows and clearing it post-dispatch. - Lesson: Never turn off a privacy guard when it blocks valid traffic—carve the narrowest documented exception with sibling checks.
Try it yourself
Run all four read-only commands from the repository root in Windows PowerShell (or Git Bash for the node steps). None calls external APIs or touches ports 3000, 4000 or 5432.
Step 1: Run the Turkish tax, entity-gate and safeguarded-payment tests
node --test packages/payments/test/payments.test.mjsExpect 25 passing tests (fail 0) across 5 suites verifying integer-kuruş math, SQL invariants, VUK 234 checks, LiveGmvGateError and the five decoupled state machines.
Step 2: Run the finance copy and zero-float compliance gate
node tools/check-turkish-finance-copy.mjsExpect five [PASS] lines covering UI copy, zero parseFloat/.toFixed in payments, honest pending status for OD-01 and issues 3, 4 and 21, and 450 bps / 350_000n parity.
Step 3: Compute a ₺22,000 retainer and a ₺9,500 sprint directly
node --input-type=module -e "import { calculateTurkishTaxBreakdown } from './packages/payments/src/tr-tax-ledger.ts'; for (const cfg of [{ grossServiceMinor: 2200000n, billingModel: 'monthly_retainer', retainerMonthIndex: 1 }, { grossServiceMinor: 950000n, billingModel: 'fixed_sprint' }]) { const r = calculateTurkishTaxBreakdown(cfg); console.log(cfg.billingModel, 'checkout:', r.checkoutChargeMinor.toString(), 'tevkifat:', r.kdvTevkifatMinor.toString(), 'stopaj:', r.ecommerceStopajMinor.toString(), 'fee:', r.platformFeeMinor.toString(), 'payout:', r.subMerchantPayoutMinor.toString()); }"Expect exact integer-kuruş output:
monthly_retainer checkout: 2508000 tevkifat: 132000 stopaj: 22000 fee: 176000 payout: 2274800
fixed_sprint checkout: 1140000 tevkifat: 0 stopaj: 9500 fee: 95000 payout: 1016500Verify by hand: 2274800 + 22000 + 176000 + 35200 = 2508000, and 1016500 + 9500 + 95000 + 19000 = 1140000 (0 drift).
Step 4: List the ten open legal and tax questions awaiting sign-off
Select-String -Path docs/COUNSEL-BRIEF.md -Pattern '^\| \*\*C\d+' | Select-Object -ExpandProperty LineExpect ten rows (C1–C10) showing the adviser, topic and gated launch step.
Check yourself
0 / 6A teammate suggests skipping KVKK consent for Meta CAPI because the collector hashes e-mails and phones with SHA-256 and never stores plaintext. Why is that rejected?
A KDV-registered store hires a commercial marketer for a ₺10,500 (ex-VAT) ad-management retainer. Does 3/10 VAT withholding apply, and what is the checkout charge?
On a ₺22,000 (ex-VAT) Month-1 retainer (8% platform fee = ₺1,760), what is the 1% e-commerce withholding (stopaj)?
A shopper clicks a Click-to-WhatsApp ad Monday 10:00 and the store replies at 10:15. At Tuesday 16:00 (hour 30), can the store send a free-form message?
An unregistered freelancer asks to bill a monthly retainer using a gider pusulası (VUK 234). Why does onboarding refuse them?
A workspace owner requests cryptographic_shred_request erasure while one safeguarded milestone is unsettled (active_fiscal_holds = 1). What must the pre-flight gate do?
Words to know
30Go deeper
In this repository
docs/COUNSEL-BRIEF.md: open questionsC1–C10and worked kuruş tables pending issue 3.docs/OWNER-DECISIONS.md:OD-04,OD-05,OD-11,OD-13and openOD-15.docs/adr/0006-iyzico-pazaryeri-and-turkish-tax-ledger.mdanddocs/adr/0007-kvkk-consent-gate-and-db-residency.md: payment, tax and KVKK residency architecture decisions.docs/REGULATORY-COMPLIANCE-MAPPING-KVKK-6493-VUK-TR.md,docs/KVKK-AYDINLATMA-DRAFT.mdanddocs/AUDIT-LOG-RETENTION-AND-EVIDENCE-POLICY-TR.md: control mapping, draft privacy notice and VUK/TTK retention policy.
Archived wave-by-wave lessons replaced
03-kvkk-etk-iys-and-whatsapp-windows.md- Archived lesson 04, on marketplace payments and tax, in
the archive index 24-zero-echo-api-security-settlement-readiness-and-structured-data-governance.md28-signal-freshness-sla-budget-rebalance-walls-and-compliance-mapping.md33-unit-economics-t071-kvkk-retention-and-allocation-math.md
Official external documentation
- Personal Data Protection Authority (KVKK): Law No. 6698, Article 7 erasure and Article 9 SCC guidance.
- Presidency of Turkey Legislation System: Laws 6698 (KVKK), 6493, 6563 (ETK), 6502, 213 (VUK) and 6102 (TTK).
- Revenue Administration (GİB) and GİB e-Belge Portal:
3/10VAT withholding,1%e-commerce withholding and VUK 509/589 e-Belge rules. - Central Bank of Turkey (TCMB): Law 6493 payment-institution licensing.
- Message Management System (İYS): commercial message consent and opt-out registry.
- iyzico Developer Docs: Pazaryeri sub-merchants, split checkout and webhook signatures.
- Meta WhatsApp Cloud API: 24-hour CSW, 72-hour FEP and per-message pricing.
- EU GDPR: pseudonymisation (Recital 26) and erasure (Article 17).