cURL
curl --request POST \
--url https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes \
--header 'Content-Type: application/json' \
--header 'partner-api-key: <api-key>' \
--data '
{
"sourceCurrency": "MXN",
"targetCurrency": "USD",
"sourceAmount": 123,
"targetAmount": 123,
"premiumSpread": 123,
"bulkTransactionCount": 3
}
'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
payload = {
"sourceCurrency": "MXN",
"targetCurrency": "USD",
"sourceAmount": 123,
"targetAmount": 123,
"premiumSpread": 123,
"bulkTransactionCount": 3
}
headers = {
"partner-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'partner-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceCurrency: 'MXN',
targetCurrency: 'USD',
sourceAmount: 123,
targetAmount: 123,
premiumSpread: 123,
bulkTransactionCount: 3
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sourceCurrency' => 'MXN',
'targetCurrency' => 'USD',
'sourceAmount' => 123,
'targetAmount' => 123,
'premiumSpread' => 123,
'bulkTransactionCount' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
payload := strings.NewReader("{\n \"sourceCurrency\": \"MXN\",\n \"targetCurrency\": \"USD\",\n \"sourceAmount\": 123,\n \"targetAmount\": 123,\n \"premiumSpread\": 123,\n \"bulkTransactionCount\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("partner-api-key", "<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.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes")
.header("partner-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sourceCurrency\": \"MXN\",\n \"targetCurrency\": \"USD\",\n \"sourceAmount\": 123,\n \"targetAmount\": 123,\n \"premiumSpread\": 123,\n \"bulkTransactionCount\": 3\n}")
.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::Post.new(url)
request["partner-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceCurrency\": \"MXN\",\n \"targetCurrency\": \"USD\",\n \"sourceAmount\": 123,\n \"targetAmount\": 123,\n \"premiumSpread\": 123,\n \"bulkTransactionCount\": 3\n}"
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"
}
],
"quoteId": "123e4567-e89b-12d3-a456-426614174000",
"expiresAt": "2025-01-01T00:00:00.000Z"
}
}Cross-Ramp
Create Cross-Ramp Quote
POST
/
api
/
partner
/
v2
/
cross-ramp
/
quotes
cURL
curl --request POST \
--url https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes \
--header 'Content-Type: application/json' \
--header 'partner-api-key: <api-key>' \
--data '
{
"sourceCurrency": "MXN",
"targetCurrency": "USD",
"sourceAmount": 123,
"targetAmount": 123,
"premiumSpread": 123,
"bulkTransactionCount": 3
}
'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
payload = {
"sourceCurrency": "MXN",
"targetCurrency": "USD",
"sourceAmount": 123,
"targetAmount": 123,
"premiumSpread": 123,
"bulkTransactionCount": 3
}
headers = {
"partner-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'partner-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceCurrency: 'MXN',
targetCurrency: 'USD',
sourceAmount: 123,
targetAmount: 123,
premiumSpread: 123,
bulkTransactionCount: 3
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sourceCurrency' => 'MXN',
'targetCurrency' => 'USD',
'sourceAmount' => 123,
'targetAmount' => 123,
'premiumSpread' => 123,
'bulkTransactionCount' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes"
payload := strings.NewReader("{\n \"sourceCurrency\": \"MXN\",\n \"targetCurrency\": \"USD\",\n \"sourceAmount\": 123,\n \"targetAmount\": 123,\n \"premiumSpread\": 123,\n \"bulkTransactionCount\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("partner-api-key", "<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.sandbox.capa.fi/api/partner/v2/cross-ramp/quotes")
.header("partner-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sourceCurrency\": \"MXN\",\n \"targetCurrency\": \"USD\",\n \"sourceAmount\": 123,\n \"targetAmount\": 123,\n \"premiumSpread\": 123,\n \"bulkTransactionCount\": 3\n}")
.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::Post.new(url)
request["partner-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceCurrency\": \"MXN\",\n \"targetCurrency\": \"USD\",\n \"sourceAmount\": 123,\n \"targetAmount\": 123,\n \"premiumSpread\": 123,\n \"bulkTransactionCount\": 3\n}"
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"
}
],
"quoteId": "123e4567-e89b-12d3-a456-426614174000",
"expiresAt": "2025-01-01T00:00:00.000Z"
}
}Creates a locked cross-ramp quote with a guaranteed exchange rate. Pass the returned
quoteId when creating a cross-ramp transaction.
Field Relationships
- Provide either
sourceAmountortargetAmount, not both. - For a bulk, set
bulkTransactionCountto the number of transactions you will create with Create Bulk Cross-Ramp (2–50). Each transaction pays the fixed fee of its own USD leg, so the quote nets that fee once per transaction. Omit it for a single cross-ramp.
Important Notes
- Quotes expire — check the
expiresAtfield and create the transaction before it lapses. - Pass the returned
quoteIdto Create Cross-Ramp, or to Create Bulk Cross-Ramp if you setbulkTransactionCount. A single cross-ramp rejects a quote priced for a bulk. - To quote a USD payout to China (CN) or Hong Kong (HK), pass
targetCountry: "CN"(or"HK") 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 | ”Failed to create quote” |
Authorizations
Body
application/json
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 Only for a quote you will redeem with Create Bulk Cross-Ramp: the number of transactions in the bulk. Each transaction pays the fixed fee of its own USD leg, so the quote nets that fee once per transaction. Omit it for a single cross-ramp; a single cross-ramp rejects a quote that has it.
Required range:
2 <= x <= 50Example:
3