# Integration and Testing
source: https://developer.mastercard.com/places/documentation/testing/index.md

Testing in Sandbox provides access to a rich set of data that mimics what is available in production. The data in sandbox is entirely mocked information that uses realistic merchant locations data, but should not be used in any production system, the values for each location are not applicable to real world configurations.
Warning: The merchant locations data used in sandbox are randomly generated mocked data and should not be treated as being an accurate representation of real world merchant locations.

## Prerequisites {#prerequisites}

Confirm the following before you send any requests:

* Your project is created and Sandbox credentials are available.
* You are using the Sandbox base URL: `https://sandbox.api.mastercard.com/location-intelligence/places-locator/`
* OAuth 1.0a signing is configured correctly.

If you still need onboarding or credential setup, start with the [Quick Start Guide](https://developer.mastercard.com/places/documentation/quick-start-guide/index.md).

## Testing Workflow {#testing-workflow}

Follow this ordered checklist to validate your integration end-to-end.

| # |                               Test                               |        Endpoint         |                                                                                                                                                                                                                 What to Verify                                                                                                                                                                                                                 |
|---|------------------------------------------------------------------|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 | **Get Location Details by location id**                          | `GET /places/200406839` | Send a `location_id` in the url body. Confirm HTTP 200 and a JSON with location details. See [Sandbox Test Data](https://developer.mastercard.com/places/documentation/testing/index.md#sandbox-test-data) for testing data, and refer to [Places By Id](https://developer.mastercard.com/places/documentation/tutorials-and-guides/endpoint-overview/use-cases-1/index.md) for an overview of the endpoint                                    |
| 2 | **Get Location Details by location id with invalid location_id** | `GET /places/abcd`      | Send a `location_id` in the url body that is non-numeric. Confirm HTTP 400 and a JSON error message saying INVALID_REQUEST. See [Sandbox Test Data](https://developer.mastercard.com/places/documentation/testing/index.md#sandbox-test-data) for testing data, and refer to [Places By Id](https://developer.mastercard.com/places/documentation/tutorials-and-guides/endpoint-overview/use-cases-1/index.md) for an overview of the endpoint |
| 3 | **Get Location Details by Lat/Long**                             | `POST /places/searches` | Send latitude/longitude and country in the post body. Confirm HTTP 200 and a JSON with location details. See [Sandbox Test Data](https://developer.mastercard.com/places/documentation/testing/index.md#sandbox-test-data) for testing data, and refer to [Places Search](https://developer.mastercard.com/places/documentation/tutorials-and-guides/endpoint-overview/use-cases-1/index.md) for an overview of the endpoint                   |

## Sandbox Test Data {#sandbox-test-data}

For list of sandbox data containing valid Places please click [here](https://static.developer.mastercard.com/content/places/uploads/places_sandbox_data.xlsx)

## Troubleshooting {#troubleshooting}

For a full list of error codes and their meanings, see [Code and Formats](https://developer.mastercard.com/places/documentation/codes-and-formats/index.md).

### Authentication Errors (HTTP 401) {#authentication-errors-http-401}

The following are common causes of authentication errors:

* Consumer key does not match the one in your Mastercard Developers project.
* Signing key (.p12 file) password is incorrect or the file is corrupted.
* OAuth timestamp is too far from the server time (must be within 5 minutes).
* The request body was modified after the OAuth signature was computed.

<br />

To resolve this error, try the following:

1. Verify your consumer key matches the value on your Mastercard Developers project page.
2. Re-download your .p12 keystore file and confirm the password is correct.
3. Ensure your system clock is synchronized.
4. If using a custom HTTP client, ensure the OAuth signature is computed over the final request body.

### Bad Request Errors (HTTP 400) {#bad-request-errors-http-400}

The following are common causes of bad request errors:

* Missing or malformed JSON request body.
* Invalid `location_id` value (must be numeric).
* Invalid `INVALID_LATITUDE`.
* Invalid `INVALID_LONGITUDE`.

<br />

To resolve this error, try the following:

1. Validate your JSON payload with a JSON linter.
2. For location lookup, ensure `location_id` is numeric
3. For location search, ensure `latitude` is between -90 and 90, and `longitude` is between -180 and 180.

## Environment Guidance {#environment-guidance}

For environment URLs and descriptions, see [API Basics - Environments](https://developer.mastercard.com/places/documentation/api-basics/index.md#environments).

* Start in sandbox and complete your positive and negative validation there.
* Move to production only after sandbox testing is complete and production access has been approved.

## Next Steps {#next-steps}

* Start with the [Quick Start Guide](https://developer.mastercard.com/places/documentation/quick-start-guide/index.md) if you still need credentials or project setup.
* Use [Developer Tools](https://developer.mastercard.com/places/documentation/developer-tools/index.md) if you want ready-to-run collections.
* Follow the endpoint tutorials when you are ready to run detailed positive and negative test cases.
