Skip to main content
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.
The Payment Widget does not create any transaction. Monitoring and processing the incoming transfer must be handled by your backend via webhooks or polling.

Prerequisites

Walkthrough


Select deposit method

The widget lets the user select a crypto network and view the deposit address.

Create a widget session

Call Create widget session to start the select-for-deposit flow. To customize the theme and layout, see the example here.
The response contains a session object with a url field that loads the widget. Return response.session to your frontend as is.

Set up the widget

Initialize the widget for the select-for-deposit flow using the session data returned from the API.
Both examples above are for web applications — either creating the iframe yourself or letting the SDK do it. For native apps using a WebView, see Native apps with the Web SDK for the SDK’s native-bundling pattern, or Setup without the SDK for the no-SDK approach that loads the session url directly as the WebView’s top-level page.

Handle the complete event

The complete event fires when the user selects a deposit method and the widget displays the deposit address.
The event payload:
  • via — set to deposit-method when 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.
The widget presents the deposit address and reference directly to the user. The depositMethod.details contains:

Handle cancellations

The cancel event fires when the user closes the widget without completing the selection.

Handle errors

The error 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.

Sample transaction

In a successful crypto deposit, the origin is represented as a crypto-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 executed in one of the following modes, indicated by origin.node.execution.mode:
The transaction is received from the blockchain network. origin.node.execution.mode is onchain, and origin.node.execution.transactionHash holds the transaction hash, as in the example above.
When both the sender and recipient are Uphold users, the transfer is processed within Uphold’s infrastructure instead of the blockchain. This avoids network fees and is faster than on-chain processing.Each side sees the transfer from its own perspective:When both users belong to the same organization, the execution also identifies the counterpart account: destination.node.execution.accountOwnerId and destination.node.execution.accountId for the sender, and origin.node.execution.accountOwnerId and origin.node.execution.accountId for the recipient.Because funds move between Uphold accounts, the assets may differ from an on-chain transfer:
  • Sender: destination.asset is the asset of the recipient account associated with the address, which may differ from the one in the quote.
  • Recipient: origin.asset is the asset of the sender’s account, which may differ from the network’s asset or even be one the network doesn’t support, such as a fiat asset.
Used in development environments for testing, see Simulate crypto deposit. The transaction appears processed without affecting blockchain state, although user balances are updated. origin.node.execution.mode is simulated.

Handle on-hold transactions

If the crypto deposit is placed on-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 is completed, and send an email if applicable.
You now support crypto deposits via the Payment Widget.