The Payment Widget handles crypto network selection and displays the deposit address to the user. Your backend only needs to create the session and monitor for the incoming transfer.Documentation Index
Fetch the complete documentation index at: https://developer.uphold.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- The user has completed onboarding and has the required capabilities enabled.
Walkthrough
Select deposit method
The widget lets the user select a crypto network and view the deposit address.Create a payment session
Call the Create payment session endpoint to create a session for theselect-for-deposit flow.
session object with a token and url 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: Used in development environments for testing purposes. The transaction appears as processed but does not affect actual blockchain state (user balances will be affected though). The
origin.node.execution.modewill besimulated(Available soon).
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.
List pending RFIs
Call List requests for information to retrieve the pending RFIs for the transaction.Travel Rule
Travel Rule is a regulatory requirement that mandates the collection and transmission of information about the originator and beneficiary of certain crypto transactions. Use the Travel Rule widget to collect the required information.Create the widget session
Call Create session with"flow": "deposit-form" and the RFI id.
Open the widget
The example below is for web applications. For native apps using a WebView, see Native app integration.
Update the RFI
Once the widget emitscomplete, call Update request for information with the Travel Rule data.
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.