Skip to main content
POST
/
api
/
v1
/
accounts
/
{account-id}
/
orders
Create an order from a quote
curl --request POST \
  --url https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders \
  --header 'Content-Type: application/json' \
  --data '
{
  "quote-id": "550e8400-e29b-41d4-a716-446655440000",
  "source-wallet-address": "0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c",
  "target-wallet-address": "0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c",
  "target-end-user-pix-key": "user@example.com",
  "source-payment-method": "brcode"
}
'
{
  "order": {
    "base-rate": "1.0000",
    "state-updated-at": "2024-01-15T10:30:00Z",
    "effective-rate": "0.9950",
    "state": "created",
    "target-asset": "eth-base/brlv",
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "quote-id": "550e8400-e29b-41d4-a716-446655440000",
    "source-asset": "fiat/brl",
    "source-amount": "100.50",
    "created-at": "2024-01-15T10:30:00Z",
    "target-amount": "99.75",
    "fee-amount": "0.50",
    "fee-asset": "fiat/brl",
    "brcode": "00020101021226890014br.gov.bcb.pix...",
    "qr-code-base64": "<string>",
    "expiration": "2024-01-15T10:30:00Z"
  }
}

Path Parameters

account-id
string<uuid>
required

Body

application/json
quote-id
string<uuid>
required

Unique identifier of the quote to accept

Example:

"550e8400-e29b-41d4-a716-446655440000"

source-wallet-address
string | null

Ethereum wallet address for source tokens (required only when source asset is a token like eth-mainnet/brlv, eth-base/brlv or eth-base/wbrly)

Example:

"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c"

target-wallet-address
string | null

Ethereum wallet address for receiving tokens. Resolved server-side to an internal wallet, a whitelisted external wallet, or a target wallet. For FX (BRL<->USDC) orders, target wallets must also be FX-whitelisted for the account.

Example:

"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c"

target-end-user-pix-key
string | null

PIX key of a third-party end-user to receive BRL. Allowed only for USDC->BRL FX orders. When set, BRL is delivered directly from the Crown FX pool to this PIX key; the API user's own bank account is not touched.

Example:

"user@example.com"

source-payment-method
enum<string> | null

How the source BRL is collected. 'brcode' issues a one-time PIX QR for the exact amount that the account pays to fund a BRL->BRLV order; 'account-balance' funds from the account's existing BRL balance and is the default when this field is omitted.

Available options:
brcode,
account-balance
Example:

"brcode"

Response

Order created successfully

order
object
required