Skip to main content
To collect BRL via Pix and settle in USDC or USDT, create an autoconversion rule on your customer’s BRL account: Lumx returns a static Pix QR code (brCode), and every Pix payment made with it is converted and delivered on-chain. For a single charge, POST /transactions/on-ramp with rail set to PIX returns a brCode for that one payment. Both paths end the same way. The payer pays in BRL, Lumx converts, and the stablecoin is delivered on-chain, up to five minutes after the Pix. The receipt gives you the transaction hash.

Choose a method

Prerequisites

  • A customer in APPROVED status with an ACTIVE BRL account. For a business, see Open a named BRL account for a business.
  • An API key from the Dashboard and a webhook endpoint. See Webhooks.
  • The customer’s id, and for rules, the BRL account’s id from GET /accounts?customerId={customerId}.

Option 1: standing rule with a static Pix QR code

Send a POST request to /autoconversion-rules with the BRL account, the asset, and the network.
Request
The response carries the code to share, in sourceDepositInfo:
Response (excerpt)
Render the brCode as a QR code or show it as copy-and-paste text. The depositIdentifier is embedded in it and matches each payment to the rule. A BRL account can have more than one rule. The rule always converts at the market rate. It does not accept a locked quote. Each deposit must be worth at least 50 USD, or it is not converted. Request fields, retrieving and listing rules, errors, and the minimum amount are in Autoconversion Rules.

Option 2: one-off charge with an on-ramp

Send a POST request to /transactions/on-ramp. You set the amount, so the Pix code is for that payment.
Request
Response
Show state.payment.brCode to the payer. The metadata object comes back on the transaction and on every webhook, so you can match the payment to your order.

Request fields

Lock the rate

To quote a fixed amount of stablecoin, request a locked rate first with POST /exchange-rates (type set to LOCKED, timelock of 30s, 1m, or 5m). Then pass the returned id as exchangeRateId in the on-ramp request, together with customerId and purpose. See Exchange Rates.

Expiry and late payments

An on-ramp has a payment window. A floating Pix on-ramp expires after 1 day, and a locked one expires with its quote. If the payer pays after that, Lumx does not process the transaction and refunds the sender on Pix. Create a new on-ramp instead. You get the onramp.expired webhook when the window closes.

Track the payment with webhooks

Every Pix payment, from either method, runs as an on-ramp transaction. Subscribe to the onramp.* events: The happy path is AWAITING_FUNDS, TRANSFERRING_FIAT, TRADING, TRANSFERRING_STABLECOIN, SUCCESS. Deduplicate events with the webhook-id header, and verify the signature as described in Webhooks.

Confirm the on-chain delivery

onramp.success carries the receipt. The delivery is in transactionHash and blockExplorerUrl:
onramp.success (excerpt)
The fees object in the receipt breaks down the Lumx and partner fees, and finalTargetAmount is the amount delivered after them. The stablecoin is delivered on the blockchain you chose, or on the project’s default. An on-ramp credits the customer’s wallet, and a rule credits the wallet of the customer who owns the account. Each customer has one wallet per network. GET /customers/{id}?includeBalances=true returns the balances. Which asset runs on which network: The wallet is a regular on-chain address, so you can move the balance on with a transfer or an off-ramp. See Stablecoin Wallets.

Test in sandbox

A one-off on-ramp in sandbox completes on its own and credits the stablecoin to the customer’s wallet, so you can test the full flow and then use that balance for off-ramps. Deposits cannot be made against sandbox accounts, so for a rule, call POST /autoconversion-rules/simulate-deposit with the accountId, an amount, and the rule’s depositIdentifier as reference. The response is { "matchedRule": true }, and your endpoint receives the onramp.* events. The endpoint returns 404 in production.

Limits

An on-ramp counts against the customer’s onramp limits. A transaction above a limit returns 422 with TRANSACTION_LIMIT_EXCEEDED. See Transaction Limits.

Autoconversion Rules

Full reference for standing rules, in every currency.

Named BRL account

Open the BRL account that receives the Pix.

Transactions

On-ramp lifecycle and payment expiration.

Stablecoin Wallets

Networks, balances, and transfers out.