Guides
Accounts and fees
FIAT and crypto accounts, execution flags, fees, balances and statement.
Each customer has one account per currency it uses. The account receives deposits, pays withdrawals and settles trades, and it carries the deposit and withdrawal fees.
Create an account
Required fields: name, currencyId (see Environment) and featureFlags (may be {}).
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/account \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "EUR Account", "currencyId": 3, "featureFlags": {}, "depositFeePercentage": 0.5, "withdrawalFlatFee": 2.5}'{
"status": true,
"statusCode": 201,
"result": {
"id": 1036,
"name": "EUR Account",
"type": "FIAT",
"currencyId": 3,
"customerId": 1001,
"enabled": true,
"maxAllowedDebt": 0,
"isAutomaticApproval": true,
"autoExecuteDeposit": true,
"autoExecuteWithdrawal": true,
"featureFlags": {},
"currency": { "id": 3, "code": "EUR", "name": "Euro", "precision": 2, "type": "FIAT", "enabled": true }
},
"message": null
}Without featureFlags, the response is 400 FeatureFlags is required..
Execution flags
| Field | Default | Effect |
|---|---|---|
autoExecuteDeposit | true (FIAT), always false (CRYPTO) | FIAT with true generates the PIX right away (PENDING_DEPOSIT); with false the deposit stays CREATED |
autoExecuteWithdrawal | true | With false, the withdrawal waits for treasury in PENDING_TREASURY |
maxAllowedDebt | 0 | How far the account may go negative on a withdrawal |
enabled | true | A disabled account answers Account not found. to new orders |
Change them with PUT /api/v1/customer/{customerId}/account/{accountId}, for example {"autoExecuteWithdrawal": false}.
Bloquo doesn't document the default of autoExecuteWithdrawal. In Mimicr it is true.
Fees
Fees are sent when you create or update the account, separately for deposits and withdrawals:
| Field | Example | Meaning |
|---|---|---|
depositFeePercentage / withdrawalFeePercentage | 0.5 | 0.5% of the amount |
depositFlatFee / withdrawalFlatFee | 2.5 | flat fee in the account currency |
minPercentageDepositFee / minPercentageWithdrawalFee | 1 | floor of the percentage part |
maxPercentageDepositFee / maxPercentageWithdrawalFee | 50 | cap of the percentage part |
The fee is max(min(amount × percentage, cap), flat fee). Deposits credit amount − fee (totalAmount); withdrawals debit amount + fee.
GET /api/v1/customer/{customerId}/fee/account/{accountId} returns the configuration as an array, with the percentage as a fraction (0.5% becomes 0.005):
[
{ "id": 1034, "accountId": 1036, "orderType": "Deposit", "feePercentage": 0.005, "flatFee": 0, "minPercentageFee": null, "maxPercentageFee": null },
{ "id": 1035, "accountId": 1036, "orderType": "Withdrawal", "feePercentage": 0, "flatFee": 2.5, "minPercentageFee": null, "maxPercentageFee": null }
]Using minPercentageFee as a floor of the percentage part is a Mimicr decision; Bloquo documents only the formula with the cap and the flat fee.
Balances
The balance is the sum of the account's transactions minus what is held by withdrawals, trades and FX payments in flight.
curl https://bloquo.mimicr.dev/api/v1/customer/1001/balances \ -H "Authorization: Bearer <token>"
{
"status": true,
"statusCode": 200,
"result": [
{ "accountId": 1004, "balance": 48916.1, "accountInfo": { "type": "FIAT", "currencyId": 1, "currencyName": "BRL", "currencyCode": "BRL", "maxAllowedDebt": 0, "name": "BRL Account" } }
],
"message": null
}GET /api/v1/customer/{customerId}/balance/accountId/{accountId} returns a single account ({"accountId": 1004, "balance": 48916.1}) and answers 404 Account not found. for an unknown account. Note the different envelope: this route has no statusCode.
Named accounts
GET /api/v1/customer/{customerId}/accounts ("coming soon" in Bloquo) returns an array with no envelope, with each account's payment instruments: the PIX key of BRL accounts and the wallet of crypto accounts.
Statement
Every settled movement becomes a Credit or Debit transaction (negative amount on debits) with orderType DEPOSIT, WITHDRAWAL, TRADE, FX_PAYMENT or REFUND. GET /api/v1/customer/{customerId}/transaction filters by accountId, currency, type, orderId, orderType, startDate and endDate; .../transaction/report exports a CSV of up to 1000 rows. See the pagination shape in Pagination.
Delete
DELETE /api/v1/customer/{customerId}/account/{accountId} only works with a zero balance; otherwise 400 Account cannot be deleted while holding balance..
Balance for tests
Use the account.credit action to fund an account without going through a deposit:
npx mimicr action bloquo account.credit accountId=1036 amount=5000.00
Reference: Create account, Update account, Get fee configuration, Get customer balances, Get account balance, List named accounts, List transactions.