Create a currency quote
Creates a quote for a given currency pair.
You can create a quote for either an internal currency exchange or an outbound payment.
To create a quote for an internal currency exchange, set type.to to balance.
For an outbound payment, use any of payment, multiple, or forward.
Once you’ve created a quote, you can create an order.
All quotes expire after 12 seconds.
curl --request POST \
--url 'https://api.equalsmoney.com/v2/orders/quote?accountId={{accountId}}' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"targetCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"settlementDate": "20221027",
"type": {
"from": "bank",
"to": "payment",
"recipientId": "8lciyups6"
},
"marginCurrency": "USD"
}
'import requests
url = "https://api.equalsmoney.com/v2/orders/quote"
payload = {
"sourceCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"targetCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"settlementDate": "20221027",
"type": {
"from": "bank",
"to": "payment",
"recipientId": "8lciyups6"
},
"marginCurrency": "USD"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceCurrency: {
amount: 0,
currency: {budgetId: '775596ae-2624-40af-a9dc-9756110a4a03', currencyCode: 'USD'}
},
targetCurrency: {
amount: 0,
currency: {budgetId: '775596ae-2624-40af-a9dc-9756110a4a03', currencyCode: 'USD'}
},
settlementDate: '20221027',
type: {from: 'bank', to: 'payment', recipientId: '8lciyups6'},
marginCurrency: 'USD'
})
};
fetch('https://api.equalsmoney.com/v2/orders/quote', 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.equalsmoney.com/v2/orders/quote",
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([
'sourceCurrency' => [
'amount' => 0,
'currency' => [
'budgetId' => '775596ae-2624-40af-a9dc-9756110a4a03',
'currencyCode' => 'USD'
]
],
'targetCurrency' => [
'amount' => 0,
'currency' => [
'budgetId' => '775596ae-2624-40af-a9dc-9756110a4a03',
'currencyCode' => 'USD'
]
],
'settlementDate' => '20221027',
'type' => [
'from' => 'bank',
'to' => 'payment',
'recipientId' => '8lciyups6'
],
'marginCurrency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.equalsmoney.com/v2/orders/quote"
payload := strings.NewReader("{\n \"sourceCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"targetCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"settlementDate\": \"20221027\",\n \"type\": {\n \"from\": \"bank\",\n \"to\": \"payment\",\n \"recipientId\": \"8lciyups6\"\n },\n \"marginCurrency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.equalsmoney.com/v2/orders/quote")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sourceCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"targetCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"settlementDate\": \"20221027\",\n \"type\": {\n \"from\": \"bank\",\n \"to\": \"payment\",\n \"recipientId\": \"8lciyups6\"\n },\n \"marginCurrency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.equalsmoney.com/v2/orders/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"targetCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"settlementDate\": \"20221027\",\n \"type\": {\n \"from\": \"bank\",\n \"to\": \"payment\",\n \"recipientId\": \"8lciyups6\"\n },\n \"marginCurrency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "EABCDE6FGHI0",
"quoteRequestId": "USD-USD-5-5",
"settlement": {
"date": "20221027",
"price": {
"amount": 5,
"currency": "USD"
},
"charges": {
"fee": 0,
"margin": 0,
"other": 0
}
},
"quote": {
"rate": 1,
"inverseRate": 1,
"fromGbpAmount": 3,
"from": {
"amount": 5,
"currency": "USD"
},
"to": {
"amount": 5,
"currency": "USD"
},
"direction": 1
}
}Authorizations
Query Parameters
The ID of the account to work with.
"F50091"
Body
Body
Details about the source currency.
Show child attributes
Show child attributes
Details about the target currency.
Show child attributes
Show child attributes
The settlement date.
^20[0-9]{2}[0-2][0-9][0-3][0-9]$"20221027"
Details about the type of quote that you're creating.
Show child attributes
Show child attributes
The ISO-4217 currency in which margin (collateral) is held for the contract. Required when creating a forward contract.
^[A-Z]{3}$"USD"
Was this page helpful?
curl --request POST \
--url 'https://api.equalsmoney.com/v2/orders/quote?accountId={{accountId}}' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"targetCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"settlementDate": "20221027",
"type": {
"from": "bank",
"to": "payment",
"recipientId": "8lciyups6"
},
"marginCurrency": "USD"
}
'import requests
url = "https://api.equalsmoney.com/v2/orders/quote"
payload = {
"sourceCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"targetCurrency": {
"amount": 0,
"currency": {
"budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
"currencyCode": "USD"
}
},
"settlementDate": "20221027",
"type": {
"from": "bank",
"to": "payment",
"recipientId": "8lciyups6"
},
"marginCurrency": "USD"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceCurrency: {
amount: 0,
currency: {budgetId: '775596ae-2624-40af-a9dc-9756110a4a03', currencyCode: 'USD'}
},
targetCurrency: {
amount: 0,
currency: {budgetId: '775596ae-2624-40af-a9dc-9756110a4a03', currencyCode: 'USD'}
},
settlementDate: '20221027',
type: {from: 'bank', to: 'payment', recipientId: '8lciyups6'},
marginCurrency: 'USD'
})
};
fetch('https://api.equalsmoney.com/v2/orders/quote', 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.equalsmoney.com/v2/orders/quote",
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([
'sourceCurrency' => [
'amount' => 0,
'currency' => [
'budgetId' => '775596ae-2624-40af-a9dc-9756110a4a03',
'currencyCode' => 'USD'
]
],
'targetCurrency' => [
'amount' => 0,
'currency' => [
'budgetId' => '775596ae-2624-40af-a9dc-9756110a4a03',
'currencyCode' => 'USD'
]
],
'settlementDate' => '20221027',
'type' => [
'from' => 'bank',
'to' => 'payment',
'recipientId' => '8lciyups6'
],
'marginCurrency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.equalsmoney.com/v2/orders/quote"
payload := strings.NewReader("{\n \"sourceCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"targetCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"settlementDate\": \"20221027\",\n \"type\": {\n \"from\": \"bank\",\n \"to\": \"payment\",\n \"recipientId\": \"8lciyups6\"\n },\n \"marginCurrency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.equalsmoney.com/v2/orders/quote")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sourceCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"targetCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"settlementDate\": \"20221027\",\n \"type\": {\n \"from\": \"bank\",\n \"to\": \"payment\",\n \"recipientId\": \"8lciyups6\"\n },\n \"marginCurrency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.equalsmoney.com/v2/orders/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"targetCurrency\": {\n \"amount\": 0,\n \"currency\": {\n \"budgetId\": \"775596ae-2624-40af-a9dc-9756110a4a03\",\n \"currencyCode\": \"USD\"\n }\n },\n \"settlementDate\": \"20221027\",\n \"type\": {\n \"from\": \"bank\",\n \"to\": \"payment\",\n \"recipientId\": \"8lciyups6\"\n },\n \"marginCurrency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "EABCDE6FGHI0",
"quoteRequestId": "USD-USD-5-5",
"settlement": {
"date": "20221027",
"price": {
"amount": 5,
"currency": "USD"
},
"charges": {
"fee": 0,
"margin": 0,
"other": 0
}
},
"quote": {
"rate": 1,
"inverseRate": 1,
"fromGbpAmount": 3,
"from": {
"amount": 5,
"currency": "USD"
},
"to": {
"amount": 5,
"currency": "USD"
},
"direction": 1
}
}