# Testing
source: https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/index.md

Use this page to plan and execute Sandbox validation for the Consumer Credit Analytics API. It covers the recommended workflow, positive and negative coverage, and the reference guides you need for endpoint-level execution.
Note: Start all validation in Sandbox before moving to Production.

### Choosing a testing method {#choosing-a-testing-method}

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

* [Reference Application](https://developer.mastercard.com/consumer-credit-analytics/documentation/developer-tools/reference-app/index.md) --- pre-built requests with OAuth and encryption configured.
* [Insomnia Collection](https://developer.mastercard.com/consumer-credit-analytics/documentation/developer-tools/insomnia-collection/index.md) --- an alternative API client with a ready-to-use workspace.
* Custom API client generated as per guidance in [API Basics](https://developer.mastercard.com/consumer-credit-analytics/documentation/api-basics/index.md).

## Positive testing {#positive-testing}

Positive testing confirms that valid requests succeed and return the expected data.

### Validate these behaviors {#validate-these-behaviors}

* Valid request bodies return success code `200 OK`.
* Created resources can be retrieved by ID or found through search.
* Updates persist and can be verified with a follow-up GET.
* Encrypted endpoints accept correctly signed and encrypted payloads.

## Positive test cases {#positive-test-cases}

View the representative positive test cases for these APIs.

* [Consumer Scores](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/scores-req-res/index.md) - Allows you to retrieve the delinquency score for the consumer.
* [Custom Feature Scores](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/consumer-enhanced-scores-req-res/index.md) - Allows you to retrieve enhanced score for the consumer.
* [Consumer Metrics](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/metrics-req-res/index.md) - Allows you to retrieve the custom metrics for consumer transactions.

## Negative testing {#negative-testing}

Negative testing confirms that invalid requests fail cleanly and return useful error details.

### Validate these behaviors {#validate-these-behaviors-1}

* Missing required fields return `400 Bad Request`. Internal server errors return `500 Internal Server Error`.
* Invalid field values return validation errors with a clear `ReasonCode` and `Description`.
* Requests for unknown resources return `404 Not Found`, forbidden responses return `403 Forbidden`, and unauthorized responses return `401 Unauthorized`.
* Incorrect or missing authentication data is rejected.
* Encrypted endpoints reject malformed or unencrypted payloads when encryption is required.

## Negative test cases {#negative-test-cases}

View the representative negative test cases for these APIs.

* [Consumer Scores](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/scores-req-res/index.md) - Allows you to retrieve the delinquency score for the consumer.
* [Custom Feature Scores](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/consumer-enhanced-scores-req-res/index.md) - Allows you to retrieve enhanced score for the consumer.
* [Consumer Metrics](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/metrics-req-res/index.md) - Allows you to retrieve the custom metrics for consumer transactions.

For the complete list of response codes, reason codes, and formatting rules, see [Codes and Formats](https://developer.mastercard.com/consumer-credit-analytics/documentation/code-and-formats/index.md).

### Next steps {#next-steps}

* Consult the [API Reference](https://developer.mastercard.com/consumer-credit-analytics/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/consumer-credit-analytics/documentation/support/index.md) for FAQs and troubleshooting guidance.
