Skip to main content
This quickstart uses the HEADLESS fulfilment mode. You already hold the document images, so you upload them from your server. Blaaiz never contacts the person you verify. A headless session asks for DOCUMENTS, PROOF_OF_ADDRESS, or both. If you need a live selfie, use the Blaaiz-hosted quickstart instead. Read Merchant KYC overview first for the session model.

Before you start

  • Merchant KYC must be enabled for your business.
  • Your OAuth credentials must carry the compliance-kyc:create and compliance-kyc:read scopes.
  • Your kyc_url webhook must be registered. See Merchant KYC webhooks.
The examples use the production base URL https://api-prod.blaaiz.com. For development, use https://api-dev.blaaiz.com.

Flow

Step 1: Create the session

HEADLESS is the default mode for a ["DOCUMENTS"] set, so you can omit fulfilment_mode. Send "fulfilment_mode": "HEADLESS" if you prefer to be explicit.
steps.selfie is null because the requirement set has no SELFIE. The session must be AWAITING_INPUT before it accepts a document. If status is CREATED, repeat the create call with the same idempotency_key.

Step 2: Get an upload URL

Do not send document bytes in the request body. A request body larger than about 8 KB is rejected at the network edge, before the API sees it. Use the upload URL for every real document.
Your file_name must use letters, numbers, spaces, dashes, or underscores, and must end in .jpg, .jpeg, .png, .webp, or .pdf. Blaaiz adds a random prefix and returns the result in data.file_name.

Step 3: Upload the bytes

Send the file to the url with an HTTP PUT. Add every header from the headers object.
A staged file must be 5 MB or smaller. Blaaiz rejects a larger file when you register it in step 4.

Step 4: Register the document

This call tells Blaaiz which staged file belongs to the session, and what the file is.
The response is the session, with steps.documents set to SUBMITTED:
To send more than one document, repeat steps 2 to 4 for each file. Give each file its own id_doc_type.

Proof of address

When the requirement set includes PROOF_OF_ADDRESS, upload the proof of address the same way. Repeat steps 2 to 4, and set id_doc_type to the type of document you hold. A photo and a PDF are both accepted, so send image/jpeg, image/png, image/webp, or application/pdf.
On a proof of address, country means the country of the address on the document. It is not the nationality of the person, and it is not the country of the identity document. A person can hold a passport of one country and a bank statement of another. The upload sets steps.proof_of_address to SUBMITTED:
steps.documents is null on a ["PROOF_OF_ADDRESS"] session, because that set asks for no identity document. Upload the proof of address only, then submit.

Small files

A document under about 8 KB can travel in the request body. Replace file_name with content_base64 and send the base64 of the file. Send one of the two fields, never both.
Real identity documents are larger than the edge limit. Use the upload URL for them.

Step 5: Submit the session for review

The session moves to IN_REVIEW:
Blaaiz refuses the submit in three cases:
  • A step of the set is still PENDING. Upload what that step asks for first. A null step never blocks the submit.
  • The session already left AWAITING_INPUT. You cannot submit twice.
  • The session is SUMSUB_HOSTED. The person submits that session on the verification link.
Review starts only when every step of the set is SUBMITTED. On a ["DOCUMENTS", "PROOF_OF_ADDRESS"] session, that means both uploads must land before you call submit. An IN_REVIEW session no longer expires, and it accepts no more documents.

Step 6: Wait for the webhook

A RETRYABLE rejection means the person can try again. Create a new session with a new idempotency_key and upload clearer images. A FINAL rejection means you must not retry. Verify the x-blaaiz-signature header before you trust the payload. See Merchant KYC webhooks.