- Overview
- Requirements
- Frameworks/Libraries
- Integrating with OpenAPI Generator
- Configuration
- Use-Cases
- Execute the Use-Cases
- Service Documentation
- API Reference
- Support
- License
This is a reference application to demonstrate how the Small Business Credit Analytics(SBCA) API is used. To call the API, a consumer key and .p12 file are required - they can be obtained by creating a project on https://developer.mastercard.com - see the Configuration section below for detailed instructions.
- Java 11
- IntelliJ IDEA (or any other IDE)
- Apache Maven
- OpenAPI Generator
OpenAPI Generator generates API client libraries from OpenAPI Specs. It provides generators and library templates for supporting multiple languages and frameworks. Check Generating and Configuring a Mastercard API Client to learn more about how to generate a simple API client for consuming APIs.
- Create an account on Mastercard Developers if you don't have one already.
- Once logged in, create a new project, add the Small Business Credit Analytics API to it, and click continue.
- Click the button to generate and download your private signing key - a
.p12
file will be downloaded. - Copy the downloaded
.p12
file to thesrc/main/resources
folder in your code. - Open
src/main/java/com/mastercard/creditanalytics/api/ApiExamples.java
and configure the default ApiClient creation logic:
apiBasePath
- This is the URL Path to the API endpoint, one of:- For the sandbox environment, https://sandbox.api.mastercard.com/small-business/credit-analytics/locations
- For the production environment, https://api.mastercard.com/small-business/credit-analytics/locations
signingKeyPath
- Path to the key (*.p12) file on your machine. If you placed the file in yoursrc/main/resources
directory, your path might look like./src/main/resources/*.p12
to run locally.signingKeyAlias
- The alias of your key. The default value for sandbox keys iskeyalias
.signingKeyPassword
- The password for your Keystore. The default value for sandbox projects iskeystorepassword
.consumerKey
- This is your consumer key from the Sandbox Keys or Production Keys section of your project page.
-
/matches
Match a merchant's details to Mastercard's locations database
Use this endpoint to retrieve potential matches to the merchant's provided name and address metadata in Mastercard's database. -
/metrics/{location_id}
Get performance metrics for a merchant
Use this endpoint to retrieve performance metrics for a matched merchant returned from /matches
More details can be found here.
- Run
mvn clean install
from the root of the project directory. - When the project builds successfully, you can run the following command to start the project:
java -jar target/creditanalytics-referenceapp-1.0.0.jar
- This will start the application and run through a set of examples exercising all the use cases mentioned above
Small Business Credit Analytics documentation can be found here.
The OpenAPI specification can be found here.
Please email advisors.help@mastercard.com with any questions or feedback you may have.
Copyright 2021 Mastercard
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.