Skip to main content
POST
/
v1-alpha2
/
wallets
/
{walletLocator}
/
balances
Fund Wallet
curl --request POST \
  --url https://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '
{
  "amount": 10,
  "token": "usdxm",
  "chain": "base-sepolia"
}
'
import requests

url = "https://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances"

payload = {
"amount": 10,
"token": "usdxm",
"chain": "base-sepolia"
}
headers = {
"X-API-KEY": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10, token: 'usdxm', chain: 'base-sepolia'})
};

fetch('https://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances', 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://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances",
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([
'amount' => 10,
'token' => 'usdxm',
'chain' => 'base-sepolia'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-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://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances"

payload := strings.NewReader("{\n \"amount\": 10,\n \"token\": \"usdxm\",\n \"chain\": \"base-sepolia\"\n}")

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

req.Header.Add("X-API-KEY", "<x-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://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"token\": \"usdxm\",\n \"chain\": \"base-sepolia\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://staging.crossmint.com/api/v1-alpha2/wallets/{walletLocator}/balances")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"token\": \"usdxm\",\n \"chain\": \"base-sepolia\"\n}"

response = http.request(request)
puts response.read_body
{
  "token": "usdc",
  "decimals": 6,
  "balances": {
    "base": "121000000",
    "ethereum": "121000000",
    "total": "242000000"
  }
}
{
"error": true,
"message": "<error message>"
}
This is an alpha API and subject to change.
This endpoint is only available in staging and only supports USDXM.

Headers

X-API-KEY
string
required

API key required for authentication

Path Parameters

walletLocator
string
required

A wallet locator can be of the format:

  • <walletAddress>
  • email:<email>:<walletType>
  • userId:<userId>:<walletType>
  • userId:<userId>:<walletType> (white label user example)
  • phoneNumber:<phoneNumber>:<walletType>
  • twitter:<handle>:<walletType>
  • x:<handle>:<walletType>
  • me:<walletType> (Use when calling from the client side with a client API key)

Body

application/json
amount
number
required

The amount of currency to fund the wallet with. Between 1 and 100

Required range: 1 <= x <= 100
Example:

10

token
enum<string>
required

The currency to fund the wallet with. Only USDXM is supported.

Available options:
usdxm
Example:

"usdxm"

chain
enum<string>
required

The chain to fund the wallet with

Available options:
arbitrum-sepolia,
avalanche-fuji,
base-sepolia,
ethereum-sepolia,
optimism-sepolia,
polygon-amoy,
sei-atlantic-2-testnet,
skale-nebula-testnet,
soneium-minato-testnet,
viction-testnet,
solana,
stellar
Example:

"base-sepolia"

Response

Funds sent successfully.

token
enum<string>
required

The token

Available options:
ape,
bnb,
coti,
eth,
pathusd,
matic,
mnt,
pol,
plume,
sei,
chz,
avax,
xai,
fuel,
hbar,
vic,
ip,
zcx,
u2u,
flow,
usdc,
usdce,
busd,
usdxm,
usdt,
credit,
usdf,
pyusd0,
eurc,
weth,
degen,
superverse,
pirate,
wld,
xmeme,
alphausd,
betausd,
thetausd,
wirex-usdc,
bonk,
phantom-cash,
xlm,
usdm0,
usdm1,
mgusd,
wirex-usdc,
sol,
sui,
apt,
sfuel,
xion
Example:

"eth"

decimals
number
required

The number of decimals of the token

Example:

18

balances
object
required

The balance of the wallet in different chains

Example:
{
"token": "usdc",
"decimals": 6,
"balances": {
"base": "121000000",
"ethereum": "121000000",
"total": "242000000"
}
}