Guides
Sub-accounts and KYC
Create end-customer sub-accounts, upload documents and follow the compliance review.
A sub-account is an end customer (individual or company, Brazilian or foreign) under one of your customers. It starts Pending, goes through compliance and can only operate once Active. Its accounts (one per enabled currency) and trading pairs are created along with it.
Create the sub-account
The kind field decides the required document:
kind | Document |
|---|---|
BrazilianIndividual | cpfNumber (check digits validated) |
BrazilianLegalEntity | cnpjNumber (check digits validated) |
ForeignIndividual | passportNumber or foreignTaxId, plus countryCodeIso3 |
ForeignLegalEntity | foreignTaxId and countryCodeIso3 |
Also required: name, email, phoneNumber, expectedMonthlyVolumeBrl, isUsPerson, isPoliticallyExposedPerson, the full address and settings with enabledCurrencyCodes (not empty) and tradingPairs. dateOfBirth is required for individuals and not allowed for companies.
curl -X POST https://bloquo.mimicr.dev/api/v1/subaccount/1001 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"kind": "BrazilianIndividual",
"name": "João da Silva",
"email": "joao@email.com",
"phoneNumber": "+5511999999999",
"cpfNumber": "529.982.247-25",
"dateOfBirth": "1990-05-20",
"expectedMonthlyVolumeBrl": 10000,
"isUsPerson": false,
"isPoliticallyExposedPerson": false,
"address": {
"street": "Rua das Flores", "number": "100", "neighborhood": "Centro",
"city": "São Paulo", "region": "SP", "postalCode": "01310-100", "countryCodeIso3": "BRA"
},
"settings": {
"enabledCurrencyCodes": ["BRL", "USD"],
"tradingPairs": [
{ "baseCurrencyCode": "USD", "quoteCurrencyCode": "BRL", "buySpreadPercentage": 1.5, "sellSpreadPercentage": 1.5 }
]
}
}'{ "status": true, "result": { "id": 1018 }, "message": null }Companies (BrazilianLegalEntity and ForeignLegalEntity) need beneficialOwners: each one holding more than 25% (ownershipPercentage) and the sum at most 100%.
Common errors
message | Cause |
|---|---|
Invalid CPF number. | CPF with wrong check digits |
Invalid CNPJ number. | CNPJ with wrong check digits |
A customer with this document already exists under the specified parent. | Same document under the same parent |
Beneficial owner ownership must be greater than 25%. | UBO with 25% or less |
DateOfBirth is not allowed for company types. | dateOfBirth on a company |
Parent customer does not allow child customers. | Parent without childEnabled |
For a repeated document, Bloquo's table says 409 and the endpoint example says 400. In Mimicr the response is 400.
Compliance status
| Status | Meaning |
|---|---|
Pending | Under review |
AwaitingKyc | Compliance asked for documents |
Active | Approved; can create orders |
Rejected | Rejected for good |
Follow it through the status field of GET /api/v1/customer/{customerId}. Before Active, the sub-account's deposits, withdrawals and FX payments answer 400 Customer is not active..
In Mimicr, the review happens about 3 seconds after creation. By default the sub-account becomes Active. To test the other paths, use Mimicr's triggers in name:
namecontainingKYC(e.g.Maria KYC Souza): goesAwaitingKyc.namecontainingREJEITAR: goesRejected.
Upload documents
Send the files as multipart/form-data, in the fields identity_document, incorporation_document, beneficial_owner_identity_documents and beneficial_owner_passport_documents:
curl -X POST https://bloquo.mimicr.dev/api/v1/subaccount/1001/1026/documents \ -H "Authorization: Bearer <token>" \ -F "identity_document=@rg.pdf"
{
"status": true,
"result": { "customerId": 1026, "documentReferences": { "identity_document": "973fe1ca-892a-42a6-9584-276524006b50" } },
"message": null
}If the sub-account was AwaitingKyc, it goes back to Pending and, in Mimicr, becomes Active on the next review. The path requires the direct parent: another parentId answers 403 The specified customer is not a child of the given parent..
Drive compliance in tests
Turn autoApproveSubaccounts off and decide each case:
npx mimicr action bloquo subaccount.approve customerId=1018 npx mimicr action bloquo subaccount.request_kyc customerId=1018 npx mimicr action bloquo subaccount.reject customerId=1018
To wait for the automatic decision:
npx mimicr wait bloquo object kind=customer id=1018 status=Active
Reference: Create sub-account, Upload sub-account KYC documents, Get customer.