Skip to main content
The Payment Widget handles Apple Pay selection for deposits via the Select for Deposit flow, where users can select Apple Pay as the payment method. After the user confirms an Apple Pay deposit quote, the Payment Widget completes the Apple Pay authorization and creates the transaction via the Authorize flow.

Prerequisites

Walkthrough


Select deposit method

The Payment Widget’s Select for Deposit flow presents the available payment methods, letting the user select Apple Pay 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. 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

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 after the user selects Apple Pay.
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

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

Create a quote

Call Create quote with Apple Pay as the origin and the user’s account as the destination. Specify Apple Pay as the origin with type: "apm" and method: "apple-pay".
A successful response includes the quote details and a requirements array. For Apple Pay, it contains authorize:apple-pay, which indicates that the user must authorize Apple Pay before the transaction can be created.

Authorize and create the transaction

After the user confirms the Apple Pay quote, hand off to the Payment Widget Authorize flow. It presents the Apple Pay sheet, creates the transaction, and polls until a terminal status is reached. Apple Pay authorizes per transaction on the user’s device — there is no stored authorization to reuse, so the user confirms with Face ID, Touch ID, or their passcode every time. By default, the widget renders a full walkthrough around the authorization; in headless mode, it renders only the Apple Pay button so you can embed it directly into your own UI — see Headless mode below.

Create an authorize session

Call Create widget session to start the authorize flow, passing the quoteId and adding authorize:apple-pay to the requirements array. For web apps, also include the top-page domain. To enable headless mode, set authorize.mode to headless in options. To customize the theme and layout, see the example here.
The top-page domain is the domain shown in the browser’s URL bar — the very top-level page hosting the widget iframe. For web apps, it must match the domain you registered with Apple Pay for your merchant ID.
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 with the session. The widget presents the Apple Pay sheet, collects device data, creates the transaction, and polls until a terminal status is reached.
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.

Headless mode

By default, the widget renders a full authorization experience — a short walkthrough, the Apple Pay button, and a processing screen while the transaction is confirmed. In headless mode, it renders only the Apple Pay button, with no surrounding UI, so you can embed it directly into your own layout. Your app then owns the surrounding context and the post-authorization experience — progress and success feedback, and a way to cancel. To enable it, set authorize.mode to headless in the options of the Create widget session request:
See AuthorizeFlowOptions in the SDK reference for the full type definition.

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 dismisses the Apple Pay sheet or navigates back without completing authorization.

Handle errors

The error event fires for critical unrecoverable errors — except authorize_transaction_failed, which is retryable in headless mode: the widget resets itself back to its ready state, so the Apple Pay button works again if you leave the widget mounted. In default mode there is no in-place retry for this code — the button does not become usable again, so unmount and create a new authorize session if you want the user to try again. authorize_transaction_failed is the retryable code for Apple Pay authorization and transaction-creation failures. event.detail.error.details.reason narrows down where it happened:
ReasonDescription
unable-to-create-payment-requestThe browser could not build the Apple Pay payment request
unable-to-make-paymentThe device or browser reported it cannot make this payment
unable-to-show-payment-requestThe Apple Pay sheet could not be shown
invalid-payment-responseThe Apple Pay sheet returned a response without the expected payment token
unable-to-create-transactionApple Pay authorization succeeded, but the transaction itself could not be created — see event.detail.error.cause below for the underlying reason
Other failures in this flow — such as a missing or expired quote, or the SDK being unavailable — surface with their own code and are not retryable; handle those with a generic fallback. As with any Widget error, the original failure is preserved in event.detail.error.cause. When details.reason is unable-to-create-transaction, event.detail.error.cause.code is one of:
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

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

Sample transaction

In a successful Apple Pay deposit, the origin is represented as an apm node with the method as {apmMethod}. 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. Here’s an example:
Apple Pay transaction completed confirmation

Troubleshooting

Having issues rendering Apple Pay? See Troubleshooting in the Payment Widget installation guide.
You now support Apple Pay deposits via the Payment Widget.