# Validation Services common content 2
source: https://developer.mastercard.com/cross-border-services/documentation/api-ref/account-validation-apis/common2-bank-iban-generation-api/index.md

## Sandbox Testing {#sandbox-testing}

You can make API calls to the Sandbox server from your application code using the [tutorials](https://developer.mastercard.com/cross-border-services/documentation/tutorials/index.md), which involves creating a Mastercard Developers project and using the Sandbox keys to generate the required Authorization Header.
Tip: During the onboarding process, Mastercard will assign a registered partner ID to test in the higher environments (MTF Test and Production). This partner ID will not be able to access the sandbox environment, but the customer can still access sandbox by using the non-registered partner ID.   
Any correctly formatted partner ID can be used in the sandbox. As a best practice, use the first 15 digits of your institution's name (alphanumeric and/or special characters, no spaces) as the Partner_ID.   
For testing in sandbox, please use unique transaction_reference on each run. Note: The sandbox does not return parameters unique to originating institutions; such as pricing, limits, and corridor-specific data requirements, but allows you to test general call structure and responses outside of the production environment. After sandbox testing is completed, customers meeting the eligibility requirements will be assigned a project manager to do integrated testing in the test environment that has been configured to include requested receiving corridors, current foreign exchange rates, and fixed and variable fees specific to the Originating Institution.

### Sandbox Test cases {#sandbox-test-cases}

Alert: For the Validation Services requests initiated in the Sandbox/MTF url must use the test cases specified in the following table. Please limit your testing requirements only to test cases available below.

The Sandbox server returns simulated, static responses. You can use the following test cases to produce specific responses.

| Status  |                                                      Test Case                                                       |                                                                                                      Request Payload                                                                                                       |
|---------|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Valid   | IBAN is successfully generated when all mandatory and optional fields are present.                                   | { "accountUri": { "type": "ban", "value": "20041010050500013M02606" }, "country": "FRA", "branchCode": "2004101005", "accountNo": "0500013026" }                                                                           |
| Valid   | IBAN is successfully generated when the combination of BAN and country are provided as input                         | { "accountUri": { "type": "ban", "value": "20041010050500013M02606" }, "country": "FRA", "branchCode": null, "accountNo": null }                                                                                           |
| Valid   | IBAN is successfully generated when the combination of Account number, Branch code and country are provided as input | { "accountUri": null, "country": "ITA", "branchCode": "2004101005", "accountNo": "0500013026" }                                                                                                                            |
| Invalid | IBAN is not generated due to invalid checksum of legacy account number                                               | Send the below request where accountNo should end with 'ER00216' { "accountUri": { "type": "ban", "value": "10604511619000000000001" }, "country": "ITA", "branchCode": "0604511619", "accountNo": "000000000001ER00216" } |
| Invalid | IBAN is not generated due to invalid bank identifier                                                                 | Send the below request where accountNo should end with 'ER00203' { "accountUri": { "type": "ban", "value": "10604511619000000000001" }, "country": "ITA", "branchCode": "0601111619", "accountNo": "0500013026ER00203" }   |

## Sample Request {#sample-request}

* JSON

```JSON
{
  "accountUri": {
    "type": "ban",
    "value": "20041010050500013M02606"
  },
  "country": "FRA",
  "branchCode": "2004101005",
  "accountNo": "0500013026"
}
```

## Sample Response {#sample-response}

### 1.Successful IBAN Generation Response: {#1successful-iban-generation-response}

* JSON

```JSON
{
  "ibanDetails": {
    "accounts": {
      "account": [
        {
          "type": "IBAN",
          "value": "FR1420041010050500013M02606"
        },
        {
          "type": "BAN",
          "value": "20041010050500013M02606"
        }
      ]
    },
    "bank": {
      "bic": {
        "type": "SWIFT BIC",
        "value": "PSSTFRPPLIL"
      },
      "name": "La Banque Postale",
      "branchName": "Centre de Lille",
      "branchCode": "2004101005",
      "address": {
        "line1": "3 R Paul Duez",
        "city": "Lille",
        "postalCode": "59900 Cedex 9",
        "country": "FRA"
      }
    }
  }
}
```

### 2. Rejected IBAN generation response for invalid input value. {#2-rejected-iban-generation-response-for-invalid-input-value}

* JSON

```JSON
{
  "Errors": {
    "Error": [
      {
        "RequestId": "3969",
        "Source": "country",
        "ReasonCode": "INVALID_INPUT_VALUE",
        "Description": "Invalid Input Value",
        "Recoverable": "false",
        "Details": {
          "Detail": [
            {
              "Name": "ErrorDetailCode",
              "Value": "082000"
            }
          ]
        }
      }
    ]
  }
}
```

### 3. Rejected IBAN generation response for invalid bank identifier. {#3-rejected-iban-generation-response-for-invalid-bank-identifier}

* JSON

```JSON
{
  "Errors": {
    "Error": [
      {
        "RequestId": "1716",
        "Source": "",
        "ReasonCode": "INVALID_BANK_IDENTIFIER",
        "Description": "Invalid bank identifier",
        "Recoverable": "false",
        "Details": {
          "Detail": [
            {
              "Name": "ErrorDetailCode",
              "Value": "130305"
            }
          ]
        }
      }
    ]
  }
}
```

## Error Codes {#error-codes}

Please refer to complete list of error codes [here](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/index.md).

For information about the HTTP response codes that may be returned for your API requests, see [HTTP Response Codes](https://developer.mastercard.com/cross-border-services/documentation/response-error-codes/http-response-codes/index.md).
