# Acquirers: Onboard Risk Check API onboarding source: https://developer.mastercard.com/onboard-risk-check/documentation/tutorials-and-guides/orc-inquiries-tutorial/index.md ## What you will learn {#what-you-will-learn} * Create a new Maven (Java) project. * Add required resources. * Add required dependencies. * Generate the API client. * Make an API call. ## What you will need {#what-you-will-need} To complete this tutorial, you can use: * Maven 3+ * JDK 17+ * IntelliJ IDEA 2017+ (any other IDE can be used). * OpenAPI spec for Onboard Risk Check API [onboard-risk-check-api.yaml](https://static.developer.mastercard.com/content/onboard-risk-check/swagger/onboard-risk-check-api.yaml) (63KB). * A developer account on [Mastercard Developers](https://developer.mastercard.com/account/log-in) and Onboard Risk Check API project. Tip: For instructions on how to create a developer account and API project, please refer to the [Quick Start Guide](https://developer.mastercard.com/platform/documentation/getting-started-with-mastercard-apis/quick-start-guide/). Click **Next** to begin. ### Step 1 - Step one: Create a new Maven project {#step-1---step-one-create-a-new-maven-project} To begin ORC API onboarding, you must first create a new Maven project. ## 1. New Maven project {#1-new-maven-project} In IntelliJ IDEA, create a new Maven project that sets up your directory structure automatically. ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step1-1.png) ## 2. Naming details {#2-naming-details} Enter "cyber-secure-orc-tutorial" in the **Name** and **ArtifactId** fields. ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step1-2.png) ### Step 2 - Step two: Add resources {#step-2---step-two-add-resources} Before you can add dependencies, you must add resources. ## 1. Save the API specification file {#1-save-the-api-specification-file} Download the OpenAPI specification file for the Onboard Risk Check API [onboard-risk-check-api.yaml](https://static.developer.mastercard.com/content/onboard-risk-check/swagger/onboard-risk-check-api.yaml) (63KB), and add it to the resources folder of your Maven project. ## 2. Save the API signing key {#2-save-the-api-signing-key} Add the Sandbox Signing Key generated for your Cyber Secure ORC project to the resources folder of your Maven project. The steps to create the project and generate the Sandbox Signing Key are described in the [Quick Start Guide](https://developer.mastercard.com/platform/documentation/getting-started-with-mastercard-apis/quick-start-guide/). Note: For detailed information about the Signing Keys, refer to [Getting keys for your application](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/#getting-keys-for-your-application). Your Maven project directory should look as follows (the .iml file is used by IntelliJ IDEA). ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step2a.png) ### Step 3 - Step three: Add dependencies {#step-3---step-three-add-dependencies} Before you can generate the API client, you must update the pom.xml file. ## 1. Add OpenAPI plugin details {#1-add-openapi-plugin-details} Add the following plugin to the pom.xml file in your Maven project to add the OpenAPI Generator. The OpenAPI Generator creates API client libraries from [OpenAPI Specifications](https://github.com/OAI/OpenAPI-Specification) (formerly known as Swagger Files). OpenAPI Generator provides multiple generators and library templates to support multiple languages and frameworks. In this tutorial we are using the Java generator and the default okhttp-gson library template. ```java 4.0.0 com.mastercard.api.orc cyber-secure-orc-tutorial 1.0-SNAPSHOT org.openapitools openapi-generator-maven-plugin 6.6.0 Cyber Secure ORC API REST Client generate ${project.basedir}/src/main/resources/onboard-risk-check-api.yaml java src/gen/java/main com.mastercard.api.orc com.mastercard.api.orc cyber-secure-orc-tutorial com.mastercard.api.orc.model ``` ## 2. Add various dependencies {#2-add-various-dependencies} Add the following dependencies for the API client library generation and the Mastercard OAuth1 Signer library to your pom.xml file. Mastercard APIs use [OAuth 1.0a](https://developer.mastercard.com/platform/documentation/authentication/using-oauth-1a-to-access-mastercard-apis/) authentication. OAuth1 Signer libraries are developed and maintained by the Mastercard API team and hosted on [GitHub](https://github.com/Mastercard). They include code helpers targeting the HTTP clients used by the different OpenAPI Generator library templates. ```java 17 17 UTF-8 17 ${java.version} ${java.version} 2.0.21-RELEASE UTF-8 1.5.2.Final 5.9.1 5.6.0 1.9.0 5.0.2-RELEASE 4.0.0-RELEASE 1.8.5 1.6.8 4.10.0 2.10.1 1.6.5 4.13.2 1.0.2 1.5.2 3.0.2 0.2.6 2.1.1 5.9.2 io.swagger swagger-annotations ${swagger-core-version} com.squareup.okhttp3 okhttp ${okhttp3-version} com.squareup.okhttp3 logging-interceptor ${okhttp3-version} com.google.code.gson gson ${gson-version} io.gsonfire gson-fire ${gson-fire-version} org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} org.threeten threetenbp ${threetenbp-version} com.mastercard.developer oauth1-signer ${oauth1-signer-version} junit junit ${junit-version} com.google.code.findbugs jsr305 ${findbugs-version} org.openapitools jackson-databind-nullable ${nullable-version} javax.ws.rs javax.ws.rs-api ${javax-rs-version} org.junit.jupiter junit-jupiter-api ${junit-jupiter-version} compile javax.annotation javax.annotation-api 1.3.2 ``` ### Step 4 - Step four: Generate the API client {#step-4---step-four-generate-the-api-client} Once you have added the dependencies, you can generate the sources. There are two options when using the OpenAPI Generator to generate the API client library: * Generate and use the source files on the fly. * Generate and deploy the source files to a Maven repository. This tutorial explains how to generate the API client library on the fly, so the dependencies that are needed to generate the library are included. To deploy the source files to a Maven repository, you only need to include the dependency for that repository. ## 1. Open Maven window {#1-open-maven-window} In IntelliJ IDEA, navigate to **View** \> **Tool Windows** \> **Maven** to open the Maven window. ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step4.png) ## 2. Generate sources {#2-generate-sources} Click the icons for **Reimport All Maven Projects and Generate Sources** and **Update Folders for All Projects** . ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step4b.png) The sources will be generated in the target folder inside the Maven project structure. This project can be built and used as a standalone dependency in any project you need to develop. ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step4c.png) ### Step 5 - Step five: Make a POST API call {#step-5---step-five-make-a-post-api-call} In this step we will make a POST API call to initiate an inquiry using the generated API client. ## 1. Main class {#1-main-class} Create a Java file called Main.java in the `com.mastercard.api.orc` package. ## 2. Prepare the API key details {#2-prepare-the-api-key-details} Add the following code to the `main()` method of the class. This will make your OAuth credentials available to the program and will create the PrivateKey used for signing the requests. ```java String consumerKey = "#YOUR 97 CHARACTER CONSUMER KEY HERE#"; String signingKeyFilePath = "#PATH TO YOUR P12 FILE HERE#"; String signingKeyAlias = "#YOUR KEY ALIAS HERE#"; String signingKeyPass = "#YOUR KEY PASSWORD HERE#"; // Load the signing key PrivateKey signingKey = AuthenticationUtils.loadSigningKey(signingKeyFilePath, signingKeyAlias, signingKeyPass); ``` ## 3. Configure APIClient {#3-configure-apiclient} Add the following code to instantiate an ApiClient and configure it to sign requests with your authentication credentials. The `OkHttpOAuth1Interceptor` used to sign the requests is provided by the Mastercard OAuth1 Signer library. This tutorial also uses `client.setDebugging(true)` to view detailed request information when the application is run. ```java // Set the ApiClient ApiClient client = new ApiClient(); OkHttpClient.Builder httpClientBuilder = client.getHttpClient().newBuilder(); // Configure the Mastercard service URL client.setBasePath("https://sandbox.api.mastercard.com/onboard-risk-check"); // Add the interceptor code responsible for signing HTTP requests httpClientBuilder.addInterceptor(new OkHttpOAuth1Interceptor(consumerKey, signingKey)); client.setHttpClient(httpClientBuilder.build()); //Debugging is enabled for testing client.setDebugging(true); ``` ## 4. Create the Inquiry object that contains the merchant details {#4-create-the-inquiry-object-that-contains-the-merchant-details} In this example we plan to get Cyber Health Risks, Sanctions Screening, and Business Identity. ```java // Form the inquiry request object that contains the details about the merchant InitiateInquiry inquiry = new InitiateInquiry(); // Add options - cyberHealth is for Cyber Risks inquiry.addOptionsItem("cyberHealth"); // Add options - sanctionsScreening is for Sanctions Screening inquiry.addOptionsItem("sanctionsScreening"); // Add options - businessIdentity is for Business Identity inquiry.addOptionsItem("businessIdentity"); // Construct businessInfo object -- part of criteria Map businessInfo = new HashMap<>(); // Construct business address object -- part of businessInfo Map businessAddress = new HashMap<>(); businessAddress.put("streetAddressLine1", "1551 CROSSBEAM DR"); businessAddress.put("streetAddressLine2", "CASSELBERRY"); businessAddress.put("city", "Miami"); businessAddress.put("stateCode", "FL"); businessAddress.put("postalCode", "327075922"); businessAddress.put("countryCode", "US"); // Construct peopleOfSignificantControl address object -- part of peopleOfSignificantControl Map peopleOfSignificantControlAddress = new HashMap<>(); peopleOfSignificantControlAddress.put("addressOne", "123 Main St."); peopleOfSignificantControlAddress.put("addressTwo", "village"); peopleOfSignificantControlAddress.put("country", "US"); peopleOfSignificantControlAddress.put("stateProvince", "Texas"); peopleOfSignificantControlAddress.put("city", "Houston"); peopleOfSignificantControlAddress.put("postalCode", "73001"); // Construct List of peopleOfSignificantControl object -- part of businessInfo //Map peopleOfSignificantControl = new HashMap<>(); List> peopleOfSignificantControlList = new ArrayList<>(); Map peopleOfSignificantControl = new HashMap<>(); // Populate peopleOfSignificantControl peopleOfSignificantControl.put("firstGivenName", "Michael"); peopleOfSignificantControl.put("middleName", "J"); peopleOfSignificantControl.put("firstSurName", "Scott"); peopleOfSignificantControl.put("secondSurname", "Flax"); peopleOfSignificantControl.put("fullName", "Michael J Scott Flax"); peopleOfSignificantControl.put("businessName", "VERTEX AUTO CORP."); peopleOfSignificantControl.put("address", peopleOfSignificantControlAddress); peopleOfSignificantControlList.add(peopleOfSignificantControl); // Populate businessInfo businessInfo.put("name", "THE BAIT SHOP"); businessInfo.put("merchantUrl", "www.bait.com"); businessInfo.put("legalName", "BAIT R US"); businessInfo.put("address", businessAddress); businessInfo.put("jurisdiction", "FL"); businessInfo.put("ein", "123"); businessInfo.put("binBrn", "123"); businessInfo.put("peopleOfSignificantControl", peopleOfSignificantControlList); // Construct List of principalInfo object -- part of criteria List> principalInfoList = new ArrayList<>(); // Construct principal object -- part of principalInfo Map principal = new HashMap<>(); // Construct principal address object -- part of principal Map principalAddress = new HashMap<>(); principalAddress.put("streetAddressLine1", "1551 CROSSBEAM DR"); principalAddress.put("streetAddressLine2", "CASSELBERRY"); principalAddress.put("city", "Miami"); principalAddress.put("stateCode", "FL"); principalAddress.put("postalCode", "327075922"); principalAddress.put("countryCode", "US"); // Populate principal principal.put("firstName", "Joe"); principal.put("lastName", "Smith"); principal.put("dateOfBirth", "1970-03-09"); principal.put("address", principalAddress); //Add principal object to principalInfoList principalInfoList.add(principal); // Construct criteria object Map criteria = new HashMap<>(); criteria.put("requestingIca", "7919"); criteria.put("businessInfo", businessInfo); criteria.put("principalInfo", principalInfoList); // Add criteria inquiry.setCriteria(criteria); ``` ## 5. Call the API endpoint {#5-call-the-api-endpoint} Call the Initiate Inquiry endpoint to send the request to Mastercard. Expect an Inquiry Reference Number (IRN) back on successful response (202 Accepted). ```java // Inquiry Reference Number will be returned on successful response InquiryReferenceWithMetadata irn; // Call the API InquiryApi api = new InquiryApi(client); irn = api.initiateInquiry(inquiry); // Use this IRN to track the request. You will need this in GET endpoint System.out.println(irn.getInquiryReferenceNumber()); ``` ## 6. Verify that the Main class is complete and correct. {#6-verify-that-the-main-class-is-complete-and-correct} Below is the complete code from steps 1 through 5. ```java package com.mastercard.api.orc; import com.mastercard.api.ApiClient; import com.mastercard.api.orc.model.InitiateInquiry; import com.mastercard.api.orc.model.InquiryReferenceWithMetadata; import com.mastercard.developer.interceptors.OkHttpOAuth1Interceptor; import com.mastercard.developer.utils.AuthenticationUtils; import okhttp3.OkHttpClient; import java.security.PrivateKey; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main { public static void main(String[] args) throws Exception { String consumerKey = "#YOUR 97 CHARACTER CONSUMER KEY HERE#"; String signingKeyFilePath = "#PATH TO YOUR P12 FILE HERE#"; String signingKeyAlias = "#YOUR KEY ALIAS HERE#"; String signingKeyPass = "#YOUR KEY PASSWORD HERE#"; // Load the signing key PrivateKey signingKey = AuthenticationUtils.loadSigningKey(signingKeyFilePath, signingKeyAlias, signingKeyPass); // Set the ApiClient ApiClient client = new ApiClient(); OkHttpClient.Builder httpClientBuilder = client.getHttpClient().newBuilder(); // Configure the Mastercard service URL client.setBasePath("https://sandbox.api.mastercard.com/onboard-risk-check"); // Add the interceptor code responsible for signing HTTP requests httpClientBuilder.addInterceptor(new OkHttpOAuth1Interceptor(consumerKey, signingKey)); client.setHttpClient(httpClientBuilder.build()); //Debugging is enabled for testing client.setDebugging(true); try { // Form the inquiry request object that contains the details about the merchant InitiateInquiry inquiry = new InitiateInquiry(); // Add options - cyberHealth is for Cyber Risks inquiry.addOptionsItem("cyberHealth"); // Add options - sanctionsScreening is for Sanctions Screening inquiry.addOptionsItem("sanctionsScreening"); // Add options - businessIdentity is for Business Identity inquiry.addOptionsItem("businessIdentity"); // Construct businessInfo object -- part of criteria Map businessInfo = new HashMap<>(); // Construct business address object -- part of businessInfo Map businessAddress = new HashMap<>(); businessAddress.put("streetAddressLine1", "1551 CROSSBEAM DR"); businessAddress.put("streetAddressLine2", "CASSELBERRY"); businessAddress.put("city", "Miami"); businessAddress.put("stateCode", "FL"); businessAddress.put("postalCode", "327075922"); businessAddress.put("countryCode", "US"); // Construct peopleOfSignificantControl address object -- part of peopleOfSignificantControl Map peopleOfSignificantControlAddress = new HashMap<>(); peopleOfSignificantControlAddress.put("addressOne", "123 Main St."); peopleOfSignificantControlAddress.put("addressTwo", "village"); peopleOfSignificantControlAddress.put("country", "US"); peopleOfSignificantControlAddress.put("stateProvince", "Texas"); peopleOfSignificantControlAddress.put("city", "Houston"); peopleOfSignificantControlAddress.put("postalCode", "73001"); // Construct List of peopleOfSignificantControl object -- part of businessInfo //Map peopleOfSignificantControl = new HashMap<>(); List> peopleOfSignificantControlList = new ArrayList<>(); Map peopleOfSignificantControl = new HashMap<>(); // Populate peopleOfSignificantControl peopleOfSignificantControl.put("firstGivenName", "Michael"); peopleOfSignificantControl.put("middleName", "J"); peopleOfSignificantControl.put("firstSurName", "Scott"); peopleOfSignificantControl.put("secondSurname", "Flax"); peopleOfSignificantControl.put("fullName", "Michael J Scott Flax"); peopleOfSignificantControl.put("businessName", "VERTEX AUTO CORP."); peopleOfSignificantControl.put("address", peopleOfSignificantControlAddress); peopleOfSignificantControlList.add(peopleOfSignificantControl); // Populate businessInfo businessInfo.put("name", "THE BAIT SHOP"); businessInfo.put("merchantUrl", "www.bait.com"); businessInfo.put("legalName", "BAIT R US"); businessInfo.put("address", businessAddress); businessInfo.put("jurisdiction", "FL"); businessInfo.put("ein", "123"); businessInfo.put("binBrn", "123"); businessInfo.put("peopleOfSignificantControl", peopleOfSignificantControlList); // Construct List of principalInfo object -- part of criteria List> principalInfoList = new ArrayList<>(); // Construct principal object -- part of principalInfo Map principal = new HashMap<>(); // Construct principal address object -- part of principal Map principalAddress = new HashMap<>(); principalAddress.put("streetAddressLine1", "1551 CROSSBEAM DR"); principalAddress.put("streetAddressLine2", "CASSELBERRY"); principalAddress.put("city", "Miami"); principalAddress.put("stateCode", "FL"); principalAddress.put("postalCode", "327075922"); principalAddress.put("countryCode", "US"); // Populate principal principal.put("firstName", "Joe"); principal.put("lastName", "Smith"); principal.put("dateOfBirth", "1970-03-09"); principal.put("address", principalAddress); //Add principal object to principalInfoList principalInfoList.add(principal); // Construct criteria object Map criteria = new HashMap<>(); criteria.put("requestingIca", "7919"); criteria.put("businessInfo", businessInfo); criteria.put("principalInfo", principalInfoList); // Add criteria inquiry.setCriteria(criteria); // Inquiry Reference Number will be returned on successful response InquiryReferenceWithMetadata irn; // Call the API InquiryApi api = new InquiryApi(client); irn = api.initiateInquiry(inquiry); // Use this IRN to track the request. You will need this in GET endpoint System.out.println(irn.getInquiryReferenceNumber()); } catch (Exception e){ e.printStackTrace(); } } } ``` ## 7. Run the application {#7-run-the-application} Navigate to **Main.java file** \>**Run 'Main.main()'** to run the application. The screenshot below shows the IRN received on successful response. ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step5.png) ### Step 6 - Step six: Make a GET API call {#step-6---step-six-make-a-get-api-call} In this step we will make a GET API call to retrieve the inquiry results using the generated API client. For this tutorial, we will continue in the same Main class as created in step *five*. ## 1. Main class {#1-main-class-1} From previous step *five* we received the Inquiry Reference Number (IRN). We can now use this to call the GET endpoint to retrieve the risk rating reports. ```java // Get the risk rating reports from the GET endpoint InquiryResult result; // irn: obtained from the previous POST call for retrieving the results result = api.retrieveInquiry(irn.getInquiryReferenceNumber()); // The results will contain the ratings reports System.out.println(result); ``` ## 2. Run the application {#2-run-the-application} Navigate to **Main.java file** \>**Run 'Main.main()'** to run the application. The screenshot below shows the sample of the response (200 OK). ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step6a.png) ![](https://static.developer.mastercard.com/content/onboard-risk-check/uploads/step6b.png) ## 3. Complete final Main class {#3-complete-final-main-class} Here is the complete Main class from all the steps in this tutorial. ```java package com.mastercard.api.orc; import com.mastercard.api.ApiClient; import com.mastercard.api.orc.model.InitiateInquiry; import com.mastercard.api.orc.model.InquiryReferenceWithMetadata; import com.mastercard.api.orc.model.InquiryResult; import com.mastercard.developer.interceptors.OkHttpOAuth1Interceptor; import com.mastercard.developer.utils.AuthenticationUtils; import okhttp3.OkHttpClient; import java.security.PrivateKey; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main { public static void main(String[] args) throws Exception { String consumerKey = "#YOUR 97 CHARACTER CONSUMER KEY HERE#"; String signingKeyFilePath = "#PATH TO YOUR P12 FILE HERE#"; String signingKeyAlias = "#YOUR KEY ALIAS HERE#"; String signingKeyPass = "#YOUR KEY PASSWORD HERE#"; // Load the signing key PrivateKey signingKey = AuthenticationUtils.loadSigningKey(signingKeyFilePath, signingKeyAlias, signingKeyPass); // Set the ApiClient ApiClient client = new ApiClient(); OkHttpClient.Builder httpClientBuilder = client.getHttpClient().newBuilder(); // Configure the Mastercard service URL client.setBasePath("https://sandbox.api.mastercard.com/onboard-risk-check"); // Add the interceptor code responsible for signing HTTP requests httpClientBuilder.addInterceptor(new OkHttpOAuth1Interceptor(consumerKey, signingKey)); client.setHttpClient(httpClientBuilder.build()); //Debugging is enabled for testing client.setDebugging(true); try { // Form the inquiry request object that contains the details about the merchant InitiateInquiry inquiry = new InitiateInquiry(); // Add options - cyberHealth is for Cyber Risks inquiry.addOptionsItem("cyberHealth"); // Add options - sanctionsScreening is for Sanctions Screening inquiry.addOptionsItem("sanctionsScreening"); // Add options - businessIdentity is for Business Identity inquiry.addOptionsItem("businessIdentity"); // Construct businessInfo object -- part of criteria Map businessInfo = new HashMap<>(); // Construct business address object -- part of businessInfo Map businessAddress = new HashMap<>(); businessAddress.put("streetAddressLine1", "1551 CROSSBEAM DR"); businessAddress.put("streetAddressLine2", "CASSELBERRY"); businessAddress.put("city", "Miami"); businessAddress.put("stateCode", "FL"); businessAddress.put("postalCode", "327075922"); businessAddress.put("countryCode", "US"); // Construct peopleOfSignificantControl address object -- part of peopleOfSignificantControl Map peopleOfSignificantControlAddress = new HashMap<>(); peopleOfSignificantControlAddress.put("addressOne", "123 Main St."); peopleOfSignificantControlAddress.put("addressTwo", "village"); peopleOfSignificantControlAddress.put("country", "US"); peopleOfSignificantControlAddress.put("stateProvince", "Texas"); peopleOfSignificantControlAddress.put("city", "Houston"); peopleOfSignificantControlAddress.put("postalCode", "73001"); // Construct List of peopleOfSignificantControl object -- part of businessInfo //Map peopleOfSignificantControl = new HashMap<>(); List> peopleOfSignificantControlList = new ArrayList<>(); Map peopleOfSignificantControl = new HashMap<>(); // Populate peopleOfSignificantControl peopleOfSignificantControl.put("firstGivenName", "Michael"); peopleOfSignificantControl.put("middleName", "J"); peopleOfSignificantControl.put("firstSurName", "Scott"); peopleOfSignificantControl.put("secondSurname", "Flax"); peopleOfSignificantControl.put("fullName", "Michael J Scott Flax"); peopleOfSignificantControl.put("businessName", "VERTEX AUTO CORP."); peopleOfSignificantControl.put("address", peopleOfSignificantControlAddress); peopleOfSignificantControlList.add(peopleOfSignificantControl); // Populate businessInfo businessInfo.put("name", "THE BAIT SHOP"); businessInfo.put("merchantUrl", "www.bait.com"); businessInfo.put("legalName", "BAIT R US"); businessInfo.put("address", businessAddress); businessInfo.put("jurisdiction", "FL"); businessInfo.put("ein", "123"); businessInfo.put("binBrn", "123"); businessInfo.put("peopleOfSignificantControl", peopleOfSignificantControlList); // Construct List of principalInfo object -- part of criteria List> principalInfoList = new ArrayList<>(); // Construct principal object -- part of principalInfo Map principal = new HashMap<>(); // Construct principal address object -- part of principal Map principalAddress = new HashMap<>(); principalAddress.put("streetAddressLine1", "1551 CROSSBEAM DR"); principalAddress.put("streetAddressLine2", "CASSELBERRY"); principalAddress.put("city", "Miami"); principalAddress.put("stateCode", "FL"); principalAddress.put("postalCode", "327075922"); principalAddress.put("countryCode", "US"); // Populate principal principal.put("firstName", "Joe"); principal.put("lastName", "Smith"); principal.put("dateOfBirth", "1970-03-09"); principal.put("address", principalAddress); //Add principal object to principalInfoList principalInfoList.add(principal); // Construct criteria object Map criteria = new HashMap<>(); criteria.put("requestingIca", "7919"); criteria.put("businessInfo", businessInfo); criteria.put("principalInfo", principalInfoList); // Add criteria inquiry.setCriteria(criteria); // Inquiry Reference Number will be returned on successful response InquiryReferenceWithMetadata irn; // Call the API InquiryApi api = new InquiryApi(client); irn = api.initiateInquiry(inquiry); // Use this IRN to track the request. You will need this in GET endpoint System.out.println(irn.getInquiryReferenceNumber()); // Get the risk rating reports from the GET endpoint InquiryResult result; // irn: obtained from the previous POST call for retrieving the results result = api.retrieveInquiry(irn.getInquiryReferenceNumber()); // The results will contain the ratings reports System.out.println(result); } catch (Exception e){ e.printStackTrace(); } } } ```