Vaulting a PayPal account will allow you to charge the account in the future without requiring your customer to be present during the transaction or re-authenticate with PayPal when they are present during the transaction.

When the customer completes the PayPal authentication flow, the PayPal interface closes and returns the nonce and additional PayPal data to your app. At this point in time a PayPal pre-approved payment is created between you and the customer, displayed in the customer's account profile on Send the nonce to your server where it can be used to create a transaction.

The vaulted payment flow supports the following features:

  • Select or add shipping addresses in the PayPal account
  • Select or add funding instruments in the PayPal account
  • Two factor authentication support (currently only for US, UK, CA, DE, AT, and AU)


Typical use cases for the vaulted payment flow:

  • Faster payments for repeat customers
  • Subscriptions
  • Recurring billing (e.g. automatic top-up or usage based charges)

Invoking the Vault flowanchor

  1. Swift
class MyViewController: UIViewController {
    var braintreeClient: BTAPIClient?

    func startCheckout() {
        // Example: Initialize BTAPIClient, if you haven't already
        braintreeClient = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")!
        let payPalDriver = BTPayPalDriver(apiClient: braintreeClient!)

        let request = BTPayPalVaultRequest()
        request.billingAgreementDescription = "Your agreement description" // Displayed in customer's PayPal account
        payPalDriver.tokenizePayPalAccount(with: request) { (tokenizedPayPalAccount, error) -> Void in
            if let tokenizedPayPalAccount = tokenizedPayPalAccount {
                print("Got a nonce: (tokenizedPayPalAccount.nonce)")
                // Send payment method nonce to your server to create a transaction
            } else if let error = error {
                // Handle error here...
            } else {
                // Buyer canceled payment approval

Collecting device dataanchor

Collecting device data from your customers is required when initiating non-recurring transactions from Vault records. For instructions, see the Premium Fraud Management Tools Guide.

Shipping addressanchor

Shipping addresses may or may not be collected during the PayPal Vault flow. However, if you choose to collect shipping addresses yourself, it can be passed along with the server side Transaction.Sale call. Look at the Server-side page for more information.

Country and language supportanchor

PayPal is available to merchants in all countries that we support and to customers in 140+ countries.

Currency presentmentanchor

In the Vault flow itself, the transaction currency and amount are not displayed to the customer. It is up to you to display these details in your checkout flow somewhere (e.g. cart page, order review page, etc.). Our Server-Side guide outlines which currencies are supported for PayPal transactions.

Next Page: Server-side