Skip to main content
The Payment Widget handles PayPal selection for deposits via the Select for Deposit flow, where users can select or unlink a previously linked PayPal account directly in the widget. After the user confirms a PayPal deposit quote, the Payment Widget creates the transaction and completes the PayPal authorization — whether the account is new or already linked — via the Authorize flow.

Prerequisites

  • The user has completed onboarding, has the paypal capability enabled, and has a verified phone number.
  • Your app has integrated the Payment Widget SDK.
  • Your API client has the required scopes:
    • core.transactions:create — to create quotes and transactions
    • widgets.payment.sessions:create — to create widget sessions

Walkthrough

The diagram shows a first-time authorization. For an already-authorized account, skip the sign-in — the widget only collects device data and reuses the stored authorization.

Select deposit method

The Payment Widget’s Select for Deposit flow presents the available payment methods, letting the user select PayPal when it’s available. It performs selection only: it does not create the quote or the transaction.

Create a widget session

Call Create widget session to start the select-for-deposit flow.
Pass 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

The complete event fires after the user selects PayPal. The event payload includes the selected PayPal external account — if it has already been previously authorized.
Once you have the selection, prompt the user to choose a destination account, then create a quote.

Handle cancellations

Handle errors

The error event fires for critical unrecoverable 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.

Select destination account

deposits can target any account. If the selected account is not in the account’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.
Once the user selects PayPal and their account, proceed to Create a quote.

Create a quote

Call Create quote with PayPal as the origin and the user’s account as the destination. There are two ways to specify the PayPal origin:
  • apm shortcut — use type: "apm" with method: "paypal". This is always accepted, whether or not the user already has a linked PayPal account.
  • external-account reference — if the user already has a linked PayPal account, you can reference it directly with type: "external-account" and its id (from List external accounts):
The example below uses the apm shortcut.
A successful response includes the quote details and a requirements array. If it contains authorize:paypal, the user must authorize PayPal before the transaction can be created.

Present the order summary

Before creating the transaction, display an order summary of the quote — the amount, fees, and the origin and destination — so the user can review it. Here’s an example:
PayPal order summary

Authorize and create the transaction

After the user confirms the PayPal deposit quote, hand off to the Payment Widget Authorize flow. It creates the transaction, runs the PayPal authorization, and polls until a terminal status is reached — so the same flow works for both new and already-authorized accounts.

Create an authorize session

Call Create widget session with flow: "authorize", the quoteId and with the requirements array containing authorize:paypal.

Set up the widget

Initialize the widget with the session. The widget interacts with PayPal, creates the transaction, and polls until a terminal status is reached. For a new account the user signs in to PayPal to authorize; for an already-authorized account they do not sign in again — the widget only collects device data and reuses the stored authorization.
For native apps using a WebView, you’ll need a bridge for events as outlined in Installation & setup.

Handle the complete event

The complete event does not guarantee success. Always check transaction.status and trigger.reason.
Failure reasons in transaction.statusDetails.reason:

Handle cancellations

The cancel event fires when the user navigates back without completing authorization.

Handle errors

The error event fires for critical unrecoverable errors.
Error codes in event.detail.error.code:
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.

Monitor for settlement

transactions remain in processing while the payment settles. Monitor until the transaction reaches a terminal state.

Sample transaction

In a successful PayPal deposit, the origin is the external account representing the user’s PayPal account and the destination is the user’s account.

Notify the user

After the transaction completes, display the transaction details to the user so they can confirm the deposit succeeded. It must include the PayPal logo and the PayPal account email used. Here’s an example:
PayPal transaction completed confirmation
You now support PayPal deposits via the Payment Widget.