# Testing
source: https://developer.mastercard.com/payment-currency-conversion/documentation/testing/index.md

The Sandbox server returns simulated responses, enabling you to try this API quickly.

Use the following test scenarios to produce specific responses. Unless 'Test Data' instructs otherwise, ensure your GET call includes the required request parameters with valid values.

### Currencies {#currencies}

|     Test Scenario      |                    Test Data                     | HTTP Status Code/Reason Code |      Reason Description       |
|------------------------|--------------------------------------------------|------------------------------|-------------------------------|
| Currency list returned | None                                             | 200/OK                       | Successful                    |
| Unnecessary parameter  | Include unnecessary parameter `currency` = '123' | 200/OK                       | Successful, parameter ignored |

### Conversion Rates Status {#conversion-rates-status}

|    Test Scenario    |                              Test Data                              | HTTP Status Code/Reason Code |      Reason Description      |
|---------------------|---------------------------------------------------------------------|------------------------------|------------------------------|
| Rates not issued    | None, but make GET call before current day's rates have been issued | 200/OK                       | Successful, `status` = 'No'  |
| Rates issued        | None, but make GET call after current day's rates have been issued  | 200/OK                       | Successful, `status` = 'Yes' |
| Invalid date format | Include optional parameter `rate_date` = '2024'                     | 400/BAD_REQUEST              | Invalid rate_date            |
| Invalid future date | Include optional parameter `rate_date` = future date                | 404/NOT_FOUND                | Data not available           |
| Invalid past date   | Include optional parameter `rate_date` = '2022-12-12'               | 403/FORBIDDEN                | Data is not accessible       |

### Conversion Rate Details {#conversion-rate-details}

|            Test Scenario             |                            Test Data                             | HTTP Status Code/Reason Code |                                      Reason Description                                      |
|--------------------------------------|------------------------------------------------------------------|------------------------------|----------------------------------------------------------------------------------------------|
| Conversion details                   | Only include required parameters with valid values               | 200/OK                       | Successful                                                                                   |
| Conversion details with extra fields | Include required and optional parameters with valid values       | 200/OK                       | Successful, with additional response fields `clearingSystem` and `transactionTypeIdentifier` |
| Missing parameter                    | Omit one of the required parameters                              | 400/BAD_REQUEST              | Invalid, identifies missing parameter                                                        |
| Missing value                        | Include parameter `transaction_date` with no value               | 400/BAD_REQUEST              | Missing transaction_date                                                                     |
| Invalid date format                  | Make parameter `transaction_date` = '2024'                       | 400/BAD_REQUEST              | Invalid transaction_date                                                                     |
| Invalid future date                  | Make parameter `transaction_date` = future date                  | 404/NOT_FOUND                | Data not available                                                                           |
| Invalid past date                    | Make parameter `transaction_date` = '2022-12-12'                 | 403/FORBIDDEN                | Data is not accessible                                                                       |
| Invalid amount value                 | Make parameter `transaction_amount` = 'ABC'                      | 400/BAD_REQUEST              | Invalid transaction_amount, provide a numeric value                                          |
| Amount too small                     | Make parameter `transaction_amount` = '0' (zero)                 | 400/BAD_REQUEST              | Invalid transaction_amount, must be greater than zero                                        |
| Amount too large                     | Make parameter `transaction_amount` = '1000000000'               | 400/BAD_REQUEST              | Invalid transaction_amount, must not exceed 999999999.99                                     |
| Amount with 3-digit exponent         | Make parameter `transaction_amount` = '134.874'                  | 400/BAD_REQUEST              | Invalid transaction_amount, only 2 precision allowed in right side                           |
| Unsupported currency                 | Make parameter `transaction_currency` = 'KPW' (North Korean Won) | 400/BAD_REQUEST              | Invalid transaction_currency                                                                 |
| Invalid clearing system              | Include optional parameter `clearing_system` = 'Singl'           | 400/BAD_REQUEST              | Invalid clearing_system                                                                      |

Note: Due to its simplicity, this service does not have Mastercard Test Facility (MTF) APIs and test cases.
