# Add Payment Card (to be deprecated)
source: https://developer.mastercard.com/carbon-calculator/documentation/testing/testcase/test_case_add_card/index.md

Allows a registered Service Provider to add a new Payment Card under its profile.

## Pre-requisites {#pre-requisites}

Refer to the [Add Payment Card](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/add_payment_card/index.md) use case.


API Reference: `GET /payment-cards`

<br />

## Test Cases {#test-cases}

### Test Case: Success-Add Card {#test-case-success-add-card}

##### Request {#request}

```json
{
    "encryptedData": "3a1ce4719811b528ad517f2a3dba6dbc43152225c2cb5b1f5c05580bf7c97f6ef9d2366f587f6e35c8af2299e7635b5212930c8ac4faf09802a4e5b07688c7aa",
    "encryptedKey": "2323232ccef1f06acb6d4fe0c4828c9b5c0dd62909bb33b80c959b8852dc6014feecc9e66ddd38ceb4800cc856135401c9123fff498c5555aa1b6946525f459face4d20f9ff796c2e0a90d28d84f64e8b0d3b96654e5b231aab0eb3bbc961c5a59b1033c91c3ea3aeab23849a73612e25ee5904a4118b35f82c84c2de496ec6ec37aec71177a788eda5b66f9fa279d62e98408a5f42e693fc8a9b2141efeba77ab46ea4d0381a297cffa35b5c39242266bf2b0a3c7d6f83a0895d02edb00f008c652e683ed11b32278c9d2db943dad85fe5c8ad1d2376904aafc643be0e48a12a939834800e89bc78f50539fdaa1a56fa9d8232592704e6c23f560e2ea58fbd5",
    "iv": "2323a534b22011b4150b0fab77d1978a",
    "oaepHashingAlgorithm": "SHA256",
    "publicKeyFingerprint": "232323a0c1309b08c181cb49e37337984188d066644d431912623a7b6269a807e5"
}
```

##### Response {#response}

```json
{
    "bin": "545502",
    "last4fpan": "8351",
    "status": "ACTIVE",
    "paymentCardId": "9f12f385-0b47-4cca-9e9d-baced21bca63"
}
```

### Test Case: Fail-Invalid PAN {#test-case-fail-invalid-pan}

##### Request {#request-1}

```json
{
    "encryptedData": "4a1ce4719811b528ad517f2a3dba6dbc43152225c2cb5b1f5c05580bf7c97f6ef9d2366f587f6e35c8af2299e7635b5212930c8ac4faf09802a4e5b07688c7aa",
    "encryptedKey": "1323232ccef1f06acb6d4fe0c4828c9b5c0dd62909bb33b80c959b8852dc6014feecc9e66ddd38ceb4800cc856135401c9123fff498c5555aa1b6946525f459face4d20f9ff796c2e0a90d28d84f64e8b0d3b96654e5b231aab0eb3bbc961c5a59b1033c91c3ea3aeab23849a73612e25ee5904a4118b35f82c84c2de496ec6ec37aec71177a788eda5b66f9fa279d62e98408a5f42e693fc8a9b2141efeba77ab46ea4d0381a297cffa35b5c39242266bf2b0a3c7d6f83a0895d02edb00f008c652e683ed11b32278c9d2db943dad85fe5c8ad1d2376904aafc643be0e48a12a939834800e89bc78f50539fdaa1a56fa9d8232592704e6c23f560e2ea58fbd5",
    "iv": "2323a534b22011b4150b0fab77d19788a",
    "oaepHashingAlgorithm": "SHA256",
    "publicKeyFingerprint": "232323a0c1309b08c181cb49e37337984188d066644d431912623a7b6269a807e5"
}
```

##### Response {#response-1}

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "Service-Provider-Mgmt",
        "ReasonCode": "INVALID_FPAN",
        "Description": "The card number in the request is either invalid or does not match with your currently supported account range. Try again with a valid card number or update the supported account range.",
        "Recoverable": false,
        "Details": ""
      }
    ]
  }
}
```

