> 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-android/additional-features/use-correlationid.md).

# Use correlationID

Get and set a correlation ID for Tokenization tracking.

## Overview

Each Tokenization process has an associated `correlationID` that you can share with Thales to help with troubleshooting.

This identifier can be obtained in two ways:

* From a successful eligibility check or from a Tokenization error.
* You can also assign your own custom `correlationID` when calling `checkEligibility()` .

**Available since:** `6.15.0`

## SDK integration

### Get `correlationID` from `checkEligibility()`

* After successful `checkEligibility()`
  * After a successful eligibility check, read `acceptanceData.correlationID`.
  * Store this value if you need to trace the same Tokenization process later.
* After error on `checkEligibility()`
  * Read or store `correlationID` as soon as the error is caught.

The following example explains how to get `correlationID` `checkEligibility()` :

```kotlin
mgCardEnrollmentService.checkEligibility(
    eligibilityData,
    instrumentData,
    object : CardEligibilityListener {
        override fun onSuccess(
            termsAndConditions: TermsAndConditions,
            issuerData: IssuerData
        ) {
            val correlationId = termsAndConditions.correlationId
            Log.d(TAG, "Correlation ID: $correlationId")
        }

        override fun onError(error: MobileGatewayError) {
            val correlationId = error.correlationId
            Log.e(TAG, "Digitization failed. Correlation ID: $correlationId")
        }
    }
)
```

`ProvisioningServiceError` also provides `getCorrelationId()`.

### Set a custom correlationID

You can set `correlationID` only in `checkEligibility()`.

The following `checkEligibility()` variants support this parameter.

Use a custom value when you want to trace a Tokenization process across the issuer backend, the digital wallet application, and Thales logs.

You can also use your own identifier format, for example:

```
ORDER-12345-SESSION-67890
```

#### Set a custom correlationID with instrument data

```kotlin
val correlationId = UUID.randomUUID().toString()

mgCardEnrollmentService.checkEligibility(
    eligibilityData,
    instrumentData,
    correlationId,
    object : CardEligibilityListener {
        override fun onSuccess(
            termsAndConditions: TermsAndConditions,
            issuerData: IssuerData
        ) {
            val returnedCorrelationId = termsAndConditions.correlationId
            Log.d(TAG, "Digitization correlation ID: $returnedCorrelationId")
        }

        override fun onError(error: MobileGatewayError) {
            val returnedCorrelationId = error.correlationId
            Log.e(TAG, "Digitization failed. Correlation ID: $returnedCorrelationId")
        }
    }
)
```

#### Set a custom correlationID with a pushSessionID

<pre class="language-kotlin"><code class="lang-kotlin"><strong>mgCardEnrollmentService.checkEligibility(
</strong>    eligibilityData,
    pushSessionId,
    correlationId,
    object : CardEligibilityListener {
        override fun onSuccess(
            termsAndConditions: TermsAndConditions,
            issuerData: IssuerData
        ) {
            val trackingId = termsAndConditions.correlationId
            Log.d(TAG, "Push enrollment correlation ID: $trackingId")
        }

        override fun onError(error: MobileGatewayError) {
            val trackingId = error.correlationId
            Log.e(TAG, "Push enrollment failed. Correlation ID: $trackingId")
        }
    }
)
</code></pre>

### Related pages

* [Check card eligibility](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/check-card-eligibility.md)
* [Green flow digitization](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/digitize-a-card/green-flow-digitization.md)
* [Yellow flow digitization](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/digitize-a-card/yellow-flow-digitization.md)
* [Digitizing a card](/nfc-wallet-sdk-android/help/error-management/mg-error-management/digitizing-a-card.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/additional-features/use-correlationid.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
