The talent graph's recruiter monetization was designed (Opportunity → Pilot →
Proof funnel) but never wired to charge. This adds the placement/candidate-unlock
revenue engine on top of the existing talent graph, charged through Creem (a
merchant-of-record with Turkey-based-seller payout support — the portfolio
standard used by bidstage/CalDesk), not Polar/Stripe.
Revenue gate: a recruiter (opportunity owner) unlocks a matched candidate's
contact + full evidence. Gating mirrors the referral gate (owner-only, no
self-unlock, candidate must have real matching evidence). The fee is charged via
a Creem checkout whose custom_price is the exact computed fee, and settled by the
signed checkout.completed webhook, which records the entitlement + receipt.
- Fee math (pure, configurable): flat unlock access fee (TALENT_UNLOCK_FEE_CENTS,
default $49) or a percentage placement success fee (rate + min/max clamps) when
a placement amount is supplied.
- New TalentPlacement model + migration: entitlement/receipt with a compound
unique key (opportunity, candidate, recruiter) for charge idempotency and a
unique providerOrderId; provider defaults to creem.
- Creem adapter (createCreemCheckout) mirroring the reviewed bidstage lib/creem.ts,
and a signed Creem webhook route (HMAC-SHA256, timing-safe) that settles
placements. Amount is revalidated against the quoted fee before unlocking.
- Routes: POST/GET /talent-graph/opportunities/:id/unlocks and gated
GET .../candidates/:candidateId/contact (402 until paid).
- Errors.paymentRequired (402) helper.
- Tests: fee math, gating, charge idempotency, and the signed webhook settlement
path (75 tests). Secrets are env-only (CREEM_API_KEY, CREEM_WEBHOOK_SECRET,
CREEM_PRODUCT_ID) — none committed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>