Prerequisites
- The user is onboarded and verified (KYC).
- An account created for the user to receive the deposit.
- The asset and network are enabled in your environment (e.g., BTC mainnet, ETH mainnet/testnet).
- Your system is set up to listen to webhooks for incoming transactions.
The flow
Choose asset & network
Confirm the asset (e.g., XRP) and network (e.g., xrp-ledger) that the user wants to deposit.Generate deposit address
Request a deposit address for the user’s account by calling the Set up Account Deposit Method endpoint.address and, if applicable, a reference (e.g., destination tag, memo).
Display deposit instructions
Render the address and a QR code. If areference is present, display it prominently and treat it as required input.
Monitor for incoming transactions
Prefer webhooks for real-time updates, or fall back to polling if webhooks are not feasible.- Webhook events (recommended):
- core.transaction.created
status: processingmeaning detected on-chain but not yet confirmed
- core.transaction.status-changed
status: completedmeaning necessary confirmations reachedstatus: failedmeaning irrecoverable error
- core.transaction.created
- Polling (fallback):
- Get Transaction endpoint.
Transaction object
Below is a sample transaction object returned by the Get Transaction endpoint. Theorigin field shows how the source of the deposit is represented:
Execution modes
Crypto deposits are processed using different execution modes depending on the environment and configuration:- On-chain execution: The transaction is processed directly on the blockchain network. The
origin.node.execution.modewill be"onchain"and include atransactionHashas shown in the example above. - Simulated execution: Used in development environments for testing purposes. The transaction appears processed but does not affect actual blockchain state (user balances will be affected though). The
origin.node.execution.modewill be"simulated"(Available soon).
Notify the user
Show an in-app confirmation and send an email once the deposit is completed.Congratulations! You’ve successfully implemented the crypto deposit flow using the Enterprise API Suite.