Prerequisites
- The user has completed onboarding and has the required capabilities enabled.
- The Payment Widget SDK is installed in your frontend. See Installation and setup.
Walkthrough
Select deposit method
The widget lets the user select a crypto network and view the deposit address.Create a widget session
Call the Create widget session endpoint to create a session for theselect-for-deposit flow.
session object. Pass response.session to your frontend to initialize the widget.
Set up the widget
Initialize the widget for theselect-for-deposit flow using the session data returned from the API.
The example above is for web applications. For native apps using a WebView, you’ll need a bridge for events as outlined in Installation & setup.
Handle the complete event
Thecomplete event fires when the user selects a deposit method and the widget displays the deposit address.
via— set todeposit-methodwhen the user completes the crypto network selection.selection.account— the account that will receive the deposit.selection.depositMethod— the deposit method with crypto transfer instructions.
depositMethod.details contains:
Handle cancellations
Thecancel event fires when the user closes the widget without completing the selection.
Handle errors
Theerror event fires when an error occurs during the flow.
Monitor for the incoming transfer
The widget presents the deposit instructions to the user but does not monitor for the incoming transfer. Your application must do this via webhooks or polling. Prefer webhooks for real-time updates, or fall back to polling if webhooks are not feasible.- Webhook events (recommended):
- core.transaction.created
status: processing→ detected on-chain but not yet confirmed
- core.transaction.status-changed
status: completed→ necessary confirmations reachedstatus: on-hold→ transaction checks paused (e.g., pending RFIs)status: failed→ irrecoverable error
- core.transaction.created
- Polling (fallback): Get transaction
Sample transaction
In a successful crypto deposit, the origin is represented as acrypto-address node reflecting the sender’s on-chain address. The destination is the account that was set up to receive the deposit.
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 beonchainand include atransactionHashas shown in the example above. - 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 on-chain processing. The
origin.node.execution.modewill beoffchain. Theexecutionobject for these transactions includes additional properties:accountOwnerId(the sender user ID) andaccountId(the sender account ID). - Simulated execution (Test Helpers): Used in development environments for testing purposes (Simulate crypto deposit). The transaction appears as processed but does not affect actual blockchain state (user balances will be affected though). The
origin.node.execution.modewill besimulated.
Handle on-hold transactions
If the crypto deposit is placedon-hold with reason pending-requests-for-information, resolve the pending RFIs before the deposit can complete. For the full step-by-step implementation, see the Travel Rule deposit flow guide.
Notify the user
Display an in-app confirmation when the transaction iscompleted, and send an email if applicable.
You now support crypto deposits via the Payment Widget.