--- title: "Pull provisioning from Apple Wallet" description: "Learn how to allow your cardholders to add their Adyen-issued card to Apple Wallet from the Apple Wallet app." url: "https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning" source_url: "https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning.md" canonical: "https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning" last_modified: "2023-03-28T14:00:00+02:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # Pull provisioning from Apple Wallet Learn how to allow your cardholders to add their Adyen-issued card to Apple Wallet from the Apple Wallet app. In addition to [in-app push provisioning](https://docs.adyen.com/issuing/tokens-digital-wallet/in-app-push-provisioning), you must also support pull provisioning from Apple Wallet. After implementing the Apple Wallet extension, your app's name and icon appears in the **From Apps on Your iPhone** list of cards available to add to the Wallet. If you are integrating pull provisioning from Apple Wallet, you must also integrate [in-app push provisioning for Apple Pay](https://docs.adyen.com/issuing/tokens-digital-wallet/in-app-push-provisioning). ## Requirements Before you begin, take into account the following requirements, limitations, and preparations. | Requirement | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | You need an integration that supports [Adyen Issuing](https://docs.adyen.com/issuing). | | **[API credentials](https://docs.adyen.com/issuing/manage-access/api-credentials-web-service)** | Your API credential must have the following role: - **Bank Issuing PaymentInstrument Network Token Activation Data role** | | **Limitations** | Your app must target iOS 13.4 or later. Your development environment must use Xcode 14 or later and Swift 5.7 or later. | | **Setup steps** | Install the [Adyen Apple Pay Provisioning SDK](https://github.com/Adyen/adyen-apple-pay-provisioning-ios/) following the instructions in the repository's README file. | ## Extension provisioning flow The following sequence diagram shows the flow for pull provisioning from Apple Wallet. ![](https://docs.adyen.com/media/d6f57ae0e388507882b3c96fb97c083ee6c7125ef4dc173b4e81b1d4a0bd25da.svg?decoding=auto\&fetchpriority=auto) As shown in the diagram, the provisioning flow is the following: 1. [Show your app on Apple Wallet](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#show-your-app-on-wallet) 2. [Show card passes](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#show-card-passes) 3. [Generate a request to add a card](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#start-provisioning-process) 4. [Provision the card](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-card) ## Add Apple extensions Before you implement pull provisioning from Apple Wallet: 1. [Add the Apple Wallet extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-wallet-extension). 2. [Add Authentication UI extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-auth-extension). ### Add the Apple Wallet extension To add the Apple Wallet extension: 1. Add a new target to your Xcode project with any Extension template. Then, change the values under the `NSExtension` dictionary in the `Info.plist` as follows: | Key | Type | Value | | --------------------------- | ------ | --------------------------------------------- | | `NSExtension` | String | **com.apple.PassKit.issuer-provisioning** | | `NSExtensionPrincipalClass` | String | **$(PRODUCT\_MODULE\_NAME).ExtensionHandler** | 2. Create an `ExtensionHandler` class that implements the `PKIssuerProvisioningExtensionHandler` protocol. This class manages the issuer-provided extension that is used during the card provisioning process. **Add Wallet extension** ```swift import PassKit class ExtensionHandler: PKIssuerProvisioningExtensionHandler { } ``` ### Add the Authentication UI extension The Apple Wallet authenticates cardholders before allowing them to provision cards. You can implement this authentication process in your UI by adding the Authentication UI extension. To add this extension: 1. Add another target to your Xcode project with any Extension template. Change the values under the `NSExtension` dictionary in the `Info.plist` as follows: | Key | Type | Value | | --------------------------- | ------ | ------------------------------------------------------- | | `NSExtension` | String | **com.apple.PassKit.issuer-provisioning.authorization** | | `NSExtensionPrincipalClass` | String | **$(PRODUCT\_MODULE\_NAME).AuthorizationProvider** | 2. Create an `AuthorizationProvider` class that is a subclass of `UIViewController` and implements the `PKIssuerProvisioningExtensionAuthorizationProviding` protocol. Use the `completionHandler` to communicate if the authentication was successful. ## Initialize the Adyen Apple Pay Provisioning SDK At the beginning of each step of the provisioning flow, you must initialize the **Adyen Apple Pay Provisioning SDK**, so you can call the SDK's methods. The following sequence diagram shows the flow to initialize the SDK. ![](https://docs.adyen.com/media/f23fc312800592e8bc37e962b92c4d1f17dc93d19d166f27c4a5e76e595ce8ba.svg?decoding=auto\&fetchpriority=auto) As shown in the diagram, the initialization flow is the following: 1. Make a GET `/paymentInstruments/{id}/networkTokenActivationData` request. 2. Receive an `sdkInput` from Adyen. 3. Initialize the `ExtensionProvisioningService` using the `sdkInput`. The following sections explain the steps for the provisioning flow, including the steps to initialize the SDK. ## Show your app on Apple Wallet When your user tries to add their Adyen-issued card from Apple Wallet, Apple Wallet must show your app as an option. To do this, Apple Wallet uses the [Apple Wallet extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-wallet-extension) to check if your app supports pull provisioning from Apple Wallet. If your app has cards available to add, Apple Wallet shows it as an option. You can provide your app's availability for pull provisioning from Apple Wallet by using the **Adyen Apple Pay Provisioning SDK**. Do this as follows: 1. From your server, make a GET `/paymentInstruments/{id}/networkTokenActivationData` request and specify the `id` of the payment instrument in the path.\ If your user has multiple payment instruments, make a request for each payment instrument. **Get activation data** #### curl ```bash curl https://balanceplatform-api-test.adyen.com/bcl/v2/paymentInstruments/PI00000000000000000000001/networkTokenActivationData \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -X GET ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.balanceplatform.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.balanceplatform.*; Config config = new Config() .apiKey("ADYEN_BALANCE_PLATFORM_API_KEY") .environment(Environment.TEST); Client client = new Client(config); // Send the request PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); NetworkTokenActivationDataResponse response = service.getNetworkTokenActivationData("id", null); ``` #### PHP ```php setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); // Send the request $service = new PaymentInstrumentsApi($client); $response = $service->getNetworkTokenActivationData('id'); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using Adyen.BalancePlatform.Extensions; using Adyen.BalancePlatform.Models; using Adyen.BalancePlatform.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureBalancePlatform( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY"; options.Environment = AdyenEnvironment.Test; }); services.AddAllBalancePlatformServices(); }) .Build(); var paymentInstrumentsService = host.Services.GetRequiredService(); // Send the request var result = await paymentInstrumentsService.GetNetworkTokenActivationDataAsync("id"); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, BalancePlatformAPI } = require('@adyen/api-library'); const config = new Config({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData("id"); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Send the request service := client.BalancePlatform() req := service.PaymentInstrumentsApi.GetNetworkTokenActivationDataInput("id") res, httpRes, err := service.PaymentInstrumentsApi.GetNetworkTokenActivationData(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Send the request result = adyen.balancePlatform.payment_instruments_api.get_network_token_activation_data(id="id") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY' adyen.env = :test # Set to "live" for live environment # Send the request result = adyen.balance_platform.payment_instruments_api.get_network_token_activation_data('id') ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, BalancePlatformAPI, Types } from "@adyen/api-library"; const config = new Config({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData("id"); ``` The response contains the `sdkInput` string that you need to initialize the provisioning service in the next step. 2. Initialize the `ExtensionProvisioningService` class, which manages the [Apple Wallet extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-wallet-extension). Pass the `sdkInput` to the class as a parameter. **Initiate card provisioning for one payment instrument** ```swift import AdyenApplePayExtensionProvisioning let provisioningService = ExtensionProvisioningService(sdkInput: sdkInput) ``` If you requested multiple `sdkInput` strings, pass them to the class in an array. **Initiate card provisioning for multiple payment instruments** ```swift import AdyenApplePayExtensionProvisioning let provisioningService = ExtensionProvisioningService(sdkInputs: [sdkInput1, sdkInput2, ...]) ``` 3. From the **Adyen Apple Pay Provisioning SDK**, call `extensionStatus` to implement the `status` method of the `PKIssuerProvisioningExtensionHandler` protocol. Consider including the following parameters: * `requiresAuthentication`: A boolean that specifies whether you provide [authentication through the UI extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-auth-extension). * `entriesUnavailableExtensionStatus`: If the `ExtensionProvisioningService` could not be initialized, return this parameter to indicate that the provisioning service is not available. **Get current status** ```swift func status() async -> PKIssuerProvisioningExtensionStatus { // Initialize the service return provisioningService.extensionStatus(requiresAuthentication: true) // If service could not be initialized return ExtensionProvisioningService.entriesUnavailableExtensionStatus } ``` After completing these steps, the **Adyen Apple Pay Provisioning SDK** sends the status to the Apple Wallet extension. If your provisioning service is available, the `status` object contains information about the available [card passes](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#show-card-passes) in your app. The time limit for your app to complete these steps is 100 milliseconds. If your app exceeds this limit, make a new GET `/paymentInstruments/{id}/networkTokenActivationData` request to refresh the `sdkInput`. ## Show card passes To enable your user to add their card to their Apple Wallet, you must show the cards as available card passes. You can do this by providing the card data and card art to **Adyen Apple Pay Provisioning SDK**. With this information, the SDK generates a preview of the card passes to the user. The SDK uses two different methods to generate the available card passes: * `passEntries`: This method shows card passes on the Wallet app on iPhone. * `remotePassEntries`: This method shows card passes on: * The Watch app on iPhone. * The Wallet app on Apple Watch. To implement `passEntries` and `remotePassEntries`: 1. From your server, make a GET `/paymentInstruments/{id}/networkTokenActivationData` request and specify the `id` of the payment instrument in the path. **Get activation data** #### curl ```bash curl https://balanceplatform-api-test.adyen.com/bcl/v2/paymentInstruments/PI00000000000000000000001/networkTokenActivationData \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -X GET ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.balanceplatform.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.balanceplatform.*; Config config = new Config() .apiKey("ADYEN_BALANCE_PLATFORM_API_KEY") .environment(Environment.TEST); Client client = new Client(config); // Send the request PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); NetworkTokenActivationDataResponse response = service.getNetworkTokenActivationData("id", null); ``` #### PHP ```php setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); // Send the request $service = new PaymentInstrumentsApi($client); $response = $service->getNetworkTokenActivationData('id'); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using Adyen.BalancePlatform.Extensions; using Adyen.BalancePlatform.Models; using Adyen.BalancePlatform.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureBalancePlatform( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY"; options.Environment = AdyenEnvironment.Test; }); services.AddAllBalancePlatformServices(); }) .Build(); var paymentInstrumentsService = host.Services.GetRequiredService(); // Send the request var result = await paymentInstrumentsService.GetNetworkTokenActivationDataAsync("id"); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, BalancePlatformAPI } = require('@adyen/api-library'); const config = new Config({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData("id"); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Send the request service := client.BalancePlatform() req := service.PaymentInstrumentsApi.GetNetworkTokenActivationDataInput("id") res, httpRes, err := service.PaymentInstrumentsApi.GetNetworkTokenActivationData(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Send the request result = adyen.balancePlatform.payment_instruments_api.get_network_token_activation_data(id="id") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY' adyen.env = :test # Set to "live" for live environment # Send the request result = adyen.balance_platform.payment_instruments_api.get_network_token_activation_data('id') ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, BalancePlatformAPI, Types } from "@adyen/api-library"; const config = new Config({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData("id"); ``` The response contains the `sdkInput` string that you need to initialize the provisioning service in the next step. If the extension needs to show multiple payment instruments, request an `sdkInput` string for each payment instrument. 2. Initialize the `ExtensionProvisioningService` class, which manages the [Apple Wallet extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-wallet-extension). Pass the `sdkInput` to the class as a parameter. **Initiate card provisioning for one payment instrument** ```swift import AdyenApplePayExtensionProvisioning let provisioningService = ExtensionProvisioningService(sdkInput: sdkInput) ``` If you requested multiple `sdkInput`, pass these to the class in an array. **Initiate card provisioning for multiple payment instruments** ```swift import AdyenApplePayExtensionProvisioning let provisioningService = ExtensionProvisioningService(sdkInputs: [sdkInput1, sdkInput2, ...]) ``` 3. Implement `ExtensionProvisioningServiceDelegate` to receive the `cardArt(forBrand: String)` callback from the **Adyen Apple Pay Provisioning SDK**. This callback returns the card art that corresponds to each available card pass. **Provide card art** ```swift extension ExtensionHandler: ExtensionProvisioningServiceDelegate { func cardArt(forBrand brand: String) -> CGImage { return UIImage(named: "card_art")!.cgImage! } } ``` 4. From the SDK, call `passEntries` and `remotePassEntries` and pass the delegate that you created in the previous step. **Get pass entries** ```swift func passEntries() async -> [PKIssuerProvisioningExtensionPassEntry] { return provisioningService.passEntries(withDelegate: self) } func remotePassEntries() async -> [PKIssuerProvisioningExtensionPassEntry] { return provisioningService.remotePassEntries(withDelegate: self) } ``` Now, the Apple Wallet or Watch app shows the available card passes to your user. The time limit for your app to complete these steps is 20 seconds. If your app exceeds this limit, make a new GET `/paymentInstruments/{id}/networkTokenActivationData` request to refresh the `sdkInput`. ## Start pull provisioning from Apple Wallet After your user selects to add a card to Apple Wallet, the Apple Wallet extension calls **Adyen Apple Pay Provisioning SDK** to generate a request to provision the card pass. To generate a request for adding a card: 1. From your server, make a GET `/paymentInstruments/{id}/networkTokenActivationData` request and specify the `id` of the payment instrument in the path.\ If your user has multiple payment instruments, make a request for each payment instrument. **Get activation data** #### curl ```bash curl https://balanceplatform-api-test.adyen.com/bcl/v2/paymentInstruments/PI00000000000000000000001/networkTokenActivationData \ -H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \ -H 'content-type: application/json' \ -X GET ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.balanceplatform.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.balanceplatform.*; Config config = new Config() .apiKey("ADYEN_BALANCE_PLATFORM_API_KEY") .environment(Environment.TEST); Client client = new Client(config); // Send the request PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); NetworkTokenActivationDataResponse response = service.getNetworkTokenActivationData("id", null); ``` #### PHP ```php setXApiKey("ADYEN_BALANCE_PLATFORM_API_KEY"); $client->setEnvironment(Environment::TEST); // Send the request $service = new PaymentInstrumentsApi($client); $response = $service->getNetworkTokenActivationData('id'); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using Adyen.BalancePlatform.Extensions; using Adyen.BalancePlatform.Models; using Adyen.BalancePlatform.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureBalancePlatform( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_BALANCE_PLATFORM_API_KEY"; options.Environment = AdyenEnvironment.Test; }); services.AddAllBalancePlatformServices(); }) .Build(); var paymentInstrumentsService = host.Services.GetRequiredService(); // Send the request var result = await paymentInstrumentsService.GetNetworkTokenActivationDataAsync("id"); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, BalancePlatformAPI } = require('@adyen/api-library'); const config = new Config({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData("id"); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", Environment: common.TestEnv, }) // Send the request service := client.BalancePlatform() req := service.PaymentInstrumentsApi.GetNetworkTokenActivationDataInput("id") res, httpRes, err := service.PaymentInstrumentsApi.GetNetworkTokenActivationData(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_BALANCE_PLATFORM_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Send the request result = adyen.balancePlatform.payment_instruments_api.get_network_token_activation_data(id="id") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 to latest require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY' adyen.env = :test # Set to "live" for live environment # Send the request result = adyen.balance_platform.payment_instruments_api.get_network_token_activation_data('id') ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 to latest import { Client, Config, EnvironmentEnum, BalancePlatformAPI, Types } from "@adyen/api-library"; const config = new Config({ apiKey: "ADYEN_BALANCE_PLATFORM_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Send the request const balancePlatformAPI = new BalancePlatformAPI(client); const response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData("id"); ``` The response contains the `sdkInput` string that you need to initialize the provisioning service in the next step. 2. Initialize the `ExtensionProvisioningService` class, which manages the [Apple Wallet extension](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-wallet-extension). Pass the `sdkInput` to the class as a parameter. **Initiate card provisioning for one payment instrument** ```swift import AdyenApplePayExtensionProvisioning let provisioningService = ExtensionProvisioningService(sdkInput: sdkInput) ``` If you requested multiple `sdkInput` strings, pass these to the class in an array. **Initiate card provisioning for multiple payment instruments** ```swift import AdyenApplePayExtensionProvisioning let provisioningService = ExtensionProvisioningService(sdkInputs: [sdkInput1, sdkInput2, ...]) ``` 3. From the SDK, call the `generateAddPaymentPassRequestForPassEntryWithIdentifier` method to obtain a pass request. In this call, include the `delegate` parameter to handle [card provisioning](https://docs.adyen.com/issuing/tokens-digital-wallet/wallet-provisioning#add-card). **Generate a request for adding a card pass** ```swift func generateAddPaymentPassRequestForPassEntryWithIdentifier( _ identifier: String, configuration: PKAddPaymentPassRequestConfiguration, certificateChain certificates: [Data], nonce: Data, nonceSignature: Data ) async -> PKAddPaymentPassRequest? { try? await provisioningService.generateAddPaymentPassRequestForPassEntryWithIdentifier( identifier, configuration: configuration, certificateChain: certificates, nonce: nonce, nonceSignature: nonceSignature, delegate: self ) } ``` 4. Send the pass request to the extension. ## Add the card to Apple Wallet After the SDK sends the pass request to the Apple Wallet extension, the extension requests from Adyen the [network token](https://docs.adyen.com/issuing/manage-network-tokens) data of the card. The extension uses this data to provision the card in Apple Wallet. To provision the card when the extension requests it: 1. Implement `ExtensionProvisioningServiceDelegate` to receive the `provision(paymentInstrumentId, sdkOutput)` callback from the **Adyen Apple Pay Provisioning SDK**. 2. In the callback, make a POST `paymentInstruments/{id}/networkTokenActivationData` request and specify the following parameters: | Parameter | Type | Description | | ----------- | ---- | ------------------------------------------------------------------------------------------------------------------------- | | `id` | Path | The `paymentInstrumentId` of the card you want to provision. | | `sdkOutput` | Body | Data automatically generated and provided by the SDK. The extension must send this data to Adyen to validate the request. | The response contains the `sdkInput` string that the SDK needs to provision the card. 3. Return the `sdkInput` string from the response back to the SDK. The following example shows how to implement these steps. **Provision the card** ```swift extension ExtensionHandler: ExtensionProvisioningServiceDelegate { func provision(paymentInstrumentId: String, sdkOutput: Data) async -> Data? { let sdkInput = // POST `sdkOutput` to server return sdkInput } } ``` After these steps are completed, the SDK returns the delegate to the Apple Wallet extension. Then, the extension provisions the card on Apple Wallet. ## Next steps [required](https://docs.adyen.com/issuing/manage-network-tokens) [Manage network tokens](https://docs.adyen.com/issuing/manage-network-tokens) [Learn how to manage network tokens for cards added to digital wallets.](https://docs.adyen.com/issuing/manage-network-tokens)