Pix Automático
Collect recurring BRL via Pix Automático and settle USDC to a Base wallet with the Crebit Lock API.
- Available in sandbox and production. Authenticate with your Crebit partner API keys for the matching environment.
- Create a beneficiary (Base USDC wallet), then a Pix Automático mandate. Crebit returns payer instructions and tracks the collection to settlement.
- Examples below use the production host; use the sandbox base URL and
X-Crebit-Environment: sandboxwhen integrating against sandbox.
Availability
| Surface | Status |
|---|---|
| POST /api/v1/fiat/collections/pix-automatico/mandates | Live when brl_usdc_collections is enabled for your partner |
| GET collections (list / get) | Live — poll status and deposit_instructions |
| Outbound fiat_collection_settled / fiat_collection_failed | Live when USDC settles or the collection fails |
| BRL collect → Bridge VA → USDC on Base | Live — after the first charge is paid, status is processing until USDC settles via the beneficiary Bridge VA |
| Cancel mandate / cycle charges | Not available on the API yet |
Before You Start
- Partner API keys for the environment you will call (
sandboxorproduction). - Feature flag
brl_usdc_collectionsenabled for your partner (Crebit ops). Without it, collection endpoints return403 brl_usdc_collections_disabled. - A Bridge customer id after KYB (Crebit attaches this when provisioning the beneficiary BRL virtual account).
- An outbound webhook endpoint registered for that environment, so you receive
fiat_collection_settled/fiat_collection_failed. See Webhooks.
How to Call
| Header | Value |
|---|---|
| X-Crebit-Key-Id | Your key id for that environment |
| X-Crebit-Key-Secret | Your key secret for that environment |
| X-Crebit-Environment | sandbox or production (must match the key and host) |
| X-Crebit-Acting-As-Partner-Id | Optional. Only when an organization admin calls on behalf of a member |
| Content-Type | application/json on POST bodies |
| Environment | Base URL |
|---|---|
| Sandbox | https://lock-apis-sandbox.crebitpay.com |
| Production | https://lock-apis.crebitpay.com |
Request samples below use https://lock-apis.crebitpay.com.
| Method | Path | Purpose |
|---|---|---|
| POST | /api/v1/fiat/beneficiaries | Create a BRL→USDC collection beneficiary |
| GET | /api/v1/fiat/beneficiaries | List beneficiaries (optional status, limit) |
| GET | /api/v1/fiat/beneficiaries/{id} | Get one beneficiary |
| POST | /api/v1/fiat/beneficiaries/{id}/provision-brl-va | Provision the permanent Bridge BRL virtual account |
| POST | /api/v1/fiat/collections/pix-automatico/mandates | Create a Pix Automático mandate |
| GET | /api/v1/fiat/collections | List collections (filter by beneficiary_id or status) |
| GET | /api/v1/fiat/collections/{collection_id} | Get one collection |
Flow
- Create a beneficiary with the Base USDC wallet that should receive settlement, then provision its BRL VA.
- Create a Pix Automático mandate. Crebit returns a
pix_automaticocollection with payer instructions. - The payer authorizes the mandate and pays the first charge using the Pix copy-paste string and/or hosted
pay_urlfromdeposit_instructions. - Poll the collection (or wait for webhooks). When USDC lands on Base, status becomes
settledand you getfiat_collection_settled.
1. Beneficiary
Every collection targets a beneficiary: a display name plus a Base USDC wallet. Provisioning creates the permanent Bridge BRL virtual account that receives BRL before the USDC onramp.
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/beneficiaries" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production" \
-d '{"display_name":"Acme Pay treasury","destination_wallet_address":"0x1111111111111111111111111111111111111111","external_reference":"acme-treasury-01"}'{
"id": "9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c",
"partner_id": "8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b",
"display_name": "Acme Pay treasury",
"external_reference": "acme-treasury-01",
"metadata": {},
"bridge_customer_id": "cust_bridge_01",
"bridge_brl_virtual_account_id": "va_brl_01",
"virtual_account_status": "activated",
"virtual_account_credentials": {},
"destination_chain": "base",
"destination_currency": "usdc",
"destination_wallet_address": "0x1111111111111111111111111111111111111111",
"developer_fee_percent": "0.1",
"status": "active",
"bridge_synced_at": "2026-11-10T12:00:00+00:00",
"created_at": "2026-11-10T11:55:00+00:00",
"updated_at": "2026-11-10T12:00:00+00:00"
}Then provision the BRL VA (requires bridge_customer_id on the beneficiary or in the body after Crebit completes Bridge KYB):
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/beneficiaries/9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c/provision-brl-va" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production" \
-d '{"bridge_customer_id":"cust_bridge_01"}'List or fetch beneficiaries any time:
curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/beneficiaries?status=active&limit=50" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production"curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/beneficiaries/9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production"Beneficiary Fields
| Field | Required | Notes |
|---|---|---|
| display_name | Yes | Label for the beneficiary, 1–256 chars |
| destination_wallet_address | Yes | Base USDC wallet (0x…). Only Base is supported |
| external_reference | No | Your own id; unique per partner when set |
| bridge_customer_id | No | Set after Bridge KYB; also accepted on provision-brl-va |
| metadata | No | Arbitrary JSON object |
| developer_fee_percent | No | Per-beneficiary fee override as a decimal string (default 0.1) |
Response also includes status (pending / active / disabled), Bridge VA fields after provision, and fixed destination_chain: base / destination_currency: usdc.
2. Create a Mandate
Creates the Pix Automático mandate and a Crebit collection. Amounts are decimal BRL strings. client_reference_id defaults to reference and must be unique per partner.
curl -sS -X POST "https://lock-apis.crebitpay.com/api/v1/fiat/collections/pix-automatico/mandates" \
-H "Content-Type: application/json" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production" \
-d '{"beneficiary_id":"9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c","reference":"SUB-1048-001","payer_name":"Maria Souza","payer_document":"249.715.637-92","payer_email":"maria@example.com","frequency":"monthly","amount_brl":"49.90","first_payment_amount_brl":"49.90","start_date":"2026-12-04","description":"Crebit subscription","retry_on_failure":true,"client_reference_id":"SUB-1048-001"}'{
"id": "a7b8c9d0-1e2f-4a3b-9c8d-0e1f2a3b4c5d",
"partner_id": "8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b",
"beneficiary_id": "9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c",
"collection_type": "pix_automatico",
"status": "awaiting_funds",
"amount_brl": "49.90",
"amount_usdc": null,
"amount_paid_brl": null,
"settlement_fees_brl": null,
"payment_method": null,
"installment_count": null,
"client_reference_id": "SUB-1048-001",
"bridge_transfer_id": null,
"bridge_deposit_id": null,
"api_environment": "production",
"deposit_instructions": {
"joia_authorization": {
"id": "pxa_1",
"reference": "SUB-1048-001",
"status": "pending",
"frequency": "monthly",
"start_date": "2026-12-04"
},
"first_payment": {
"charge_id": "chg_1",
"pay_url": "https://example.com/pay/chg_1",
"pix": {
"copy_paste": "00020126…"
}
},
"pix_copy_paste": "00020126…",
"pay_url": "https://example.com/pay/chg_1"
},
"kodano_mandate_id": "pxa_1",
"kodano_collection_id": "chg_1",
"failure_reason": null,
"settled_at": null,
"created_at": "2026-11-10T12:05:00+00:00",
"updated_at": "2026-11-10T12:05:00+00:00"
}Give the payer deposit_instructions.pix_copy_paste and/or deposit_instructions.pay_url for the first payment. Store the Crebit collection id for polling and support.
Mandate Fields
| Field | Required | Notes |
|---|---|---|
| beneficiary_id | Yes | UUID of an active collection beneficiary |
| reference | Yes | Your subscription / contract id for this mandate, 1–128 chars |
| payer_name | Yes | Payer legal name, 1–200 chars |
| payer_document | Yes | CPF or CNPJ (with or without punctuation); Crebit strips to alphanumerics |
| amount_brl | Yes | Recurring BRL amount as a decimal string |
| first_payment_amount_brl | Yes | First payment BRL amount (charged with the authorization) |
| start_date | Yes | First recurring debit date YYYY-MM-DD (after today) |
| frequency | No | weekly | monthly | quarterly | semiannually | annually (default monthly) |
| payer_email | No | Optional payer email |
| description | No | Max 35 characters |
| retry_on_failure | No | Default true |
| client_reference_id | No | Optional Crebit client reference; defaults to reference. Unique per partner |
Collection Response
Create, list, and get return the same collection object. Use status and deposit_instructions for your integration; other fields are for reconciliation and support.
| Field | Notes |
|---|---|
| id | Crebit collection UUID |
| collection_type | one_time_pix | pix_automatico | va_deposit | card_installment. va_deposit appears from permanent BRL VA activity (no create endpoint) |
| status | awaiting_funds | processing | settled | failed | cancelled | expired |
| amount_brl / amount_usdc | Decimal strings when known |
| amount_paid_brl / settlement_fees_brl | Filled as charge and settlement details arrive |
| deposit_instructions | Payer Pix copy-paste, pay_url, and related authorization / charge details |
| kodano_mandate_id / kodano_collection_id | Additional identifiers on the collection (returned as-is) |
| client_reference_id | Your reference (defaults to reference) |
| api_environment | sandbox or production |
| failure_reason / settled_at | Present on failed / settled rows |
3. Track the Collection
Poll until status is terminal, or rely on outbound webhooks. Filter list by beneficiary_id or status.
curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/collections/a7b8c9d0-1e2f-4a3b-9c8d-0e1f2a3b4c5d" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production"curl -sS -X GET "https://lock-apis.crebitpay.com/api/v1/fiat/collections?beneficiary_id=9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c&limit=50" \
-H "X-Crebit-Key-Id: YOUR_KEY_ID" \
-H "X-Crebit-Key-Secret: YOUR_KEY_SECRET" \
-H "X-Crebit-Environment: production"Status Lifecycle
| status | Meaning |
|---|---|
| awaiting_funds | Mandate created; waiting for payer authorization / first payment |
| processing | Mandate active and/or first charge paid; USDC settlement not finished yet |
| settled | USDC delivered to the beneficiary Base wallet |
| failed | Authorization refused or charge failed / refunded / chargeback |
| cancelled | Authorization or charge cancelled |
| expired | Authorization or charge expired |
While the collection is open, deposit_instructions may gain more authorization and charge detail. Drive your product from status and the outbound webhooks below.
Partner Webhooks
Crebit POSTs these events to the outbound webhook URL you registered for the environment.
| event_type | When |
|---|---|
| fiat_collection_settled | Collection newly settled (USDC on Base) |
| fiat_collection_failed | Collection newly failed |
{
"event_type": "fiat_collection_settled",
"fiat_collection_id": "a7b8c9d0-1e2f-4a3b-9c8d-0e1f2a3b4c5d",
"partner_id": "8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b",
"beneficiary_id": "9c1e2a3b-4d5f-4e6a-8b7c-1d2e3f4a5b6c",
"collection_type": "pix_automatico",
"status": "settled",
"amount_brl": "49.90",
"amount_usdc": "9.12",
"client_reference_id": "SUB-1048-001",
"bridge_transfer_id": "transfer_01",
"bridge_deposit_id": null,
"bridge_event_id": "evt_bridge_01",
"destination_wallet_address": "0x1111111111111111111111111111111111111111",
"destination_chain": "base",
"destination_currency": "usdc",
"beneficiary_display_name": "Acme Pay treasury",
"beneficiary_external_reference": "acme-treasury-01",
"settled_at": "2026-11-10T12:20:00+00:00",
"timestamp": "2026-11-10T12:20:01+00:00",
"subject": {
"relationship": "self",
"partner_id": "8f3c2a1e-4b5d-4e6f-9a7b-1c2d3e4f5a6b",
"partner_name": "Acme Pay",
"organisation_id": null,
"organisation_name": null
}
}Idempotency keys are fiat_collection_settled:{collection_id} and fiat_collection_failed:{collection_id}. Replay failed deliveries with POST /api/v1/partners/webhook-events/{id}/replay. Full schemas live on API endpoints → Webhooks.
Sandbox Smoke Steps
- Confirm
brl_usdc_collectionsis on for your sandbox partner and keys work withGET /api/v1/partners/me. POST /api/v1/fiat/beneficiarieswith a Base USDC wallet, thenPOST …/provision-brl-vaonce Bridge KYB /bridge_customer_idis ready.POST …/collections/pix-automatico/mandateswith a uniquereference. Expect201,status: awaiting_funds, and Pix /pay_urlindeposit_instructions.- Complete the first payment with the returned Pix string or hosted
pay_url. Confirm the collection moves toprocessing. - When BRL reaches the beneficiary Bridge VA and the onramp finishes, confirm
status: settled,amount_usdcpopulated, and outboundfiat_collection_settleddelivered.
Limits
- Cancel mandate and variable-amount cycle charges are not available under
/api/v1/fiat/collectionsyet. - Related but separate: one-time Pix QR (
POST …/collections/one-time-pix) and card installments (POST …/collections/card-installments, separate feature flag).
Errors
| HTTP | code | When |
|---|---|---|
| 403 | brl_usdc_collections_disabled | Feature flag off for the partner |
| 409 | beneficiary_disabled | Mandate create against a disabled beneficiary |
| 409 | beneficiary_external_reference_exists | external_reference already used for another beneficiary |
| 409 | collection_client_reference_exists | client_reference_id (or defaulted reference) already used |
| 400 | invalid_amount / bad_request | Bad BRL amount or missing reference |
| 400 | invalid_destination_wallet / unsupported_destination_chain | Wallet must be a valid Base 0x address |
| 400 | bridge_customer_required | Beneficiary needs bridge_customer_id before some collection flows |
| 503 | kodano_not_configured | Collections temporarily unavailable on this Crebit host (ops) |
| 502 | joia_error / kodano_api_error | Temporary upstream failure creating or updating the mandate; see message/details |
Field validation failures use the standard 422 validation envelope. Prefer unique reference / client_reference_id values so retries do not collide.