Get or Create Crypto Wallet - Afriex Business API
Afriex SDK
TypeScript
const response = await afriex.paymentMethods.getCryptoWallet({
asset: "USDT", // or 'USDC'
customerId: "optional-customer-id",
});
// Returns: { data: [{ address, network }], total, page }
curl --request GET \
--url https://sandbox.api.afriex.com/api/v1/payment-method/crypto-wallet \
--header 'x-api-key: <api-key>'
import requests
url = "https://sandbox.api.afriex.com/api/v1/payment-method/crypto-wallet"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://sandbox.api.afriex.com/api/v1/payment-method/crypto-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://sandbox.api.afriex.com/api/v1/payment-method/crypto-wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.afriex.com/api/v1/payment-method/crypto-wallet"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.get("https://sandbox.api.afriex.com/api/v1/payment-method/crypto-wallet")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'
url = URI("https://sandbox.api.afriex.com/api/v1/payment-method/crypto-wallet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body
Response
200
{
"data": {
"id": "695271a3ba52c13b669fad2b",
"addresses": [
{
"address": "0x1234567890123456789012345678901234567890",
"network": "ETHEREUM_MAINNET"
},
{
"address": "TYASr5UV6HEcXatwdFQfmLVUqQQQMUxHLS",
"network": "TRON_MAINNET"
}
]
}
}
Retrieve an existing crypto wallet or create a new one for the specified crypto asset. Supports USDT and USDC assets. Important: This endpoint is only active in production and does not work on staging/dev.
Authorizations
- x-api-key
Static business API key issued from the dashboard. Requests made with a key that does not include the permission required by the target endpoint will be rejected with a403 Forbiddenresponse; an unrecognised, malformed or revoked key returns401 Unauthorized.
Headers
- x-api-version
API version in ISO 8601 format (e.g. 2025-12-28). Defaults to latest stable.
Query Parameters
asset
Required. The crypto asset symbol for the wallet. Available options:USDT,USDC.customerId
Optional customer ID. If not provided, the wallet will be created for the business.
Response
200
{
"data": {
"type": "object"
}
}