> 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/control-life-cycle-operation.md).

# Control: life cycle operation

After the issuer application performs consumer verification, it can update the state of a token (suspend, resume, delete, or activate). The Push Provisioning SDK lets the issuer application manage this request. The SDK sends the request to the TSH, then directly to the TSP.

See [Authorization code (JWT format)](/classic-push-provisioning/developer-guide/data-encryption-and-authentication/authorization-code-jwt-format.md) for the `Authorization Code` required for this process. The `sub` claim must be the token reference.

> <i class="fa-info-circle">:info-circle:</i>
>
> #### Note <a href="#note" id="note"></a>
>
> * The Push Provisioning SDK does not check whether a given life cycle operation is allowed for a token.
> * The issuer application might need to validate the token state before calling an operation. For example, the Activate action requires a token in the [PENDING\_IDV](https://thalesgroup.github.io/d1sdk-docs/tpc-sdk/android/latest/com/thalesgroup/tpcsdk/model/Token.html#getState\(\)) state.
>   * Apple Pay: [requiresActivation](https://developer.apple.com/documentation/passkit/pksecureelementpass/passactivationstate/requiresactivation) state.
>   * Google Pay: [GOOGLE\_PAY\_TOKEN\_STATE\_NEEDS\_IDENTITY\_VERIFICATION](https://thalesgroup.github.io/d1sdk-docs/tpc-sdk/android/latest/com/thalesgroup/tpcsdk/provisioning/CardDigitizationStatus.html#GOOGLE_PAY_TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION)
>   * Samsung Pay: [SAMSUNG\_PAY\_PENDING\_PROVISION](https://thalesgroup.github.io/d1sdk-docs/tpc-sdk/android/latest/com/thalesgroup/tpcsdk/provisioning/CardDigitizationStatus.html#SAMSUNG_PAY_PENDING_PROVISION)

<figure><img src="https://2043783750-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC22AqJs7fn1cZC7pAaOE%2Fuploads%2FHymY6cbaiZKoqbRFTfyl%2F63e21e3b-a1be-4176-97aa-99442be70258.png?alt=media&amp;token=1891ca15-1732-425f-9f28-6df6fcbc6827" alt=""><figcaption></figcaption></figure>

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

```swift
// relevant only in case SCHEME is VISA, for MASTERCARD put empty string
let tokenRequestorId = "40010030273" // Apple Pay for Visa

let scheme = "SCHEME" // VISA, MASTERCARD, AMEX
let authorizationCode = "<JWT>" // provide JWT value related to particular card, retrieved from issuer backend
let tokenId = pass.secureElementPass?.deviceAccountIdentifier // it can also be retrieved from: `Token.id`

TPCSDK.updateTokenState(tokenId: tokenId,
                        tokenRequestorId: tokenRequestorId,
                        schemeString: scheme,
                        authorizationCode: authorizationCode,
                        action: .Activate) { success, error in
    if let error = error {
      // handle TPC Error
    } else if success {
      // todo: refresh UI to indicate state of the card digitization
    }
}
```

{% endtab %}

{% tab title="Android" %}

```java
// relevant only in case SCHEME is VISA, for MASTERCARD put empty string
String tokenRequestorId = "40010075001"; // for Google Pay or "40010043095" for Samsung Pay

String tokenId = "tokenId";
String scheme = "SCHEME"; // VISA, MASTERCARD
String authorizationCode = "<JWT>"; // provide JWT value related to particular card, retrieved from issuer backend

TPCManager.getInstance().getTSHProxy().updateTokenState(tokenId,
        tokenRequestorId,
        scheme,
        authorizationCode,
        TokenAction.ACTIVATE,
        new TPCSDKListener<Boolean>() {
            @Override
            public void onStart() {
                // on start
            }

            @Override
            public void onSuccess(TPCResult<Boolean> result) {
                Log.i(TAG, "Token State Updated");
                Boolean status = result.getResult();

                // TODO: refresh UI for new status
            }

            @Override
            public void onError(TPCSDKException exception) {
                Log.e("TAG", "updateTokenState request Error = " + exception.getMessage());
            }
        });
```

{% 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 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/classic-push-provisioning/use-cases/view-and-control/control-life-cycle-operation.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.
