Link Wallet to Card
curl --request POST \
--url https://api.example.com/v1/wallet/internal/card_linked \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-client-key: <x-client-key>' \
--data '
{
"addressId": "<string>"
}
'import requests
url = "https://api.example.com/v1/wallet/internal/card_linked"
payload = { "addressId": "<string>" }
headers = {
"x-client-key": "<x-client-key>",
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-key': '<x-client-key>',
Authorization: '<authorization>',
'Content-Type': 'application/json'
},
body: JSON.stringify({addressId: '<string>'})
};
fetch('https://api.example.com/v1/wallet/internal/card_linked', 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.example.com/v1/wallet/internal/card_linked",
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([
'addressId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-client-key: <x-client-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.example.com/v1/wallet/internal/card_linked"
payload := strings.NewReader("{\n \"addressId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-key", "<x-client-key>")
req.Header.Add("Authorization", "<authorization>")
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.example.com/v1/wallet/internal/card_linked")
.header("x-client-key", "<x-client-key>")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"addressId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/wallet/internal/card_linked")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-key"] = '<x-client-key>'
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addressId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}
{
"message": "Maximum 5 wallets can be linked"
}
Wallet
Link Wallet to Card
Link a custodial wallet to the card as a payment source
POST
/
v1
/
wallet
/
internal
/
card_linked
Link Wallet to Card
curl --request POST \
--url https://api.example.com/v1/wallet/internal/card_linked \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-client-key: <x-client-key>' \
--data '
{
"addressId": "<string>"
}
'import requests
url = "https://api.example.com/v1/wallet/internal/card_linked"
payload = { "addressId": "<string>" }
headers = {
"x-client-key": "<x-client-key>",
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-key': '<x-client-key>',
Authorization: '<authorization>',
'Content-Type': 'application/json'
},
body: JSON.stringify({addressId: '<string>'})
};
fetch('https://api.example.com/v1/wallet/internal/card_linked', 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.example.com/v1/wallet/internal/card_linked",
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([
'addressId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-client-key: <x-client-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.example.com/v1/wallet/internal/card_linked"
payload := strings.NewReader("{\n \"addressId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-key", "<x-client-key>")
req.Header.Add("Authorization", "<authorization>")
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.example.com/v1/wallet/internal/card_linked")
.header("x-client-key", "<x-client-key>")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"addressId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/wallet/internal/card_linked")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-key"] = '<x-client-key>'
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addressId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}
{
"message": "Maximum 5 wallets can be linked"
}
Link a custodial wallet to the card as a payment source. Each user can link up to 5 wallets.
Authentication
string
required
Your public API client key
string
required
Bearer token for authentication
Request Body
string
required
Wallet addressId from GET /v1/wallet/internal response
Response
boolean
Whether linking was successful
{
"success": true
}
{
"message": "Maximum 5 wallets can be linked"
}
curl -X POST "https://dev.api.baanx.com/v1/wallet/internal/card_linked" \
-H "x-client-key: YOUR_CLIENT_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"addressId": "7c1839ee-918e-4787-b74f-deeb48ead58b"
}'
import requests
all_wallets = requests.get(
"https://dev.api.baanx.com/v1/wallet/internal",
headers=headers
).json()
usdc_wallet = next(w for w in all_wallets if w['currency'] == 'usdc')
link_data = {"addressId": usdc_wallet['addressId']}
response = requests.post(
"https://dev.api.baanx.com/v1/wallet/internal/card_linked",
headers=headers,
json=link_data
)
if response.status_code == 201:
print("Wallet linked to card successfully!")
async function linkWalletToCard(addressId: string): Promise<boolean> {
const response = await fetch(
'https://dev.api.baanx.com/v1/wallet/internal/card_linked',
{
method: 'POST',
headers: {
'x-client-key': 'YOUR_CLIENT_KEY',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({ addressId })
}
);
const result = await response.json();
return result.success;
}
Related Endpoints
- List Card-Linked Wallets - View currently linked wallets
- Unlink Wallet from Card - Remove a wallet from card payment sources
- Get Internal Wallets - View all available wallets to link
Was this page helpful?
⌘I