# Insomnia Collection
source: https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/developer-tools/insomnia-collection/index.md

[Insomnia](https://insomnia.rest/) is a desktop REST client you can use to explore and test the Enhanced Currency Conversion Calculator API without writing code.

Mastercard does not currently publish a pre-built Insomnia collection for this API. You can build one in a few minutes by importing the OpenAPI specification directly.

## Import the API {#import-the-api}

1. Download the OpenAPI specification:

   [swaggerui.yaml](https://static.developer.mastercard.com/content/enhanced-currency-conversion-calculator/swagger/swaggerui.yaml) (24KB)
2. In Insomnia, select **Create** \> **Import From File** and choose the downloaded file. Insomnia generates a request for each of the four endpoints (`/summary-rates`, `/rate-statuses`, `/mc-currencies`, `/ecb-currencies`).

## Set Up Environment Variables {#set-up-environment-variables}

Create a Base Environment (or separate Sandbox/Production sub-environments) with a `base_url` variable:

| Environment |                                    `base_url`                                    |
|-------------|----------------------------------------------------------------------------------|
| Sandbox     | `https://sandbox.api.mastercard.com/enhanced/settlement/currencyrate/subscribed` |
| Production  | `https://api.mastercard.com/enhanced/settlement/currencyrate/subscribed`         |

## Configure OAuth 1.0a Authentication {#configure-oauth-10a-authentication}

The Enhanced Currency Conversion Calculator API requires every request to carry an OAuth 1.0a `Authorization` header. Insomnia does not include a built-in Mastercard OAuth 1.0a signer, so use one of the following approaches:

* Install an Insomnia plugin that supports OAuth 1.0a request signing, and configure it with your project's Consumer Key and PEM-format private key (exported from your `.p12` file).
* Generate the `Authorization` header outside Insomnia using one of Mastercard's [OAuth 1.0a signing libraries](https://github.com/Mastercard/oauth1-signer-java), and paste the resulting header value into the request's **Header** tab.

## Run a Request {#run-a-request}

Select the generated `GET /summary-rates` request, confirm `{{ _.base_url }}` resolves to Sandbox, populate the required query parameters (`rate_date`, `trans_curr`, `trans_amt`, `crdhld_bill_curr`), and send it to confirm your credentials are configured correctly before moving on to the other endpoints.

## Next Steps {#next-steps}

|                                                            Category                                                            |                     Description                      |
|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| [Testing](https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/testing/index.md)             | Positive and negative test cases for every endpoint. |
| [API Reference](https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/api-reference/index.md) | Try the Sandbox APIs directly from your browser.     |

