cURL
curl --request GET \
--url https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes \
--header 'partner-api-key: <api-key>'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
headers = {"partner-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'partner-api-key': '<api-key>'}};
fetch('https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/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.capa.fi/api/partner/v2/cross-ramp/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"partner-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("partner-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes")
.header("partner-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["partner-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"sourceAmount": 5000,
"sourceCurrency": "MXN",
"targetAmount": 270.27,
"targetCurrency": "USD",
"rate": 18.5,
"marketRate": 18.407731,
"premiumSpread": 0.002,
"spread": 0.005,
"flow": "OTC",
"fees": [
{
"fee": "24.937655860348684",
"currency": "MXN",
"type": "amount",
"name": "spread_amount"
}
]
}
}Cross-Ramp
Get Cross-Ramp Rate
GET
/
api
/
partner
/
v2
/
cross-ramp
/
quotes
cURL
curl --request GET \
--url https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes \
--header 'partner-api-key: <api-key>'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
headers = {"partner-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'partner-api-key': '<api-key>'}};
fetch('https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/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.capa.fi/api/partner/v2/cross-ramp/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"partner-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("partner-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes")
.header("partner-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["partner-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"sourceAmount": 5000,
"sourceCurrency": "MXN",
"targetAmount": 270.27,
"targetCurrency": "USD",
"rate": 18.5,
"marketRate": 18.407731,
"premiumSpread": 0.002,
"spread": 0.005,
"flow": "OTC",
"fees": [
{
"fee": "24.937655860348684",
"currency": "MXN",
"type": "amount",
"name": "spread_amount"
}
]
}
}Retrieves a real-time exchange rate for a fiat-to-fiat (cross-ramp) conversion. Use this to display estimated amounts before creating a transaction.
Field Relationships
- Provide either
sourceAmountortargetAmount, not both.
Important Notes
- This returns a real-time rate that is not locked. To lock a rate, use POST /api/partner/v2/cross-ramp/quotes.
- To quote a USD payout to China (CN) or Hong Kong (HK), pass
targetCountry=CN(orHK) and optionallytargetRail(LOCALdefault, orSWIFT). See the Cross-Ramp guide.
Error Codes
These are the errors this endpoint returns most often. Branch oncode, not message, and handle codes you don’t recognize by their HTTP status. See Error Codes for the complete list.
Common Errors
| HTTP Status | Code | Message |
|---|---|---|
| 401 | UNAUTHORIZED | ”API Key is missing” |
| 401 | UNAUTHORIZED | ”Invalid API Key format” |
| 401 | UNAUTHORIZED | ”Invalid API Key” |
| 403 | PERMISSION_DENIED | ”Your role does not allow this action.” (the API key doesn’t have the permission this endpoint requires) |
| 429 | TOO_MANY_REQUESTS | ”ThrottlerException: Too Many Requests” (wait the number of seconds in the Retry-After header) |
Endpoint-Specific Errors
| HTTP Status | Code | Message |
|---|---|---|
| 400 | INVALID_USER_INPUT_ERROR | ”Invalid User Input” |
| 404 | NOT_FOUND_ERROR | ”Requested FiatCurrency was not found” (currency, country or rail not enabled for cross-ramp) |
| 500 | INTERNAL_SERVER_ERROR | ”Internal server error” (for example, no provider could price the request; retry) |
Authorizations
Query Parameters
Target country. Required to quote a USD payout to China (CN) or Hong Kong (HK), since USD otherwise defaults to the US.
Available options:
MX, DO, US, AT, BE, BG, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HU, IE, IT, LV, LT, LU, MT, NL, PL, PT, RO, SK, SI, ES, SE, IS, LI, NO, CH, GB, MC, SM, AD, VA, CN, HK