# Connect using Open API
source: https://developer.mastercard.com/merchant-match-tool/documentation/tutorials-and-guides/connect-using-api-tutorial/index.md

*ESTIMATED TIME TO COMPLETE THIS TUTORIAL: 20 MINUTES*

### Overview {#overview}

In this tutorial we'll explain how to generate a simple client application to consume the MMT API and walk you through the steps to integrate with Mastercard's OAuth 1.0 authentication and authorization flow.

You'll learn to:  

* Generate a REST client from an OpenAPI/Swagger specification  
* Sign requests using our OAuth1.0a signer libraries  

#### Prerequisites {#prerequisites}

Before starting this tutorial please ensure that you have already done the following:

* Created your project and retrieved the required credentials

<br />

APIs used in this tutorial:   

* Merchant Match Tool API [View Documentation](https://developer.mastercard.com/merchant-match-tool/documentation/index.md)

<br />

For a generic tutorial on how to generate a simple API client, reference this [link](https://developer.mastercard.com/platform/documentation/security-and-authentication/generating-and-configuring-a-mastercard-api-client/)

### Download Reference App / Python {#download-reference-app--python}

The reference app is a Python application that makes calls to the Merchant Match Tool API to search the Mastercard Supplier acceptance database.

If you prefer a self-contained reference application, please follow the instructions on the [Reference App](https://developer.mastercard.com/merchant-match-tool/documentation/reference-app/index.md) page and follow the instructions.

If you wish to review the MMT API specifications, you can download the MMT swagger definition file in YAML format (You can download the latest version [here](https://developer.mastercard.com/merchant-match-tool/documentation/api-reference/index.md)).

### Generate Client {#generate-client}

Mastercard has provided a generic tutorial you can follow to generate an Open API client.

You can skip to step 3 in the tutorial and come back here after you complete step 6.

[Generating an Open API client](https://developer.mastercard.com/platform/documentation/generating-and-configuring-a-mastercard-api-client/)

The tutorial is based on Java but you can find further tutorials for all six supported languages on [Github](https://github.com/Mastercard/mastercard-api-client-tutorial)

For more information about swagger-codegen and more options, please refer to the official page on [GitHub](https://github.com/OpenAPITools/openapi-generator).

### Call MMT API {#call-mmt-api}

Below is some example code and a sample application that you can use to call the MMT API after generating your client.

Sample application:
[mmt.zip](https://static.developer.mastercard.com/content/merchant-match-tool/uploads/mmt.zip) (211KB))

```Java
        SearchApi singleInstance = new SearchApi();
        SingleAPIRequest singleRequest = new SingleAPIRequest(); // SingleAPIRequest | 
        singleRequest.setCity("NEW YORK");
        singleRequest.setCountry("USA");
        singleRequest.setMerchantName("STARBUCKS");
        singleRequest.setPhoneNumber("2126821880");
        singleRequest.setPostalCode("10028-0414");
        singleRequest.setState("NY");
        singleRequest.setStreetAddress("1142 MADISON AVE");
        singleRequest.setTaxId("");
        try {
            SingleAPIResponse singleResult = singleInstance.searchSingle(singleRequest);
            System.out.println(singleResult.getData().getMatchedName());
        } catch (ApiException e) {
            System.err.println("Exception when calling SearchApi#searchSingle");
            e.printStackTrace();
        }
```

```java
       SearchApi multiInstance = new SearchApi();
        MultipleAPIRequest multiRequest = new MultipleAPIRequest(); // MultipleAPIRequest |
        ExtendedMatchRequest extendedMultiRequest = new ExtendedMatchRequest();
        extendedMultiRequest.setCity("NEW YORK");
        extendedMultiRequest.setCountry("USA");
        extendedMultiRequest.setMerchantName("STARBUCKS");
        extendedMultiRequest.setPhoneNumber("2126821880");
        extendedMultiRequest.setPostalCode("10028-0414");
        extendedMultiRequest.setState("NY");
        extendedMultiRequest.setStreetAddress("1142 MADISON AVE");
        extendedMultiRequest.setTaxId("");
        multiRequest.add(extendedMultiRequest);
        try {
            MultipleAPIResponse multiResult = multiInstance.searchMultiple(multiRequest);
            for (int resultIndex = 0; resultIndex<multiResult.getData().size(); resultIndex++){
                  System.out.println(multiResult.getData().get(resultIndex).getRecord().getMatchedName());
            }
        } catch (ApiException e) {
            System.err.println("Exception when calling SearchApi#searchMultiple");
            e.printStackTrace();
        }
```

