Preview a Swap

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

What does this endpoint do?

The purpose of this endpoint is to simulate a ramp process and generate a quote. It validates your payload, calculates the exchange rate, and estimates the blockchain fees.

Flow Configuration:
The flow is determined by the properties you include in the request:

  • On-ramp: Include cryptoWithdrawalInformation to ensure the cryptocurrency is sent to the correct wallet.
  • Off-ramp: Include fiatWithdrawalInformation. You must provide either a Key (PIX Key) or a QrCode to ensure the funds are sent to the correct destination.

QR Code Payout Logic (Off-ramp)

When using a PIX QrCode within fiatWithdrawalInformation, the validation of the quoteRequest depends on whether the code has an embedded value:

  • QR Code without value: You act as the definer of the amount. You must provide either BaseAmount or QuoteAmount in the quoteRequest.
{
  "taxId": "33821597035",
  "name": "José",
  "email": "[email protected]",
  "externalId": "123",
  "taxIdCountry": "BRA",
  "DepositBlockchain": "Polygon",
  "fiatWithdrawalInformation": {
    "QrCode": "000201..." // Generic QR Code
  },
  "quoteRequest": {
    "Side": "Sell",
    "BaseAmount": 10, // Amount is REQUIRED
    "QuoteAmount": 0,
    "BaseCurrency": "USDC",
    "QuoteCurrency": "BRL"
  }
}
  • QR Code with value: The amount is fixed by the QR Code itself. You must set both BaseAmount and QuoteAmount to 0 in the quoteRequest. The API will automatically extract the amount from the QR Code string.
{
  "taxId": "33821597035",
  "name": "José",
  "email": "[email protected]",
  "externalId": "123",
  "taxIdCountry": "BRA",
  "DepositBlockchain": "Polygon",
  "fiatWithdrawalInformation": {
    "QrCode": "000201..." // QR Code with embedded value (e.g., R$ 50.00)
  },
  "quoteRequest": {
    "Side": "Sell",
    "BaseAmount": 0,      // Must be 0
    "QuoteAmount": 0,     // Must be 0
    "BaseCurrency": "USDC",
    "QuoteCurrency": "BRL"
  }
}

Refund Configuration & Auto-Refunds

To enable automatic refunds in case of an error during the flow, you must provide the refundCryptoAddress property in this request.

Refund Constraints

The eligibility for an automatic refund depends on when the error occurs:

  • Before Trade: If the error happens before the exchange takes place, the refund can be processed for any currency pair.
  • After Trade: If the error happens after the exchange, the automatic refund is supported only for equivalent currency pairs (e.g., BRL-BRZ).

Quote Information

To generate a valid preview, you must provide the quoteRequest object containing the specific trade details (such as amount, side, and currencies).

Note: Unlike the v1 endpoint, passing a pre-existing quoteId is not supported here, as this endpoint is responsible for calculating the quote.

Response Data

The response will include a previewId and a blockchainFee.

  • previewId: Required to call the Create Swap Order (Accept) endpoint.
  • blockchainFee: specifically refers to the fee charged by the blockchain network to process the transaction, unrelated to service fees.
Body Params
string
required

Field that uniquely identifies the individual or country. Only numbers accepted, all number should be sent, including leading zeros when applicable.

string
enum
required
string

Field used for partner link a personal identifier

string

Holder's name

string

Holder's email

quoteRequest
object
required

Properties for quote request

fiatWithdrawalInformation
object

Information for withdraw in off-ramp proccess. Only mandatory in off-ramp proccess

cryptoWithdrawalInformation
object

Information for withdraw in on-ramp proccess. Only mandatory in on-ramp proccess

string
enum

Target deposit blockchain

string

Wallet address to auto-refund crypto in case of error during the flow

Headers
string
required
Responses

401

Unauthorized

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json