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
Link or select a card account
The widget session lets the user link a new card or select an existing one.Create a widget session
Call Create widget session to start theselect-for-deposit flow.
response.session to your frontend to initialize the widget.
Set up the widget
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 after the user selects a card. The event payload includes the selected card external account.
Handle cancellations
Handle errors
Theerror event fires for critical unrecoverable errors. Card-specific errors (duplicate card, country mismatch, card limits) are handled by the widget internally.
Select destination account
Card deposits can target any account. If the selected account is not in the card’s currency, the amount will be converted at settlement using Uphold’s prevailing rate. Make sure the destination asset has the necessary features enabled.Find an existing account
Call List accounts to retrieve the user’s accounts and let them pick the one they want to fund.Create a new account
If the user has no accounts, create one with Create account before proceeding.Create a quote
Call Create quote with the selected card external account as origin and the destination account.Quotes typically expire quickly. Prompt for user confirmation within the expiry window and requote if needed.
Authorize and create the transaction
After the user confirms the card deposit quote, hand off to the Payment Widget Authorize flow. This flow creates the transaction, completes any 3DS challenge the issuer requires, and polls until a terminal status is reached — so the same flow works whether or not authorization is needed.Create an authorize session
Call Create widget session withflow: "authorize" and the quoteId.
Set up the widget
Initialize the widget with the session. The widget creates the transaction, handles the 3DS redirect, and polls until a terminal status is reached.For native apps using a WebView, you’ll need a bridge for events as outlined in Installation & setup.
Handle the complete event
transaction.statusDetails.reason:
Handle cancellations
Thecancel event fires when the user navigates back without completing authorization.
Handle errors
Theerror event fires for critical unrecoverable errors. Card-specific errors (duplicate card, country mismatch, card limits) are handled by the widget internally.
event.detail.error.code:
Complete implementation example
external-account representing the card and the destination is the user’s account.
Monitor for settlement
Card deposit transactions may 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
Notify the user
Display an in-app confirmation when the transaction iscompleted, and send an email if applicable.
You now support card deposits via the Payment Widget.