# Retrieving Existing Passes from PassKit

Before starting the provisioning flow, the application should retrieve existing passes from PassKit.

The `deviceAccountIdentifier` values are required to query the TMP API for the current token status and determine whether a card has already been provisioned on the device or on paired devices such as Apple Watch.

#### **Example**

```swift
import PassKit

let passLibrary = PKPassLibrary()

let localPasses = passLibrary.passes().compactMap {
    $0.secureElementPass?.deviceAccountIdentifier
}

let remotePasses = passLibrary.remoteSecureElementPasses.compactMap {
    $0.deviceAccountIdentifier
}

let deviceAccountIdentifiers = localPasses + remotePasses

```

Local passes represent cards provisioned directly on the iPhone, while remote passes represent cards provisioned on external or paired devices, including **<span class="notion-enable-hover" data-token-index="1">Apple Watch</span>**.