> 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/push-provisioning/implement-push-provisioning/implement-view-and-control/view-and-control-digital-cards.md).

# View and control digital cards

{% hint style="danger" %}
Tokenization service is required to use Thales D1 SDK for "View\&Control" capabilities.
{% endhint %}

Use this guide to let the **End User** view and manage **digital cards** (tokens) created for their cards in **xPay Wallets** and other **token requestors**.

In the issuer application, you typically:

* display all digital cards linked to a specific `cardId`
* show each digital card status (for example, active or suspended)
* support basic life cycle actions such as suspend, resume, delete, and activate

## Prerequisites

Make sure that:

* The End User and card are registered in the **D1 backend**.
* The **D1 SDK** is integrated into your issuer application and initialized.
* The issuer application has completed the D1 SDK login flow.

For the end-to-end wallet Tokenization flow, see [Implement push to digital wallets](/push-provisioning/implement-push-provisioning/implement-push-to-digital-wallets.md).

## View digital cards

To display existing digital cards for a specific `cardId`, call `getDigitalCardList()`.

The response contains a list of `DigitalCard` objects. For Visa Cloud Token Framework (CTF), the `DigitalCard` object also includes device binding information, which allows the application to view all device bindings associated with each digital card.

The `DigitalCard` contains the following information:

* Digital card state (for example, active, suspended, or pending activation).
* Digital card expiry date.
* Last four digits of the digital card.
* Device name and type that contain the digital card.
* Token requestor ID (`tokenRequestorID`).
* Whether the digital card is on the current device (`isOnCurrentDevice`) for the selected wallet or token requestor (for example, Apple Pay, Google Pay, Samsung Pay, or NFC Wallet).
* Device binding list (since SDK 4.3.0 for Visa CTF). Contains the binding reference, device name, and binding status (APPROVED, DECLINED, or CHALLENGED) for each bound device.

{% hint style="info" %}
Due to payment network limitations, you cannot always retrieve the token requestor name and logo in real time.

As a best practice, identify the top 5–10 token requestor IDs relevant to your portfolio and hard-code an End User–facing display name and logo in the issuer application.
{% endhint %}

### Flow

<figure><img src="/files/GjJ8RBKN3cvVyai65DYq" alt="Flow for retrieving the digital card list"><figcaption><p>High-level flow for listing digital cards for a card.</p></figcaption></figure>

### Sequence diagram

**Pre-requisites**

* Consumer account and card were registered in D1
* SDK is properly initialized
* Issuer App called D1 SDK login API

<figure><img src="/files/fYirFsfPBinYwoVR9X6p" alt="Example issuer application screen showing a list of digital cards"><figcaption><p>Example issuer application UI for listing digital cards.</p></figcaption></figure>

### Examples

{% tabs %}
{% tab title="Android" %}

```kotlin
fun getDigitalCardList(d1Task: D1Task, cardID: String) {
    val callback: D1Task.Callback<List<DigitalCard>> = object : D1Task.Callback<List<DigitalCard>> {

        override fun onSuccess(digitalCardList: List<DigitalCard>) {
            // Handles the digitalCardList object from server.
            // For example, to display it on the UI as sample image above.
            for (digitalCard in digitalCardList) {
                val digitalCardID = digitalCard.cardID
                val digitalCardState = digitalCard.state // State of current Digital Card.
                val digitalCardExp = digitalCard.expiryDate // Expiry date of current Digital Card.
                val last4 = digitalCard.last4 // Last 4 digits of current Digital Card.
                val tokenRequestorID = digitalCard.tokenRequestorID // Token Requestor ID.
                val isOnCurrentDevice = digitalCard.isOnCurrentDevice //Identifies if the digital card is on the current device.

                // Retrieves device binding list (since SDK 4.3.0 for Visa CTF).
                val deviceBindingList = digitalCard.deviceBindingList
                deviceBindingList?.forEach { binding ->
                    val bindingReference = binding.bindingReference // Binding reference ID.
                    val deviceName = binding.deviceName // Device name.
                    val bindingStatus = binding.bindingStatus // APPROVED, DECLINED, or CHALLENGED.
                }
            }
        }

        override fun onError(exception: D1Exception) {
            // Refer to D1 SDK Integration – Error Management section.
        }
    }
    d1Task.getDigitalCardList(cardID, callback)
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
let cardID = "" // Obtained for example, from server.
d1Task.digitalCardList(cardID) { digitalCards, error in
    if let error = error {
        // Refer to D1 SDK Integration – Error Management section.
    } else if let digitalCards = digitalCards {
        // Proceeds with subsequent flows. For example, update UI.
        for digitalCard in digitalCards {
            print("Digital cardID: \(digitalCard.cardID)")
            print("State: \(digitalCard.state.rawValue)")
            print("Last4: \(digitalCard.last4 ?? "")")
            print("Expiry: \(digitalCard.expiryDate ?? "")")
            print("DeviceID: \(digitalCard.deviceID ?? "")")
            print("Device name: \(digitalCard.deviceName ?? "")")
            print("Device type: \(digitalCard.deviceType ?? "")")
            print("TokenRequestorID: \(digitalCard.tokenRequestorID ?? "")")
            print("isOnCurrentDevice: \(digitalCard.isOnCurrentDevice)")

            // Retrieves device binding list (since SDK 4.3.0 for Visa CTF).
            if let deviceBindingList = digitalCard.deviceBindingList {
                for binding in deviceBindingList {
                    print("Binding Reference: \(binding.bindingReference ?? "")")
                    print("Device Name: \(binding.deviceName ?? "")")
                    print("Binding Status: \(binding.bindingStatus?.rawValue ?? "")")
                }
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Control digital cards

The issuer application can allow the End User to manage each digital card state.

Supported actions include:

* **Suspend** a digital card when the current state is active: `d1Task.updateDigitalCard(cardID, digitalCard, CardAction.SUSPEND, callback)`
* **Resume** a digital card when the current state is suspended: `d1Task.updateDigitalCard(cardID, digitalCard, CardAction.RESUME, callback)`
* **Delete** a digital card: `d1Task.updateDigitalCard(cardID, digitalCard, CardAction.DELETE, callback)`
* **Activate** a digital card (for example, after step-up authentication): `d1PushWallet.activateDigitalCard(digitalCard.getCardID(), callback)`

### Sequence diagram

**Pre-requisites**

* Consumer account and card were registered in D1
* SDK is properly initialized
* Issuer App called D1 SDK login API

<figure><img src="/files/A2GiCD6e73qmIcjIAcNh" alt="Example issuer application screen for controlling digital cards"><figcaption><p>Example issuer application UI for controlling a digital card state.</p></figcaption></figure>

### Examples

{% tabs %}
{% tab title="Android" %}

```kotlin
//digitalCard: retrieved from getDigitalCardList API
fun controlDigitalCard(d1Task: D1Task, cardID: String, digitalCard: DigitalCard) {
    val callback: D1Task.Callback<Boolean> = object : D1Task.Callback<Boolean> {

        override fun onSuccess(isSuccess: Boolean) {
            if (isSuccess) {
                // Digital Card State has been successfully updated.
                // Application can update the UI.
            } else {
                // Updating Digital Card State has failed.
            }
        }

        override fun onError(exception: D1Exception) {
            // Refer to D1 SDK Integration – Error Management section.
        }
    }

    // If current state of Digital Card is ACTIVE
    d1Task.updateDigitalCard(cardID, digitalCard, CardAction.SUSPEND, callback)
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
let cardID = "" // obtained e.g. from server
// If current state of Digital Card is ACTIVE
// digitalCard is retrieved from D1Task.digitalCardList API
d1Task.updateDigitalCard(cardID, digitalCard: digitalCard, action: .suspend) { isSuccess, error in
    if let error = error {
        // Refer to D1 SDK Integration – Error Management section
    } else {
        if isSuccess {
            // Proceed with subsequent flows e.g. update UI
        } else {
            // Failure might be because of invalid state e.g. updating active card to active state
        }
    }
}
```

{% endtab %}
{% endtabs %}

For a full access to the D1 SDK, please check [API reference](/push-provisioning/integrate-the-d1-sdk/api-reference.md).


---

# 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/push-provisioning/implement-push-provisioning/implement-view-and-control/view-and-control-digital-cards.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.
