# Retrieve Token Details
source: https://developer.mastercard.com/mastercard-processing-digital/documentation/sandbox-testing/retrieve-token-details/index.md

## Test case -- Success -- Retrieve details of a single Token {#test-case--success--retrieve-details-of-a-single-token}

This test case describes retrieving details of a specified token stored in the CMS.

**Sample request**

`GET /tokens/5598765432109876`

**Sample response**

`200`

```JSON
{
    "cardContractId": 70001,
    "cardContractNumber": "535585______6188",
    "clientId": 40000,
    "clientShortName": "John Smith",
    "deviceName": "A1B2C3D4E5F6G7H8",
    "deviceType": "21",
    "panUniqueReference": "P12312123456789012345678901234567890123456789012",
    "tokenCreationDate": "2021-02-15T20:58:39Z",
    "tokenExpiryDate": "2402",
    "tokenNumber": "5598765432109876",
    "tokenRequestorId": "50120834693",
    "tokenStatus": "Active",
    "tokenType": "C",
    "tokenUniqueReference": "DSHRMC223456789012345678901234567890123456789012",
    "walletName": "Google Pay"
}
```

## Test case -- Success -- Retrieve all Tokens for a Client {#test-case--success--retrieve-all-tokens-for-a-client}

This test case describes retrieving details of tokens assigned to a specified client stored in the CMS.
Note: For the `/clients/client_id/tokens` endpoint, the Sandbox stores three tokens with a different `tokenStatus` so you can test the optional filtering by using the `status` query parameter.

**Sample request**

`GET /clients/40000/tokens`

**Sample response**

`200`

```JSON
{
    "clientTokens": [
        {
            "cardContractId": 70001,
            "cardContractNumber": "535585______6188",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H8",
            "deviceType": "21",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-15T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109876",
            "tokenRequestorId": "50120834693",
            "tokenStatus": "Active",
            "tokenType": "C",
            "tokenUniqueReference": "DSHRMC223456789012345678901234567890123456789012",
            "walletName": "Google Pay"
        },
        {
            "cardContractId": 70001,
            "cardContractNumber": "535585______6188",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H8BB",
            "deviceType": "19",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-16T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109861",
            "tokenRequestorId": "50120834693",
            "tokenStatus": "Deactivated",
            "tokenType": "C",
            "tokenUniqueReference": "DSHRMC12312123456789012345678901234567890123456789012",
            "walletName": "Google Pay"
        },
        {
            "cardContractId": 70002,
            "cardContractNumber": "535585______6189",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H9",
            "deviceType": "21",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-17T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109895",
            "tokenRequestorId": "50110030273",
            "tokenStatus": "Active",
            "tokenType": "S",
            "tokenUniqueReference": "DAPLMC123456789012345678901234567890123456789012",
            "walletName": "Apple Pay"
        }
    ]
}
```

## Test case -- Success -- Retrieve all Tokens for a Client - No Tokens {#test-case--success--retrieve-all-tokens-for-a-client---no-tokens}

This test case describes retrieving details of tokens assigned to a specified client stored in the CMS that does not have any tokens.

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

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

**Sample request**

`GET /clients/45001/tokens`

**Sample response**

`200`

```JSON
{
    "clientTokens": []
}
```

## Test case -- Success -- Retrieve all Tokens for a Card Contract {#test-case--success--retrieve-all-tokens-for-a-card-contract}

This test case describes retrieving details of tokens assigned to a specified card contract stored in the CMS.
Note: For the `/cards/card_contract_id/tokens` endpoint, the Sandbox stores two tokens with a different `tokenStatus` so you can test the optional filtering by using the `status` query parameter.

**Sample request**

`GET /cards/70001/tokens`

**Sample response**

`200`

```JSON
{
    "cardContractTokens": [
        {
            "cardContractId": 70001,
            "cardContractNumber": "535585______6188",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H8",
            "deviceType": "21",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-15T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109876",
            "tokenRequestorId": "50120834693",
            "tokenStatus": "Active",
            "tokenType": "C",
            "tokenUniqueReference": "DSHRMC223456789012345678901234567890123456789012",
            "walletName": "Google Pay"
        },
        {
            "cardContractId": 70001,
            "cardContractNumber": "535585______6188",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H8BB",
            "deviceType": "19",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-16T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109861",
            "tokenRequestorId": "50120834693",
            "tokenStatus": "Deactivated",
            "tokenType": "C",
            "tokenUniqueReference": "DSHRMC12312123456789012345678901234567890123456789012",
            "walletName": "Google Pay"
        }
    ]
}
```

## Test case -- Success -- Retrieve all Tokens for a Card Contract - No Tokens {#test-case--success--retrieve-all-tokens-for-a-card-contract---no-tokens}

This test case describes retrieving details of tokens assigned to a specified card contract stored in the CMS that does not have any tokens.

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

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

**Sample request**

`GET /cards/45001/tokens`

**Sample response**

`200`

```JSON
{
    "cardContractTokens": [
        {
            "cardContractId": 70001,
            "cardContractNumber": "535585______6188",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H8",
            "deviceType": "21",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-15T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109876",
            "tokenRequestorId": "50120834693",
            "tokenStatus": "Active",
            "tokenType": "C",
            "tokenUniqueReference": "DSHRMC223456789012345678901234567890123456789012",
            "walletName": "Google Pay"
        },
        {
            "cardContractId": 70001,
            "cardContractNumber": "535585______6188",
            "clientId": 40000,
            "clientShortName": "John Smith",
            "deviceName": "A1B2C3D4E5F6G7H8BB",
            "deviceType": "19",
            "panUniqueReference": "P12312123456789012345678901234567890123456789012",
            "tokenCreationDate": "2021-02-16T20:58:39Z",
            "tokenExpiryDate": "2402",
            "tokenNumber": "5598765432109861",
            "tokenRequestorId": "50120834693",
            "tokenStatus": "Deactivated",
            "tokenType": "C",
            "tokenUniqueReference": "DSHRMC12312123456789012345678901234567890123456789012",
            "walletName": "Google Pay"
        }
    ]
}
```

