Why USDC and BRL
This picks up where the pay-in quickstart ends: the customer holds USDC on Polygon. Paying out over Pix shows the return trip, with the customer turning dollars on-chain back into reais, for example to pay a supplier or move the money to their own bank. The same calls work in other corridors. Register a destination on another rail, such as a CLABE overSPEI for MXN, and point the off-ramp at it. 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.- Build it for me
- Step by step
The agent writes and runs the full script, then reports back.
Prompt
How it works
Before you start
- A sandbox API key. See Authentication.
- An approved customer with USDC in their wallet. The pay-in quickstart gets you there, and this page uses the customer it creates.
1. Register the Pix destination
A destination is where the payout goes, and Lumx verifies its holder before any money is sent. Here it is the customer’s own Pix key, soholder.relationship is SELF and the holder’s name and taxId match the customer.
Request
Response (excerpt)
APPROVED, and this Pix destination comes back approved. Save its id. Later payouts to the same recipient can reuse it.
2. Create the off-ramp
The off-ramp sells 100 USDC from the customer’s Polygon wallet and sends the BRL to the destination. The minimum per payout is the equivalent of USD 40.Request
Response (excerpt)
- The destination already fixes the rail and the currency, so the request has no
railortargetCurrency. The response fills them in. PERSONAL_ACCOUNTonly works withSELFdestinations. To pay a third party, register the destination with their details and pick the matching purpose code.memogoes in the message field of the Pix.
3. Wait for the payout
The off-ramp moves throughTRANSFERRING_STABLECOIN, TRADING, and TRANSFERRING_FIAT to SUCCESS. In the sandbox this takes about a minute.
Request
Response (excerpt)
finalTargetAmount is the BRL the recipient receives, after fees. blockExplorerUrl opens the on-chain transfer that left the customer’s wallet.
What changes in production
- Recipients: most payouts go to third parties, such as suppliers or employees. Register their destination with their details and the right
holder.relationship. Destinations on some rails stay inUNDER_VERIFICATIONuntil Lumx approves them. Wait for thedestinations.approvedwebhook. - The rate: without a quote, the off-ramp converts at a floating rate. To fix the BRL amount before you pay, lock a quote.
- Status updates: subscribe to the
offramp.*webhooks instead of polling. - Sender name: the recipient sees your customer as the sender. See Sender of record.
Related resources
Pay out stablecoins via Pix
The full Pix payout guide, with third-party recipients and errors.
Lock an FX quote
Fix the BRL amount before you pay.
USDT to MXN over SPEI
The same flow in Mexico.
Pay-in: BRL to USDC
Fund the wallet first.