How to integrate OFAC screening into a payment API
Add a screening call before payment processing so every transaction passing through your API is checked against sanctions data first.
TL;DR
TL;DR: Insert a screening request at the top of your payment endpoint, block on a flagged result, and only proceed to settlement when the counterparty comes back clean.
Placement and flow
The screening call should be the first step in the payment handler, before any ledger update or settlement. Send the counterparty's wallet address or name to the screening endpoint, then branch: a clean result continues the transaction, while a flagged result returns a blocked response without moving funds.
Latency and reliability
A screening API that answers in under 100 ms keeps the added overhead below the threshold most payment flows can tolerate. Treat the check as a hard gate rather than a best-effort log, because OFAC sanctions carry strict liability and intent is not required for a violation.
A practical pattern
Use a dedicated tool such as sanctions_check for the lookup and risk_score when you need a richer view. The decision comes back as ALLOW or BLOCK. SanctionsAI exposes this as one HTTP call with no key required on the free tier, making the integration a small, testable step in your codebase.