KYC flow
Most flows require validating a user’s Know Your Customer (KYC) level before creating an order. The high-level steps are:
Call Get user KYC state with a user's email and a country.
If
requiredKycTypeis non-null and higher thanpassedKycType, the user has already crossed an aggregate threshold and must upgrade KYC before further orders. Skip to step 5.Otherwise, inspect
kycSettingsto determine whether the order you're about to create triggers a per-order rule:Match settings where
operationTypeandcurrencyTypealign with the order side you care about.For per-order entries (
min/maxset), check whether the order's USD value falls in[min, max).Take the highest
typeamong all matching entries.
If
passedKycTypeis already at or above the required tier, proceed to quoting and order creation.Otherwise, pick the document from
kycDocumentswhosetypematches the required tier, collectrequiredFieldsfrom the user, and submit via Submit user KYC. The response is the same shape as Get user KYC state.Poll Get user KYC state until
currentKycStatus === "approved"andpassedKycTypereaches the required tier. (For Nigerian advanced KYC,currentKycPhasetransitions frombvn_checktoimages_checkinternally — no extra action needed.)
Note on amount-based pre-checks: requiredKycType reflects only the user's lifetime successful order history (aggregate rules). It does not account for the size of the next order. To pre-check whether a specific upcoming order will trip a per-order rule, evaluate kycSettings yourself as described in step 3.
Tip: In the sample below, a per-order rule requires advanced KYC for any single crypto payout of $100 or more, and an aggregate rule requires advanced once the user's lifetime successful crypto payouts exceed $1,000.
Response fields
passedKycType("basic" | "advanced" | null) — the highest KYC tier the user has already passed.reachedKycLimit(boolean) —truewhen the user has too many pending KYC submissions and cannot initiate another until existing ones resolve.requiredKycType("basic" | "advanced" | null) — server-computed required tier based on the user's lifetime successful order history (aggregate rules only). If non-null and higher thanpassedKycType, the user must upgrade KYC.nullmeans no aggregate rule is forcing an upgrade — a per-order rule inkycSettingsmay still apply to the next order.currentKycType("basic" | "advanced" | undefined) — the tier of the user's latest in-flight KYC submission.currentKycStatus("initiated" | "approved" | "rejected" | "invalid" | null) — status of the latest KYC submission.currentKycStatusDescription(string | null) — human-readable reason for the current status.currentKycPhase("bvn_check" | "images_check" | undefined) — set only for Nigerian advanced KYC. Internal sub-step of an advanced verification. Merchants submit all fields (including images) in a single call; phases progress internally. Use only for progress UI.kycDocuments— list of documents available for the country, each with_id,type,title,value, and arequiredFieldsarray.kycSettings— list of KYC rules for the country. Two variants coexist:Per-order —
minandmaxare set. The rule fires when the order's USD value on the matchingoperationType+currencyTypeside is in[min, max).maxmay be"Infinity".Aggregate —
maxOrdersCountand/ormaxAmountUsdare set. The rule fires once the user's lifetime successful order count or USD volume in that(operationType, currencyType)bucket reaches the threshold. This is whatrequiredKycTypereflects.All settings carry
operationType,currencyType, andtype(required KYC tier). When multiple fire, the highesttypewins.
Sample Get user KYC state response
The "advanced" KYC document requires images. Submit them as an array of objects with image_type_id and image URL. Image URLs must be publicly accessible or contain the image data as a base64-encoded string. The "image_type_id" can accept the following values:
0: Selfie
1: Document front
5: Document back
Sample Submit user KYC request
The Submit response has the same shape as Get user KYC state. Continue polling Get user KYC state until currentKycStatus becomes approved and passedKycType reaches the required tier, then proceed with quoting and order creation.
Last updated

