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

# activate(_:withActivationData:completion:)

Activates a payment pass using the provided activation code.

```
func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, any Error) -> Void)? = nil)
```

## Parameters

`paymentPass`

The payment pass to activate.

`activationData`

The one-time cryptographic password.

    PassKit encodes the data as Base64 and then sends it to the payment network. The framework treats this data as an opaque value.

`completion`

The completion block that PassKit calls after activation.

    This block takes the following parameters:

- `success`: <doc://com.apple.documentation/documentation/Swift/true> if the authorization succeeds; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.
- `error`: If `success` is <doc://com.apple.documentation/documentation/Swift/false>, a description of the error.

## Discussion

You can only activate a provisioned pass, and it must be in the [`PKPaymentPassActivationState.requiresActivation`](/documentation/PassKit/PKPaymentPassActivationState/requiresActivation) state.

> Important:
> Activating payment passes requires a special entitlement issued from Apple. For more information, see [developer.apple.com/apple-pay/](https://developer.apple.com/apple-pay/).

---

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)