# Integration and Testing
source: https://developer.mastercard.com/eop-admin/documentation/integration-and-testing/index.md

## Ready to begin testing? {#ready-to-begin-testing}

Testing is an important part of the development process. It allows you to ensure that your application is functioning as expected and that any changes you make do not introduce new bugs or issues.
Tip: We recommend that you begin testing in the sandbox before integrating with the production environment. The sandbox environment is a safe space where you can test your application without affecting real data or users. It allows you to experiment with different scenarios and configurations, and to identify and fix any issues before deploying your application to production.

Once you have created a project on Mastercard Developers and generated sandbox credentials, you can start testing.

### Base URLs for testing: {#base-urls-for-testing}

* Sandbox
* Production

```Sandbox
https://sandbox.api.mastercard.com/loyalty/offers/eop
```

```Production
https://api.mastercard.com/loyalty/offers/eop
```

## Methods of testing Sandbox/Production {#methods-of-testing-sandboxproduction}

### 1. Postman {#1-postman}

> * [Postman Collections](https://www.postman.com/collection/) is an API client that allows developers to test your API calls in sandbox and production environments without writing any code. This makes sharing pre-formed API requests with partners extremely easy, and permits partners to run individual API requests or those within a folder or the entire collection.
> * For detailed steps, refer to the Manual Postman collection setup section.

### 2. Reference Application {#2-reference-application}

> * Our Spring Boot Reference Application acts as an API client and allows you to integrate different operations.
> * For detailed steps, refer to the [Reference Application](https://developer.mastercard.com/eop-admin/documentation/reference-app/index.md) page.

### 3. Insomnia {#3-insomnia}

> * Insomnia is an open-source API client developers use to quickly and easily send REST requests to Mastercard APIs. Mastercard developed an [Insomnia plugin](https://github.com/Mastercard/insomnia-plugin-mastercard) for handling API authentication.
> * This [Insomnia Tutorial](https://developer.mastercard.com/platform/tutorial/use-insomnia-rest-client-for-mastercard-apis) explains how to test Offers Merchant Content using the Insomnia Rest API client.

## Manual Postman collection setup {#manual-postman-collection-setup}

### What to expect from this guide {#what-to-expect-from-this-guide}

This guide provides information on how to set up your postman app to call APIs hosted on Mastercard Developers. These steps will help you create a postman collection and configure your endpoint to make a successful call.

### Prerequisites {#prerequisites}

* API keys can be downloaded from Mastercard Developers during project creation.
* Postman desktop application.
* Open API Spec file (YAML).
* The screenshot shows where you can download the .yaml file of the Locations API that is used in this guide. ![download-specification](https://static.developer.mastercard.com/content/eop-admin/images/1-download-specification.png)

### Convert your PKCS#12 key as an RSA key {#convert-your-pkcs12-key-as-an-rsa-key}

1. Convert the .p12 file downloaded from Mastercard Developers using the command below:

    openssl pkcs12 -in '<location of the .p12 file>' | openssl rsa -out <Filename of the key generated ending with .key>

2. Use the password/passphrase values of your .p12 file(the one you set up when downloading it from Mastercard Developers). ![convert-key.png](https://static.developer.mastercard.com/content/eop-admin/images/2-convert-key.png)

### Create a collection for your API. {#create-a-collection-for-your-api}

1. In your postman application, select **Import**.
2. From **File** , select the **Upload Files** option.
3. Select **Import** to import your .yaml file.

|                                                                                                |                                                                                                |                                                                                                |
|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| ![import.png](https://static.developer.mastercard.com/content/eop-admin/images/3-1-import.png) | ![import.png](https://static.developer.mastercard.com/content/eop-admin/images/3-2-import.png) | ![import.png](https://static.developer.mastercard.com/content/eop-admin/images/3-3-import.png) |

### Configure your credentials in Postman {#configure-your-credentials-in-postman}

1. Select your collection

2. Select the ellipsis menu icon next to your collection name

3. Select **Edit** .
   ![creds](https://static.developer.mastercard.com/content/eop-admin/images/4-1-creds.png)

4. Navigate to the **Authorization** tab, configure the following values, and save the changes.

   |      Field       |                             Value                             |
   |------------------|---------------------------------------------------------------|
   | Type             | OAuth 1.0                                                     |
   | Add auth data to | Request Headers                                               |
   | Signature Method | RSA-SHA256                                                    |
   | Consumer Key     | The key from Mastercard Developers                            |
   | Private Key      | Select the file you generated using the OpenSSL command above |
   | Advanced section | Check **Include body hash**                                   |

   ![creds](https://static.developer.mastercard.com/content/eop-admin/images/4-2-creds.png)
5. Navigate to the **Variables** tab and make sure the baseUrl **CURRENT VALUE** has the appropriate endpoint set up that matches the sandbox or production key you configured in the previous step.
   ![vars](https://static.developer.mastercard.com/content/eop-admin/images/5-vars.png)

6. Choose any of the requests and select **Send** . A successful response displays.
   ![request](https://static.developer.mastercard.com/content/eop-admin/images/6-request.png)

## Next steps {#next-steps}

* When you are ready to use the API, refer to the [Tutorials and Guides](https://developer.mastercard.com/eop-admin/documentation/tutorials-and-guides/index.md) and [Reference App](https://developer.mastercard.com/eop-admin/documentation/reference-app/index.md) sections for information on connecting to Offers Merchant Content.
* To learn more about any error codes you receive, refer to [Code and Formats](https://developer.mastercard.com/eop-admin/documentation/code-and-formats/index.md).
