# Relink Tokens to Another Card Contract
source: https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/relink-tokens-to-another-card-contract/index.md

## Test case -- Success -- Relink a single Token {#test-case--success--relink-a-single-token}

This test case describes relinking a specified token to another card contract stored in the CMS.

**Sample request**

`PUT /cards/70001/token-relinks`

```JSON
{
  "newCardContractId": 68412281,
  "tokenNumber": "7432718333341001"
}
```

**Sample response**

`204`

## Test case -- Success -- Relink all Tokens {#test-case--success--relink-all-tokens}

This test case describes relinking all tokens assigned from one card contract to another stored in the CMS.

**Sample request**

`PUT /cards/70001/token-relinks`

```JSON
{
  "newCardContractId": 68412281
}
```

**Sample response**

`204`

## Test case -- Fail -- No Tokens to relink or one of the Tokens is deactivated {#test-case--fail--no-tokens-to-relink-or-one-of-the-tokens-is-deactivated}

This test case describes an attempt to relink all tokens assigned from one card contract to another stored in the CMS where there are no tokens assigned to a card contract, or one of the tokens is deactivated.

For this test case, use the following information in the request:

|   Path parameter   | Available value |
|--------------------|-----------------|
| `card_contract_id` | 10003           |

**Sample request**

`PUT /cards/10003/token-relinks`

```JSON
{
  "newCardContractId": 68412281
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "INVALID_TOKEN",
        "Description": "Token not found or is deactivated in the CMS.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Card Contract in wrong status {#test-case--fail--card-contract-in-wrong-status}

This test case describes an attempt to relink all tokens assigned from one card contract to another stored in the CMS that is not in the right status.

For this test case, use the following information in the request:

|   Path parameter   | Available value |
|--------------------|-----------------|
| `card_contract_id` | 10004           |

**Sample request**

`PUT /cards/10004/token-relinks`

```JSON
{
  "newCardContractId": 68412281
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "CARD_CONTRACT_STATUS_IS_WRONG",
        "Description": "Card contract with id 10004 in wrong status to relink tokens.",
        "Recoverable": false
      }
    ]
  }
}
```

