# Retrieve Custom Data
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/data-management/query-cms-to-get-particular-data/retrieve-custom-data/index.md

## Test case -- Success -- Retrieve Custom Data for a Client {#test-case--success--retrieve-custom-data-for-a-client}

This test case describes retrieving custom data for a specified client stored in the CMS.

**Sample request**

`GET /clients/40000/custom-data/TAG_01`

**Sample response**

`200`

```JSON
{
    "clientCustomDataTagValues": [
        {
            "tagContainer": "ADD_INFO_01",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_02",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_03",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_04",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_01",
            "tagName": "TAG_01"
        }
    ]
}
```

## Test case -- Fail -- Invalid Client's tag name {#test-case--fail--invalid-clients-tag-name}

This test case describes an attempt to retrieve custom data for a specified client stored in the CMS by using an invalid tag name.

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

| Path parameter | Available value |
|----------------|-----------------|
| `tag_name`     | INVALID         |

**Sample request**

`GET /clients/40000/custom-data/INVALID`

**Sample response**

`404`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "CUSTOM_DATA_TAG_DOES_NOT_EXIST",
        "Description": "Specified tag doesn't exist.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Success -- Retrieve Custom Data for a Contract {#test-case--success--retrieve-custom-data-for-a-contract}

This test case describes retrieving custom data for a specified contract (account contract or card contract) stored in the CMS.
**Sample request**

`GET /contracts/70001/custom-data/TAG_01`

**Sample response**

`200`

```JSON
{
    "contractCustomDataTagValues": [
        {
            "tagContainer": "ADD_INFO_01",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_02",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_03",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_04",
            "tagName": "TAG_01",
            "tagValue": "TAG_01_VALUE"
        },
        {
            "tagContainer": "ADD_INFO_01",
            "tagName": "TAG_01"
        }
    ]
}
```

## Test case -- Fail -- Invalid Contract's tag name {#test-case--fail--invalid-contracts-tag-name}

This test case describes an attempt to retrieve custom data for a specified contract (account contract or card contract) stored in the CMS by using an invalid tag name.

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

| Path parameter | Available value |
|----------------|-----------------|
| `tag_name`     | INVALID         |

**Sample request**

`GET /contracts/70001/custom-data/INVALID`

**Sample response**

`404`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "CUSTOM_DATA_TAG_DOES_NOT_EXIST",
        "Description": "Specified tag doesn't exist.",
        "Recoverable": false
      }
    ]
  }
}
```

