Guides
Getting started

Quickstart

Activate the sandbox, get a token, create a PIX deposit and receive the signed webhook.

This guide takes you from zero to your first Deposit webhook in a few minutes. You will use two hosts: https://api.mimicr.dev (Mimicr's control API, with your mk_… key) and https://bloquo.mimicr.dev (the simulated Bloquo API, with the Bloquo token).

1. Activate the sandbox

In the console, open your organization, go to Bloquo and click Ativar sandbox do Bloquo (Developer, Admin or Owner role). Or activate it through the control API with an organization write key (Organization settings → API keys):

bash
curl -X POST https://api.mimicr.dev/v1/bloquo/activate \
  -H "Authorization: Bearer mk_..."

The response (201) already includes the credentials. If the sandbox already exists, the response is 409 bloquo_already_active.

2. Get the credentials

bash
curl https://api.mimicr.dev/v1/bloquo \
  -H "Authorization: Bearer mk_..."
json
{
  "active": true,
  "host": "https://bloquo.mimicr.dev",
  "token_url": "https://bloquo.mimicr.dev/api/v1/auth/authenticateServer",
  "credentials": { "client_id": "acme-1a2b3c4d", "client_secret": "3f74uiq7aM1hWOoJ..." },
  "root_customer_id": 1001,
  "accounts": [
    { "id": 1004, "currency": "BRL", "balance": "0.00" },
    { "id": 1007, "currency": "USD", "balance": "0.00" },
    { "id": 1010, "currency": "USDT", "balance": "0.000000" },
    { "id": 1013, "currency": "USDC", "balance": "0.000000" }
  ]
}

root_customer_id is the Institutional customer that owns the token; the account ids are the ones you use in paths.

3. Get a token

bash
curl -X POST https://bloquo.mimicr.dev/api/v1/auth/authenticateServer \
  -H "Content-Type: application/json" \
  -d '{"clientId": "acme-1a2b3c4d", "clientSecret": "3f74uiq7aM1hWOoJ..."}'
json
{
  "status": true,
  "result": { "accessToken": "eyJhbGciOiJSUzI1NiIs...", "expiresIn": 3600, "tokenType": "Bearer" },
  "message": null
}

Send Authorization: Bearer <accessToken> on every other call. Details in Authentication.

4. Fund an account

Deposits don't need a balance, but withdrawals, trades and FX payments do. The fastest way is the account.credit action, which posts an already settled credit:

bash
npx mimicr action bloquo account.credit accountId=1004 amount=10000.00

The same through the control API:

bash
curl -X POST https://api.mimicr.dev/v1/bloquo/actions/account.credit \
  -H "Authorization: Bearer mk_..." \
  -H "Content-Type: application/json" \
  -d '{"accountId": "1004", "amount": "10000.00"}'

5. Register the webhook URL

Without a notification preference (and without a webhookUrl on the order), the event is dropped, as in Bloquo. Register a public URL for Deposit:

bash
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/notification/preference \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"notificationType": "Webhook", "orderType": "Deposit", "webhookUrl": "https://your-service.com/webhooks/bloquo"}'

6. Create a PIX deposit

bash
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/orders/deposit/account/1004 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1000.00, "name": "João Silva", "payerTaxId": "529.982.247-25"}'

The response (201) is the order itself, with no envelope:

json
{
  "orderCreated": true,
  "id": 1043,
  "customerId": 1001,
  "accountId": 1004,
  "requestedAmount": 1000,
  "totalAmount": 1000,
  "currency": "BRL",
  "status": "PENDING_DEPOSIT",
  "pixKey": "3e3c8e7e-0540-45bc-b23a-7e08be5beac0",
  "pixCopyPaste": "00020101021226660014br.gov.bcb.pix2544pix.bloquo.io/qr/v2/...",
  "expireAt": "2026-11-05T20:10:56.877Z",
  "orderHistory": [
    { "createdAt": "2026-11-05T20:05:56.878Z", "statusName": "PENDING_DEPOSIT", "description": "PIX instruction generated; waiting for payment." }
  ]
}

About 4 seconds later the simulated payer pays: the order moves to COMPLETED, the account is credited and the webhook goes out.

7. Wait for the webhook

bash
npx mimicr wait bloquo delivery order_type=Deposit order_id=1043 event=COMPLETED

The command holds until the notification exists and prints the body sent, the URL, the delivery status and the attempts. Your URL receives a POST with the X-Bloquo-Signature header:

json
{
  "orderId": 1043,
  "orderType": "DEPOSIT",
  "accountId": 1004,
  "customerId": 1001,
  "amount": 1000,
  "requestedAmount": 1000,
  "feeAmount": 0,
  "totalAmount": 1000,
  "currency": "BRL",
  "status": "COMPLETED",
  "bankReference": "E1823612020261105201326CA2A49060",
  "e2eId": "E1823612020261105201326CA2A49060",
  "finalizedAt": "2026-11-05T20:06:01.277Z",
  "failureReason": null,
  "webhookUrl": "https://your-service.com/webhooks/bloquo"
}

Check the signature before processing: see Verify the signature.

Next steps