This guide shows you how to create a virtual account so your users can send fiat and receive crypto.
Prerequisites
- Your user has completed onboarding (Custom KYC flow with endorsement approved)
- You have their
externalUserId
- Customer’s
baseEndorsementStatus is "approved"
What is Onramp?
Onramp allows your users to:
- Send USD via bank transfer to provided bank account details
- Automatically receive cryptocurrency at their wallet address
This is useful for users who want to buy crypto using fiat currency.
Create Virtual Account
Create a virtual account that generates bank deposit instructions:
POST /v0/virtual-accounts
{
"externalUserId": "user_123",
"sourceCurrency": "USD",
"destinationPaymentRail": "ethereum",
"destinationCurrency": "usdc",
"destinationAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}
// Response includes bank account details for user to deposit fiat
{
"data": {
"id": "va_id",
"bankName": "Example Bank",
"bankAccountNumber": "1234567890",
"bankRoutingNumber": "021000021",
// ... user deposits to these details, receives crypto automatically
}
}
Give these bank details to your user. When they send USD to this account, USDC will automatically be sent to their destinationAddress.
How It Works
- Your user initiates a bank transfer to the provided bank account
- When the transfer completes, Karma automatically converts USD to USDC
- USDC is sent to the user’s specified
destinationAddress
- You receive webhook events about the transaction status
Monitoring Transactions
Configure webhooks to receive real-time updates:
// Example webhook payload
{
"event_type": "virtual_account.payment.completed",
"data": {
"externalUserId": "user_123",
"amount": "100.00",
"currency": "USD",
"destinationAmount": "99.50",
"destinationCurrency": "USDC",
"status": "completed"
}
}
Next Steps