# Retrieve accountContractId
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/cms-identifiers-search/retrieve-accountcontractid/index.md

## Test case -- Success -- Retrieve accountContractId by the account contract number {#test-case--success--retrieve-accountcontractid-by-the-account-contract-number}

This test case describes retrieving the `accountContractId` assigned to the specified account contract number stored in the CMS.

**Sample request**

`POST /accounts/searches`

```JSON
 {
  "accountContractIdentifier": " ABC_121235694296313",
  "accountContractIdentifierType": "ACCOUNT_CONTRACT_NUMBER"
}
```

**Sample response**

`200`

```JSON
{
  "accountContractId": 60001
}
```

## Test case -- Success -- Retrieve accountContractId by the CBS number {#test-case--success--retrieve-accountcontractid-by-the-cbs-number}

This test case describes retrieving the `accountContractId` assigned to the specified CBS number stored in the CMS.

**Sample request**

`POST /accounts/searches`

```JSON
{
  "accountContractIdentifier": "CBS83863371812033",
  "accountContractIdentifierType": "CBS_NUMBER"
}
```

**Sample response**

`200`

```JSON
{
  "accountContractId": 60001
}
```

## Test case -- Fail -- No Account Contract found {#test-case--fail--no-account-contract-found}

This test case describes an attempt to retrieve the `accountContractId` stored in the CMS by sending an account contract identifier that is not assigned to any account contract in the CMS.

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

|            Field            | Available value |
|-----------------------------|-----------------|
| `accountContractIdentifier` | 10001           |

**Sample request**

`POST /accounts/searches`

```JSON
{
  "accountContractIdentifier": " 10001",
  "accountContractIdentifierType": "ACCOUNT_CONTRACT_NUMBER"
}
```

**Sample response**

`404`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "ACCOUNT_CONTRACT_DOES_NOT_EXIST",
        "Description": "Account contract not found.",
        "Recoverable": false
      }
    ]
  }
}
```

