Estimate exchange amount for a currency pair
curl --request POST \
--url https://api.example.com/api/v1/partner/public/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"exchangeId": 1,
"sourceCurrencyId": 1,
"destCurrencyId": 2,
"amount": 1000,
"direction": "source"
}
'import requests
url = "https://api.example.com/api/v1/partner/public/estimate"
payload = {
"exchangeId": 1,
"sourceCurrencyId": 1,
"destCurrencyId": 2,
"amount": 1000,
"direction": "source"
}
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({
exchangeId: 1,
sourceCurrencyId: 1,
destCurrencyId: 2,
amount: 1000,
direction: 'source'
})
};
fetch('https://api.example.com/api/v1/partner/public/estimate', 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.example.com/api/v1/partner/public/estimate",
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([
'exchangeId' => 1,
'sourceCurrencyId' => 1,
'destCurrencyId' => 2,
'amount' => 1000,
'direction' => 'source'
]),
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.example.com/api/v1/partner/public/estimate"
payload := strings.NewReader("{\n \"exchangeId\": 1,\n \"sourceCurrencyId\": 1,\n \"destCurrencyId\": 2,\n \"amount\": 1000,\n \"direction\": \"source\"\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.example.com/api/v1/partner/public/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"exchangeId\": 1,\n \"sourceCurrencyId\": 1,\n \"destCurrencyId\": 2,\n \"amount\": 1000,\n \"direction\": \"source\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/partner/public/estimate")
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 \"exchangeId\": 1,\n \"sourceCurrencyId\": 1,\n \"destCurrencyId\": 2,\n \"amount\": 1000,\n \"direction\": \"source\"\n}"
response = http.request(request)
puts response.read_body{
"sourceAmount": 1000,
"destAmount": 41500,
"rate": 41.5,
"isReverse": false,
"sourceCurrency": {
"id": 1,
"name": "US Dollar",
"ticker": "USD",
"image": {
"id": "cbcfa8b8-3a25-4adb-a9c6-e325f0d0f3ae",
"path": "/uploads/usd.png"
}
},
"destCurrency": {
"id": 1,
"name": "US Dollar",
"ticker": "USD",
"image": {
"id": "cbcfa8b8-3a25-4adb-a9c6-e325f0d0f3ae",
"path": "/uploads/usd.png"
}
},
"exchangeId": 1,
"offerId": 42
}{
"statusCode": 400,
"message": [
"url must be a URL address",
"events should not be empty"
],
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Not Found"
}{
"statusCode": 429,
"message": "Too Many Requests"
}Public
Estimate Exchange
Calculates the estimated source or destination amount for a given currency pair and exchange. Uses the same rate logic as order creation.
POST
/
partner
/
public
/
estimate
Estimate exchange amount for a currency pair
curl --request POST \
--url https://api.example.com/api/v1/partner/public/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"exchangeId": 1,
"sourceCurrencyId": 1,
"destCurrencyId": 2,
"amount": 1000,
"direction": "source"
}
'import requests
url = "https://api.example.com/api/v1/partner/public/estimate"
payload = {
"exchangeId": 1,
"sourceCurrencyId": 1,
"destCurrencyId": 2,
"amount": 1000,
"direction": "source"
}
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({
exchangeId: 1,
sourceCurrencyId: 1,
destCurrencyId: 2,
amount: 1000,
direction: 'source'
})
};
fetch('https://api.example.com/api/v1/partner/public/estimate', 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.example.com/api/v1/partner/public/estimate",
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([
'exchangeId' => 1,
'sourceCurrencyId' => 1,
'destCurrencyId' => 2,
'amount' => 1000,
'direction' => 'source'
]),
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.example.com/api/v1/partner/public/estimate"
payload := strings.NewReader("{\n \"exchangeId\": 1,\n \"sourceCurrencyId\": 1,\n \"destCurrencyId\": 2,\n \"amount\": 1000,\n \"direction\": \"source\"\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.example.com/api/v1/partner/public/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"exchangeId\": 1,\n \"sourceCurrencyId\": 1,\n \"destCurrencyId\": 2,\n \"amount\": 1000,\n \"direction\": \"source\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/partner/public/estimate")
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 \"exchangeId\": 1,\n \"sourceCurrencyId\": 1,\n \"destCurrencyId\": 2,\n \"amount\": 1000,\n \"direction\": \"source\"\n}"
response = http.request(request)
puts response.read_body{
"sourceAmount": 1000,
"destAmount": 41500,
"rate": 41.5,
"isReverse": false,
"sourceCurrency": {
"id": 1,
"name": "US Dollar",
"ticker": "USD",
"image": {
"id": "cbcfa8b8-3a25-4adb-a9c6-e325f0d0f3ae",
"path": "/uploads/usd.png"
}
},
"destCurrency": {
"id": 1,
"name": "US Dollar",
"ticker": "USD",
"image": {
"id": "cbcfa8b8-3a25-4adb-a9c6-e325f0d0f3ae",
"path": "/uploads/usd.png"
}
},
"exchangeId": 1,
"offerId": 42
}{
"statusCode": 400,
"message": [
"url must be a URL address",
"events should not be empty"
],
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Not Found"
}{
"statusCode": 429,
"message": "Too Many Requests"
}Authorizations
Partner API key. Format: sk_branch_<32chars>, sk_personal_<32chars>, or pk_<32chars> (public, read-only)
Body
application/json
Exchange office ID
Example:
1
Source currency ID
Example:
1
Destination currency ID
Example:
2
Amount to convert
Example:
1000
Whether amount is in source or destination currency
Available options:
source, dest Example:
"source"
Response
Estimation result