transaction:withdrawal-e2e flow handles the entire APM withdrawal in one session: the user picks the origin Uphold account, selects the payment method, enters the amount, reviews a live quote, authorizes the payout with the APM and sees the status of the transaction — all without your backend creating a quote or a transaction:authorize session.
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-sdkis on a version that supports the end-to-end flows.- The additional requirements of each APM you offer are met, such as those for Apple Pay and Venmo.
- The target browser or platform supports the APM.
Walkthrough
Complete the withdrawal in the widget
The widget session takes the user from account and payment method selection through the amount, quote and APM authorization.Create a widget session
Call Create widget session to start thetransaction:withdrawal-e2e 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.
By default, the end-to-end flows offer every payment method: bank, card, crypto and APMs. To offer APMs only, set paymentMethods to the APMs you want:
The widget creates the
transaction:authorize session for the APM itself, so you don’t create one.- Apple Pay: don’t pass a
domain. The widget determines the domain of the top-level page and uses it to validate the merchant with Apple Pay. For production, that domain must still be registered with Apple Pay. - Headless mode: not currently supported in the end-to-end flows. The widget always shows its own authorization screens, even if
authorize.modeis set toheadless. - Venmo: on iOS Safari, Venmo is not available in the end-to-end flows.
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 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. In an iOS WKWebView, PayPal also needs popup handling, see Platform implementation.Apple Pay needs the
payment permission. The Web SDK’s mountIframe() grants it. Without the SDK, keep payment 'src' in the iframe allow attribute, as in the example above.Handle the complete event
Thecomplete event fires when the user closes the terminal status screen. Its value is the authorization result — the transaction plus what triggered the completion, as for every other withdrawal method.
Handle cancellations
Thecancel event fires when the user closes the widget before authorizing. No transaction exists at that point.
Handle errors
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. This includes the APM authorization: when Apple Pay is not available on the device, the user is asked to change the payment method, and when the authorization fails, the user can try again or change the payment method. Insufficient balance is handled this way rather than as anerror event.
Monitor for settlement
APM withdrawal transactions remain inprocessing while the payment settles. Monitor until the transaction reaches a terminal state.
- Webhook events (recommended):
- core.transaction.created —
status: processing→ transaction created, pending settlement - core.transaction.status-changed —
status: completed→ funds settled;status: failed→ irrecoverable error
- core.transaction.created —
- Polling (fallback): Get transaction
Sample transaction
- Apple Pay
- PayPal
- Venmo
In a successful Apple Pay withdrawal, the origin is the user’s
account and the destination is an apm node with the method as {apmMethod}. The transaction status is initially processing and updates to completed once the transfer settles.Notify the user
Display an in-app confirmation when the transaction iscompleted, and send an email if applicable.
You now support end-to-end APM withdrawals via the Payment Widget.
Failure reasons
A transaction that was created can still fail afterwards: itsstatus becomes failed, or on-hold when information is requested, and statusDetails.reason says why. You learn about it through the core.transaction.status-changed webhook, or by polling Get transaction. The table only lists the reasons your integration should act on, such as by notifying the user.