Skip to main content
The Payment Widget’s withdrawal flow handles the entire card withdrawal in one session: the user picks the origin Uphold account, links or selects a card, enters the amount, reviews a live quote, confirms the transaction and sees its status — all without your backend creating a quote or a second session.
If you need to build the amount entry and review screens yourself, see Select for Withdrawal instead. To compare all flows, see Flows.

Prerequisites

  • The user has completed onboarding and has the required capabilities enabled.
  • The Payment Widget is set up in your frontend. See Installation and setup.
  • @uphold/enterprise-payment-widget-web-sdk is on a version that supports the end-to-end flows.

Walkthrough


Complete the withdrawal in the widget

The widget session takes the user from account and card selection through the amount, quote and authorization.

Create a widget session

Call Create widget session to start the withdrawal flow. No data is required — the widget gathers everything from the user. Use options to customize the Widget’s theme and layout, as well as the flow itself. See the example here and the SDK reference for all available options.
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

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 SDK for the SDK’s native-bundling pattern, or Setup with JavaScript 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 closes the terminal status screen. Its value is the authorization result — the transaction plus what triggered the completion.
complete is only emitted once the user closes the status screen. A user who abandons the widget there leaves a real transaction behind that your app never hears about. Treat webhooks as the source of truth and complete as a UX signal.
In a successful card withdrawal, the origin is the user’s account and the destination is the external-account representing the card. The transaction status is initially processing and updates to completed once the transfer settles.

Handle cancellations

The cancel event fires when the user closes the widget before authorizing. No transaction exists at that point.

Handle errors

The Payment Widget handles most errors internally. For unrecoverable errors, the widget fires an error event. It is the host application’s responsibility to handle these events, present an error message to the user, and unmount the widget.
The widget recovers from quote and authorization failures internally by returning the user to the review screen with an appropriate action — change the amount, change the payment method, or try again. Insufficient balance is handled this way rather than as an error event. These are the known errors:

Monitor for settlement

Card withdrawal transactions may remain in processing while the payout settles. Monitor until the transaction reaches a terminal state.

Notify the user

Display an in-app confirmation when the transaction is completed, and send an email if applicable.
You now support end-to-end card withdrawals via the Payment Widget.