Tax ID verification provider FAQ

Tax ID verification on Turtini uses a swappable provider abstraction. Today's providers, in priority order:

1. **Middesk** (primary, full KYB) — when MIDDESK_API_KEY is set in Firebase secrets, all paid verifications run through Middesk. Returns TIN match + Secretary of State + watchlists + officers + liens + bankruptcies + business age. Cost: ~$5/check (platform charges +15% = ~$5.75 to org).

2. **Tax1099** (fallback, TIN-only) — when only TAX1099_API_KEY is set. Returns IRS TIN match only — no SoS or watchlists. Cost: ~$0.50/check (~$0.58 to org).

3. **Stub** (dev fallback) — runs when no provider key is set. Deterministic match/mismatch based on EIN digit-sum. Free; never used in production.

Provider selection is automatic — the system picks the first one whose secret is set. Setting MIDDESK_API_KEY (even sandbox) means everything runs through Middesk.

Stripe Connect KYB is independent of these providers. It runs whenever an org completes Stripe Connect onboarding, mirrored via the account-updated webhook. It's free, automatic, and IRS-authoritative for the EIN. The provider abstraction is a fallback for orgs that don't use Stripe Connect.

To swap to a different provider (e.g. Sigma or Persona), add a new TaxIdVerificationProvider object to functions/src/taxIdVerification.ts and update getTaxIdProvider(). The cost lookup table PROVIDER_COST_CENTS controls the chargeback amount per provider.