<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 10.12.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PassKit",
  "identifier" : "/documentation/PassKit/PKPassLibrary/serviceProviderData(for:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PassKit (Apple Pay and Wallet)"
    ],
    "preciseIdentifier" : "c:objc(cs)PKPassLibrary(im)serviceProviderDataForSecureElementPass:completion:"
  },
  "title" : "serviceProviderData(for:completion:)"
}
-->

# serviceProviderData(for:completion:)

Calls a completion handler that returns the custom data for a Secure Element pass.

```
func serviceProviderData(for secureElementPass: PKSecureElementPass, completion: @escaping @Sendable (Data?, (any Error)?) -> Void)
```

```
func serviceProviderData(for secureElementPass: PKSecureElementPass) async throws -> Data
```

## Parameters

`secureElementPass`

The Secure Element pass to check for secure data.

`completion`

The completion block called by the system that returns the data or an error.

    This block takes the following parameters:

- `serviceProviderData`: The custom data for the Secure Element pass; otherwise, `nil`.
- `error`: If the process fails, an <doc://com.apple.documentation/documentation/Foundation/NSError> that describes the failure; otherwise, `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)