# Install and set up (/sdk/ios/install-and-setup)

Add the PayPal Mobile SDK v3.0.0 for iOS, initialize CoreConfig, and register your return links.



Complete these core setup steps once. Then integrate any payment method, PayPal Checkout or Card, using its guide. Each one starts from the setup here and adds only what is specific to that method.

## Prerequisites [#prerequisites]

You'll need the following before integrating the SDK:

* A PayPal developer account, a client ID, and your merchant ID from the [PayPal Developer Dashboard](/dashboard/).
* A server-side integration that can create and capture orders ([Orders v2 API](/api/orders/v2/)), and, for vault flows, create setup tokens and payment tokens.
* Universal Links configured for your return URL before testing.
* Xcode 15+, iOS 16+, Swift 5.9+.

## 1. Add the SDK [#1-add-the-sdk]

The SDK ships as per-feature products. Add only what you use. Add `FraudProtection`, which provides device data used to reduce declines, plus the product for each payment method you integrate. With CocoaPods:

```ruby
# Podfile
pod 'PayPal/CorePayments'
pod 'PayPal/FraudProtection'      # device data (risk signals)

# Add the product(s) for the method(s) you integrate:
pod 'PayPal/PayPalPayments'       # PayPal Checkout + Vault
pod 'PayPal/PaymentButtons'       # PayPal buttons
# pod 'PayPal/CardPayments'       # Card (ACDC)
```

Or add the `paypal-ios` Swift Package and include the matching products.

## 2. Initialize CoreConfig [#2-initialize-coreconfig]

Every client (`PayPalClient`, `CardClient`) is built from a single `CoreConfig`. No network calls occur at initialization.

```swift
let config = CoreConfig(
    clientID:    "<YOUR_CLIENT_ID>",
    environment: .sandbox,               // .live for production
    merchantID:  "<YOUR_MERCHANT_ID>",   // Required, encrypted merchant account ID
    bnCode:      nil                     // Partner integrations only
)
```

Reuse this `config` across every method client. Switch `.sandbox` to `.live` for production.

## 3. Register your return links [#3-register-your-return-links]

PayPal checkout sends the buyer to the PayPal app, or an in-app browser, and back to your app through a Universal Link. In **App Target › Signing & Capabilities › Associated Domains**, add `applinks:example.com` and serve your AASA file at `https://example.com/.well-known/apple-app-site-association`. One domain covers both your return and cancel URLs.

Register the custom-scheme fallback under `CFBundleURLTypes`, and declare the PayPal app scheme under `LSApplicationQueriesSchemes` so the SDK can detect it. `fallbackSchemeURL` is optional on `PayPalURLConfig`, but set it regardless. Without it, a buyer whose Universal Link fails to open your app has no way back to checkout:

```xml
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array><string>merchantapp</string></array>
    </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>paypal</string>
</array>
```

Define the matching URL config once to pass to each method's session or checkout call:

```swift
let urlConfig = PayPalURLConfig(
    returnAppURL:      URL(string: "https://example.com/merchant-app/return")!,
    cancelAppURL:      URL(string: "https://example.com/merchant-app/cancel")!,
    fallbackSchemeURL: URL(string: "merchantapp://return")   // Optional; see note above
)
```

> **Info:** Card (ACDC) resolves its 3D Secure challenge in-process through `ASWebAuthenticationSession` and needs no Associated Domains or custom-scheme registration.

## Next steps [#next-steps]

With setup done, integrate a payment method:

* [PayPal Checkout](/sdk/ios/add-payment-methods/paypal-checkout): One-Time Checkout, save payment methods with or without purchase, Pay Later, and PayPal Credit.
* [Card (ACDC)](/sdk/ios/add-payment-methods/card): card payments and saving cards.
