curl --request POST \
--url https://api.spherepay.co/v2/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "100.00",
"customerId": "customer_3faa484998f44cfead9668608b9ee1f5",
"destination": {
"currency": "brl",
"network": "pix"
},
"source": {
"currency": "usdc",
"network": "polygon"
},
"integratorBpsFeeRate": "20",
"quoteDurationSeconds": 60,
"referenceSide": "source"
}
'import requests
url = "https://api.spherepay.co/v2/quote"
payload = {
"amount": "100.00",
"customerId": "customer_3faa484998f44cfead9668608b9ee1f5",
"destination": {
"currency": "brl",
"network": "pix"
},
"source": {
"currency": "usdc",
"network": "polygon"
},
"integratorBpsFeeRate": "20",
"quoteDurationSeconds": 60,
"referenceSide": "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({
amount: '100.00',
customerId: 'customer_3faa484998f44cfead9668608b9ee1f5',
destination: {currency: 'brl', network: 'pix'},
source: {currency: 'usdc', network: 'polygon'},
integratorBpsFeeRate: '20',
quoteDurationSeconds: 60,
referenceSide: 'source'
})
};
fetch('https://api.spherepay.co/v2/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.spherepay.co/v2/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([
'amount' => '100.00',
'customerId' => 'customer_3faa484998f44cfead9668608b9ee1f5',
'destination' => [
'currency' => 'brl',
'network' => 'pix'
],
'source' => [
'currency' => 'usdc',
'network' => 'polygon'
],
'integratorBpsFeeRate' => '20',
'quoteDurationSeconds' => 60,
'referenceSide' => '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.spherepay.co/v2/quote"
payload := strings.NewReader("{\n \"amount\": \"100.00\",\n \"customerId\": \"customer_3faa484998f44cfead9668608b9ee1f5\",\n \"destination\": {\n \"currency\": \"brl\",\n \"network\": \"pix\"\n },\n \"source\": {\n \"currency\": \"usdc\",\n \"network\": \"polygon\"\n },\n \"integratorBpsFeeRate\": \"20\",\n \"quoteDurationSeconds\": 60,\n \"referenceSide\": \"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.spherepay.co/v2/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.00\",\n \"customerId\": \"customer_3faa484998f44cfead9668608b9ee1f5\",\n \"destination\": {\n \"currency\": \"brl\",\n \"network\": \"pix\"\n },\n \"source\": {\n \"currency\": \"usdc\",\n \"network\": \"polygon\"\n },\n \"integratorBpsFeeRate\": \"20\",\n \"quoteDurationSeconds\": 60,\n \"referenceSide\": \"source\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spherepay.co/v2/quote")
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 \"amount\": \"100.00\",\n \"customerId\": \"customer_3faa484998f44cfead9668608b9ee1f5\",\n \"destination\": {\n \"currency\": \"brl\",\n \"network\": \"pix\"\n },\n \"source\": {\n \"currency\": \"usdc\",\n \"network\": \"polygon\"\n },\n \"integratorBpsFeeRate\": \"20\",\n \"quoteDurationSeconds\": 60,\n \"referenceSide\": \"source\"\n}"
response = http.request(request)
puts response.read_body{
"created": "2025-01-01T00:00:00.000Z",
"customerId": "customer_d243ab2b1de4447d8a046d87fefe58cf",
"destination": {
"amount": "545.50",
"currency": "brl",
"exchangeRate": "5.455",
"network": "pix"
},
"expiresAt": "2025-01-01T00:01:00.000Z",
"fees": {
"integratorFee": {
"bpsRate": "0",
"currency": "usdc",
"fixedAmount": "0.00",
"totalAmount": "0.00"
},
"platformFee": {
"bpsRate": "20",
"currency": "usdc",
"fixedAmount": "0.00",
"totalAmount": "2.00"
}
},
"id": "quote_d243ab2b1de4447d8a046d87fefe58cf",
"source": {
"amount": "100.00",
"currency": "usdc",
"network": "polygon"
},
"type": "off_ramp",
"quoteDurationSeconds": 45,
"referenceSide": "source",
"status": "active"
}{
"code": "address/invalid",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Invalid request parameters",
"status": 400
}{
"code": "resource/not-found",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Resource not found",
"status": 404
}{
"code": "validation/failed",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Validation failed",
"errors": [
{
"detail": "Invalid email format",
"pointer": "/email"
},
{
"detail": "Name is required",
"pointer": "/name"
}
],
"status": 422
}Create a Rate-Locked Quote
Create a locked exchange rate quote. The quote is valid for the specified duration and can be used once to create a transfer.
curl --request POST \
--url https://api.spherepay.co/v2/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "100.00",
"customerId": "customer_3faa484998f44cfead9668608b9ee1f5",
"destination": {
"currency": "brl",
"network": "pix"
},
"source": {
"currency": "usdc",
"network": "polygon"
},
"integratorBpsFeeRate": "20",
"quoteDurationSeconds": 60,
"referenceSide": "source"
}
'import requests
url = "https://api.spherepay.co/v2/quote"
payload = {
"amount": "100.00",
"customerId": "customer_3faa484998f44cfead9668608b9ee1f5",
"destination": {
"currency": "brl",
"network": "pix"
},
"source": {
"currency": "usdc",
"network": "polygon"
},
"integratorBpsFeeRate": "20",
"quoteDurationSeconds": 60,
"referenceSide": "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({
amount: '100.00',
customerId: 'customer_3faa484998f44cfead9668608b9ee1f5',
destination: {currency: 'brl', network: 'pix'},
source: {currency: 'usdc', network: 'polygon'},
integratorBpsFeeRate: '20',
quoteDurationSeconds: 60,
referenceSide: 'source'
})
};
fetch('https://api.spherepay.co/v2/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.spherepay.co/v2/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([
'amount' => '100.00',
'customerId' => 'customer_3faa484998f44cfead9668608b9ee1f5',
'destination' => [
'currency' => 'brl',
'network' => 'pix'
],
'source' => [
'currency' => 'usdc',
'network' => 'polygon'
],
'integratorBpsFeeRate' => '20',
'quoteDurationSeconds' => 60,
'referenceSide' => '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.spherepay.co/v2/quote"
payload := strings.NewReader("{\n \"amount\": \"100.00\",\n \"customerId\": \"customer_3faa484998f44cfead9668608b9ee1f5\",\n \"destination\": {\n \"currency\": \"brl\",\n \"network\": \"pix\"\n },\n \"source\": {\n \"currency\": \"usdc\",\n \"network\": \"polygon\"\n },\n \"integratorBpsFeeRate\": \"20\",\n \"quoteDurationSeconds\": 60,\n \"referenceSide\": \"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.spherepay.co/v2/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.00\",\n \"customerId\": \"customer_3faa484998f44cfead9668608b9ee1f5\",\n \"destination\": {\n \"currency\": \"brl\",\n \"network\": \"pix\"\n },\n \"source\": {\n \"currency\": \"usdc\",\n \"network\": \"polygon\"\n },\n \"integratorBpsFeeRate\": \"20\",\n \"quoteDurationSeconds\": 60,\n \"referenceSide\": \"source\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spherepay.co/v2/quote")
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 \"amount\": \"100.00\",\n \"customerId\": \"customer_3faa484998f44cfead9668608b9ee1f5\",\n \"destination\": {\n \"currency\": \"brl\",\n \"network\": \"pix\"\n },\n \"source\": {\n \"currency\": \"usdc\",\n \"network\": \"polygon\"\n },\n \"integratorBpsFeeRate\": \"20\",\n \"quoteDurationSeconds\": 60,\n \"referenceSide\": \"source\"\n}"
response = http.request(request)
puts response.read_body{
"created": "2025-01-01T00:00:00.000Z",
"customerId": "customer_d243ab2b1de4447d8a046d87fefe58cf",
"destination": {
"amount": "545.50",
"currency": "brl",
"exchangeRate": "5.455",
"network": "pix"
},
"expiresAt": "2025-01-01T00:01:00.000Z",
"fees": {
"integratorFee": {
"bpsRate": "0",
"currency": "usdc",
"fixedAmount": "0.00",
"totalAmount": "0.00"
},
"platformFee": {
"bpsRate": "20",
"currency": "usdc",
"fixedAmount": "0.00",
"totalAmount": "2.00"
}
},
"id": "quote_d243ab2b1de4447d8a046d87fefe58cf",
"source": {
"amount": "100.00",
"currency": "usdc",
"network": "polygon"
},
"type": "off_ramp",
"quoteDurationSeconds": 45,
"referenceSide": "source",
"status": "active"
}{
"code": "address/invalid",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Invalid request parameters",
"status": 400
}{
"code": "resource/not-found",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Resource not found",
"status": 404
}{
"code": "validation/failed",
"correlationId": "28c61e885c6e5eaa78c1a2183a9b883c",
"detail": "Validation failed",
"errors": [
{
"detail": "Invalid email format",
"pointer": "/email"
},
{
"detail": "Name is required",
"pointer": "/name"
}
],
"status": 422
}/v2/transfer directly.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The quote amount. For MXN/USD RFQ it is denominated by referenceSide; all other corridors retain their existing source-amount behavior.
^\d+(\.\d{2})?$"100.00"
The customer's ID.
^customer_[a-z0-9]+$"customer_3faa484998f44cfead9668608b9ee1f5"
The destination currency and network for the quote.
Show child attributes
Show child attributes
The source currency and network for the quote.
Show child attributes
Show child attributes
The integrator BPS fee rate. The BPS rate must be an integer string between 0 and 10000.
^\d+$"20"
For MXN/SPEI to USD/wire or USD/swift quotes, the field may be omitted or must be 45; omission defaults to 45. For all other supported routes, explicit values must be 30, 60, or 300 seconds and omission defaults to 60.
60
MXN/USD RFQ only. The side denominating amount; defaults to source when omitted.
source, destination "source"
Response
The datetime the quote was created.
"2025-01-01T00:00:00.000Z"
The customer ID.
"customer_d243ab2b1de4447d8a046d87fefe58cf"
Show child attributes
Show child attributes
The datetime when this quote expires.
"2025-01-01T00:01:00.000Z"
Show child attributes
Show child attributes
A unique identifier for the quote.
^quote_[a-z0-9]+$"quote_d243ab2b1de4447d8a046d87fefe58cf"
Show child attributes
Show child attributes
The transfer type this quote is for.
on_ramp, off_ramp, fiat_to_fiat "off_ramp"
RFQ-only quote duration in seconds.
x > 045
RFQ-only side whose amount was referenced for pricing.
source, destination "source"
The current status of the quote.
active, used, expired "active"