# Retrieve cardContractId
source: https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/cms-identifiers-search/retrieve-cardcontractid/index.md

## Overview {#overview}

The use case describes how you retrieve the `cardContractId` based on different card contract identifiers and pass in the card contract creation request (a `POST` request sent to the `/cards` endpoint) so that the CMS keeps mapping between them.

## Sequence diagram {#sequence-diagram}

Diagram retrieve-cardcontractid

### Explanation {#explanation}

1. The server sends a `POST` request to the `/cards/searches` endpoint by passing the required fields in the request body:
   * `cardContractIdentifierType`, where you can choose from one of the following values:
     * `CARD_CONTRACT_NUMBER`
     * `CBS_NUMBER`
   * `cardContractIdentifier`, where you send the value of the selected `cardContractIdentifierType` field value
2. The API returns the `cardContractId` number stored in the CMS.

Refer to [Sandbox testing](https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/cms-identifiers-search/retrieve-accountcontractid/index.md) for information on how to execute the use case in the Sandbox environment.

## Endpoint {#endpoint}


API Reference: `POST /cards/searches`

