Guides
Customers and accounts

Customer hierarchy

The root customer, child customers and what each token can reach.

In Bloquo, customers form a tree. The token represents the sandbox's root customer (Institutional), and every {customerId} in a path must be that customer or one of its descendants. There are two ways to create children:

  • POST /api/v1/customer: a plain child customer, active right away. Good for branches and internal structures.
  • POST /api/v1/subaccount/{parentId}: a sub-account for an end customer, with a document, an address and a compliance review. See Sub-accounts and KYC.

Customer types

typeIdname
1Institutional
2Company
3EndCustomer

Bloquo's specification doesn't fix the type ids. In Mimicr, GET /api/v1/customer/types returns exactly this table. Sub-accounts are created as EndCustomer.

Create a child customer

Required fields: name, taxId, country, parentId, typeId and platformModules. The parent must have childEnabled: true, and the child's maxChildDepth must be smaller than the parent's.

bash
curl -X POST https://bloquo.mimicr.dev/api/v1/customer \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Filial",
    "taxId": "11.222.333/0001-81",
    "country": "BR",
    "parentId": 1001,
    "typeId": 2,
    "platformModules": 1,
    "enabled": true,
    "maxChildDepth": 1
  }'
json
{
  "status": true,
  "statusCode": 201,
  "result": {
    "id": 1017,
    "typeId": 2,
    "name": "Acme Filial",
    "taxId": "11.222.333/0001-81",
    "country": "BR",
    "parentId": 1001,
    "childEnabled": true,
    "childDepth": 1,
    "maxChildDepth": 1,
    "liquidityOperationsCapabilities": 3,
    "platformModules": 1,
    "enabled": true,
    "status": "Active",
    "type": { "id": 2, "name": "Company" }
  },
  "message": null
}

Common errors, all 400: Parent customer not found., Parent customer does not allow child customers. and Child maxChildDepth must be smaller than the parent's..

Read, update and delete

  • GET /api/v1/customer/{customerId} returns the customer; GET /api/v1/customer/me, the token's customer.
  • GET /api/v1/customer/{customerId}/childrenList lists the direct children, paginated ({data, pagination}).
  • PUT /api/v1/customer/{customerId} updates the customer. taxId, typeId and parentId are immutable and ignored without an error.
  • DELETE /api/v1/customer/{customerId} disables the customer (enabled: false). Every account must have a zero balance, otherwise 400 Customer has accounts with balance.. The root customer can't be deleted.

Access through the hierarchy

{customerId}Response
The root customer or a descendantnormal
A customer that exists outside your tree403 Access denied.
An id that doesn't exist400 Customer with Id: '<id>' not found.

The /children lists of deposits, withdrawals, trades and FX payments return the orders of every descendant of the customer in the path.

Liquidity capabilities

liquidityOperationsCapabilities is a bit mask. GET /api/v1/customer/{customerId}/liquidityCapabilities/list returns the map (None 0, SelfLiquidation 1, ThirdPartyLiquidation 2, LiquidationViaFxPayment 4), and GET /api/v1/customer/{customerId}/liquidityCapabilities returns the customer's active names. The root customer has 7: all three capabilities.

Reference: Create customer, Get customer, Update customer, Delete customer, List sub-accounts, Get liquidity capabilities.