Verify a user's identity
Verify a Brazilian user's identity with a document and a liveness check before they deposit or withdraw with Pix.
Before a user can move reais in or out, they verify their identity once: their name, birth date and CPF, a photo of a document, and usually a liveness check (a short selfie video). Notus checks it with its providers and gives you back an identity id to use on every Pix deposit and withdrawal.
1. Create a verification session
const { session, frontDocumentUpload, backDocumentUpload } =
await notus.kyc.createStandardIndividualVerification({
firstName: 'Maria',
lastName: 'Silva Santos',
birthDate: '15/03/1990',
documentId: '12345678901',
documentCategory: 'DRIVERS_LICENSE',
documentCountry: 'BRAZIL',
livenessRequired: true,
})documentIdis the user's CPF, digits only.birthDateisDD/MM/YYYY.documentCategoryisIDENTITY_CARD,DRIVERS_LICENSEorPASSPORT.
2. Upload the document photos
Each upload object holds a url and form fields. Post the file straight to that URL, with the fields first and the file last. Do it within 15 minutes; the file must be PNG or JPEG, up to 25 MB.
async function upload(file: Blob, { url, fields }: { url: string; fields: Record<string, string> }) {
const form = new FormData()
for (const [key, value] of Object.entries(fields)) form.append(key, value)
form.append('file', file)
const response = await fetch(url, { method: 'POST', body: form })
if (!response.ok) throw new Error(`Upload failed: ${response.status}`)
}
await upload(front, frontDocumentUpload)
if (backDocumentUpload) await upload(back, backDocumentUpload)3. Run the liveness check
When livenessRequired is true, show the liveness component in your app with the session id: @notus-api/react-sdk on the web, @notus-api/expo-sdk on mobile.
<Liveness sessionId={session.id} onSuccess={() => processSession(session.id)} />4. Process the session and read the result
await notus.kyc.processVerificationSession({ sessionId: session.id })
const result = await notus.kyc.getVerificationSessionResult({ sessionId: session.id })Poll the result, or listen for the kyc notification sent to your server, until it finishes:
Poll the result, or listen for the kyc webhook, until it settles:
| Status | Meaning |
|---|---|
PENDING | Waiting for uploads and processing. |
PROCESSING, VERIFYING | Being checked. |
PENDING_MANUAL_REVIEW | A person on the Notus team is reviewing it. |
COMPLETED | Approved. individualId is set. |
FAILED | Rejected; failureReason says why. |
EXPIRED | Not finished in time. Start a new session. |
The approved session's individualId is the user's identity id. Save it: Pix quotes take it as identityId.
After approval
- Limits. Get Identity Financial Limits returns how much the user can still deposit, withdraw and pay with Pix QR codes.
- Providers. Each payment provider approves the user separately. Get Identity Providers shows each provider's status and the
actionto take:NONE,WAIT, orREVERIFYwhen the provider needs a new verification. Start one with Create Individual Reverification. - Deletion. Delete Identity removes an identity at the user's request.
- Limits. Get Identity Financial Limits returns how much the user can still deposit, withdraw and pay with Pix QR codes.
- Providers. Each ramp provider approves the user separately. Get Identity Providers shows each provider's status and the
actionto take:NONE,WAIT, orREVERIFYwhen the provider needs a new verification. Start one with Create Individual Reverification. - Deletion. Delete Identity removes an identity at the user's request.
Enhanced and business verification
- Enhanced (
createEnhancedIndividualVerification) raises a verified user's limits with proof of address, source of funds and the purpose of their transactions. It returns extra upload slots for those documents. - Business (
createStandardBusinessVerification) verifies a company by CNPJ, with its documents and its owners' documents. The approved session returns abusinessId, used asidentityIdthe same way. - Options on the standard session:
nationality;preFlight: truechecks the CPF against the government database first and fails the session on a mismatch;limitssets custom monthly, daily or quarterly limits;metadata. The contact fields (email,address,city,state,postalCode,phoneNumber) go all together or not at all. - Default monthly limits: 50,000 for a standard individual, 100,000 enhanced, 500,000 for a business. Pix QR code payments: 2,000 a day and 500 per payment.
- The older per-type routes (
…/standard/{sessionId},…/standard/{sessionId}/process) are deprecated; use the genericverification-sessionsroutes above.