Overview
Converting assets with Crown API is a two-step process:- Create a quote between two assets to get exchange rates and pricing
- Create an order using the quote ID with additional information based on the asset types
Wallet addresses are required only for token assets (like
eth-base/brlv, eth-base/usdc). For fiat assets (fiat/brl), no wallet addresses are needed.Step 1: Create a Quote
First, request a quote specifying your source and target assets, along with either the source or target amount.Supported Conversions
BRL ↔ BRLV (same-currency conversions)fiat/brl→eth-base/brlveth-base/brlv→fiat/brlfiat/brl→tempo/brlvtempo/brlv→fiat/brl
fiat/brl→eth-base/usdceth-base/usdc→fiat/brl
FX conversions (BRL ↔ USDC) are subject to additional regulatory requirements. They require a
trade-reason on the quote request, and the corresponding wallets must be FX-whitelisted for the account.Request Examples
You can specify either
source-amount or target-amount in your quote request, but not both. The quote engine will calculate the other amount based on current exchange rates.FX Quotes: trade-reason
trade-reason is required only for FX quotes (BRL ↔ USDC), where it carries the SISBACEN classification mandated by the Central Bank of Brazil. It must be omitted for same-currency BRL ↔ BRLV quotes — those conversions are not FX trades and do not need a SISBACEN reason.
Valid values (FX quotes only), with the regulatory code each one carries:
The quote response echoes back
trade-reason along with trade-reason-code, the corresponding regulatory code.
FX Quotes: rate-lock
An FX quote is priced live and stays valid for five seconds:expires-at is the deadline to place the order. To hold the rate for longer, request a quote rate lock by name with rate-lock. Two locks are available: 15s keeps the quote valid for fifteen seconds and 10m for ten minutes. The extra time is charged as basis points added to the account’s spread, priced per lock. The rate lock is folded into pricing.spread, never shown as a separate line.
BRL to USDC (FX), rate locked for 10 minutes
rate-lock when the lock was granted, and the order created from that quote carries it too. A quote can also be refused with:
rate-lock: quote rate locks apply only to FX conversions between BRL and a non-BRL-pegged assetwhen the field is sent on a BRL ↔ BRLV quote.Quote rate lock 10m is currently unavailablewhen Crown is not offering that lock at the moment. Retry without it.
FX Quotes: payment-term
For a BRL → USDC order that will be paid with a PIX QR code (see pay after acceptance),payment-term says how long after accepting the quote the QR code may be paid:
Payment terms must be enabled individually on your account, like rate locks; contact Crown’s support team for each one you need. A quote with
10m or d1 can only be accepted with source-payment-method: "brcode", and is refused with Payment term 10m is not enabled for this account (or d1) without the capability. The order response carries the resulting deadline in expiration. Like the rate lock, the term’s rate is folded into pricing.spread.
BRL to USDC (FX), pay within ten minutes
Quote Response
Quote responses include a full pricing breakdown so you can audit the all-in cost before placing an order:Step 2: Create an Order
Once you have a quote ID, create an order to execute the conversion. The required fields depend on your source and target asset types.Wallet Address Requirements
Wallets managed by Crown can be used immediately. To use a wallet that isn’t managed by Crown, you must first contact Crown’s support team to register it. Registration is per-operation:
- Minting BRLV to an external wallet requires that wallet to be registered for BRLV minting.
- FX orders that deliver USDC to an external wallet (BRL → USDC) require that wallet to be registered for FX operations.
target-end-user-pix-key (see Delivering BRL to a third party).
Delivering BRL to a third party
For USDC → BRL FX orders, you can have BRL delivered directly to a third-party recipient by settingtarget-end-user-pix-key. When this field is set, BRL is paid from Crown’s FX pool straight to that PIX key — your own bank account is not touched.
This field is allowed only for USDC → BRL FX orders.
Order Examples
Funding an order with PIX
By default, afiat/brl order is funded from the account’s existing BRL balance. To instead let the account holder pay for the order with a one-time PIX QR code, set source-payment-method to brcode when creating the order.
source-payment-method accepts:account-balance(default, used when the field is omitted): the order is funded from the account’s existing BRL balance.brcode: Crown issues a one-time PIX QR code for the exact order amount. The order settles once the QR is paid.
brcode is available for BRL → BRLV and for BRL → USDC (FX). The two behave differently after payment, see below.brcode, the response carries the PIX payload to present to the payer:
brcode: the EMV PIX copy-paste payload.qr-code-base64: a base64-encoded PNG of the QR code.expiration: when the QR code stops being payable.
The PIX QR code can only be paid from a bank account under the tax ID registered for the account that placed the order: the account holder funds their own QR code. A payment from any other payer is refused by the bank.
BRL → BRLV
- Create a quote for
fiat/brl→eth-base/brlv(ortempo/brlv). - Create the order with
source-payment-method: "brcode"and thetarget-wallet-addressthat will receive BRLV. The order is parked awaiting payment, and the response carries thebrcode/qr-code-base64. - Pay the QR code. Funds are pulled in via PIX rather than from the account balance.
- BRLV is minted to the target wallet once payment is confirmed, and the order-completed webhook fires.
pending-payment state with the PIX payload to collect payment:
BRL → USDC: pay after acceptance
For FX orders,brcode lets you lock the rate first and pay afterwards. The account does not need BRL on balance when the order is created: accepting the quote fixes effective-rate, reserves the USDC, and returns a PIX QR code with a deadline. The USDC is delivered to the target wallet once the PIX arrives.
The flow is:
- Create a quote for
fiat/brl→eth-base/usdcwith atrade-reason. - Create the order with
source-payment-method: "brcode"and an FX-whitelistedtarget-wallet-address. The rate is locked at this point. - Pay the QR code before
expiration. This is the funding deadline, not just the QR’s validity, and it follows the quote’spayment-term: the end of today’s trading day by default, ten minutes after acceptance for10m, the end of the next business day ford1. - USDC is delivered to the target wallet once the PIX is confirmed, and the order-completed webhook fires.
expired shortly after expiration. The reservation is released and nothing is charged or owed: the account simply did not take the rate. To convert, create a new quote.
If the PIX arrives after expiration, it cannot be applied to an order that has already expired. Crown asks the bank to return the payment to the account it came from, the order moves to payment-returned, and the order-refund-initiated webhook fires with the deposit identifier. The webhook says the return was requested; the bank settles it afterwards.
The order can also be refused at creation with
Paying after acceptance is not available right now. Pay from your BRL balance instead. This happens when the trading day is closed, or when the quote’s term would already have run out. Retry later, or fund the order from the account balance.Outside the trading day, only the 10m term is sold, and only to accounts enabled for off-market trading. A quote with no term, or with d1, cannot be paid after acceptance until the next trading day opens.Order Fees
Every order response includes the fee Crown charged for the conversion:fee-amount— the fee amount (decimal string).fee-asset— the asset the fee is denominated in (e.g.,fiat/brl).
pricing.fee.
Order Status
After creating an order, it will go through several status states:pending-payment- Abrcodeorder waiting for its PIX. An order paid from the account balance never waits herepending-delivery- The order is paid and its target asset is on its wayrolling-back- The order is being undonecompleted- Order has been successfully completedrolled-back- Order was undone for a reason other than fundingexpired- Abrcodeorder whose funding window closed with no payment. Nothing was charged and nothing is owedpayment-returned- Abrcodeorder whose PIX arrived after the window. The payment is being returned to the account it came fromrejected- The order could not go ahead
- Using the Get Order endpoint
- Listing orders by state with the List Orders by State endpoint
- Setting up webhooks and listening to the order-completed and order-refund-initiated webhooks
Listing orders by state
The List Orders by State endpoint lists your orders in the states you pass instates, comma separated.
If you manage sub-accounts, their orders are included, each with its account-id.
Without states, it lists orders in every state.
To see every order still waiting on a payment or a delivery:
limit orders.
While next-cursor is not null, request the next page with cursor set to it.
Reconciling a day of orders
To check a day of orders against your own records, list every order that completed on that day.date is the calendar day in America/Sao_Paulo on which an order reached its state: the day it completed, for a completed order.