> 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/classic-push-provisioning/use-cases/view-and-control/view-get-token-list.md).

# View: get token list

With the Push Provisioning SDK, the issuer application can retrieve the token list for a specific card and the locations where those tokens were requested. The end user can then browse the token list and view:

* The state of the token (enabled or disabled).
* Token requestor identifier.
* Device information, such as device ID, name, and type (when provided by the TSP).
* Expiry date of the token.
* Last four digits of the token.
* Whether the token is on the current device (`isOnCurrentDevice`) when the issuer application is configured for Google Pay, Samsung Pay, or Apple Pay.

The following figure shows an example user experience that the issuer application can implement:

<figure><img src="/files/mPxzxqXw3cXrvRS3GAZA" alt=""><figcaption><p>Example token list user experience.</p></figcaption></figure>

The Push Provisioning SDK requires card information (PAN and expiry date) to retrieve the token list. The following figure shows an overview of the flow the issuer application must implement:

<figure><img src="/files/YxQtnyJAXNccIxMP26GB" alt=""><figcaption><p>Get token list flow.</p></figcaption></figure>

\
**Note**

* Due to payment network limitations, you cannot retrieve the token requestor name and logo in real time.
* We recommend that the issuer application identifies the top 5–10 token requestor identifiers and hardcodes a merchant- or wallet-facing name and logo.

### SDK integration <a href="#sdk-integration" id="sdk-integration"></a>

#### Step 1: Getting the encrypted card details <a href="#step-1-getting-the-encrypted-card-details" id="step-1-getting-the-encrypted-card-details"></a>

To retrieve the token list, the issuer application must provide the encrypted card details to the Push Provisioning SDK.

The issuer backend provides the encrypted card details to the issuer application. The card details use the [PKCS#7 format](/classic-push-provisioning/developer-guide/data-encryption-and-authentication/card-data-encryption-pkcs-7-format.md).

#### Step 2: Getting the token list <a href="#step-2-getting-the-token-list" id="step-2-getting-the-token-list"></a>

After the issuer application retrieves the encrypted card details from the issuer backend, it can request the token list.

The following code snippet shows an example of how to retrieve the token list via the Push Provisioning SDK:

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

```swift
func getTokens() {
    let scheme = CardScheme.Mastercard
    let payload = "PKCS7 encrypted PAN"
    
    let card = FundingCard(scheme: scheme,
                           encryptedPayload: payload)
    
    TPCSDK.getTokens(card: card) {
      (tokenList, error) in
      if let tokenList = tokenList {
          for token in tokenList {
              if(token.isOnCurrentDevice){
                  // This token is on the current device.
              }
          }
      }
    }
  }
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
- (void) getTokens {
  CardScheme scheme = CardSchemeMastercard;
  NSString * payload = @"PKCS7 encrypted PAN";
  
  FundingCard * card = [[FundingCard alloc] initWithScheme:scheme
                                          encryptedPayload:payload];
  
  [TPCSDK getTokensWithCard:card
                 completion:^(NSArray<Token *> * _Nullable tokenList, NSError * _Nullable error) {
  }];
}
```

{% endtab %}

{% tab title="Android" %}

```java
CardInfo cardInfo = new CardInfo();
cardInfo.setScheme("VISA");
cardInfo.setEncryptedPayload("PAYLOAD")
cardInfo.setAuthorizationCode("AUTHORIZATION_CODE");
cardInfo.setLast4PanDigits("1234");
cardInfo.setIssuerAppId("ISSUERID");

final TPCSDKListener<Token[]> tokenListener = new TPCSDKListener<Token[]>() {
    @Override
    public void onStart() {
        // on start
    }

    @Override
    public void onSuccess(TPCResult<Token[]> result) {
	      Log.i("TAG", "get tokenLsit request success");
        Token[] tokens = result.getResult();
        if (tokens != null) {
          for (int i = 0; i < tokens.length; i++) {
            if (tokens[i].isOnCurrentDevice()) {
              // This token is on the current device.
            }
          }
        }
    }

    @Override
    public void onError(TPCSDKException exception) {
        // Error while fetching token list
        Log.i("TAG", "get tokenList request failed");
    }
};

TPCManager.getInstance().getTSHProxy().getTokenList(cardInfo, tpcsdkListener);
```

{% endtab %}
{% endtabs %}


---

# 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/classic-push-provisioning/use-cases/view-and-control/view-get-token-list.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.
