Docs
llms.txt for AI agents Download OpenAPI spec

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: sandbox when integrating against sandbox.

Availability

SurfaceStatus
POST /api/v1/fiat/collections/pix-automatico/mandatesLive 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_failedLive when USDC settles or the collection fails
BRL collect → Bridge VA → USDC on BaseLive — after the first charge is paid, status is processing until USDC settles via the beneficiary Bridge VA
Cancel mandate / cycle chargesNot available on the API yet

Before You Start

  1. Partner API keys for the environment you will call (sandbox or production).
  2. Feature flag brl_usdc_collections enabled for your partner (Crebit ops). Without it, collection endpoints return 403 brl_usdc_collections_disabled.
  3. A Bridge customer id after KYB (Crebit attaches this when provisioning the beneficiary BRL virtual account).
  4. An outbound webhook endpoint registered for that environment, so you receive fiat_collection_settled / fiat_collection_failed. See Webhooks.

How to Call

HeaderValue
X-Crebit-Key-IdYour key id for that environment
X-Crebit-Key-SecretYour key secret for that environment
X-Crebit-Environmentsandbox or production (must match the key and host)
X-Crebit-Acting-As-Partner-IdOptional. Only when an organization admin calls on behalf of a member
Content-Typeapplication/json on POST bodies
EnvironmentBase URL
Sandboxhttps://lock-apis-sandbox.crebitpay.com
Productionhttps://lock-apis.crebitpay.com

Request samples below use https://lock-apis.crebitpay.com.

MethodPathPurpose
POST/api/v1/fiat/beneficiariesCreate a BRL→USDC collection beneficiary
GET/api/v1/fiat/beneficiariesList beneficiaries (optional status, limit)
GET/api/v1/fiat/beneficiaries/{id}Get one beneficiary
POST/api/v1/fiat/beneficiaries/{id}/provision-brl-vaProvision the permanent Bridge BRL virtual account
POST/api/v1/fiat/collections/pix-automatico/mandatesCreate a Pix Automático mandate
GET/api/v1/fiat/collectionsList collections (filter by beneficiary_id or status)
GET/api/v1/fiat/collections/{collection_id}Get one collection

Flow

  1. Create a beneficiary with the Base USDC wallet that should receive settlement, then provision its BRL VA.
  2. Create a Pix Automático mandate. Crebit returns a pix_automatico collection with payer instructions.
  3. The payer authorizes the mandate and pays the first charge using the Pix copy-paste string and/or hosted pay_url from deposit_instructions.
  4. Poll the collection (or wait for webhooks). When USDC lands on Base, status becomes settled and you get fiat_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.

HTTP code sample
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"}'
json, response (201) code sample
json, response (201)
{
  "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):

HTTP code sample
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:

HTTP code sample
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"
HTTP code sample
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

FieldRequiredNotes
display_nameYesLabel for the beneficiary, 1–256 chars
destination_wallet_addressYesBase USDC wallet (0x…). Only Base is supported
external_referenceNoYour own id; unique per partner when set
bridge_customer_idNoSet after Bridge KYB; also accepted on provision-brl-va
metadataNoArbitrary JSON object
developer_fee_percentNoPer-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.

HTTP code sample
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"}'
json, response (201) code sample
json, response (201)
{
  "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

FieldRequiredNotes
beneficiary_idYesUUID of an active collection beneficiary
referenceYesYour subscription / contract id for this mandate, 1–128 chars
payer_nameYesPayer legal name, 1–200 chars
payer_documentYesCPF or CNPJ (with or without punctuation); Crebit strips to alphanumerics
amount_brlYesRecurring BRL amount as a decimal string
first_payment_amount_brlYesFirst payment BRL amount (charged with the authorization)
start_dateYesFirst recurring debit date YYYY-MM-DD (after today)
frequencyNoweekly | monthly | quarterly | semiannually | annually (default monthly)
payer_emailNoOptional payer email
descriptionNoMax 35 characters
retry_on_failureNoDefault true
client_reference_idNoOptional 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.

FieldNotes
idCrebit collection UUID
collection_typeone_time_pix | pix_automatico | va_deposit | card_installment. va_deposit appears from permanent BRL VA activity (no create endpoint)
statusawaiting_funds | processing | settled | failed | cancelled | expired
amount_brl / amount_usdcDecimal strings when known
amount_paid_brl / settlement_fees_brlFilled as charge and settlement details arrive
deposit_instructionsPayer Pix copy-paste, pay_url, and related authorization / charge details
kodano_mandate_id / kodano_collection_idAdditional identifiers on the collection (returned as-is)
client_reference_idYour reference (defaults to reference)
api_environmentsandbox or production
failure_reason / settled_atPresent 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.

HTTP code sample
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"
HTTP code sample
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

statusMeaning
awaiting_fundsMandate created; waiting for payer authorization / first payment
processingMandate active and/or first charge paid; USDC settlement not finished yet
settledUSDC delivered to the beneficiary Base wallet
failedAuthorization refused or charge failed / refunded / chargeback
cancelledAuthorization or charge cancelled
expiredAuthorization 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_typeWhen
fiat_collection_settledCollection newly settled (USDC on Base)
fiat_collection_failedCollection newly failed
json, fiat_collection_settled code sample
json, fiat_collection_settled
{
  "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

  1. Confirm brl_usdc_collections is on for your sandbox partner and keys work with GET /api/v1/partners/me.
  2. POST /api/v1/fiat/beneficiaries with a Base USDC wallet, then POST …/provision-brl-va once Bridge KYB / bridge_customer_id is ready.
  3. POST …/collections/pix-automatico/mandates with a unique reference. Expect 201, status: awaiting_funds, and Pix / pay_url in deposit_instructions.
  4. Complete the first payment with the returned Pix string or hosted pay_url. Confirm the collection moves to processing.
  5. When BRL reaches the beneficiary Bridge VA and the onramp finishes, confirm status: settled, amount_usdc populated, and outbound fiat_collection_settled delivered.

Limits

  • Cancel mandate and variable-amount cycle charges are not available under /api/v1/fiat/collections yet.
  • Related but separate: one-time Pix QR (POST …/collections/one-time-pix) and card installments (POST …/collections/card-installments, separate feature flag).

Errors

HTTPcodeWhen
403brl_usdc_collections_disabledFeature flag off for the partner
409beneficiary_disabledMandate create against a disabled beneficiary
409beneficiary_external_reference_existsexternal_reference already used for another beneficiary
409collection_client_reference_existsclient_reference_id (or defaulted reference) already used
400invalid_amount / bad_requestBad BRL amount or missing reference
400invalid_destination_wallet / unsupported_destination_chainWallet must be a valid Base 0x address
400bridge_customer_requiredBeneficiary needs bridge_customer_id before some collection flows
503kodano_not_configuredCollections temporarily unavailable on this Crebit host (ops)
502joia_error / kodano_api_errorTemporary 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.