# API Basics
source: https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/api-basics/index.md

The Enhanced Currency Conversion Calculator API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Our API returns [JSON-encoded](https://www.json.org/json-en.html) responses and uses standard HTTP response codes, authentication, and verbs.

## Authentication {#authentication}

The Enhanced Currency Conversion Calculator API requires all requests to be signed using [**OAuth 1.0a**](https://oauth.net/core/1.0a/).

In short

* Mastercard uses [**OAuth 1.0a**](https://oauth.net/core/1.0a/) for authenticating client applications
* Requests with a body must be signed using the Google Request Body Hash extension for OAuth
* OAuth Keys for your project can be set up in your dashboard
* Client authentication libraries can be found on GitHub, with how-to information provided in README.md files

For further details, see [**Using OAuth 1.0a to Access Mastercard APIs**](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/)

## API Host {#api-host}

There are two Mastercard environments:

* **Sandbox:** Sandbox environment is where you access API stubs that return simulated, static responses.
* **Production:** Production environment is where you complete testing and launch your solution.

| Environment |                                  URL                                  |
|-------------|-----------------------------------------------------------------------|
| Sandbox     | <https://sandbox.api.mastercard.com/enhanced/settlement/currencyrate> |
| Prodcution  | <https://api.mastercard.com/enhanced/settlement/currencyrate>         |

## API Keys and Access {#api-keys-and-access}

* Mastercard authenticates API requests using your account's API keys. If you do not include your key when making an API request, or use one that is incorrect or outdated, Mastercard returns an error.   
* Your API keys are available in your project dashboard on [**Mastercard Developers**](https://developer.mastercard.com/).   
* To renew your Project Keys, go to **My Project dashboard** , click **Actions** , and then click **Renew** . For more details, see [How To Renew Your Project Keys](https://developer.mastercard.com/platform/documentation/getting-started-with-mastercard-apis/renewing-your-keys/ "Renew").   

Warning: All keys created in the Mastercard Developer Portal account expire after one year and must be renewed, otherwise they will be revoked.

<br />

The following table outlines the key management activities. Once generated, most of these keys and their certificates are accessible from the API project dashboard, except for the private keys generated offline.

|    Category    |                                                                                                                                                                                               Description                                                                                                                                                                                               |
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Sandbox Key    | Private keys used for API authentication with the Sandbox environments. Mastercard generates the initial set of keys when creating your project; you download the Signing Key via your browser. The project page shows the Consumer Key. If you want to generate and use your own keys, you can discard the Mastercard-generated keys and renew them using your Certificate Signing Request (CSR) file. |
| Production Key | Private keys used for API authentication with the Production environment. Mastercard can generate this key set for you when you request Production access; you download the Signing Key via your browser. Alternatively, we recommend that you generate your own keys and upload your CSR file, to ensure you are the only entity possessing your private key. The project page shows the Consumer Key. |

**Production Access**

When you are ready to move to production, you can request Production access. To request Production access click **Request Production Access** through the project dashboard. Once your production access request has been reviewed, you will receive a notification indicating your access has been approved or denied.  

The following diagram shows the production environment architecture:

![](https://static.developer.mastercard.com/content/enhanced-currency-conversion-calculator/uploads/ecc-architecture.JPG)

1. Verifies authorization of access to production currency rate data
2. Retrieves and returns production currency rate data for authorized client

## Glossary {#glossary}

To ensure best experience when integrating with this service please familiarize yourself with the following conventions.

|                                                                                Category                                                                                |                     Description                      |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| [Parameters](https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/parameters/index.md)                                               | A glossary that explains input and output responses. |
| [HTTP Response codes](https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/code-and-formats/index.md#http-response-and-reason-codes) | Detailed descriptions on HTTP codes and messages.    |
| [ISO Currency Codes](https://developer.mastercard.com/enhanced-currency-conversion-calculator/documentation/code-and-formats/index.md#iso-currency-codes)              | List of currencies available via the API.            |

