Skip to main content
POST
/
payment
/
api
/
v1
/
offramp
Initiate Offramp
curl --request POST \
  --url https://api.carbnconnect.com/payment/api/v1/offramp \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "user_id": "5d1aabf5-361e-4470-8b99-51d1ce3ef338",
  "account_id": "5bc098b7-027f-48a9-9c67-c1666555f5a6"
}
'
import requests

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

payload = {
    "user_id": "5d1aabf5-361e-4470-8b99-51d1ce3ef338",
    "account_id": "5bc098b7-027f-48a9-9c67-c1666555f5a6"
}
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: '5d1aabf5-361e-4470-8b99-51d1ce3ef338',
    account_id: '5bc098b7-027f-48a9-9c67-c1666555f5a6'
  })
};

fetch('https://api.carbnconnect.com/payment/api/v1/offramp', 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",
  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' => '5d1aabf5-361e-4470-8b99-51d1ce3ef338',
    'account_id' => '5bc098b7-027f-48a9-9c67-c1666555f5a6'
  ]),
  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"

	payload := strings.NewReader("{\n  \"user_id\": \"5d1aabf5-361e-4470-8b99-51d1ce3ef338\",\n  \"account_id\": \"5bc098b7-027f-48a9-9c67-c1666555f5a6\"\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")
  .header("x-api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"user_id\": \"5d1aabf5-361e-4470-8b99-51d1ce3ef338\",\n  \"account_id\": \"5bc098b7-027f-48a9-9c67-c1666555f5a6\"\n}")
  .asString();
require 'uri'
require 'net/http'

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

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\": \"5d1aabf5-361e-4470-8b99-51d1ce3ef338\",\n  \"account_id\": \"5bc098b7-027f-48a9-9c67-c1666555f5a6\"\n}"

response = http.request(request)
puts response.read_body
{
  "address": "9fV7wU6bnbY1Y2Snhmmow8rtUmxhuze6FYVBjm2dRvmX",
  "crypto": "USDC",
  "chain": "solana"
}

Authorizations

x-api-key
string
header
required

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

Body

application/json
user_id
string<uuid>
required

The unique identifier of the user

Example:

"5d1aabf5-361e-4470-8b99-51d1ce3ef338"

account_id
string<uuid>
required

The unique identifier of the registered destination account

Example:

"5bc098b7-027f-48a9-9c67-c1666555f5a6"

Response

Offramp initiated successfully

address
string

Cryptocurrency deposit address where users should send their crypto

Example:

"9fV7wU6bnbY1Y2Snhmmow8rtUmxhuze6FYVBjm2dRvmX"

crypto
string

Cryptocurrency type (e.g., USDC, BTC, ETH)

Example:

"USDC"

chain
string

Blockchain network (e.g., solana, ethereum, polygon)

Example:

"solana"