# Reference App
source: https://developer.mastercard.com/business-payment-controls/documentation/reference-app/index.md

## Reference application {#reference-application}

This reference application allows you to execute a series of sample API calls to the Business Payment Controls Accounts API and Accounts Reporting API and execute all the use cases of the API. This guide will explain how to use the Business Payment Controls API in a Java environment. This section guides you through configuring, building, and running the client reference application.

### Reference Application Overview {#reference-application-overview}

This reference application is organized as a series of tests that execute a series of interactions with the Business Payment Controls service as follows:

#### Account service tests {#account-service-tests}

* Create Real Card
* Lost/Stolen Real Card Multi-Step Flow
* Lost/Stolen Real Card Single Step Flow
* Update Real Card
* Get Real Card
* Search Real Card(s)
* Create a contact linked to a real card
* Update a contact linked to a real card
* Get a contact linked to a real card
* Get all the contacts linked to a real card
* Delete a contact linked to a real card
* Create a funding source
* Update a funding source
* Get a funding source
* Search for a funding source
* Delete a funding source
* Create a virtual card with In Control rules
* Create a virtual card with simplified rules
* Update a virtual card
* Update a virtual card status
* Get a virtual card
* Search for a virtual card
* Delete a virtual card

#### Retail API migration test {#retail-api-migration-test}

* Migrate Existing Real Card To Account Service With Proxy Card Identifier
* Migrate Existing Real Card To Account Service With PAN/Account Number
* Migrate Existing Virtual Card To Account Service With Proxy Card Identifier
* Migrate Existing Virtual Card To Account Service With PAN/Account Number

#### Account reporting service tests {#account-reporting-service-tests}

* Create Authorization Report
* Get Authorization Report Status by Guid
* Get Authorization Report Data by Guid
* Get All Authorization Reports
* Create Clearing Report
* Get Clearing Report Status by Guid
* Get Clearing Report Data by Guid
* Get All Clearing Reports
* Create Summary Clearing Report
* Get Clearing Summary Report Status by Guid
* Get Clearing Summary Report Data by Guid
* Get All Clearing Summary Reports

### Prerequisites {#prerequisites}

1. Install [Java 8](https://www.oracle.com/java/technologies/java8.html).
2. Install [Gradle 7.6](https://gradle.org/install/).
3. Ensure you have access to the following dependencies:
   1. Mastercard Developers [OAuth Signer v1.2.4](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/)
   2. org.openapitools v4.2.3
   3. OKHttp v4.5.0
   4. JUnit Jupiter v5.5.2
   5. AssertJ v3.14.0 These dependencies are configured in the gradle.build. Gradle should download these dependencies automatically.

### Frameworks used {#frameworks-used}

[OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator)

## Set up a project with Mastercard Developers {#set-up-a-project-with-mastercard-developers}

1. Create an account at [Mastercard Developers](https://developer.mastercard.com).
2. Create a new project and add the `Business Payment Controls API` to your project.
3. A `.p12` keystore file containing sandbox credentials is downloaded automatically. Save this file for later
4. Take note of the *Consumer Key* , *keyalias* , and *keystore password* given when the project is created.

### Subscriber onboarding {#subscriber-onboarding}

Contact your Mastercard representative to begin the onboarding process. If you do not already have a contact, use the **Get Help** button on the [Support](https://developer.mastercard.com/business-payment-controls/documentation/support/index.md) page to establish contact.
Once onboarding is complete, you can integrate to the Business Payment Controls API.

## Build the reference application {#build-the-reference-application}

### Step 1: Prepare the reference application {#step-1-prepare-the-reference-application}

1. To download, select [business-payment-controls.zip](https://static.developer.mastercard.com/content/business-payment-controls/uploads/business-payment-controls.zip) (131KB).
2. Extract the downloaded zip file to a folder of your choice.
3. Download and unzip the Java-based reference implementation and follow the setup instructions in the README.MD file.
