Bit Capital

The Bit Capital Developer Hub

Welcome to the Bit Capital developer hub. You'll find comprehensive guides and documentation to help you start working with the platform as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides    API Reference

Document Verification

To ensure the account holder is the one requesting the sign up, we require you to upload its documents for automated verification. The list of required documents depends on your business model, but usually just an identification document with photo is enough.

Uploading Documents

To upload a document you need to know the User ID and its Document Type enum.

Personal Document Types:

  • brl_individual_reg (front / back / both_sides / selfie)
  • brl_drivers_license (front / back / both_sides / selfie)
  • brl_address_statement (front / selfie)

Corporate Document Types (based on company establishment format):

  • MEI - ccmei;
  • EI - ei_registration_requirement;
  • EPP - articles_of_association;
  • ERELI - eireli_incorporation_statement;
  • LTDA - articles_of_association;
  • EMGP - articles_of_association;
  • SA - company_bylaws;
  • SS - articles_of_association;
  • ME - ei_registration_requirement.
import fs from 'fs';
import util from 'util';

const open = util.promisify(fs.open);

// Gather information for upload
const type = DocumentType.BRL_INDIVIDUAL_REG;
const userId = '9a07b821-c143-4e7f-bfda-9adf48c836ee';

// Open image file using FS
const file = await open('photo.png', 'r');

// Upload document
const document = await bitcapital
	.consumers()
	.documents()
	.uploadPicture(userId, type, file);

Uploading as Base64

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. Some platforms may have problems handling binary files and Form Data, so you may send a base64 encoded image string instead. This is not desirable as it may increase the payload size, but may be useful in the integration steps. You can use this form of data to upload images on the platform.

There are some types of implementation of the base64, you can check which one you are using in this article. The platform is type agnostic and it will remove the padding characters '=' and '/' before storing it in the database, independently of the base64 version.

The platform supports only jpeg and png format for the Bse64 upload, so these are the only possible data MIME prefixes:

  • data:image/png;base64,
  • data:image/jpeg;base64,

If you forget to use a prefix, or use an invalid one, the endpoint will throw an error.

// Gather information for upload
const type = DocumentType.BRL_INDIVIDUAL_REG;
const userId = '9a07b821-c143-4e7f-bfda-9adf48c836ee';

// The number associated with this document, depending on ins type
// Usually an unique code printed in the front, such as RG number or CPF
const number = '1234567890';

// Get image from Base64 string
const imageStr = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8Xw8AAoMBgDTD2qgAAAAASUVORK5CYII='

// Upload document
const document = await bitcapital
	.consumers()
	.documents()
	.uploadPictureFromBase64(userId, type, number, imageStr);
curl --location --request POST 'https://instance-url.btcore.app/consumers/d01e8d22-219d-4b57-bf71-900cfb5eed6d/documents/brl_identity/front' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 0000000000000000000000000000000000000000'\
--data-raw '{
	"picture": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
	"number": "123456"
}'

After all required documents are uploaded, the consumer will be sent to a queue automatically with the state "processing_documents". All state changes will be notified with Domain postbacks.

After all checks, if the user is approved it will be sent to the "processing_wallets" states, for automated account creation in the network. After all automated processing is done, it will be the "ready" state, fully operational.

Vision AI Verification

We use machine learning to check the documents uploaded to the platform using the Google Cloud Vision services. It looks for a lot of different aspects of the uploaded image to check for potential manipulation and frauds.

Most of the verification results are available in the Document state details.

Name
Description

hasCorrectDimensions

Check if the document has the correct dimensions.

  • Size:

    • Minimum: 1 Kb
    • Maximum: 15000 Kb

  • Width:

    • Minimum: 360px
    • Maximum: 2160px

  • Height:

    • Minimum: 360px
    • Maximum: 2160px

hasCorrectFormat

Check if the image has the correct format for computer vision AI verification.

Supported formats:

  • JPG / JPEG
  • PNG
  • GIF


hasNeededLabels

Check if the document has been identified with the correct labels from the AI.

Needs to be identified as an "Identity Document" by the AI.


hasNeededFaces

Check if the image has the needed amount of faces, and their quality.

Needs at least 1 face for identity documents with picture. The face has to be clear, without blurs and with a minimum confidence in the face landmarks (eyes, nose and mouth).


hasCorrectType

Check if the Document has been identified by the AI with the correct type.

Supported types:

  • brl_individual_reg
  • brl_drivers_license
  • passport


hasNoMatchingWebImages

Check if the image has an online presence.

Documents must not be available online, this indicates a leak of personal data, potentially leading to frauds.


Failure States

If anything fails, it may be sent to:

  • rejected, if the consumer was checked and the result was denied for compliance reasons,
  • invalid_documents, when documents are not valid for checking in this instance,
  • manual_verification, when additional documents or further checking is required in this instance,
  • provider_failed, if something went wrong in the external custody provider after the internal checks passed, contact the support.

Updating existing documents

To override previously sent documents, just upload new sides to a document with the same type. We keep track of document updates, but only the latest submitted version will be considered for any verification purpose.

Manual Verification

Some users cannot be verified in a fully automated algorithm, so in some cases your signup might go to the manual_verification state. This usually happens with blurred documents, or some mistyped information by the users.

Some other cases might be more complex and require a full compliance analysis, on which we might request you some additional documents:

  • A valid and official address statement to verify the card delivery destination
  • A valid tax revenue report or equivalent Receita Federal / IRS document.

You can check the reason and the actions available in the Consumer States. We encourage opening a ticket in the Help Desk for further support, whenever needed.

Updated about a month ago


Document Verification


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.