# API Basics
source: https://developer.mastercard.com/match/documentation/api-basics/index.md

## Authentication {#authentication}

#### In short {#in-short}

* Mastercard uses [OAuth 1.0a](https://developer.mastercard.com/platform/documentation/using-oauth-1a-to-access-mastercard-apis) 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
* Create Mastercard Developers project using reference of [Quick Start Guide](https://developer.mastercard.com/platform/documentation/getting-started-with-mastercard-apis/quick-start-guide)
* Client authentication libraries can be found on GitHub, with how-to information provided in README.md files   

#### Transport Encryption {#transport-encryption}

The transport between client applications and Mastercard is secured using [TLS/SSL](https://developer.mastercard.com/platform/documentation/authentication/using-mtls-to-access-mastercard-apis), which means data are encrypted by default when transmitted across networks.

#### OAuth keys \& authentication libraries {#oauth-keys--authentication-libraries}

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

## Conventions {#conventions}

* Use [OpenAPI Generator](https://openapi-generator.tech) to generate jar from yaml file.   

## How to Consume the MATCH Pro API {#how-to-consume-the-match-pro-api}

Note: There are multiple ways of integrating with the Mastercard Alert to Control High Risk Pro ( MATCH Pro) API:

1. Using a generated API client (recommended)
2. Using a method of your choice

#### Generating your own MATCH Pro API client {#generating-your-own-match-pro-api-client}

Create customizable API clients from the MATCH Pro API specification and let Mastercard's open-source client libraries handle the authentication for you. This approach offers the most flexibility and is strongly recommended.   

For this, please follow our [Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/getting-started-with-mastercard-apis/generating-and-configuring-a-mastercard-api-client) tutorial with the following API specification: [OpenAPI Spec Download](https://static.developer.mastercard.com/content/match/swagger/match-pro.yaml)

* Please ignore steps 5 and 7 as the MATCH Pro API does not currently have payload encryption.   

#### Using a method of your choice {#using-a-method-of-your-choice}

MATCH Pro exposes a JSON-RPC API, you are free to use the HTTP client of your choice and can still leverage the Mastercard open-source [client libraries](https://developer.mastercard.com/platform/documentation/authentication/using-oauth-1a-to-access-mastercard-apis) for signing your requests.

For that, please refer to the [MATCH Pro API Reference](https://developer.mastercard.com/match/documentation/api-reference/).

## Environments {#environments}

| Environment. |                                                                                                                                       Description                                                                                                                                       |
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Sandbox      | In the sandbox environment a mock service is running that provides sample responses based on the value of the 'referenceNumber'. To access Sandbox select MATCH Pro when setting up [My Projects](https://developer.mastercard.com/dashboard)                                           |
| MTF          | In MTF you can access the Match Pro MTF services. MTF environment is for testing purposes only to perform all user acceptance testing (UAT). To access MTF you need to select [Request MTF Access](https://developer.mastercard.com/dashboard) in the MATCH Pro project you have setup. |
| Production   | In production you can access the Match Pro production services. To access production you need to select [Request Production Access](https://developer.mastercard.com/dashboard) in the MATCH Pro project you have setup.                                                                |

