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"
}
'import requests
url = "https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders"
payload = {
"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"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
'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'
})
};
fetch('https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders"
payload := strings.NewReader("{\n \"quote-id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-end-user-pix-key\": \"user@example.com\",\n \"source-payment-method\": \"brcode\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders")
.header("Content-Type", "application/json")
.body("{\n \"quote-id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-end-user-pix-key\": \"user@example.com\",\n \"source-payment-method\": \"brcode\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"quote-id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-end-user-pix-key\": \"user@example.com\",\n \"source-payment-method\": \"brcode\"\n}"
response = http.request(request)
puts response.read_body{
"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",
"qr-code-base64": "<string>",
"fee-amount": "0.50",
"expiration": "2024-01-15T10:30:00Z",
"fee-asset": "fiat/brl",
"brcode": "00020101021226890014br.gov.bcb.pix..."
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}Create Order
Creates an order by accepting a quote. Wallet addresses are required only for token assets (eth-base/brlv, eth-mainnet/brlv, eth-base/wbrly). For fiat assets (fiat/brl, fiat/usd), no wallet addresses are needed. Use source-wallet-address for the source wallet and target-wallet-address for the destination wallet.
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"
}
'import requests
url = "https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders"
payload = {
"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"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
'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'
})
};
fetch('https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders"
payload := strings.NewReader("{\n \"quote-id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-end-user-pix-key\": \"user@example.com\",\n \"source-payment-method\": \"brcode\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders")
.header("Content-Type", "application/json")
.body("{\n \"quote-id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-end-user-pix-key\": \"user@example.com\",\n \"source-payment-method\": \"brcode\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.crown-brlv.com/api/v1/accounts/{account-id}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"quote-id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"source-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-wallet-address\": \"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c\",\n \"target-end-user-pix-key\": \"user@example.com\",\n \"source-payment-method\": \"brcode\"\n}"
response = http.request(request)
puts response.read_body{
"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",
"qr-code-base64": "<string>",
"fee-amount": "0.50",
"expiration": "2024-01-15T10:30:00Z",
"fee-asset": "fiat/brl",
"brcode": "00020101021226890014br.gov.bcb.pix..."
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"code": "<string>"
}
}Path Parameters
Body
Unique identifier of the quote to accept
"550e8400-e29b-41d4-a716-446655440000"
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)
"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c"
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.
"0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c"
PIX key of a third-party end-user bank account to receive BRL. Allowed for USDC->BRL and BRLV->BRL orders. The recipient bank account's tax-id must match the tax-id registered on the account the order is executed on. When set, BRL is delivered directly to this PIX key; the API user's own bank account is not touched.
"user@example.com"
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.
brcode, account-balance "brcode"
Response
Order created successfully
Show child attributes
Show child attributes