# Order a Virtual Card – Create Client, Account Contract, and Cord Contract
source: https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/card-lifecycle-management/order-virtual-card/index.md

## Test case -- Success -- Step 1 Create a Client {#test-case--success--step-1-create-a-client}

This test case describes creating a client object in the CMS.

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

|               Field                | Available value |
|------------------------------------|-----------------|
| `clientType`                       | PR              |
| `orderDepartment`                  | Department      |
| `serviceGroupCode`                 | 021             |
| `clientPersonalData.title`         | MR              |
| `clientpersonaldata.maritalStatus` | DD              |
|                                    | DM              |
|                                    | DS              |
|                                    | DX              |

**Sample request**

`POST /clients`

```JSON
{
  "clientCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ],
  "clientNumber": "ABC_5698521931",
  "clientType": "PR",
  "orderDepartment": "Department",
  "serviceGroupCode": "021",
  "additionalDate01": "2021-01-27T09:59:44Z",
  "additionalDate02": "2021-02-15T20:58:39Z",
  "clientBaseAddressData": {
    "addressLine1": "Mrs. Alice Smith Apartment",
    "addressLine2": "1c 213",
    "addressLine3": "Derrick Street",
    "addressLine4": "2nd floor",
    "city": "Boston",
    "country": "USA",
    "postalCode": "02130",
    "state": "MA"
  },
  "clientCompanyData": {
    "companyDepartment": "Department",
    "companyName": "Company",
    "companyTradeName": "Company Trade",
    "position": "Employee"
  },
  "clientContactData": {
    "email": "johndoe@example.com",
    "fax": "0048123456789",
    "faxHome": "0048123456789",
    "phoneNumberHome": "0048123456789",
    "phoneNumberMobile": "0048123456789",
    "phoneNumberWork": "0048123456789"
  },
  "clientIdentificationData": {
    "identificationDocumentDetails": "161235698529429",
    "identificationDocumentNumber": "161235698529328",
    "identificationDocumentType": "Passport",
    "socialNumber": "161235698529227",
    "taxPosition": "Tax position",
    "taxpayerIdentifier": "161235698529531"
  },
  "clientPersonalData": {
    "birthDate": "2021-06-25",
    "birthName": "Doe",
    "birthPlace": "Warsaw",
    "citizenship": "USA",
    "firstName": "John",
    "gender": "M",
    "language": "en",
    "lastName": "Doe",
    "maritalStatus": "DS",
    "middleName": "Carl",
    "secretPhrase": "secret",
    "shortName": "Madley",
    "suffix": "PhD",
    "title": "MR"
  },
  "clientExpiryDate": "2029-06-25",
  "embossedData": {
    "companyName": "COMPANY",
    "firstName": "JOHN",
    "lastName": "DOE",
    "title": "MR"
  }
}
```

**Sample response**

`201`  

`Location: /clients/40000`

```JSON
{
  "clientId": 40000
}
```

## Test case -- Success -- Step 2 Create an Account Contract {#test-case--success--step-2-create-an-account-contract}

This test case describes creating an account contract object in the CMS for the client created in step 1.

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

|               Field               | Available value |      Description       |
|-----------------------------------|-----------------|------------------------|
| `accountContractData.productCode` | STD-DEBCH-EUR   | Standard Debit Account |

**Sample request**

`POST /accounts`

```JSON
{
  "accountContractClassifiers": [
    {
      "classifierCode": "TEST_CLASSIFIER_01",
      "classifierValue": "VALUE_1A"
    }
  ],
  "accountContractData": {
    "accountContractName": "North Division Account",
    "accountContractNumber": "ABC_121235694296313",
    "accountContractSubtypeCode": "CA-p",
    "branchCode": "BRANCH_A",
    "cbsNumber": "CBS83863371812033",
    "clientId": 40000,
    "currency": "EUR",
    "customData": [
      {
        "removeTag": false,
        "tagContainer": "ADD_INFO_01",
        "tagName": "TAG_01",
        "tagValue": "TAG_01_VALUE"
      }
    ],
    "parentAccountContractId": 31412211,
    "productCode": "STD-DEBCH-EUR",
    "serviceGroupCode": "021"
  },
  "accountContractParameters": [
    {
      "parameterCode": "TEST_PARAMETER_01",
      "parameterValue": "45"
    }
  ],
}
```

**Sample response**

`201`  

`Location: /accounts/60001`

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

## Test case -- Success -- Step 3 Create a Card Contract {#test-case--success--step-3-create-a-card-contract}

This test case describes creating a card contract object in the CMS for the account contract created in step 2.

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

|           Field            | Available value |                Description                |
|----------------------------|-----------------|-------------------------------------------|
| `cardContract.productCode` | STD-MCDEBVF-EUR | Standard Mastercard Individual Debit Card |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "BRANCH_A",
    "cardContractNumber": "1234567890123456",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS83863371812033",
    "currency": "EUR",
    "embossedData": {
      "companyName": "COMPANY",
      "firstName": "JOHN",
      "lastName": "DOE",
      "title": "MR"
    },
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",
  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`201`  

`Location: /cards/70001`

```JSON
{
  "cardContractId": 70001
}
```

## Test case -- Fail -- Step 1 Create a Client with a duplicated clientNumber {#test-case--fail--step-1-create-a-client-with-a-duplicated-clientnumber}

This test case describes an attempt to create the client object in the CMS by providing the clientNumber that already exists in the CMS.

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

|               Field                | Available value |
|------------------------------------|-----------------|
| `clientNumber`                     | 11111           |
| `clientType`                       | PR              |
| `orderDepartment`                  | Department      |
| `serviceGroupCode`                 | 021             |
| `clientPersonalData.title`         | MR              |
| `clientPersonalData.maritalStatus` | DD              |
|                                    | DM              |
|                                    | DS              |
|                                    | DX              |

**Sample request**

`POST /clients`

```JSON
{
   "clientCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ],
  "clientNumber": "11111",
  "clientType": "PR",
  "orderDepartment": "Department",
  "serviceGroupCode": "021",
  "additionalDate01": "2021-01-27T09:59:44Z",
  "additionalDate02": "2021-02-15T20:58:39Z",
  "clientBaseAddressData": {
    "addressLine1": "Mrs. Alice Smith Apartment",
    "addressLine2": "1c 213",
    "addressLine3": "Derrick Street",
    "addressLine4": "2nd floor",
    "city": "Boston",
    "country": "USA",
    "postalCode": "02130",
    "state": "MA"
  },
  "clientCompanyData": {
    "companyDepartment": "Department",
    "companyName": "Company",
    "companyTradeName": "Company Trade",
    "position": "Employee"
  },
  "clientContactData": {
    "email": "johndoe@example.com",
    "fax": "0048123456789",
    "faxHome": "0048123456789",
    "phoneNumberHome": "0048123456789",
    "phoneNumberMobile": "0048123456789",
    "phoneNumberWork": "0048123456789"
  },
  "clientIdentificationData": {
    "identificationDocumentDetails": "161235698529429",
    "identificationDocumentNumber": "161235698529328",
    "identificationDocumentType": "Passport",
    "socialNumber": "161235698529227",
    "taxPosition": "Tax position",
    "taxpayerIdentifier": "161235698529531"
  },
  "clientPersonalData": {
    "birthDate": "2021-06-25",
    "birthName": "Doe",
    "birthPlace": "Warsaw",
    "citizenship": "USA",
    "firstName": "John",
    "gender": "M",
    "language": "en",
    "lastName": "Doe",
    "maritalStatus": "DS",
    "middleName": "Carl",
    "secretPhrase": "secret",
    "shortName": "Madley",
    "suffix": "PhD",
    "title": "MR"
  },
  "clientExpiryDate": "2029-06-25",
  "embossedData": {
    "companyName": "COMPANY",
    "firstName": "JOHN",
    "lastName": "DOE",
    "title": "MR"
  }
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "DUPLICATED_CLIENT_NUMBER",
                "Description": "Duplicated client number.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Fail -- Step 1 Create a Client with a duplicated socialNumber {#test-case--fail--step-1-create-a-client-with-a-duplicated-socialnumber}

This test case describes an attempt to create the client object in the CMS by providing the social number that already exists in the CMS.

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

|               Field                | Available value |
|------------------------------------|-----------------|
| `clientNumber`                     | 22222           |
| `clientType`                       | PR              |
| `orderDepartment`                  | Department      |
| `serviceGroupCode`                 | 021             |
| `clientPersonalData.title`         | MR              |
| `clientPersonalData.maritalStatus` | DD              |
|                                    | DM              |
|                                    | DS              |
|                                    | DX              |

**Sample request**

`POST /clients`

```JSON
{
    "clientCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ],
  "clientNumber": "22222",
  "clientType": "PR",
  "orderDepartment": "Department",
  "serviceGroupCode": "021",
  "additionalDate01": "2021-01-27T09:59:44Z",
  "additionalDate02": "2021-02-15T20:58:39Z",
  "clientBaseAddressData": {
    "addressLine1": "Mrs. Alice Smith Apartment",
    "addressLine2": "1c 213",
    "addressLine3": "Derrick Street",
    "addressLine4": "2nd floor",
    "city": "Boston",
    "country": "USA",
    "postalCode": "02130",
    "state": "MA"
  },
  "clientCompanyData": {
    "companyDepartment": "Department",
    "companyName": "Company",
    "companyTradeName": "Company Trade",
    "position": "Employee"
  },
  "clientContactData": {
    "email": "johndoe@example.com",
    "fax": "0048123456789",
    "faxHome": "0048123456789",
    "phoneNumberHome": "0048123456789",
    "phoneNumberMobile": "0048123456789",
    "phoneNumberWork": "0048123456789"
  },
  "clientIdentificationData": {
    "identificationDocumentDetails": "161235698529429",
    "identificationDocumentNumber": "161235698529328",
    "identificationDocumentType": "Passport",
    "socialNumber": "161235698529227",
    "taxPosition": "Tax position",
    "taxpayerIdentifier": "161235698529531"
  },
  "clientPersonalData": {
    "birthDate": "2021-06-25",
    "birthName": "Doe",
    "birthPlace": "Warsaw",
    "citizenship": "USA",
    "firstName": "John",
    "gender": "M",
    "language": "en",
    "lastName": "Doe",
    "maritalStatus": "DS",
    "middleName": "Carl",
    "secretPhrase": "secret",
    "shortName": "Madley",
    "suffix": "PhD",
    "title": "MR"
  },
  "clientExpiryDate": "2029-06-25",
  "embossedData": {
    "companyName": "COMPANY",
    "firstName": "JOHN",
    "lastName": "DOE",
    "title": "MR"
  }
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "DUPLICATED_SOCIAL_NUMBER",
        "Description": "Duplicated social number.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Step 1 Create a Client with a duplicated taxpayer identifier {#test-case--fail--step-1-create-a-client-with-a-duplicated-taxpayer-identifier}

This test case describes an attempt to create the client object in the CMS by providing the taxpayer identifier that already exists in the CMS.

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

|               Field                | Available value |
|------------------------------------|-----------------|
| `clientNumber`                     | 33333           |
| `clientType`                       | PR              |
| `orderDepartment`                  | Department      |
| `serviceGroupCode`                 | 021             |
| `clientPersonalData.title`         | MR              |
| `clientPersonalData.maritalStatus` | DD              |
|                                    | DM              |
|                                    | DS              |
|                                    | DX              |

**Sample request**

`POST /clients`

```JSON
{
   "clientCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ],
  "clientNumber": "33333",
  "clientType": "PR",
  "orderDepartment": "Department",
  "serviceGroupCode": "021",
  "additionalDate01": "2021-01-27T09:59:44Z",
  "additionalDate02": "2021-02-15T20:58:39Z",
  "clientBaseAddressData": {
    "addressLine1": "Mrs. Alice Smith Apartment",
    "addressLine2": "1c 213",
    "addressLine3": "Derrick Street",
    "addressLine4": "2nd floor",
    "city": "Boston",
    "country": "USA",
    "postalCode": "02130",
    "state": "MA"
  },
  "clientCompanyData": {
    "companyDepartment": "Department",
    "companyName": "Company",
    "companyTradeName": "Company Trade",
    "position": "Employee"
  },
  "clientContactData": {
    "email": "johndoe@example.com",
    "fax": "0048123456789",
    "faxHome": "0048123456789",
    "phoneNumberHome": "0048123456789",
    "phoneNumberMobile": "0048123456789",
    "phoneNumberWork": "0048123456789"
  },
  "clientIdentificationData": {
    "identificationDocumentDetails": "161235698529429",
    "identificationDocumentNumber": "161235698529328",
    "identificationDocumentType": "Passport",
    "socialNumber": "161235698529227",
    "taxPosition": "Tax position",
    "taxpayerIdentifier": "161235698529531"
  },
  "clientPersonalData": {
    "birthDate": "2021-06-25",
    "birthName": "Doe",
    "birthPlace": "Warsaw",
    "citizenship": "USA",
    "firstName": "John",
    "gender": "M",
    "language": "en",
    "lastName": "Doe",
    "maritalStatus": "DS",
    "middleName": "Carl",
    "secretPhrase": "secret",
    "shortName": "Madley",
    "suffix": "PhD",
    "title": "MR"
  },
  "clientExpiryDate": "2029-06-25",
  "embossedData": {
    "companyName": "COMPANY",
    "firstName": "JOHN",
    "lastName": "DOE",
    "title": "MR"
  }
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "DUPLICATED_TAXPAYER_IDENTIFIER",
        "Description": "Duplicated taxpayer identifier.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Step 2 Create an Account Contract with a duplicated accountContractNumber {#test-case--fail--step-2-create-an-account-contract-with-a-duplicated-accountcontractnumber}

This test case describes an attempt to create an account contract object in the CMS by providing the accountContractNumber that already exists in the CMS.

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

|                   Field                   | Available value |      Description       |
|-------------------------------------------|-----------------|------------------------|
| accountContractData.accountContractNumber | 535584000000000 |                        |
| accountContractData.productCode           | STD-DEBCH-EUR   | Standard Debit Account |

**Sample request**

`POST /accounts`

```JSON
{
  "accountContractData": {
    "accountContractNumber": "535584000000000",
    "productCode": "STD-DEBCH-EUR",
    "clientId": 40000,
    "cbsNumber": "CBS83863371812033",
    "accountContractName": "North Division Account"
  }
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "DUPLICATED_CONTRACT_NUMBER",
        "Description": "Duplicated contract number.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Step 2 Create an Account Contract with a duplicated cbsNumber {#test-case--fail--step-2-create-an-account-contract-with-a-duplicated-cbsnumber}

This test case describes an attempt to create an account contract object in the CMS by providing the cbsNumber that already exists in the CMS.

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

|              Field              |   Available value   |      Description       |
|---------------------------------|---------------------|------------------------|
| accountContractData.cbsNumber   | CBS1950395609519670 |                        |
| accountContractData.productCode | STD-DEBCH-EUR       | Standard Debit Account |

**Sample request**

`POST /accounts`

```JSON
{
  "accountContractData": {
    "accountContractNumber": "ABC_121235694296313",
    "productCode": "STD-DEBCH-EUR",
    "clientId": 40000,
    "cbsNumber": "CBS1950395609519670",
    "accountContractName": "North Division Account"
  }
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "DUPLICATED_CBS_NUMBER",
        "Description": "Duplicated CBS number.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Step 3 Create a Card with an invalid BIN range {#test-case--fail--step-3-create-a-card-with-an-invalid-bin-range}

This test case describes an attempt to create a card contract object in the CMS by providing the `cardContractNumber` (PAN) outside the assigned BIN range configured in the CMS during the onboarding process.

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

|               Field               | Available value  |                Description                |
|-----------------------------------|------------------|-------------------------------------------|
| `cardContract.cardContractNumber` | 5231707480806611 |                                           |
| `cardContract.productCode`        | STD-MCDEBVF-EUR  | Standard Mastercard Individual Debit Card |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "BRANCH_A",
    "cardContractNumber": "5231707480806611",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS83863371812033",
    "currency": "EUR",
    "embossedData": {
      "companyName": "COMPANY",
      "firstName": "JOHN",
      "lastName": "DOE",
      "title": "MR"
    },
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",

  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "INVALID_BIN_RANGE",
                "Description": "Invalid card contract number BIN range.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Fail -- Step 3 Create a Card with a duplicated cbsNumber {#test-case--fail--step-3-create-a-card-with-a-duplicated-cbsnumber}

This test case describes an attempt to create a card contract object in the CMS by providing the `cbsNumber` that already exists in the CMS.

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

|           Field            |   Available value   |                Description                |
|----------------------------|---------------------|-------------------------------------------|
| `cardContract.cbsNumber`   | CBS1950395609519670 |                                           |
| `cardContract.productCode` | STD-MCDEBVF-EUR     | Standard Mastercard Individual Debit Card |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "BRANCH_A",
    "cardContractNumber": "1234567890123456",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS1950395609519670",
    "currency": "EUR",
    "embossedData": {
      "companyName": "COMPANY",
      "firstName": "JOHN",
      "lastName": "DOE",
      "title": "MR"
    },
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",
  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "DUPLICATED_CBS_NUMBER",
                "Description": "Duplicated CBS number.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Fail -- Step 3 Create a Card with an invalid productionCode {#test-case--fail--step-3-create-a-card-with-an-invalid-productioncode}

This test case describes an attempt to create a card contract object in the CMS by providing the value of the `productionCode` field that was not configured in the CMS during the onboarding process.

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

|             Field             | Available value |                Description                |
|-------------------------------|-----------------|-------------------------------------------|
| `cardContract.productionCode` | INVALID         |                                           |
| `cardContract.productCode`    | STD-MCDEBVF-EUR | Standard Mastercard Individual Debit Card |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "BRANCH_A",
    "cardContractNumber": "1234567890123456",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS83863371812033",
    "currency": "EUR",
    "embossedData": {
      "companyName": "COMPANY",
      "firstName": "JOHN",
      "lastName": "DOE",
      "title": "MR"
    },
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",
    "productionCode": "INVALID"
  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "INVALID_PRODUCTION_CODE",
                "Description": "Invalid production code.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Fail -- Step 3 Create a Card with an invalid branch code {#test-case--fail--step-3-create-a-card-with-an-invalid-branch-code}

This test case describes an attempt to create a card contract object in the CMS by providing the incorrect value in the `branchCode` field in the request body.

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

|           Field            | Available value |                Description                |
|----------------------------|-----------------|-------------------------------------------|
| `cardContract.branchCode`  | INVALID         |                                           |
| `cardContract.productCode` | STD-MCDEBVF-EUR | Standard Mastercard Individual Debit Card |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "INVALID",
    "cardContractNumber": "1234567890123456",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS83863371812033",
    "currency": "EUR",
    "embossedData": {
      "companyName": "COMPANY",
      "firstName": "JOHN",
      "lastName": "DOE",
      "title": "MR"
    },
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",
  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "INVALID_BRANCH_CODE",
                "Description": "Invalid branch code.",
                "Recoverable": false
            }
        ]
    }
}
```

## Test case -- Fail -- Step 3 Create a Card with an invalid PAN (Luhn check failed) {#test-case--fail--step-3-create-a-card-with-an-invalid-pan-luhn-check-failed}

This test case describes an attempt to create a card contract object in the CMS by providing the incorrect value (not compliant with the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm)) in the `cardContractNumber` field in the request body.

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

|           Field            | Available value  |                Description                |
|----------------------------|------------------|-------------------------------------------|
| `cardContract.branchCode`  | INVALID          |                                           |
| `cardContract.productCode` | STD-MCDEBVF-EUR  | Standard Mastercard Individual Debit Card |
| `cardContractNumber`       | 5231707480806617 |                                           |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "BRANCH_A",
    "cardContractNumber": "5231707480806617",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS83863371812033",
    "currency": "EUR",
    "embossedData": {
      "companyName": "COMPANY",
      "firstName": "JOHN",
      "lastName": "DOE",
      "title": "MR"
    },
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",
    "productionCode": "NWOPIN_NOPROD"
  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`400`

```JSON
{
  "Errors": {
    "Error": [
      {
        "Source": "MASTERCARD PROCESSING",
        "ReasonCode": "LUHN_CHECK_FAILED",
        "Description": "Luhn check for card contract number failed.",
        "Recoverable": false
      }
    ]
  }
}
```

## Test case -- Fail -- Step 3 Create a Card without embossed data {#test-case--fail--step-3-create-a-card-without-embossed-data}

This test case describes an attempt to create a card contract object in the CMS by not providing embossed data in the request for the client that was created without embossed data too.

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

|            Field            | Available value |
|-----------------------------|-----------------|
| `cardContract.embossedData` | null            |

**Sample request**

`POST /cards`

```JSON
{
  "accountContractId": 60001,
  "clientId": 40000,
  "cardContract": {
    "branchCode": "BRANCH_A",
    "cardContractNumber": "1234567890123456",
    "cardContractName": "Card contract name",
    "cardSubtypeCode": "CA-p",
    "cbsNumber": "CBS83863371812033",
    "currency": "EUR",
    "embossedData": null,
    "cardExpiryDate": "3004",
    "productCode": "STD-MCDEBVF-EUR",
    "productionCode": "NWOPIN_NOPROD"
  },
  "cardContractCustomData": [
    {
      "removeTag": false,
      "tagContainer": "ADD_INFO_01",
      "tagName": "TAG_01",
      "tagValue": "TAG_01_VALUE"
    }
  ]
}
```

**Sample response**

`400`

```JSON
{
    "Errors": {
        "Error": [
            {
                "Source": "MASTERCARD PROCESSING",
                "ReasonCode": "EMBOSSED_DATA_IS_MISSING",
                "Description": "Embossed data is missing for card contract.",
                "Recoverable": false
            }
        ]
    }
}
```

