Prerequisites
- The user is onboarded and verified (KYC).
- The crypto-withdrawals capability is enabled for the user.
- A funded account to support the withdrawal.
- The details of the destination wallet: blockchain address and destination tag/memo if applicable (e.g., XRP/XLM).
The flow
Choose the source account
List the user’s accounts using the List accounts endpoint and allow them to choose one with sufficient balance for the withdrawal.Collect withdrawal details
Collect the details where to make the withdrawal to. This can be implemented either by calling the necessary API endpoints directly to build a custom UI for collecting the required details, or by integrating the Payment Widget, which handles the entire process automatically. Both implementations are described below.Using the REST API
Follow these steps to perform a crypto withdrawal using the REST API.List networks
To retrieve the list of available networks, use the List networks and List rails endpoints. Filter for networks of typecrypto that have at least one rail of type crypto-transaction with the withdrawal feature enabled.
When constructing the UI to collect the withdrawal details, use the Network’s reference field to determine whether to display a destination tag/memo input.
Using the Payment Widget
To use the Payment Widget for crypto withdrawals, you must use theSelect for Withdrawal flow.
Select for withdrawal flow
Please refer to the Select for withdrawal guide for a step-by-step tutorial.Regardless of how the withdrawal details were collected (REST API or Payment Widget), the rest of the process is handled via REST API.
Create a quote
Create a quote for the withdrawal using the Create quote endpoint.Quote object
A successful response returns aquote object with details about the withdrawal, including fees and expiration.
Quotes typically expire quickly. Prompt for user confirmation within the expiry window and regenerate if needed.
Handle quote requirements
Some quotes may include requirements in therequirements array that must be resolved before creating the transaction. If present, follow the Quote requirements flow before proceeding.
Create a transaction
Once the user confirms the quote, create the transaction using the Create transaction endpoint.Transaction object
A successful response returns atransaction object with details about the initiated withdrawal.
origin.node.type:accountorigin.node.id: The id of the source accountorigin.node.ownerId: The id of the user that owns the source accountdestination.node.type:crypto-addressdestination.node.network: The destination crypto network (e.g.bitcoin)destination.node.address: The destination crypto address (e.g.1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa)destination.node.reference: The destination address reference, such as a destination tag (if applicable)
Execution modes
Crypto withdrawals support different execution modes depending on the destination and environment:- On-chain execution: The transaction is processed directly on the blockchain network. The
destination.node.execution.modewill beonchainand include blockchain-specific details such as transaction hashes upon completion. - Off-chain execution: When both the sender and recipient are Uphold users, the transaction is processed internally within Uphold’s infrastructure. This eliminates network fees and is faster than onchain processing. The
destination.node.execution.modewill beoffchain. For offchain transactions, theexecutionobject includes additional properties:accountOwnerId(the recipient user ID) andaccountId(the recipient account ID). - 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
destination.node.execution.modewill besimulated.
Monitor for settlement
Prefer webhooks for real-time updates, or fall back to polling if webhooks are not feasible.- Webhook events (recommended):
- core.transaction.created
status: processing→ initiated but not yet broadcast
- core.transaction.status-changed
status: completed→ broadcast and confirmedstatus: on-hold→ transaction checks paused (e.g., pending RFIs)status: failed→ transaction failed, checkstatusDetailsfor more info
- core.transaction.created
- Polling (fallback):
- Get transaction endpoint.
Notify the user
Display an in-app confirmation when the transaction iscompleted, and send an email if applicable.
You now support crypto transfer withdrawals with the Enterprise API Suite!