<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialSession/performWiredTransaction(using:over:instanceAID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SecureElementCredential",
      "UIKit"
    ],
    "preciseIdentifier" : "s:23SecureElementCredential0C7SessionC01_abC6_UIKitE23performWiredTransaction5using4over11instanceAIDyAC0C0V_So7UISceneC10Foundation4DataVtYaKF"
  },
  "title" : "performWiredTransaction(using:over:instanceAID:)"
}
-->

# performWiredTransaction(using:over:instanceAID:)

Enters wired mode with user authentication.

```
func performWiredTransaction(using credential: CredentialSession.Credential, over scene: UIScene, instanceAID: Data) async throws
```

## Parameters

`credential`

The credential to activate and transition into card emulation state with.

`scene`

The <doc://com.apple.documentation/documentation/UIKit/UIScene> the authentication sheet appears over.

`instanceAID`

The applet instance identifier of the installed credential to authorize.

## Discussion

If the person using the app chooses to authorize, the specified instance will first have an auth token delivered by the broker interface on the Secure Element as described in the [Apple Business Register](https://register.apple.com) Secure Element documents. Otherwise the session throws `userDeclined`.

Use the following flow to call this method:

1. Call [`acquirePresentmentAssertion()`](/documentation/SecureElementCredential/CredentialSession/acquirePresentmentAssertion()) before calling this function to ensure that UI from other applications’ payment tasks don’t interfere with this transaction.
2. Relinquish the asssertion with [`relinquish()`](/documentation/SecureElementCredential/CredentialSession/PresentmentIntentAssertion/relinquish()) immediately prior to calling `performWiredTransaction(using:over:instanceAID:)`.
3. After presenting the credential, call [`endWiredMode()`](/documentation/SecureElementCredential/CredentialSession/endWiredMode()) to return to management mode.
4. If you have further proprietary payment UI to perform, use [`acquirePresentmentAssertion()`](/documentation/SecureElementCredential/CredentialSession/acquirePresentmentAssertion()) to re-acquire the assertion. Perform your tasks, then call [`relinquish()`](/documentation/SecureElementCredential/CredentialSession/PresentmentIntentAssertion/relinquish()) again. Re-acquiring the assertion is subject to the limit of two assertions in an 80-second span.

The credential session can be in any state when calling this method. If the call succeeds, the state transitions to [`CredentialSession.State.wired(credential:)`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/wired(credential:)). The state transitions to [`CredentialSession.State.management`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management) if the call encounters a [`CredentialSession.ErrorCode.resourceUnavailable`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/resourceUnavailable) error; otherwise the state remains unchanged.

An app extension calling this method needs to have the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.identity-document-services.document-provider.mobile-document-types> entitlement.

> Important: Calling this method may generate a billable event to the credential provider.

> Throws: An ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode``. The most common errors are:
> 
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/credentialDoesNotExist``: The specified credential doesn’t exist or the caller doesn’t have access to it.
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/instanceDoesNotExist``: The specified instance identifier doesn’t exist in the target credential.
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/userCanceledAuthorization``: The user dismissed the authorization sheet.
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/resourceUnavailable``: The system resource is unavailable. The session transitions to ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management``.

---

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)