> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/additional-features/handle-visa-multiple-aids.md).

# Handle Visa Multiple AIDs

## Overview

Use the NFC Wallet SDK to handle Visa Multiple AIDs.

You can read the available AIDs. You can also update AID priority and lock status.

## SDK Integration

Application identifiers (AIDs) are exposed through `DigitalCard.aidInfoList: [AIDInfo]`.

To detect multiple AIDs, check `DigitalCard.isMultiAID: Bool`.

### Retrieve AID information

`DigitalCard.aidInfoList: [AIDInfo]` returns an array of `AIDInfo` objects.

Each `AIDInfo` includes the AID and metadata:

* `AIDInfo.aid`: The AID as a `String`.
* `AIDInfo.label`: The label as a `String`.
* `AIDInfo.lockStatus`: The AID status: `.locked` or `.unlocked` (default).

{% hint style="warning" %}
Only Visa cards are supported.

When called on a non-Visa card:

* `DigitalCard.isMultiAID` always returns `false`.
* `DigitalCard.aidInfoList` and `DigitalCard.setAIDInfoList(_:)` throw `clientError`.
  {% endhint %}

{% hint style="info" %}
A terminal returns status word `6A81` when it sends **SELECT** to a locked AID.
{% endhint %}

### Update AID priority and lock status

Use the `AIDInfo` objects from `aidInfoList` when you build an updated list.

`AIDInfo.lockStatus` is mutable. You can also reorder the list to change AID priority.

The first element in the list has the highest priority.

To update AID configuration:

1. Use the `DigitalCard.aidInfoList: [AIDInfo]` API to retrieve the `AIDInfo` from the digital card.
2. Create a new array and update order and/or `lockStatus`.
3. Apply the update using `DigitalCard.setAIDInfoList(_:)`.

{% hint style="warning" %}
When setting a new list, keep the same `AIDInfo` elements.

Do not add, remove, or change AIDs or labels. Otherwise, `DigitalCard.Error.aidInfoListMismatch` is thrown.
{% endhint %}

### Example

This example reorders AIDs and locks one AID.

```swift
var aidInfoList = try await digitalCard.aidInfoList
let isMultiAID = try await digitalCard.isMultiAID
  
var newAIDInfoList: [AIDInfo] = []

// Reorder the items as necessary:
newAIDInfoList.append(aidInfoList[3])
newAIDInfoList.append(aidInfoList[0])
newAIDInfoList.append(aidInfoList[1])
newAIDInfoList.append(aidInfoList[2])

// If the items do not need to be reordered,
// we can simply create a new copy from the original:
newAIDInfoList = aidInfoList

// Change the lockStatus of the AIDs as necessary:
newAIDInfoList[0].lockStatus = .locked
newAIDInfoList[1].lockStatus = .unlocked

// Set the new array of `AIDInfo` objects into the digitalCard:
try await digitalCard.setAIDInfoList(newAIDInfoList)
```

{% hint style="info" %}
`digitalCard.aidInfoList` returns a copy of `AIDInfo`.

Mutating the array does not update the digital card. Call `setAIDInfoList(_:)` for changes to take effect.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/additional-features/handle-visa-multiple-aids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
