Skip to main content

Deposits & Withdrawals

Users fund card spending by depositing funds. This guide covers the deposit and withdrawal flows.

Funding Methods

MethodTimingAvailability
Crypto (USDC/USDT)MinutesNow
ACH1-3 business daysComing soon
WireSame dayComing soon

How It Works

  1. Get the user’s funding methods via the API
  2. User deposits funds (crypto, ACH, or wire)
  3. Balance is credited once funds are received
  4. Spending power equals deposited value
  5. Users can withdraw unused funds

Crypto Deposits

Supported Chains & Tokens

ChainUSDCUSDTChain ID
PolygonYesYes137
BaseYesYes8453
OptimismYesYes10
ArbitrumYesYes42161
AvalancheYesYes43114

Deposits

Step 1: Get Funding Methods

curl https://api.useproxy.ai/v1/users/$USER_ID/funding \
  -H "Api-Key: $API_KEY"
Response:
{
  "object": "funding",
  "userId": "user_abc123",
  "methods": [{
    "type": "crypto",
    "network": "base",
    "chainId": 8453,
    "address": "0x36561987b391685A09A26068eFBa31D6dFbfC530"
  }]
}

Step 2: Send Tokens

Transfer USDC or USDT to the address on your preferred chain.
Send tokens to the correct chain! Each deposit address only works on its specific chain.

Step 3: Verify Balance

curl https://api.useproxy.ai/v1/balances/$USER_ID \
  -H "Api-Key: $API_KEY"
Response:
{
  "userId": "user_abc123",
  "available": 10000,
  "pending": 0,
  "deposited": 10000,
  "currency": "USD"
}
Balance updates once funds are received.

Understanding Balance Fields

FieldDescription
availableWhat can be spent right now (cents)
pendingAuthorizations not yet settled (cents)
depositedTotal funds deposited (cents)
currencyCurrency code (always “USD”)
Formula:
available = deposited - pending - spent

Withdrawals

Users can withdraw unused funds at any time.

Check Available Balance

Before withdrawing, ensure available covers the amount:
curl https://api.useproxy.ai/v1/balances/$USER_ID \
  -H "Api-Key: $API_KEY"

Create Withdrawal

curl -X POST https://api.useproxy.ai/v1/withdrawals \
  -H "Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "$USER_ID",
    "chainId": 8453,
    "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": 5000000,
    "recipientAddress": "0x..."
  }'
FieldTypeRequiredDescription
chainIdnumberYesChain to withdraw on
tokenAddressstringYesToken contract address
amountnumberYesAmount in token minor units (USDC has 6 decimals, so 1000000 = $1)
recipientAddressstringNoDestination wallet address
USDC uses 6 decimal places. To withdraw $5 USDC, send amount: 5000000.
Response:
{
  "id": "withdrawal_xyz",
  "userId": "user_abc123",
  "chainId": 8453,
  "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount": 5000000,
  "recipientAddress": "0x...",
  "transactionHash": "0x...",
  "status": "submitted"
}

Withdrawal Status

StatusDescription
pendingAwaiting processing
submittedTransaction submitted to network
confirmedTransaction confirmed on-chain
failedTransaction failed

List Withdrawals

curl "https://api.useproxy.ai/v1/withdrawals?userId=$USER_ID" \
  -H "Api-Key: $API_KEY"

Get Withdrawal

Check the status of a specific withdrawal:
curl "https://api.useproxy.ai/v1/withdrawals/$WITHDRAWAL_ID" \
  -H "Api-Key: $API_KEY"
Response:
{
  "object": "withdrawal",
  "id": "wd_abc123",
  "userId": "user_xyz",
  "chainId": 8453,
  "amount": 10000000,
  "recipientAddress": "0x...",
  "status": "confirmed",
  "transactionHash": "0x...",
  "createdAt": 1234567890,
  "confirmedAt": 1234567900
}

Webhooks

Subscribe to deposit and withdrawal events:
EventDescription
deposit.receivedFunds received and credited
deposit.address_readyDeposit address available
withdrawal.submittedWithdrawal transaction submitted
withdrawal.confirmedWithdrawal confirmed on-chain
withdrawal.failedWithdrawal failed
user.balance.updatedCredit limit or spending power changed

Sandbox Testing

In sandbox, use test tokens (rUSD) instead of real USDC:
ChainrUSD Contract
Base Sepolia0x10b5Be494C2962A7B318aFB63f0Ee30b959D000b
Optimism Sepolia0x915F8c4a8b9fE793b3185c4186F716d7e5D891b6
Arbitrum Sepolia0xd116d4752fc50D660FB5b5c801448Ae84B4937bc
To get test tokens:
  1. Go to the block explorer for the rUSD contract
  2. Connect your wallet
  3. Call mint(amount) (max 100 tokens per transaction)
  4. Transfer to the user’s depositAddress
rUSD has 6 decimals like USDC. To mint 100 rUSD, call mint(100000000).

Best Practices

Use user.balance.updated webhooks to track credit changes in real-time.
Always verify available balance before issuing cards or making large purchases.
Withdrawal transactions can fail due to network issues. Implement retry logic.