# Reference Application
source: https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/dev-tools/reference-app/index.md

## Overview {#overview}

Please refer to the reference apps below for sample code to authenticate, encrypt and invoke calls to the Benefit Allocation Service API. Reference apps are available in Java and .NET. Each README.md has instructions on generating an OpenAPI client.

## Java Reference Application {#java-reference-application}

### Prerequisites {#prerequisites}

* Java 17 installed

### Technologies Used {#technologies-used}

* Spring Boot 3.2.5
* Maven 3.6.3
* Open Api Generator

### Get the Source Code {#get-the-source-code}

Download the source code of the Java reference app from below
[bas-ref-app-java.zip](https://static.developer.mastercard.com/content/benefit-allocation-service-mtls/uploads/bas-ref-app-java.zip) (52KB)

### Run the Java Application {#run-the-java-application}

1. Download and extract the Java reference application.
2. Follow the `README.md` in the extracted project to generate or configure the OpenAPI client.
3. Configure the MTF base URL, mTLS certificate path, private key path, and encryption certificate path.
4. Run the Maven build and start the application according to the project `README.md`.
5. Send the sample request from the [Quick Start Guide](https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/quick-start-guide/index.md#step-3-confirm-sandbox-configuration-and-make-your-first-request) and confirm the expected response.

## .NET Reference Application {#net-reference-application}

### Prerequisites {#prerequisites-1}

* .NET SDK installed

### Technologies Used {#technologies-used-1}

* .NET
* Open Api Generator

### Get the Source Code {#get-the-source-code-1}

Download the source code of the .NET reference app from below
[bas-ref-app-dotnet.zip](https://static.developer.mastercard.com/content/benefit-allocation-service-mtls/uploads/bas-ref-app-dotnet.zip) (61KB)

### Run the .NET Application {#run-the-net-application}

1. Download and extract the .NET reference application.
2. Follow the `README.md` in the extracted project to generate or configure the OpenAPI client.
3. Configure the MTF base URL, mTLS certificate path, private key path, and encryption certificate path.
4. Build and run the application according to the project `README.md`.
5. Send the sample request from the [Quick Start Guide](https://developer.mastercard.com/benefit-allocation-service-mtls/documentation/quick-start-guide/index.md#step-3-confirm-sandbox-configuration-and-make-your-first-request) and confirm the expected response.

## Validation Checklist {#validation-checklist}

Before using either reference application as an implementation model, confirm that:

* The application points to the intended environment.
* The mTLS certificate and private key are loaded successfully.
* The encrypted request body is accepted by the API.
* The response status and response body match the expected result for the operation.
* The correlation ID is logged for support and troubleshooting.
