Skip to Content
Dashboard
GuidesPix and identityVerify a user's identity

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.

Open in ChatGPT

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,
  })
  • documentId is the user's CPF, digits only.
  • birthDate is DD/MM/YYYY.
  • documentCategory is IDENTITY_CARD, DRIVERS_LICENSE or PASSPORT.

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:

StatusMeaning
PENDINGWaiting for uploads and processing.
PROCESSING, VERIFYINGBeing checked.
PENDING_MANUAL_REVIEWA person on the Notus team is reviewing it.
COMPLETEDApproved. individualId is set.
FAILEDRejected; failureReason says why.
EXPIREDNot 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

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 a businessId, used as identityId the same way.
  • Options on the standard session: nationality; preFlight: true checks the CPF against the government database first and fails the session on a mismatch; limits sets 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 generic verification-sessions routes above.

On this page