Before users can create orders or fund escrow, they need balance in their account. OFFER-HUB supports two deposit methods depending on your payment provider configuration.
Payment Providers
Provider Method Speed Currencies crypto (default)Stellar USDC transfer ~5 seconds USDC airtmAirTM top-up 1-24 hours USD, local currencies
Set your provider in environment:
PAYMENT_PROVIDER=crypto # or "airtm"
Crypto Deposits (Default)
When PAYMENT_PROVIDER=crypto, users deposit by sending USDC to their Stellar address.
curl http://localhost:4000/api/v1/users/usr_abc123/wallet/deposit \
-H "Authorization: Bearer ohk_live_your_api_key"
Response:
{
"data": {
"provider": "crypto",
"method": "stellar_address",
"address": "GCV24WNJYXPG3QFNP6ZQMLVEMHQX5S6J2OWKGVF5U3XC6HF4QQHG7WMD",
"asset": {
"code": "USDC",
"issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
},
"network": "testnet",
"instructions": "Send USDC to this Stellar address. Deposits are detected automatically within seconds."
}
}
The user sends USDC from any Stellar wallet:
— Mobile wallet
— Web wallet
— Coinbase, Binance, etc. (if they support Stellar USDC)
OFFER-HUB monitors the blockchain for incoming transactions. When USDC arrives:
— Horizon streaming catches the payment
— Off-chain balance incremented
— balance.credited sent via SSE/webhook
— UI can update in real-time
Deposits are typically credited within 5-10 seconds of the Stellar transaction being confirmed.
AirTM Deposits
When PAYMENT_PROVIDER=airtm, users fund their accounts through AirTM's payment network.
curl -X POST http://localhost:4000/api/v1/topups \
-H "Authorization: Bearer ohk_live_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"userId": "usr_abc123",
"amount": "100.00",
"currency": "USD"
}'
Response:
{
"data": {
"id": "top_xyz789",
"userId": "usr_abc123",
"amount": "100.00",
"currency": "USD",
"status": "pending",
"airtm": {
"paymentUrl": "https://app.airtm.com/payment/abc123",
"expiresAt": "2026-02-25T13:00:00.000Z"
},
"created_at": "2026-02-25T12:00:00.000Z"
}
}
Redirect the user to the paymentUrl where they:
Log into AirTM (or create an account)
Choose payment method (bank, mobile money, crypto, etc.)
Complete the payment
AirTM sends a webhook when payment completes:
{
"event": "payment.completed",
"data": {
"topup_id": "top_xyz789",
"amount": "100.00",
"currency": "USD",
"status": "completed"
}
}
OFFER-HUB:
Verifies webhook signature
Credits user balance
Emits balance.credited event
AirTM deposits can take 1-24 hours depending on the user's payment method. Set user expectations accordingly.
Using the SDK
import { OfferHubSDK } from '@offerhub/sdk';
const sdk = new OfferHubSDK({
apiUrl: 'http://localhost:4000',
apiKey: 'ohk_live_your_api_key'
});
// Get deposit address
const deposit = await sdk.wallet.getDepositAddress('usr_abc123');
// Display to user
console.log(`Send USDC to: ${deposit.address}`);
console.log(`Network: ${deposit.network}`);
// Listen for deposit
sdk.events.on('balance.credited', (event) => {
if (event.userId === 'usr_abc123') {
console.log(`Deposit received: ${event.amount}`);
// Update UI, notify user
}
});
// Create top-up request
const topup = await sdk.topups.create({
userId: 'usr_abc123',
amount: '100.00',
currency: 'USD'
});
// Redirect user to payment page
window.location.href = topup.airtm.paymentUrl;
// Or display in iframe/modal
// <iframe src={topup.airtm.paymentUrl} />
// Listen for completion
sdk.events.on('topup.completed', (event) => {
if (event.topupId === topup.id) {
console.log('Payment received!');
// Update UI
}
});
Listening for Deposits
Connect to the event stream:
const events = new EventSource(
'http://localhost:4000/api/v1/events',
{ headers: { Authorization: 'Bearer ohk_live_...' } }
);
events.onmessage = (e) => {
const event = JSON.parse(e.data);
if (event.eventType === 'balance.credited') {
console.log(`${event.payload.userId} received ${event.payload.amount}`);
// Update balance display
updateBalance(event.payload.userId, event.payload.newBalance);
}
};
Register for balance events:
curl -X POST http://localhost:4000/api/v1/webhooks \
-H "Authorization: Bearer ohk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks",
"events": ["balance.credited"],
"secret": "your-webhook-secret"
}'
Webhook payload:
{
"id": "evt_abc123",
"type": "balance.credited",
"created_at": "2026-02-25T12:05:00.000Z",
"data": {
"userId": "usr_abc123",
"amount": "100.00",
"currency": "USD",
"source": "deposit",
"transactionId": "tx_stellar_abc...",
"newBalance": {
"available": "100.00",
"reserved": "0.00"
}
}
}
Checking Balance
After a deposit, verify the updated balance:
curl http://localhost:4000/api/v1/users/usr_abc123/balance \
-H "Authorization: Bearer ohk_live_your_api_key"
Response:
{
"data": {
"userId": "usr_abc123",
"available": "100.00",
"reserved": "0.00",
"currency": "USD"
}
}
Minimum Deposits
Provider Minimum Reason Crypto 0.01 USDC Stellar transaction cost AirTM $5.00 USD AirTM processing minimum
There's no maximum deposit limit for crypto. AirTM may have limits based on user verification level.
Supported Assets
Currently supported:
Asset Network Issuer USDC Stellar Testnet GBBD47IF6...USDC Stellar Mainnet GA5ZSEJYB...
Future support planned for:
EURC (Euro stablecoin)
Native XLM
AirTM supports 200+ funding methods including:
Bank transfers
Mobile money (M-Pesa, etc.)
Cards (Visa, Mastercard)
Local payment methods
Crypto (converted to USD)
Error Handling
Error Cause Solution Deposit not detected Wrong asset or network Verify USDC issuer matches Trustline missing Account not set up Contact support Memo required Exchange withdrawal Some exchanges require memo
Error Cause Solution TOPUP_EXPIREDPayment URL expired Create new top-up PAYMENT_FAILEDUser's payment method failed Try different method AMOUNT_BELOW_MINIMUMAmount too small Increase to $5+
Best Practices
— Make sure users know testnet vs mainnet
— Display USDC issuer for verification
— Use SSE for instant balance updates
— Guide users through deposit flow
— Copy-paste, don't type
— Testnet deposits won't show on mainnet
— Test with small amount first
— For support if needed
Testnet Funding
For development, get testnet USDC:
— Use Stellar Friendbot
— Use Circle's testnet faucet or contact OFFER-HUB
# Fund testnet account with XLM
curl "https://friendbot.stellar.org?addr=GCV24WNJYX..."
Next Steps
Wallets Guide — Understanding invisible wallets
Withdrawals Guide — Moving funds off-platform
Orders Guide — Creating your first order