GET /v2/swap/quote and GET /v2/swap/status/{id}—against a real testnet ERC-20 on Base Sepolia (pBRL), so you can verify how your application handles quotes, on-chain settlements, refunds, and payout failures without a live Pix transfer.
Supported sandbox corridors
Both corridors use
GET /v2/swap/status/{id} to track the quote’s progress.
What you can test Test your backend quote requests, BR Code rendering, status polling, on-chain balance updates on Base Sepolia (84532), payer-mismatch refunds, and offramp payout failures. Pix rails and recipient lookups are simulated in staging;pBRL(0x9762f60740142cF11C0F32C6e24cd3e86016C0f2) is a testnet token with no claim on real BRL. Sandbox transition routes are not registered in production.
Before you start
You’ll need:- Your staging Pods API URL and customer API key, provided by Pods.
- An approved sandbox KYC profile (
status: "approved",brlaEnabled: true) whosewalletAddressmatches the ramp wallet. Save itskycUserId. - Node.js 20 or later to run the examples using built-in
fetch.
Set up the Node.js client
Run these examples on your backend. ConfigurePODS_API_BASE_URL and PODS_API_KEY in your environment with the staging values provided by Pods.
Save this helper as pods-client.mjs:
await. Save them as .mjs files alongside the helper.
Ramp status reference
These are the quote statuses used by the sandbox ramp flows:Onramp: BRL Pix to pBRL
Use the standardGET /v2/swap/quote endpoint with originChain=fiat, destinationChain=base-sepolia, tokenIn=BRL, and tokenOut=0x9762f60740142cF11C0F32C6e24cd3e86016C0f2. Pass amountIn in BRL cents (1000 = R$10.00) and destinationAddress set to the wallet on your approved sandbox KYC profile.
1. Request an onramp quote
onramp.quote.id. The response matches the production Pix onramp envelope, with a visually non-payable placeholder in paymentInstructions.pix.copyPaste (sandbox-only-dont-pay-it:<quoteId>) so your frontend can render the QR or copy-paste code without risk of a real Pix transfer.
2. Simulate payment confirmation (mint pBRL)
Continue in the same script and pass bothquoteId and the matching kycUserId:
kycUserId matches the profile bound to the quote, Pods broadcasts a real onramp transaction on Base Sepolia that mints 10 pBRL (10000000000000000000) to destinationAddress and reconciles the QuoteMinted event.
3. Confirm the result in your application
destinationTxHash on Base Sepolia BaseScan.
Offramp: pBRL to BRL Pix
To test an offramp, theoriginAddress wallet must already hold pBRL on Base Sepolia (minted through the onramp flow above). Pass amountIn in 18-decimal pBRL base units (10000000000000000000 = 10 pBRL, a whole number of BRL cents) along with originAddress and any non-empty pixKey.
1. Request an offramp quote
Start a separate script:chainId and transactionData without a paymentInstructions block. If the wallet’s pBRL balance is below amountIn, the quote step returns 409 SANDBOX_INSUFFICIENT_PBRL.
2. Simulate settlement (burn pBRL)
Confirm the offramp quote withquoteId alone (kycUserId is not required for offramp confirmation):
pBRL from originAddress and reconciles the QuoteRedeemed event.
3. Confirm the result in your application
Test refunds and failures
Use separate pending quotes to verify how your application handles a payer-mismatch refund on an onramp or a rejected Pix payout on an offramp.Simulate an onramp refund (payer mismatch)
Create a new onramp quote, then callconfirmSandboxQuote with a missing, null, or different kycUserId:
QuoteRefunded event on the Base Sepolia pBRL contract without minting tokens and transitions the quote to refunded.
Simulate a failed offramp payout
Create a new offramp quote (against a wallet holding enoughpBRL), then call failSandboxOffRamp:
failureCode is optional and defaults to PROVIDER_REJECTED. Supported values:
This transition applies only to a
pending (or confirmed) sandbox offramp quote and makes no on-chain transaction, so the wallet keeps its pBRL balance.
State transitions
Onramp (BRL → pBRL)
Offramp (pBRL → BRL)
Troubleshooting and reference
Additional behavior:
GET /v2/swap/status/{id}is read-only for sandbox quotes until you call a sandbox transition endpoint (or the quote expires).- Terminal quotes (
fulfilled,refunded,failed,expired) reject further transition calls with409 PAYMENT_STATE_CONFLICT. - Validation or RPC errors (
HttpError) duringPOST /v2/swap/status/sandbox/confirmedleave the quote retryable; only a genuine on-chain revert marks the quotefailed. - In-flight settlements acquire a 60-second lease so concurrent confirmation calls reconcile the same transaction rather than broadcasting duplicate mints or burns.
Prepare for production
Before moving beyond the sandbox, verify that your application:- Requests quotes through
GET /v2/swap/quoteusing production chain names (base,polygon,monad,solana,stable) and token addresses. - Renders
paymentInstructions.pix.copyPasteon onramps and signs/submitstransactionDataon offramps. - Polls
GET /v2/swap/status/{id}until a terminal status (fulfilled,refunded,failed,expired) and handlesfailuredetails. - Uses a production Pods API key and keeps it on the backend.
- Pods Ramp Overview: end-to-end architecture for KYC, quotes, and limits.
- Move Money with Pods Ramp: production parameters, token addresses, and execution instructions across all supported networks.
- Track Pods Ramp Status: production status polling and Pix
fiatSettlementreceipts (endToEndIdandrefundEndToEndId).