# Change a Token Status
source: https://developer.mastercard.com/mastercard-processing-digital/documentation/use-cases/change-token-status/index.md

## Overview {#overview}

The use case describes the process where a cardholder changes the single token or all token status linked with their card. The `setTokenStatus` API allows to:

* Resume suspended token(s).
* Suspend token(s).
* Deactivate token(s) permanently.


Note: The process may also be triggered by the issuer employee from the issuer's back-office system. Note: Mastercard Processing automatically manages the PAN-token lifecycle. Hence, when a card contract status changes, the CMS:

* Accordingly and automatically changes the status of all tokens connected with a given `cardContractNumber` (PAN).
* Sends an appropriate ISO network message to the MDES to synchronize the status of all tokens associated with the given PAN.

For example, suppose you temporarily block the card by changing the card contract status to `05` using the Core API `changeCardContractStatus`. In that case, all active tokens will be automatically suspended in the CMS and MDES.

In case of changing the card status to `41` (card is lost) or `43` (card is stolen), the status of the tokens is not changed. These tokens will be automatically relinked to a new card contract once the card replacement is completed (for the digital card immediately, and for the physical card after card activation).

Changing the status of the token through the `setTokenStatus` (which triggers when Mastercard Processing sends an ISO network message 0302 Issuer File Update to the MDES) does not trigger sending the Tokenization Event Notification (TVN) to your server.

<br />

## Sequence diagram {#sequence-diagram}

Diagram change-token-status

### Explanation {#explanation}

1. The cardholder selects in the issuer mobile application to change the status of all tokens active for a card.
2. The mobile application sends the request to the issuer server to change the status of tokens.
3. The issuer server sends a `PUT` request to the `/cards/{card_contract_id}/tokens` endpoint by passing the `tokenStatus` field, with one of the possible values `SUSPEND`, `RESUME`, or `DEACTIVATE`, in the request body. Tip: If the cardholder wants to change the status of a single token, your server must send the `tokenNumber` field, with the token value stored in the CMS, in the request body.
4. The Mastercard Processing API triggers a change of the token status in the CMS and returns the HTTP status code `204`.
5. The CMS parallelly sends the ISO network message 0302 Issuer File Update to the MDES to synchronize the status of the tokens in the MDES.
6. The issuer server sends the response to the mobile application.
7. The mobile application notifies the cardholder that the token status has been changed.
8. The MDES changes the status of the tokens in the MDES and sends the tokens update to the appropriate wallet(s) servers. Note: In this case, Mastercard Processing will not send you a Tokenization Event Notification (TVN) because, according to the MDES Issuer Implementation Guide (MIIG), MDES does not generate TVN notifications for actions executed through the 0302 Issuer File Update messages.

Refer to [Sandbox testing](https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/index.md) for more information on how to execute the use case in the Sandbox environment.

## Endpoint {#endpoint}


API Reference: `PUT /cards/{card_contract_id}/tokens`

