> 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="/files/fQE6DOv7JPzSaoUwNnzx" 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 dynamically by asking a question.

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

```
GET https://docs.payments.thalescloud.io/classic-push-provisioning/use-cases/view-and-control/control-life-cycle-operation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
