Create Custody Wallet
Create a Carbn custody wallet for a user on the specified chain
curl --request POST \
--url https://api.carbnconnect.com/payment/api/v1/custody-wallet \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_id": "810b82b7-bd72-48c2-980f-0887fe20f08e",
"chain": "solana",
"customer_wallet_ref": "ee030180-d114-4545-a4bb-133241edf1b1"
}
'import requests
url = "https://api.carbnconnect.com/payment/api/v1/custody-wallet"
payload = {
"user_id": "810b82b7-bd72-48c2-980f-0887fe20f08e",
"chain": "solana",
"customer_wallet_ref": "ee030180-d114-4545-a4bb-133241edf1b1"
}
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: '810b82b7-bd72-48c2-980f-0887fe20f08e',
chain: 'solana',
customer_wallet_ref: 'ee030180-d114-4545-a4bb-133241edf1b1'
})
};
fetch('https://api.carbnconnect.com/payment/api/v1/custody-wallet', 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/custody-wallet",
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' => '810b82b7-bd72-48c2-980f-0887fe20f08e',
'chain' => 'solana',
'customer_wallet_ref' => 'ee030180-d114-4545-a4bb-133241edf1b1'
]),
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/custody-wallet"
payload := strings.NewReader("{\n \"user_id\": \"810b82b7-bd72-48c2-980f-0887fe20f08e\",\n \"chain\": \"solana\",\n \"customer_wallet_ref\": \"ee030180-d114-4545-a4bb-133241edf1b1\"\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/custody-wallet")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"810b82b7-bd72-48c2-980f-0887fe20f08e\",\n \"chain\": \"solana\",\n \"customer_wallet_ref\": \"ee030180-d114-4545-a4bb-133241edf1b1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.carbnconnect.com/payment/api/v1/custody-wallet")
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\": \"810b82b7-bd72-48c2-980f-0887fe20f08e\",\n \"chain\": \"solana\",\n \"customer_wallet_ref\": \"ee030180-d114-4545-a4bb-133241edf1b1\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c10dad79-4bd8-47f4-933e-4f197c5af680",
"crypto": "<string>",
"balances": [
{
"balance": 0,
"crypto": "usdc",
"contract_address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
],
"blockchain": "solana",
"status": "ACTIVE",
"user_id": "810b82b7-bd72-48c2-980f-0887fe20f08e",
"wallet_address": "GZFGBcapshUdpDjPLAjP7qnAu11w1JwzEuwEvBqWTfnT",
"customer_wallet_ref": "ee030180-d114-4545-a4bb-133241edf1b1"
}Authorizations
API key for authentication. Must be included in the x-api-key header.
Body
The unique identifier of the user
"810b82b7-bd72-48c2-980f-0887fe20f08e"
The blockchain network for the custody wallet
"solana"
Customer-provided wallet reference identifier
"ee030180-d114-4545-a4bb-133241edf1b1"
Response
Custody wallet created successfully
Unique identifier of the custody wallet
"c10dad79-4bd8-47f4-933e-4f197c5af680"
Primary crypto (null when not set; used in create response)
Token balances (null on create; populated on get)
Show child attributes
Show child attributes
Blockchain network
"solana"
Wallet status
"ACTIVE"
User who owns the custody wallet
"810b82b7-bd72-48c2-980f-0887fe20f08e"
On-chain wallet address
"GZFGBcapshUdpDjPLAjP7qnAu11w1JwzEuwEvBqWTfnT"
Customer-provided wallet reference identifier
"ee030180-d114-4545-a4bb-133241edf1b1"
curl --request POST \
--url https://api.carbnconnect.com/payment/api/v1/custody-wallet \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_id": "810b82b7-bd72-48c2-980f-0887fe20f08e",
"chain": "solana",
"customer_wallet_ref": "ee030180-d114-4545-a4bb-133241edf1b1"
}
'import requests
url = "https://api.carbnconnect.com/payment/api/v1/custody-wallet"
payload = {
"user_id": "810b82b7-bd72-48c2-980f-0887fe20f08e",
"chain": "solana",
"customer_wallet_ref": "ee030180-d114-4545-a4bb-133241edf1b1"
}
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: '810b82b7-bd72-48c2-980f-0887fe20f08e',
chain: 'solana',
customer_wallet_ref: 'ee030180-d114-4545-a4bb-133241edf1b1'
})
};
fetch('https://api.carbnconnect.com/payment/api/v1/custody-wallet', 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/custody-wallet",
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' => '810b82b7-bd72-48c2-980f-0887fe20f08e',
'chain' => 'solana',
'customer_wallet_ref' => 'ee030180-d114-4545-a4bb-133241edf1b1'
]),
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/custody-wallet"
payload := strings.NewReader("{\n \"user_id\": \"810b82b7-bd72-48c2-980f-0887fe20f08e\",\n \"chain\": \"solana\",\n \"customer_wallet_ref\": \"ee030180-d114-4545-a4bb-133241edf1b1\"\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/custody-wallet")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"810b82b7-bd72-48c2-980f-0887fe20f08e\",\n \"chain\": \"solana\",\n \"customer_wallet_ref\": \"ee030180-d114-4545-a4bb-133241edf1b1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.carbnconnect.com/payment/api/v1/custody-wallet")
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\": \"810b82b7-bd72-48c2-980f-0887fe20f08e\",\n \"chain\": \"solana\",\n \"customer_wallet_ref\": \"ee030180-d114-4545-a4bb-133241edf1b1\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c10dad79-4bd8-47f4-933e-4f197c5af680",
"crypto": "<string>",
"balances": [
{
"balance": 0,
"crypto": "usdc",
"contract_address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
],
"blockchain": "solana",
"status": "ACTIVE",
"user_id": "810b82b7-bd72-48c2-980f-0887fe20f08e",
"wallet_address": "GZFGBcapshUdpDjPLAjP7qnAu11w1JwzEuwEvBqWTfnT",
"customer_wallet_ref": "ee030180-d114-4545-a4bb-133241edf1b1"
}