Skip to main content
POST
/
payment
/
api
/
v1
/
offramp
/
get-quote
Get Offramp Quote
curl --request POST \
  --url https://api.carbnconnect.com/payment/api/v1/offramp/get-quote \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "user_id": "0d64857d-1052-4252-a95b-c118ee86efa9",
  "crypto": "USDC",
  "blockchain": "solana",
  "destination_currency": "PHP",
  "amount_in": 0.3,
  "amount_out": 17.87
}
'
import requests

url = "https://api.carbnconnect.com/payment/api/v1/offramp/get-quote"

payload = {
"user_id": "0d64857d-1052-4252-a95b-c118ee86efa9",
"crypto": "USDC",
"blockchain": "solana",
"destination_currency": "PHP",
"amount_in": 0.3,
"amount_out": 17.87
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '0d64857d-1052-4252-a95b-c118ee86efa9',
crypto: 'USDC',
blockchain: 'solana',
destination_currency: 'PHP',
amount_in: 0.3,
amount_out: 17.87
})
};

fetch('https://api.carbnconnect.com/payment/api/v1/offramp/get-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.carbnconnect.com/payment/api/v1/offramp/get-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([
'user_id' => '0d64857d-1052-4252-a95b-c118ee86efa9',
'crypto' => 'USDC',
'blockchain' => 'solana',
'destination_currency' => 'PHP',
'amount_in' => 0.3,
'amount_out' => 17.87
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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.carbnconnect.com/payment/api/v1/offramp/get-quote"

payload := strings.NewReader("{\n \"user_id\": \"0d64857d-1052-4252-a95b-c118ee86efa9\",\n \"crypto\": \"USDC\",\n \"blockchain\": \"solana\",\n \"destination_currency\": \"PHP\",\n \"amount_in\": 0.3,\n \"amount_out\": 17.87\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-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.carbnconnect.com/payment/api/v1/offramp/get-quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"0d64857d-1052-4252-a95b-c118ee86efa9\",\n \"crypto\": \"USDC\",\n \"blockchain\": \"solana\",\n \"destination_currency\": \"PHP\",\n \"amount_in\": 0.3,\n \"amount_out\": 17.87\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.carbnconnect.com/payment/api/v1/offramp/get-quote")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"0d64857d-1052-4252-a95b-c118ee86efa9\",\n \"crypto\": \"USDC\",\n \"blockchain\": \"solana\",\n \"destination_currency\": \"PHP\",\n \"amount_in\": 0.3,\n \"amount_out\": 17.87\n}"

response = http.request(request)
puts response.read_body
{
  "id": "733bb4d7-9ae3-44f6-b73c-82909bba8352",
  "amount_in": 0.3,
  "amount_out": 17.87,
  "rail_fee": 10,
  "crypto": "USDC",
  "blockchain": "solana",
  "destination_currency": "PHP",
  "carbn_exchange_rate": 59.57,
  "exchange_rate": 59.46
}

Authorizations

x-api-key
string
header
required

API key for authentication. Must be included in the x-api-key header.

Body

application/json

Request a quote for offramp transfer. Either amount_in or amount_out must be provided (but not both).

user_id
string<uuid>
required

The unique identifier of the user

Example:

"0d64857d-1052-4252-a95b-c118ee86efa9"

crypto
string
required

The cryptocurrency to convert (e.g., USDC, USDT)

Example:

"USDC"

blockchain
string
required

The blockchain network (e.g., solana, ethereum, polygon)

Example:

"solana"

destination_currency
string
required

The destination fiat currency code (ISO 4217)

Example:

"PHP"

amount_in
number

Amount of crypto to convert (input amount). Either amount_in or amount_out must be provided.

Example:

0.3

amount_out
number

Amount of fiat to receive (output amount). Either amount_in or amount_out must be provided.

Example:

17.87

Response

Quote retrieved successfully

id
string<uuid>

Unique identifier for the quote

Example:

"733bb4d7-9ae3-44f6-b73c-82909bba8352"

amount_in
number

Amount of crypto to convert (input amount)

Example:

0.3

amount_out
number

Amount of fiat to be received (output amount)

Example:

17.87

rail_fee
number

Rail fee charged for the transfer

Example:

10

crypto
string

The cryptocurrency being converted

Example:

"USDC"

blockchain
string

The blockchain network used

Example:

"solana"

destination_currency
string

The destination fiat currency code (ISO 4217)

Example:

"PHP"

carbn_exchange_rate
number

Carbn's exchange rate for the conversion

Example:

59.57

exchange_rate
number

The exchange rate applied for the conversion

Example:

59.46