# Testing
source: https://developer.mastercard.com/mastercard-send-account-info/documentation/testing/index.md

## Sandbox Testing {#sandbox-testing}

Use this guidance to perform initial Sandbox testing for this API. It covers positive and negative coverage and test cases.

The Sandbox server returns simulated responses, enabling you to try this API quickly, and should not be used for full integration testing. For valid test card numbers that you can use in your requests, see [Sandbox Test Cards](https://developer.mastercard.com/mastercard-send/documentation/implementation/sandbox-test-cards/). Do not use real consumer card numbers in the Sandbox environment. When you are ready to test your integration, move to MTF, a production-like environment, to validate your integration before Production; see [MTF Testing](https://developer.mastercard.com/mastercard-send-account-info/documentation/testing/index.md#mtf-testing).

### Choose a testing method {#choose-a-testing-method}

Choose a testing method that best matches how you want to validate requests:

* **[Postman Collection](https://developer.mastercard.com/mastercard-send-account-info/documentation/developer-tools/postman-collection/index.md)** --- pre-built requests with OAuth configured.

<!-- -->

* **[Reference Application](https://developer.mastercard.com/mastercard-send-account-info/documentation/developer-tools/reference-app/index.md)** --- a working implementation you can run and inspect.
* Custom API client generated as per the guidance in [Java API Client](https://developer.mastercard.com/mastercard-send-account-info/documentation/tutorials-and-guides/api-tutorial/index.md).

### Positive testing {#positive-testing}

Positive testing confirms that valid requests succeed and return the expected data. Validate these behaviors:

* Valid request bodies return success code `200 OK`.
* The responses have the expected eligibility values.

For test data and expected responses, see [Test cases](https://developer.mastercard.com/mastercard-send-account-info/documentation/testing/index.md#test-cases).

The example below is a positive test case request body for a `PUT /v1/partners/{partnerId}/accounts/account-info` API call.
* JSON
* XML

```JSON
{
  "account_info": {
    "account_uri": "pan:5102589999999913;exp=2077-08;cvc=123",
    "amount": "1000",
    "currency": "USD",
    "payment_type": "P2P",
    "enhanced_response": true
  }
}
```

```XML
<account_info>
  <account_uri>pan:5102589999999913;exp=2077-08;cvc=123</account_uri>
  <amount>1000</amount>
  <currency>USD</currency>
  <payment_type>P2P</payment_type>
  <enhanced_response>true</enhanced_response>
</account_info>
```

Expected result: `200 OK` and a response body containing `sending_eligibility.eligible` and `receiving_eligibility.eligible` values of 'true'.

### Negative testing {#negative-testing}

Negative testing confirms that invalid requests fail cleanly and return useful error details. Validate these behaviors:

* Missing required fields return `400 Bad Request`.
* Invalid field values return validation errors with a clear `ReasonCode` and `Description`.
* Incorrect or missing authentication data is rejected.

For test data and expected responses, see [Test cases](https://developer.mastercard.com/mastercard-send-account-info/documentation/testing/index.md#test-cases). For the error response message structure and a complete list of error codes and reason codes, see [Error Codes](https://developer.mastercard.com/mastercard-send-account-info/documentation/code-and-formats/index.md#error-codes).

### Test cases {#test-cases}

Use the following test cases to produce specific responses. As long as the request message is properly formatted, a valid response will be returned.

|                        Test Scenario                        |                                       Test Data                                       |            HTTP Status Code/Reason Code            |                            Expected Result                            |
|-------------------------------------------------------------|---------------------------------------------------------------------------------------|----------------------------------------------------|-----------------------------------------------------------------------|
| Consumer - MASTERCARD - DEBIT                               | pan:5102589999999913                                                                  | 200/OK                                             | Successful                                                            |
| Consumer - VISA - DEBIT                                     | pan:4007589999999904                                                                  | 200/OK                                             | Successful                                                            |
| Consumer - VISA - PREPAID                                   | pan:4000289999999908                                                                  | 200/OK                                             | Successful                                                            |
| Consumer - DISCOVER - DEBIT                                 | pan:6029879999999908                                                                  | 200/OK                                             | Successful                                                            |
| Commercial - MASTERCARD - DEBIT                             | pan:5477520000000018                                                                  | 200/OK                                             | Successful                                                            |
| Commercial - VISA - DEBIT                                   | pan:4000730000000004                                                                  | 200/OK                                             | Successful                                                            |
| Commercial - DISCOVER - DEBIT                               | pan:6906650000000004                                                                  | 200/OK                                             | Successful                                                            |
| Funds availability Next Business Day                        | pan:5000333641352301                                                                  | 200/OK                                             | Successful                                                            |
| Account not eligible                                        | pan:4278090004440051                                                                  | 200/ACCOUNT_NOT_ELIGIBLE                           | Account not eligible for sending and receiving                        |
| Network not eligible and country not supported              | pan:5204750000000003                                                                  | 200/NETWORK_NOT_ELIGIBLE and COUNTRY_NOT_SUPPORTED | Network not eligible for sending, country not supported for receiving |
| Account URI - Expiry Date with past present date validation | Provide expiry date as past date in Account URI, e.g. 'exp=2017-01' (Format: YYYY-MM) | 400/INVALID_INPUT_VALUE                            | Error: `account_uri.Expiration date`, invalid value (082000)          |
| Account URI Mod-10 Check on PAN failure                     | pan:1234567890123456                                                                  | 400/INVALID_INPUT_VALUE                            | Error: `account_uri`, invalid value (082000)                          |
| Invalid value                                               | `account_uri`= ABC                                                                    | 400/INVALID_INPUT_VALUE                            | Error: Invalid value (082000)                                         |
| Invalid field length                                        | `amount` = 1234567890123                                                              | 400/INVALID_INPUT_LENGTH                           | Error: Invalid length (072000)                                        |
| Missing required field                                      | Omit a required parameter, such as `account_uri`                                      | 400/MISSING_REQUIRED_INPUT                         | Error: Value is required (092000)                                     |

## MTF Testing {#mtf-testing}

### Test Card Numbers and Associated Networks {#test-card-numbers-and-associated-networks}

For test card numbers that you can use for testing in the MTF environment, see [MTF Test Cards](https://developer.mastercard.com/mastercard-send/documentation/implementation/test-cards/).

Do not use consumer card numbers in the test environment.

### Card Numbers for Different Funds Availability Options {#card-numbers-for-different-funds-availability-options}

|                        Card Number                         |    Funds Availability     |
|------------------------------------------------------------|---------------------------|
| 5000333641352301                                           | NEXT_BUSINESS_DAY         |
| 5000361001156749                                           | TWO_TO_FIVE_BUSINESS_DAYS |
| Any other card number (published on Mastercard Developers) | IMMEDIATE                 |

## Next Steps {#next-steps}

* Consult the [API Reference](https://developer.mastercard.com/mastercard-send-account-info/documentation/api-reference/index.md) for complete endpoint specifications, request and response schemas, and environment URLs.
* If you run into issues, visit [Support](https://developer.mastercard.com/mastercard-send-account-info/documentation/support/index.md) for FAQs and troubleshooting guidance.
