curl --request POST \
--url https://api-sandbox.circle.com/v1/exchange/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"currency": "EURC",
"amount": "100.00"
},
"to": {
"currency": "EURC",
"amount": "100.00"
},
"type": "tradable"
}
'import requests
url = "https://api-sandbox.circle.com/v1/exchange/quotes"
payload = {
"from": {
"currency": "EURC",
"amount": "100.00"
},
"to": {
"currency": "EURC",
"amount": "100.00"
},
"type": "tradable"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: {currency: 'EURC', amount: '100.00'},
to: {currency: 'EURC', amount: '100.00'},
type: 'tradable'
})
};
fetch('https://api-sandbox.circle.com/v1/exchange/quotes', 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://api-sandbox.circle.com/v1/exchange/quotes",
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([
'from' => [
'currency' => 'EURC',
'amount' => '100.00'
],
'to' => [
'currency' => 'EURC',
'amount' => '100.00'
],
'type' => 'tradable'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api-sandbox.circle.com/v1/exchange/quotes"
payload := strings.NewReader("{\n \"from\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"type\": \"tradable\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-sandbox.circle.com/v1/exchange/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"type\": \"tradable\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.circle.com/v1/exchange/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"type\": \"tradable\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "b8627ae8-732b-4d25-b947-1df8f4007a29",
"rate": 0.9259,
"from": {
"currency": "EURC",
"amount": "100.00"
},
"to": {
"currency": "EURC",
"amount": "100.00"
},
"type": "tradable",
"expiry": "2020-04-10T02:13:30.000Z",
"timestamp": "2020-04-10T02:13:30.000Z",
"estimatedSettlementTime": "2020-04-10T02:13:30.000Z",
"source": {
"type": "wallet",
"id": "1000662322",
"description": "End User Wallet"
},
"destination": {
"type": "wallet",
"id": "1000662322",
"description": "End User Wallet"
},
"clientEntityId": "a3f1b2c4-d5e6-7890-abcd-ef1234567890"
}
}Create an FX quote
curl --request POST \
--url https://api-sandbox.circle.com/v1/exchange/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"currency": "EURC",
"amount": "100.00"
},
"to": {
"currency": "EURC",
"amount": "100.00"
},
"type": "tradable"
}
'import requests
url = "https://api-sandbox.circle.com/v1/exchange/quotes"
payload = {
"from": {
"currency": "EURC",
"amount": "100.00"
},
"to": {
"currency": "EURC",
"amount": "100.00"
},
"type": "tradable"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: {currency: 'EURC', amount: '100.00'},
to: {currency: 'EURC', amount: '100.00'},
type: 'tradable'
})
};
fetch('https://api-sandbox.circle.com/v1/exchange/quotes', 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://api-sandbox.circle.com/v1/exchange/quotes",
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([
'from' => [
'currency' => 'EURC',
'amount' => '100.00'
],
'to' => [
'currency' => 'EURC',
'amount' => '100.00'
],
'type' => 'tradable'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api-sandbox.circle.com/v1/exchange/quotes"
payload := strings.NewReader("{\n \"from\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"type\": \"tradable\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api-sandbox.circle.com/v1/exchange/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"type\": \"tradable\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.circle.com/v1/exchange/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"to\": {\n \"currency\": \"EURC\",\n \"amount\": \"100.00\"\n },\n \"type\": \"tradable\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "b8627ae8-732b-4d25-b947-1df8f4007a29",
"rate": 0.9259,
"from": {
"currency": "EURC",
"amount": "100.00"
},
"to": {
"currency": "EURC",
"amount": "100.00"
},
"type": "tradable",
"expiry": "2020-04-10T02:13:30.000Z",
"timestamp": "2020-04-10T02:13:30.000Z",
"estimatedSettlementTime": "2020-04-10T02:13:30.000Z",
"source": {
"type": "wallet",
"id": "1000662322",
"description": "End User Wallet"
},
"destination": {
"type": "wallet",
"id": "1000662322",
"description": "End User Wallet"
},
"clientEntityId": "a3f1b2c4-d5e6-7890-abcd-ef1234567890"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Currency and, optionally, amount to sell. Exactly one of from and to must be USDC. Set at most one of from.amount and to.amount; tradable quotes require exactly one. Amounts must be at least 2.00 with at most 2 decimal places.
Show child attributes
Show child attributes
Currency and, optionally, amount to buy.
Show child attributes
Show child attributes
The quote type. Use tradable to get a quote you can execute with Create an FX trade. Defaults to reference.
reference, tradable "tradable"
Required for tradable quotes. The end user's account that is debited for the from amount. Ignored for reference quotes.
Show child attributes
Show child attributes
The end user's account that is credited with the to amount. Must belong to the same client entity as source. Defaults to source. Ignored for reference quotes.
Show child attributes
Show child attributes
Response
Successfully created a quote.
Show child attributes
Show child attributes
Was this page helpful?