This project showcases the use case of retrieving location data and related information using the Merchant Identifier API here
- Java 11 or later
A tutorial can be found here for setting up and using this service.
- Mastercard Developers Account
- A text editor or IDE
- Java 11+
- Apache Maven 3.3+
- Set up the
JAVA_HOME
environment variable to match the location of your Java installation.
- Create an account at Mastercard Developers.
- Copy the Merchant Identifier API Spec to your local drive
- Create a new project and add the 'Merchant Identifier' API to your project.
- Take note of the given consumer key, keyalias, and keystore password given upon the project creation.
- Copy the downloaded
.p12
file to your local drive. - Update the properties found in
src/main/java/com/mastercard/api/merchantidentifier/Main.java
.
private static final String BASE_URL = "https://sandbox.api.mastercard.com/merchant-identifier";
private static final String CONSUMER_KEY = "yourconsumerkeystring";
private static final String PKCS_12_KEY_FILE_PATH = "./path/to/your/signing-key.p12";
private static final String SIGNIN_KEY_ALIAS = "yourkeyalias";
private static final String SIGNIN_KEY_PASSWORD = "yourpassword";
- run
mvn compile exec:java
to run the project.
All URIs are relative to https://api.mastercard.com/merchant-identifier
Class | Method | HTTP request | Description |
---|---|---|---|
MerchantsApi | getMerchantByCardAcceptorId | GET /merchants-by-card-acceptor-ids | Get matched merchant information for a given card acceptor id |
MerchantsApi | getMerchantByTaxId | GET /merchants-by-tax-ids | Get merchant information for a given tax id |
MerchantsApi | getMerchants | GET /merchants | Get matched merchants for a given merchant descriptor |
- Address
- Country
- CountrySubDivision
- Error
- ErrorResponse
- Errors
- Merchant
- MerchantByCardAcceptorId
- MerchantByCardAcceptorIdList
- MerchantByTaxId
- MerchantByTaxIdList
- MerchantList
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.