# Verify Card Details (PAN, Expiry Date, and CVC2)
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/card-lifecycle-management/verify-card-details/index.md

## Test case -- Success {#test-case--success}

This test case describes verifying the PAN, expiry date, and CVC2 provided in the request with the data stored in the CMS.

**Sample request**

`POST /cards/details-verifications`

```JSON
{
  "cardContractNumber": "5355848943515330",
  "cardExpiryDate": "3004",
  "cardVerificationCode": "347"
}
```

**Sample response**

`200`

```JSON
{
    "cardContractId": 70001,
    "cardContractNumberVerificationResult": "PAN_CORRECT",
    "cardExpiryDateVerificationResult": "EXPIRY_DATE_CORRECT",
    "cbsNumber": "CBS83863371812033",
    "cvc2VerificationResult": "CVC2_CORRECT"
}
```

## Test case -- Success -- PAN is not in the active state {#test-case--success--pan-is-not-in-the-active-state}

This test case describes verifying PAN, expiry date, and CVC2 provided in the request with data stored in the CMS for the `cardContractNumber` with a status other than `00` in the CMS.

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

|        Field         | Available value  |
|----------------------|------------------|
| `cardContractNumber` | 2222333344445550 |

**Sample request**

`POST /cards/details-verifications`

```JSON
{
  "cardContractNumber": "2222333344445555",
  "cardExpiryDate": "3004",
  "cardVerificationCode": "347"
}
```

**Sample response**

`200`

```JSON
 {
    "cardContractId": 70001,
    "cardContractNumberVerificationResult": "PAN_CANCELLED",
    "cardExpiryDateVerificationResult": "EXPIRY_DATE_CORRECT",
    "cbsNumber": "CBS83863371812033",
    "cvc2VerificationResult": "CVC2_CORRECT"
}
```

## Test case -- Success -- Incorrect CVC2 {#test-case--success--incorrect-cvc2}

This test case describes verifying PAN, expiry date, and CVC2 provided in the request with data stored in the CMS where there is no match for the CVC2 in the CMS.

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

|         Field          | Available value |
|------------------------|-----------------|
| `cardVerificationCode` | 999             |

**Sample request**

`POST /cards/details-verifications`

```JSON
 {
  "cardContractNumber": "5355848943515330",
  "cardExpiryDate": "3004",
  "cardVerificationCode": "999"
}
```

**Sample response**

`200`

```JSON
 {
    "cardContractId": 70001,
    "cardContractNumberVerificationResult": "PAN_CORRECT",
    "cardExpiryDateVerificationResult": "EXPIRY_DATE_CORRECT",
    "cbsNumber": "CBS83863371812033",
    "cvc2VerificationResult": "CVC2_NOT_CORRECT"
}
```

## Test case -- Success -- Incorrect expiry date {#test-case--success--incorrect-expiry-date}

This test case describes verifying PAN, expiry date, and CVC2 provided in the request with data stored in the CMS where there is no match for the expiry date in the CMS.

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

|      Field       | Available value |
|------------------|-----------------|
| `cardExpiryDate` | 2212            |

**Sample request**

`POST /cards/details-verifications`

```JSON
 {
  "cardContractNumber": "5355848943515330",
  "cardExpiryDate": "2212",
  "cardVerificationCode": "347"
}
```

**Sample response**

`200`

```JSON
 {
    "cardContractId": 70001,
    "cardContractNumberVerificationResult": "PAN_CORRECT",
    "cardExpiryDateVerificationResult": "EXPIRY_DATE_NOT_CORRECT",
    "cbsNumber": "CBS83863371812033",
    "cvc2VerificationResult": "CVC2_CORRECT"
}
```

## Test case -- Success -- CVC2 and expiry date not provided {#test-case--success--cvc2-and-expiry-date-not-provided}

This test case describes verifying PAN, expiry date, and CVC2 provided in the request with data stored in the CMS where the expiry date and CVC2 are not provided in the request.

For this test case, use a `null` or an empty value in the `cardExpiryDate` and `cardVerificationCode` fields in the request body or do not send the fields in the request.

**Sample request**

`POST /cards/details-verifications`

```JSON
{
  "cardContractNumber": "5355848943515330"
}
```

**Sample response**

`200`

```JSON
 {
    "cardContractId": 70001,
    "cardContractNumberVerificationResult": "PAN_CORRECT",
    "cardExpiryDateVerificationResult": "EXPIRY_DATE_NOT_PROVIDED",
    "cbsNumber": "CBS83863371812033",
    "cvc2VerificationResult": "CVC2_NOT_PROVIDED"
}
```

## Test case -- Fail -- Not existing Card Contract {#test-case--fail--not-existing-card-contract}

This test case describes an attempt to verify PAN, expiry date, and CVC2 provided in the request with data stored in the CMS where there is no match for the card contract number in the CMS.

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

|        Field         | Available value  |
|----------------------|------------------|
| `cardContractNumber` | 1111222233334440 |

**Sample request**

`POST /cards/details-verifications`

```JSON
 {
  "cardContractNumber": "1111222233334444",
  "cardExpiryDate": "3004",
  "cardVerificationCode": "347"
}
```

**Sample response**

`404`

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

