Skip to main content
A pay-in takes fiat from a payer and delivers stablecoin to your customer. In this quickstart, a payer sends 1,000 BRL over Pix and your customer receives the equivalent in USDC on Polygon. It runs in the sandbox, where verification and the Pix payment are simulated, so it takes a few minutes and no real money moves.

Why BRL and USDC

The example uses Brazil because Pix settles instantly and the sandbox simulates it from start to finish. USDC is a dollar stablecoin, so your customer ends up holding dollars on-chain: think of a Brazilian client paying an invoice in reais while your customer keeps the proceeds in dollars. The same calls work in other corridors. Change the currency in accounts, the rail, and sourceCurrency, for example MXN over SPEI. See Coverage for every currency, rail, and network.

Build it with your AI agent

Copy a prompt into Cursor, Claude Code, Codex, or any coding agent. Both read this page and the API spec before writing code.
The agent writes and runs the full script, then reports back.
Prompt

How it works

Before you start

1. Create a customer with a BRL account

Every pay-in belongs to a customer, and the BRL has to land in an account in that customer’s name. Create both in one call: accounts lists the currencies to open.
Request
Response (excerpt)
Save the customer id. In the sandbox, the last digit of taxId sets the verification outcome, and a taxId that ends in 5 is approved. See Sandbox magic numbers. A customer has to accept the Lumx terms of service before verification can start.
Request
Response
Send {} as the body. A POST without a body is rejected with 411. In the sandbox, the customer moves to APPROVED as soon as you request the link.

3. Wait for the BRL account to be active

The account can only receive money once it is ACTIVE. After the customer is approved, it goes through REQUESTED and PROVISIONING to ACTIVE. In the sandbox this takes about a minute.
Request
Response (excerpt)

4. Create the on-ramp

The on-ramp says what you expect to receive and what to deliver: 1,000 BRL over Pix, converted to USDC on Polygon. Polygon is one of several supported networks, and blockchain picks it.
Request
Response
  • state.payment.brCode is the Pix code the payer pays. In the sandbox, the payment is simulated and the on-ramp continues on its own.
  • The Idempotency-Key header makes a retried request safe: the same key never creates a second on-ramp. See Idempotency.
  • purpose declares why the money moves. PERSONAL_ACCOUNT fits a customer funding their own wallet. See Purpose codes.

5. Wait for the USDC

The on-ramp moves through TRADING and TRANSFERRING_STABLECOIN to SUCCESS. In the sandbox this takes about a minute.
Request
Response (excerpt)
The receipt shows the conversion. baseTargetAmount is the USDC before fees, fees breaks them down, and finalTargetAmount is what reached the customer’s wallet. blockExplorerUrl opens the on-chain transfer. The customer now holds USDC. Pay it out in the payout quickstart.

What changes in production

  • Verification: your customer opens the terms of service link and completes KYC or KYB. See Individual Verification and Business Verification.
  • The payment: the payer pays the brCode from any Pix app. If nobody pays within the payment window, the on-ramp expires. See Transactions.
  • Status updates: subscribe to the account.active and onramp.* webhooks instead of polling.
  • Recurring deposits: to convert every deposit into an account without one call per payment, use an autoconversion rule.

Payout: USDC to BRL

Pay the USDC out to a Pix key.

Autoconversion rules

Convert every deposit automatically, with no call per payment.

Collect BRL via Pix

The full pay-in guide, with locked rates and webhooks.

Coverage

Every currency, rail, and network you can swap in.