# Quick Start Guide
source: https://developer.mastercard.com/consumer-credit-analytics/documentation/quick-start-guide/index.md

## Overview {#overview}

### Before you begin {#before-you-begin}

* Create a [Mastercard Developers](https://developer.mastercard.com/) account.
* Have a secure place to store downloaded OAuth and encryption keys.
* Select the testing option to use: Postman, Insomnia, the reference application, or your own client.

## Sandbox checklist {#sandbox-checklist}

### Getting Started with the Consumer Credit Analytics API {#getting-started-with-the-consumer-credit-analytics-api}

| Step | What to Do  |                                                                                                                  Description                                                                                                                  |
|------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1    | Access      | Get access to the Consumer Credit Analytics API and create your Mastercard Developers project.                                                                                                                                                |
| 2    | Credentials | Generate your Sandbox OAuth credentials and record your consumer key.                                                                                                                                                                         |
| 3    | Encryption  | If testing API requests or other protected-payload flows, complete the field-level encryption configuration as described in **API Basics** before proceeding.                                                                                 |
| 4    | First Call  | Send your first Sandbox request using the Sandbox base URL and OAuth 1.0a signing.                                                                                                                                                            |
| 5    | Validation  | Use the sample response and the [Testing](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/index.md) page to validate test data, positive flows, and negative flows.                                          |
| 6    | Production  | After Sandbox validation is complete, follow Step 5 and the [Onboarding Checklist](https://developer.mastercard.com/consumer-credit-analytics/documentation/tutorials-and-guides/onboarding-checklist/index.md) to request Production access. |

## Step 1: Get access to API {#step-1-get-access-to-api}

1. Navigate to [Mastercard Developers](https://developer.mastercard.com/) and select Sign up to create an account.
2. Activate the account by opening the link sent to the registered email address, then sign in.
3. Request access to the API if required. APIs marked with a lock icon require permission to view documentation and create a project. Access is granted by submitting an access request form. After submission, an email confirmation is sent indicating whether access has been approved or denied.

## Step 2: Create a project and generate Sandbox credentials {#step-2-create-a-project-and-generate-sandbox-credentials}

To generate Sandbox and Production credentials, create a new Mastercard Developers project. Sandbox credentials provide access to a test environment with rich mocked data for learning and validation.

1. Navigate to the [My Projects](https://developer.mastercard.com/dashboard) page and select **Create new project**.
2. Enter a project name.
3. Verify that "Are you creating this project on behalf of a client?" is set to No (this option is selected by default).
4. Select Consumer Credit Analytics in the Select your API service drop-down list, then select **Proceed** . ![Project details](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/project-details.png)
5. Provide the service details by filling out the form and select **Proceed** . ![Project details](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/add-company-details.png) Note: Payment ICAs have a length of 4 to 6 digits and non-payment ICAs have a length of 7 to 11 digits.
6. Create and securely store a key alias and keystore password for the OAuth 1.0a project keys, then select **Proceed** . Alert: You must capture and store the key alias and keystore password. The keystore password is used in conjunction with the .p12 file and Client ID for OAuth authentication. ![Project Credentials](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/proj-credentials.png) Note: You can find more details about CSR [here](https://developer.mastercard.com/platform/documentation/security-and-authentication/csr-requirements/#overview).
7. Create and record a key alias and keystore password for the encryption keys, then select **Create Project** . Note: Create your credentials:
   * key alias: It must be 8 to 75 characters long and consist of only letters and numbers.
   * keystore password: It must be at least 8 characters long and include at least two of the following:
     * letters
     * numbers
     * symbols These credentials will be used to access the API.
   ![Additional Credentials](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/addi-credentials.png)
8. Select **Download key file** and securely store the OAuth and encryption keys, then select **Open Project** . Alert: Ensure that you store this file securely, as it will not be available for download later.

* **Mastercard encryption key:** The client will use this key (.p12 file) to decrypt responses received from the CCA API. Provide the key alias and keystore password that will be used for decrypting the response.
* **Client encryption key:** The client will use this key (.pem file) to encrypt the response before sending it to the CCA API. ![Open project](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/download-sandbox-credentials.png)

9. Select **View Documentation** to access tutorials, API specifications, test cases, FAQs, and other helpful materials. ![Summary](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/cca-summary.png) 10.Navigate to the **Sandbox credentials** page to manage the keys. ![Sandbox credentials](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/sandbox-cred.png)

## Step 3: Make your first Sandbox request {#step-3-make-your-first-sandbox-request}

Once you have Sandbox credentials, set up an environment for Mastercard reference application.

### Set up the Environment for Mastercard Reference Application {#set-up-the-environment-for-mastercard-reference-application}

1. Download a Reference Application.
   1. Download the reference application [consumercreditanalytics.zip](https://static.developer.mastercard.com/content/consumer-credit-analytics/consumercreditanalytics.zip) (34MB).
   2. Import the downloaded maven project into your IDE.
   3. Refer to the following steps to configure, you can also refer to readme.md in reference application.
2. Add Resources.
   1. Add the Consumer Credit Analytics API specification to your Maven project's resources folder.
   2. Add the generated Sandbox key (`.production.p12`) file, encryption cert (`.pem` file), and decryption key (`.encryption.mc.p12`) to the same resources folder. (These files are generated when you created the project on Mastercard Developers).
   3. Your Maven project directory structure should now resemble the following: ![Maven Project Directory](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/add_resource1.png)
3. Configure `application.properties`.

```XML

##################################################################
# Connection
##################################################################
# This is the static field, referring to the sandbox endpoint
mastercard.api.base-path=https://sandbox.api.mastercard.com/consumer/credit-analytics
##################################################################
# Authentication
##################################################################
# Refer to https://developer.mastercard.com for details.
# Copy the .p12 file in src/main/resources and set the value as classpath:Loyalty_User_Management-sandbox.p12
mastercard.api.key-file=classpath:keyalias-production.p12
# The consumer key. Copy it from the "Sandbox/Production Keys" section on your project page at https://developer.mastercard.com
# For example, ylk2Y6cDCk9lDnLxl06SE7ovx2q3eoWLRBMKxTvF2b3c2228!248b2788cfd74ec8b0b8b3fd1eeb93960000000000000000
mastercard.api.consumer-key=yEQ9bZGHm5P9B-c4uzTUUDnEMurG6CkwQEF6C5YJ47a11571!f82e1e20515a4d2dab074d10a3a0aae30000000000000000
# key alias. The default key alias for the sandbox is "keyalias" (without quotes)
mastercard.api.keystore-alias=keyalias
# keystore password. The default keystore password for the sandbox project is "p@ssword" (without quotes)
mastercard.api.keystore-password=p@ssword
##################################################################
# Encryption and Decryption
##################################################################
# A certificate (PEM) file whose public key will be used for encryption.
# Copy the .pem file in src/main/resources and set the value as classpath:LoyaltyUserManagementClientEnc.pem
mastercard.api.encryption-certificate-file=classpath:consumercreditriskClientEnc1669986194333.pem
# The SHA-256 hex-encoded digest of the key used for encryption.
# For example, a36a78ddb31a3bb01e6e2887097a53ee85e51755a0db6e9ea56c4b5780182598
mastercard.api.encryption-key-fingerprint=7978b006e1fff2d3c815adf8955daf3c7495d17e69f3a427dfd85e2c2c06e94c
# Decryption key file.
# Copy the .p12 file in src/main/resources and set the value as classpath:keyalias-encryption-mc.p12
mastercard.api.decryption-key-file=classpath:keyalias-encryption-mc.p12
# Decryption key alias.
# Note: Always keep your private signing keys safe in a password-protected or hardware key store!
mastercard.api.decryption-key-alias=keyalias
# Decryption keystore password.
# Note: Always keep your private signing keys safe, in a password-protected or hardware key store!
mastercard.api.decryption-keystore-password=p@ssword
```

#### Connection settings {#connection-settings}

**mastercard.api.base-path**

Specify the [domain URL](https://developer.mastercard.com/consumer-credit-analytics/documentation/api-reference/index.md) for the environment that you want to access.

#### Authentication settings {#authentication-settings}

**mastercard.api.key-file**

* For the sandbox environment, copy the `<keyalias>.sandbox.p12` file (downloaded during sandbox project creation) to the Resources folder in your application. Paste the file name in this property.
* For the production environment, copy the `<keyalias>.production.p12` file (downloaded during production project creation) to the Resources folder in your application. Paste the file name in this property.

**mastercard.api.consumer-key**

* For the sandbox environment, use the Consumer Key generated when the sandbox project was created.
* For the production environment, use the Consumer Key generated when the production project was created.

**mastercard.api.keystore-alias**

* For the sandbox URL, use the Key Alias specified in the readme file downloaded during sandbox project creation.
* For the production URL, use the Key Alias that you provided when creating the production project.

**mastercard.api.keystore-password**

* For the sandbox URL, use the Keystore password specified in the readme file downloaded during sandbox project creation.
* For the production URL, use the Keystore password that you provided when creating the production project.

<br />

#### Encryption and decryption settings {#encryption-and-decryption-settings}

**mastercard.api.encryption-certificate-file**

* For the sandbox environment, copy the `.pem` file (downloaded during sandbox project creation) to the Resources folder in your application. Paste the file name in this property.
* For the production URL, copy the `.pem` file (downloaded during production project creation) to the Resources folder in your application. Paste the file name in this property.

**mastercard.api.encryption-key-fingerprint**

* Copy the corresponding fingerprint visible under the Client Encryption key after project creation, based on the environment that you are accessing.

**mastercard.api.decryption-key-file**

* For the production environment, copy the `<keyalias>.encryption.mc.p12` file (downloaded during production project creation) to the Resources folder in your application. Paste the file name in this property.
* For the sandbox environment, follow the same steps as for production.

**mastercard.api.decryption-key-alias**

* For the sandbox URL, use the Key Alias provided during the encryption key creation for the sandbox project.
* For the production URL, use the Key Alias that you provided when creating encryption keys for the production project.

**mastercard.api.decryption-keystore-password**

* For the sandbox URL, use the Keystore password provided during the encryption key creation for the sandbox project
* For the production URL, use the Keystore password provided during the creation of encryption keys for the production project.

## Step 4: Choose how you want to test and integrate {#step-4-choose-how-you-want-to-test-and-integrate}

### Generate the API client {#generate-the-api-client}

1. With all the necessary dependencies in place, you can now generate the source code. Open a terminal window, navigate to the project's root directory, and execute the command `mvn clean compile`. ![Maven MVN Clean](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/gent_api_client_1.png)
2. A folder named **target** is created in your root directory. This folder contains the classes generated for the schemas and API calls defined in the OpenAPI Specification. You can find the generated classes within the target folder, as illustrated below: ![Root Directory](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/gnt_api_client_2.png)

When your application is configured according to the steps outlined above, you can access the API by running the Application class.

### Create your Standalone application {#create-your-standalone-application}

1. Create a Maven Project.
   1. In the IDE, create a new Maven project, which will automatically set up the directory structure for you.
   2. Provide an appropriate ArtifactId and Project name.
2. Download and add [consumer-credit-analytics.yaml](https://static.developer.mastercard.com/content/consumer-credit-analytics/swagger/consumer-credit-analytics.yaml) (22KB) file in resources folder.
3. Update the Configuration (pom.xml) file.
   1. In your IDE, add the OpenAPI Generator Maven plugin to your project pom.xml file. Use the following plugin configuration:
      * XML

      ```XML
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openapitools</groupId>
                        <artifactId>openapi-generator-maven-plugin</artifactId>
                        <version>${openapi-generator.version}</version>
                        <executions>
                            <execution>
                                <id>Consumer Credit Analytics API Client</id>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <inputSpec>${project.basedir}/src/main/resources/consumer-credit-analytics.yaml</inputSpec>
                                    <generatorName>java</generatorName>
                                    <library>okhttp-gson</library>
                                    <generateApiTests>false</generateApiTests>
                                    <generateModelTests>false</generateModelTests>
                                    <configOptions>
                                        <sourceFolder>src/gen/main/java</sourceFolder>
                                        <dateLibrary>java8</dateLibrary>
                                    </configOptions>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
      ```

      Note: [OpenAPI Generator](https://openapi-generator.tech/) generates API client libraries using OpenAPI Specification. It provides multiple generators and library templates to support multiple languages and frameworks. We will use the Java generator for this project.
4. Add the following dependencies to your pom.xml file

* XML

```XML
 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.2</version>
        <relativePath/> <!-- lookup parent from repository -->
 </parent>

<properties>
    <java.version>1.8</java.version>
    <openapi-generator.version>5.3.1</openapi-generator.version>
    <oauth1-signer.version>1.5.1</oauth1-signer.version>
    <client-encryption.version>1.7.4</client-encryption.version>
    <nimbusds-jose-jwt.version>9.0</nimbusds-jose-jwt.version>
    <okhttp3.version>4.9.3</okhttp3.version>
    <swagger-parser.version>2.0.28</swagger-parser.version>
    <commons-lang3.version>3.12.0</commons-lang3.version>
    <gson.version>2.8.9</gson.version>
    <gson-fire.version>1.8.5</gson-fire.version>
</properties>

<dependencies>
    <dependency>
        <groupId>io.swagger.parser.v3</groupId>
        <artifactId>swagger-parser</artifactId>
        <version>${swagger-parser.version}</version>
    </dependency>
    <dependency>
        <groupId>com.mastercard.developer</groupId>
        <artifactId>oauth1-signer</artifactId>
        <version>${oauth1-signer.version}</version>
    </dependency>
    <dependency>
        <groupId>com.mastercard.developer</groupId>
        <artifactId>client-encryption</artifactId>
        <version>${client-encryption.version}</version>
    </dependency>
    <dependency>
        <groupId>com.nimbusds</groupId>
        <artifactId>nimbus-jose-jwt</artifactId>
        <version>${nimbusds-jose-jwt.version}</version>
    </dependency>
    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>${okhttp3.version}</version>
    </dependency>
    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>logging-interceptor</artifactId>
        <version>${okhttp3.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>${gson.version}</version>
    </dependency>
    <dependency>
        <groupId>io.gsonfire</groupId>
        <artifactId>gson-fire</artifactId>
        <version>${gson-fire.version}</version>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

</dependencies>
```

3. Run a Maven clean to remove any previously compiled files.

4. Execute Maven install to download the required dependencies and generate the necessary classes from the YAML file.

5. Once the build is complete, refresh the Maven project in IntelliJ IDEA to ensure the changes are properly synchronized.

6. Under the **src/main/java/** folder path, create a Java file named **ConsumerCreditAnalyticsMain.java**.

7. To make the API call, you need to make your OAuth credentials available to the program for use.

   * Java

   ```java
     String consumerKey = "your consumer key";
     String signingKeyFilePath = "/path/to/your/signing-key.p12";
     String signingKeyAlias = "your key alias";
     String signingKeystorePassword = "your keystore password";
     PrivateKey signingKey = AuthenticationUtils.loadSigningKey(signingKeyFilePath, signingKeyAlias, signingKeystorePassword);
   ```

   <br />

8. For encryption and decryption, you must provide an encryption certificate file, decryption private key, and decryption key credentials from a password-protected or hardware key store!

   * Java

   ```java
   String encryptionCertificateFilePath = "/path/to/your/client/encryption-certificate-file.pem";
   String encryptionKeyFingerprint = "your client encryption key fingerprint";
   String decryptionKeyFilePath = "/path/to/your/decryption/private-key.p12";
   String decryptionKeyAlias = "your decryption key alias";
   String decryptionKeystorePassword = "your decryption keystore password";
   ```

   <br />

9. Instantiate a client with your authentication credentials and configuration object as interceptors before you can send it.

   * Java

   ```java
   ApiClient client = new ApiClient();
   client.setBasePath("https://sandbox.api.mastercard.com/consumer/credit-analytics");
   client.setDebugging(true);
   client.setReadTimeout(40000);

   // Configure the Mastercard service URL
   client.setHttpClient(client.getHttpClient().newBuilder()
   .addInterceptor(new OkHttpJweInterceptor(jweConfig))
   .addInterceptor(new OkHttpOAuth1Interceptor(consumerKey, signingKey))
   .build());

   ```

   Note: OkHttpJweInterceptor class from the Mastercard [client encryption library](https://github.com/Mastercard?q=client-encryption) will help to encrypt request and decrypt response. Check the [encryption documentation](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/) for more details.

   <br />

10. Enable encryption and decryption.

    1. Locate the encryption certificate and decryption key that you got after creating the project in Mastercard Developers.
    2. Create a configuration object to instruct the encryption library, which fields to encrypt and decrypt.

* Java

```java
Certificate certificate = EncryptionUtils.loadEncryptionCertificate(encryptionCertificateFilePath);
PrivateKey decryptionKey = EncryptionUtils.loadDecryptionKey(decryptionKeyFilePath, decryptionKeyAlias, decryptionKeystorePassword);

JweConfig jweConfig = JweConfigBuilder.aJweEncryptionConfig()
.withEncryptionCertificate(certificate)
.withEncryptionKeyFingerprint(encryptionKeyFingerprint)
.withDecryptionKey(decryptionKey)
.withEncryptionPath("$","$")
.withDecryptionPath("$.encryptedData","$")
.build();

```

### Issue API Requests {#issue-api-requests}

Start issuing API requests now that you have your ApiClient.

### Issue the POST /scores API requests {#issue-the-post-scores-api-requests}

* Java

```java
                ArrayList<CustomerPAN> cardNumberList = new ArrayList<>();
                CustomerPAN customerPAN = new CustomerPAN();
                customerPAN.setCustomerPAN("5425233430109903");
                customerPAN.setHasConsent(true);
                cardNumberList.add(customerPAN);
                CustomerPAN customerPAN1 = new CustomerPAN();
                customerPAN1.setCustomerPAN("5408577159639842");
                customerPAN1.setHasConsent(true);
                cardNumberList.add(customerPAN1);

                ConsumerCreditAnalytics consumerCreditAnalytics = createConsumerCreditAnalyticsObject("USA", true, cardNumberList,
                new ArrayList<>(List.of("DELINQUENCY")), new ArrayList<>(List.of("CREDIT_CARD")));

                ScoresApi scoresApi = new ScoresApi(client);
                ConsumerCreditAnalyticsScore consumerCreditAnalyticsScore = scoresApi.getScores(consumerCreditAnalytics);
            
```

### Full Code Sample

* Java

```java
    import com.mastercard.developer.encryption.JweConfig;
    import com.mastercard.developer.encryption.JweConfigBuilder;
    import com.mastercard.developer.interceptors.OkHttpJweInterceptor;
    import com.mastercard.developer.interceptors.OkHttpOAuth1Interceptor;
    import com.mastercard.developer.utils.AuthenticationUtils;
    import com.mastercard.developer.utils.EncryptionUtils;
    import org.openapitools.client.ApiClient;
    import org.openapitools.client.api.ConsumerCreditScoresApi;
    import org.openapitools.client.model.ConsumerCreditAnalytics;
    import org.openapitools.client.model.ConsumerCreditAnalyticsScore;
    import org.openapitools.client.model.CustomerPAN;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
 
    import java.security.PrivateKey;
    import java.security.cert.Certificate;
    import java.util.ArrayList;
    import java.util.List;

    public class ConsumerCreditAnalyticsMain {
 
    private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerCreditAnalyticsMain.class);
 
    public static void main(String[] args) throws Exception {
 
 
        // Provide your consumer key and OAuth signing key credentials from application.properties or customizable parameter.
        String consumerKey = "your consumer key";
        String signingKeyFilePath = "/path/to/your/signing-key.p12";
        String signingKeyAlias = "your key alias";
        String signingKeystorePassword = "your keystore password";
        PrivateKey signingKey = AuthenticationUtils.loadSigningKey(signingKeyFilePath, signingKeyAlias, signingKeystorePassword);
 
        // Provide your encryption certificate file, decryption private key, and decryption key credentials from a password-protected or hardware key store!
        String encryptionCertificateFilePath = "/path/to/your/client/encryption-certificate-file.pem";
        String encryptionKeyFingerprint = "your client encryption key fingerprint";
        String decryptionKeyFilePath = "/path/to/your/decryption/private-key.p12";
        String decryptionKeyAlias = "your decryption key alias";
        String decryptionKeystorePassword = "your decryption keystore password";
 
        Certificate certificate = EncryptionUtils.loadEncryptionCertificate(encryptionCertificateFilePath);
        PrivateKey decryptionKey = EncryptionUtils.loadDecryptionKey(decryptionKeyFilePath, decryptionKeyAlias, decryptionKeystorePassword);
 
        JweConfig jweConfig = JweConfigBuilder.aJweEncryptionConfig()
                .withEncryptionCertificate(certificate)
                .withEncryptionKeyFingerprint(encryptionKeyFingerprint)
                .withDecryptionKey(decryptionKey)
                .withEncryptionPath("$","$")
                .withDecryptionPath("$.encryptedData","$")
                .build();
 
        // Instantiate API client and configure it
        ApiClient client = new ApiClient();
        client.setBasePath("https://sandbox.api.mastercard.com/consumer/credit-analytics");
        client.setDebugging(true);
        client.setReadTimeout(40000);
 
        // Configure the Mastercard service URL
        client.setHttpClient(client.getHttpClient().newBuilder()
                .addInterceptor(new OkHttpJweInterceptor(jweConfig))
                .addInterceptor(new OkHttpOAuth1Interceptor(consumerKey, signingKey))
                .build());
 
        ConsumerCreditScoresApi scoresApi = new ConsumerCreditScoresApi(client);
        LOGGER.info("<-- CALLING CCA Scores ENDPOINT -->");
        ConsumerCreditAnalyticsScore consumerCreditAnalyticsScore = scoresApi.getScores(getScoresRequest());
        LOGGER.info("<-- Scores retrieved SUCCESSFULLY -->");
 
    }
 
    public static ConsumerCreditAnalytics getScoresRequest() {
        // New ConsumerCreditAnalyticsObject request
        ArrayList<CustomerPAN> cardNumberList = new ArrayList<>();
        CustomerPAN customerPAN = new CustomerPAN();
        customerPAN.setCustomerPAN("5425233430109903");
        customerPAN.setHasConsent(true);
        cardNumberList.add(customerPAN);
        CustomerPAN customerPAN1 = new CustomerPAN();
        customerPAN1.setCustomerPAN("5408577159639842");
        customerPAN1.setHasConsent(true);
        cardNumberList.add(customerPAN1);
        ConsumerCreditAnalytics consumerCreditAnalytics = createConsumerCreditAnalyticsObject("USA", true, cardNumberList,
                new ArrayList<>(List.of("DELINQUENCY")), new ArrayList<>(List.of("CREDIT_CARD")));
 
        return consumerCreditAnalytics;
    }
 
    public static ConsumerCreditAnalytics createConsumerCreditAnalyticsObject(String countryCode, boolean hasEmbedding, List<CustomerPAN> customerPANs,
                                                                              List<String> scoreTypes, List<String> productTypes) {
        ConsumerCreditAnalytics consumerCreditAnalyticsRequest = new ConsumerCreditAnalytics();
        consumerCreditAnalyticsRequest.setCountryCode(countryCode);
        consumerCreditAnalyticsRequest.setHasEmbedding(hasEmbedding);
        consumerCreditAnalyticsRequest.setScoreTypes(scoreTypes);
        consumerCreditAnalyticsRequest.setProductTypes(productTypes);
        consumerCreditAnalyticsRequest.setCustomerPANs(customerPANs);
        return consumerCreditAnalyticsRequest;
    }
}
```

Note: If you are not using the sample code above to make an API call, then you must create an encrypted request using the [JWE encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/#jwe-encryption).

Your complete request payload must be encrypted with a .PEM file, which is downloaded while creating the project, and that encrypted payload can be sent to the CCA API. The API sends responses in an encrypted format, which can be decrypted with the .p12 downloaded while creating the project.

### Sample Encrypted Request and Response

* Json

```json
-----------Sample Payload to be encrypted------------
{
  "hasEmbedding": true,
  "countryCode": "USA",
  "customerPANs": [
    {
      "customerPAN": "5336210000002540",
      "hasConsent": true
    },
    {
      "customerPAN": "5336210000002541",
      "hasConsent": true
    }
  ],
  "scoreTypes": [
    "DELINQUENCY"
  ],
  "productTypes": [
    "CREDIT_CARD"
  ]
}
 
--------Payload after encryption----------
{
  "encryptedData": "eyJraWQiOiI0ZTgxMDczNzI1ZGU4MGI3MTQzNDNiMWQ1ZTJjYmI3Nzg0MGE1YzMwZjAyNjYxZTk1YjU0YTg1MGY5IiwiY3R5IjoiYXBwbGljYXRpb24vanNvbiIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJSU0EtT0FFUC0yNTYifQ.TTW0rrj0hJgjQUEEWsrmQB4UZmIvlJ1FwBrqG-eUWEQB3C4ZwyGoaTLGzJVtEFqYSJDHkoKB-D_hNQWqS4H3Xjx1Ecspc2cijsHvB9QgAxKs0kxyIM5ceUTCAr1ko5R25Vl0Gqnql0Sp_Q_ccYq_CQps_wHVIQUSZQKdIADBvXiytKCIxqq1ccNeY3RYJLkp7DpUCgllsIo_BxIM6A7KZHhdibnYBXiJPuDZsOrNMndKlrs_JMbVSfFlg5RI5CSdnDndl0uzfpzec9reXkSiu2XtQcw2AodKh_NezTFfwI7JYxAR0e6K8BA-N-LCy5X9Z0sWGn8ZA.TfjA6xeEMHVLoUs_lJLTwg.U-Rxhv-AJ1G08Cd4LRipvZWtOaKFLYZ0aqZ02iza_x0hwLQCH0pKJXeStIfAzbec3m7LYrV72PbtSvnbqWt0TEMpMsBou7T2aUzmQN_gJeihfDfUVFr-DhIftsB0Gz1wwl9xE89ShWPagV2ITjxTmZG2_9P2MktDIqoExUnJ-gPa5tdHyZeSSIlfO9V1TxyMKVoNQc8Zpx1amJSBtJdEFRT4Gd2HqESMSJph3GvLDyZzZX1IOhdHkF-zTI60MfJZD3Ozu7nDpjN-jplHKBdUG42-VgXIZJqoaq0fF1UZnrUd-66mBBEMUHGXy3oJKieibJabjbIgjTrzeR0wXJP2NmsCprdvra5upRHQ4id5gnA.KtInYnJoEy8I7c2W_pgMgw"
}
 
 
---------------Sample response before decryption-----------------
{
  "encryptedData": "eyJraWQiOiJhMzYyNjI5NTMyNzBhODY0YmI4MDgyNzI1MzBhMTQ1Y2NhOTJjYzIwMDliYTFmZjZjN2Q2MTAzODI2ZWFlNGZC0yNTYifQ.1fO1u-q2UqRCE-qOyRr-PtY2gtgAkozI3o-JP8uyi4QbMPwhUVDByan_bM2dmiko0ZUEEDow90Q.hZFiORkpH4IZdUFJJHnsfg.E35eLwt8pTxD0mepuROLwE86WZCuhq7hHBSLZCKVw-QuUER0DTai4sAwMu4yo80M8ixgZHhx33quLqWSH6do-i253NLTDc7AXQ8rvCKXu6RbWCUWKZmK7hrAjjcs7KIn-A9qQ-WZNs_geDuQTSMwdat6xu9TDP1pw3xiyURUelzvOjHTJzyZoDVbGHET53ErMuZ2N98Ng4VmKgHBPWzsIHBPrnui79OGitaEdrDJ6QD7saNalBzi9SL2V1LR3AE2xSm-IfIbFDvuuemLCecwrK6aithCeUcT1y5v1d4k4dqfK5r-8ji90juVo3vphxIw2S7nMcZ81AgahQIYCmAaf4FFW1wxI4eqAB2Rww.C2STtjFSvFYGgn6cTsRxbw"
}
 
---------------Sample response after decryption-----------------
{
  "predictionDataSuccesses": [
    {
      "customerPAN": "5336210000002540",
      "scores": [
        {
          "scoreType": "DELINQUENCY",
          "productType": "CREDIT_CARD",
          "score": 678,
          "decile": 20,
          "modelName": "CCA_CCS_Del_M1_v1.0",
          "embeddingFeatures": "{f1:0.113484,f2:0.113484,f3:0.070811,f4:0.059630,f5:0.051926,f6:0.044747,f7:0.042843,f8:0.039946,f9:0.039111,f10:0.033302,f11:0.027863,f12:0.025530,f13:0.024628,f14:0.023502,f15:0.020766,f16:0.020333}",
          "hasScoreChangedFromLastWeek": false,
          "isNewProspect": false
        }
      ]
    }
  ],
  "predictionDataErrors": [
    {
      "customerPAN": "5336210000002541",
      "errors": [
        {
          "reasonCode": "PAN_NOT_FOUND",
          "errorMessage": "This error is thrown when a PAN number is not found in Mastercard's database. Check with the consumer for alternate primary Mastercard Debit/Credit Card Number."
        }
      ]
    }
  ]
}
```

### Issue the POST /metrics API requests {#issue-the-post-metrics-api-requests}

* Java

```java
                 ConsumerCreditAnalyticsMetrics consumerCreditAnalyticsMetrics = new ConsumerCreditAnalyticsMetrics();
                 consumerCreditAnalyticsMetrics.setCustomerPAN("5425233430109903");
                 consumerCreditAnalyticsMetrics.setHasConsent(true);
                 consumerCreditAnalyticsMetrics.setProductType("CREDIT_CARD");
                 consumerCreditAnalyticsMetrics.setCountryCode("USA");
 
                 MastercardTransactionMetricsApi metricsApi = new MastercardTransactionMetricsApi(client);
                 MastercardTransactionMetrics mastercardTransactionMetrics = metricsApi.getMetrics(consumerCreditAnalyticsMetrics );
              
```

### Full Code Sample

* Java

```java
    import com.mastercard.developer.encryption.JweConfig;
    import com.mastercard.developer.encryption.JweConfigBuilder;
    import com.mastercard.developer.interceptors.OkHttpJweInterceptor;
    import com.mastercard.developer.interceptors.OkHttpOAuth1Interceptor;
    import com.mastercard.developer.utils.AuthenticationUtils;
    import com.mastercard.developer.utils.EncryptionUtils;
    import org.openapitools.client.ApiClient;
    import org.openapitools.client.api.MastercardTransactionMetricsApi;
    import org.openapitools.client.model.ConsumerCreditAnalyticsMetrics;
    import org.openapitools.client.model.MastercardTransactionMetrics;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
 
    import java.security.PrivateKey;
    import java.security.cert.Certificate;
 
    public class ConsumerCreditAnalyticsMain {
 
    private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerCreditAnalyticsMain.class);
 
    public static void main(String[] args) throws Exception {
 
 
        // Provide your consumer key and OAuth signing key credentials from application.properties or customizable parameter.
        String consumerKey = "your consumer key";
        String signingKeyFilePath = "/path/to/your/signing-key.p12";
        String signingKeyAlias = "your key alias";
        String signingKeystorePassword = "your keystore password";
        PrivateKey signingKey = AuthenticationUtils.loadSigningKey(signingKeyFilePath, signingKeyAlias, signingKeystorePassword);
 
        // Provide your encryption certificate file, decryption private key, and decryption key credentials from a password-protected or hardware key store!
        String encryptionCertificateFilePath = "/path/to/your/client/encryption-certificate-file.pem";
        String encryptionKeyFingerprint = "your client encryption key fingerprint";
        String decryptionKeyFilePath = "/path/to/your/decryption/private-key.p12";
        String decryptionKeyAlias = "your decryption key alias";
        String decryptionKeystorePassword = "your decryption keystore password";
 
        Certificate certificate = EncryptionUtils.loadEncryptionCertificate(encryptionCertificateFilePath);
        PrivateKey decryptionKey = EncryptionUtils.loadDecryptionKey(decryptionKeyFilePath, decryptionKeyAlias, decryptionKeystorePassword);
 
        JweConfig jweConfig = JweConfigBuilder.aJweEncryptionConfig()
                .withEncryptionCertificate(certificate)
                .withEncryptionKeyFingerprint(encryptionKeyFingerprint)
                .withDecryptionKey(decryptionKey)
                .withEncryptionPath("$","$")
                .withDecryptionPath("$.encryptedData","$")
                .build();
 
        // Instantiate API client and configure it
        ApiClient client = new ApiClient();
        client.setBasePath("https://sandbox.api.mastercard.com/consumer/credit-analytics");
        client.setDebugging(true);
        client.setReadTimeout(40000);
 
        // Configure the Mastercard service URL
        client.setHttpClient(client.getHttpClient().newBuilder()
                .addInterceptor(new OkHttpJweInterceptor(jweConfig))
                .addInterceptor(new OkHttpOAuth1Interceptor(consumerKey, signingKey))
                .build());
 
        MastercardTransactionMetricsApi metricsApi = new MastercardTransactionMetricsApi(client);
        LOGGER.info("<-- CALLING CCA Metrics ENDPOINT -->");
        MastercardTransactionMetrics mastercardTransactionMetrics = metricsApi.getMetrics(getMetricsRequest());
        LOGGER.info(mastercardTransactionMetrics.toString());
        LOGGER.info("<-- Scores retrieved SUCCESSFULLY -->");
 
    }
 
    public static ConsumerCreditAnalyticsMetrics getMetricsRequest() {
        ConsumerCreditAnalyticsMetrics consumerCreditAnalyticsMetrics = new ConsumerCreditAnalyticsMetrics();
        consumerCreditAnalyticsMetrics.setCustomerPAN("5425233430109903");
        consumerCreditAnalyticsMetrics.setHasConsent(true);
        consumerCreditAnalyticsMetrics.setProductType("CREDIT_CARD");
        consumerCreditAnalyticsMetrics.setCountryCode("USA");
        return consumerCreditAnalyticsMetrics;
    }
}
```

Note: If you are not using the sample code above to make an API call, then you must create an encrypted request using the [JWE encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/#jwe-encryption).

Your complete request payload must be encrypted with a .PEM file, which is downloaded while creating the project, and that encrypted payload can be sent to the CCA API. The API sends responses in an encrypted format, which can be decrypted with the .p12 downloaded while creating the project.

### Sample Encrypted Request and Response

* Json

```json
-----------Sample Payload to be encrypted------------
{
  "countryCode": "USA",
  "customerPAN": "5425233430109903",
  "productType": "CREDIT_CARD",
  "hasConsent": true
}
--------Payload after encryption----------
{
  "encryptedData": "eyJraWQiOiI0ZTgxMDczNzI1ZGU4MGI3MTQzNDNiMWQ1ZTJjYmI3Nzg0MGE1YzMwZjAyNjYxZTk1YjU0YTg1MGY5IiwiY3R5IjoiYXBwbGljYXRpb24vanNvbiIsImVuYyI6IkEyNTZHQ00iLCJhbGciOiJSU0EtT0FFUC0yNTYifQ.TTW0rrj0hJgjQUEEWsrmQB4UZmIvlJ1FwBrqG-eUWEQB3C4ZwyGoaTLGzJVtEFqYSJDHkoKB-D_hNQWqS4H3Xjx1Ecspc2cijsHvB9QgAxKs0kxyIM5ceUTCAr1ko5R25Vl0Gqnql0Sp_Q_ccYq_CQps_wHVIQUSZQKdIADBvXiytKCIxqq1ccNeY3RYJLkp7DpUCgllsIo_BxIM6A7KZHhdibnYBXiJPuDZsOrNMndKlrs_JMbVSfFlg5RI5CSdnDndl0uzfpzec9reXkSiu2XtQcw2AodKh_NezTFfwI7JYxAR0e6K8BA-N-LCy5X9Z0sWGn8ZA.TfjA6xeEMHVLoUs_lJLTwg.U-Rxhv-AJ1G08Cd4LRipvZWtOaKFLYZ0aqZ02iza_x0hwLQCH0pKJXeStIfAzbec3m7LYrV72PbtSvnbqWt0TEMpMsBou7T2aUzmQN_gJeihfDfUVFr-DhIftsB0Gz1wwl9xE89ShWPagV2ITjxTmZG2_9P2MktDIqoExUnJ-gPa5tdHyZeSSIlfO9V1TxyMKVoNQc8Zpx1amJSBtJdEFRT4Gd2HqESMSJph3GvLDyZzZX1IOhdHkF-zTI60MfJZD3Ozu7nDpjN-jplHKBdUG42-VgXIZJqoaq0fF1UZnrUd-66mBBEMUHGXy3oJKieibJabjbIgjTrzeR0wXJP2NmsCprdvra5upRHQ4id5gnA.KtInYnJoEy8I7c2W_pgMgw"
}
---------------Sample response before decryption-----------------
{
  "encryptedData": "eyJraWQiOiJhMzYyNjI5NTMyNzBhODY0YmI4MDgyNzI1MzBhMTQ1Y2NhOTJjYzIwMDliYTFmZjZjN2Q2MTAzODI2ZWFlNGZC0yNTYifQ.1fO1u-q2UqRCE-qOyRr-PtY2gtgAkozI3o-JP8uyi4QbMPwhUVDByan_bM2dmiko0ZUEEDow90Q.hZFiORkpH4IZdUFJJHnsfg.E35eLwt8pTxD0mepuROLwE86WZCuhq7hHBSLZCKVw-QuUER0DTai4sAwMu4yo80M8ixgZHhx33quLqWSH6do-i253NLTDc7AXQ8rvCKXu6RbWCUWKZmK7hrAjjcs7KIn-A9qQ-WZNs_geDuQTSMwdat6xu9TDP1pw3xiyURUelzvOjHTJzyZoDVbGHET53ErMuZ2N98Ng4VmKgHBPWzsIHBPrnui79OGitaEdrDJ6QD7saNalBzi9SL2V1LR3AE2xSm-IfIbFDvuuemLCecwrK6aithCeUcT1y5v1d4k4dqfK5r-8ji90juVo3vphxIw2S7nMcZ81AgahQIYCmAaf4FFW1wxI4eqAB2Rww.C2STtjFSvFYGgn6cTsRxbw"
}
---------------Sample response after decryption-----------------
{
    "customerPAN": "5255923576711240",
    "isNewProspect": false,
    "productType": "CREDIT_CARD",
    "mtmMetrics": {
        "core": "{\"core_dom_txn_amt_pct_12m\":9.94,\"core_xb_txn_amt_1m\":4623.0,\"core_onl_txn_amt_1m\":300.0,\"core_recur_txn_amt_6m\":140.0,\"core_gro_txn_amt_pct_6m\":1.92,\"core_trv_txn_amt_pct_3m\":5.86,\"core_dom_txn_cnt_3m\":40,\"core_nec_txn_amt_pct_12m\":19.68,\"core_fue_txn_cnt_3m\":21,\"core_utl_txn_cnt_3m\":86,\"core_dis_txn_cnt_3m\":2684,\"core_recur_txn_amt_12m\":1600.0,\"core_txn_amt_3m\":5052.0,\"core_ris_txn_cnt_12m\":214,\"core_cas_txn_amt_pct_3m\":0.95,\"core_xb_txn_cnt_6m\":5101,\"core_cas_txn_cnt_12m\":51,\"core_onl_txn_amt_12m\":400.0,\"core_cas_txn_cnt_1m\":48,\"core_nic_txn_amt_pct_12m\":53.33,\"core_nfc_avg_txn_cnt_12m\":8.3,\"core_nec_txn_amt_pct_6m\":19.69,\"core_lux_txn_cnt_1m\":316,\"core_blp_txn_amt_pct_1m\":4.06,\"core_tkn_txn_amt_1m\":500.0,\"core_hcs_txn_amt_pct_1m\":0.04,\"core_eap_txn_amt_pct_3m\":1.62,\"core_utl_txn_amt_pct_12m\":1.66,\"core_dis_txn_amt_pct_3m\":54.02,\"core_lux_txn_amt_pct_1m\":6.24,\"core_hcs_txn_amt_pct_12m\":0.1,\"core_nic_to_nec_txn_amt_ratio_6m\":2.7,\"core_dom_txn_cnt_1m\":35,\"core_tkn_txn_cnt_3m\":200,\"core_nag_txn_amt_pct_6m\":23.39,\"core_nfc_avg_txn_cnt_6m\":83.3,\"core_blp_txn_cnt_6m\":210,\"core_nag_txn_cnt_6m\":1229,\"core_ris_txn_amt_pct_3m\":4.06,\"core_eap_txn_amt_pct_1m\":1.64,\"core_eds_txn_cnt_3m\":89,\"core_lux_to_nec_txn_amt_ratio_12m\":0.3,\"core_tkn_txn_amt_3m\":400.0,\"core_lux_txn_cnt_3m\":323,\"core_trv_txn_amt_pct_6m\":5.84,\"core_hcs_txn_amt_pct_3m\":0.06,\"core_cas_txn_cnt_3m\":49,\"core_txn_amt_6m\":5151.0,\"core_recur_txn_cnt_12m\":1455,\"core_dom_txn_amt_12m\":522.0,\"core_lastseen_date\":\"2024-05-05\",\"core_dis_txn_amt_pct_1m\":53.97,\"core_cas_txn_amt_pct_1m\":0.95,\"core_utl_txn_cnt_6m\":87,\"core_dis_txn_cnt_6m\":2740,\"core_onl_txn_cnt_6m\":600,\"core_lux_txn_amt_pct_3m\":6.25,\"core_nic_txn_cnt_1m\":2591,\"core_tkn_txn_cnt_12m\":500,\"core_nec_txn_cnt_1m\":995,\"core_xb_txn_cnt_3m\":5010,\"core_blp_txn_amt_pct_6m\":4.02,\"core_ins_txn_cnt_1m\":9,\"core_avg_ticket_size_3m\":1.0,\"core_months_on_book\":4,\"core_gro_txn_amt_pct_1m\":1.96,\"core_fue_txn_cnt_12m\":23,\"core_tkn_txn_cnt_1m\":500,\"core_onl_txn_cnt_3m\":300,\"core_nag_txn_cnt_3m\":1205,\"core_hcs_txn_cnt_6m\":5,\"core_dis_txn_amt_pct_6m\":54.07,\"core_ins_txn_amt_pct_1m\":0.16,\"core_onl_txn_amt_6m\":100.0,\"core_ins_txn_cnt_12m\":12,\"core_dis_txn_cnt_12m\":2796,\"core_cte_txn_cnt_12m\":128,\"core_eds_txn_cnt_1m\":87,\"core_hcs_txn_cnt_12m\":6,\"core_xb_txn_amt_pct_12m\":90.06,\"core_nic_to_nec_txn_amt_ratio_3m\":2.7,\"core_txn_amt_12m\":5250.0,\"core_cas_txn_amt_pct_6m\":0.95,\"core_fue_txn_amt_pct_12m\":0.42,\"core_ris_txn_amt_pct_6m\":4.04,\"core_nic_txn_cnt_3m\":2645,\"core_xb_txn_amt_3m\":4709.0,\"core_dis_txn_amt_pct_12m\":54.11,\"core_onl_txn_cnt_12m\":600,\"core_dom_txn_cnt_6m\":48,\"core_fue_txn_cnt_1m\":20,\"core_lux_txn_cnt_6m\":330,\"core_onl_txn_amt_3m\":200.0,\"core_nec_txn_cnt_3m\":1014,\"core_xb_txn_cnt_1m\":4916,\"core_nfc_txn_amt_12m\":200.0,\"core_txn_amt_1m\":4953.0,\"core_onl_txn_cnt_1m\":300,\"core_dis_txn_cnt_1m\":2628,\"core_lux_txn_cnt_12m\":337,\"core_nag_txn_cnt_1m\":1181,\"core_eap_txn_amt_pct_12m\":1.6,\"core_gro_txn_amt_pct_12m\":1.9,\"core_gro_txn_cnt_12m\":101,\"core_gro_txn_amt_pct_3m\":1.94,\"core_blp_txn_amt_pct_3m\":4.04,\"core_eap_txn_cnt_1m\":82,\"core_onl_avg_txn_cnt_3m\":100.0,\"core_avg_ticket_size_6m\":1.0,\"core_trv_txn_cnt_1m\":296,\"core_xb_txn_amt_12m\":4728.0,\"core_nag_txn_amt_pct_3m\":23.38,\"core_ris_txn_amt_pct_12m\":4.02,\"core_hcs_txn_cnt_3m\":4,\"core_avg_ticket_size_12m\":1.0,\"core_nic_txn_amt_pct_6m\":53.31,\"core_nic_to_nec_txn_amt_ratio_1m\":2.7,\"core_cte_txn_amt_pct_1m\":2.42,\"core_dom_txn_amt_6m\":431.0,\"core_eds_txn_amt_pct_3m\":1.72,\"core_ins_txn_amt_pct_6m\":0.19,\"core_eap_txn_cnt_12m\":85,\"core_lux_to_nec_txn_amt_ratio_3m\":0.3,\"core_txn_cnt_1m\":4951,\"core_ris_txn_cnt_6m\":211,\"core_xb_txn_amt_pct_6m\":91.63,\"core_xb_txn_cnt_pct_3m\":99.21,\"core_txn_cnt_12m\":5248,\"core_nag_to_nec_txn_amt_ratio_6m\":1.2,\"core_eds_txn_amt_pct_12m\":1.73,\"core_gro_txn_cnt_6m\":100,\"core_nfc_txn_cnt_6m\":500,\"core_fue_txn_amt_pct_1m\":0.38,\"core_cte_txn_amt_pct_3m\":2.41,\"core_tkn_txn_amt_12m\":200.0,\"core_recur_txn_cnt_3m\":123,\"core_nic_txn_cnt_6m\":2699,\"core_nec_txn_cnt_6m\":1033,\"core_nag_txn_amt_pct_1m\":23.36,\"core_tkn_avg_txn_cnt_3m\":66.7,\"core_nag_txn_amt_pct_12m\":23.41,\"core_eap_txn_cnt_3m\":83,\"core_trv_txn_cnt_3m\":301,\"core_dom_txn_cnt_pct_3m\":0.79,\"core_ins_txn_amt_pct_12m\":0.21,\"core_cte_txn_cnt_6m\":126,\"core_hcs_txn_cnt_1m\":3,\"core_utl_txn_amt_pct_3m\":1.68,\"core_nec_txn_amt_pct_1m\":19.71,\"core_nfc_txn_amt_1m\":300.0,\"core_nic_to_nec_txn_amt_ratio_12m\":2.7,\"core_dom_txn_amt_pct_6m\":8.37,\"core_recur_txn_cnt_6m\":156,\"core_ins_txn_cnt_3m\":10,\"core_avg_ticket_size_1m\":1.0,\"core_lux_to_nec_txn_amt_ratio_1m\":0.3,\"core_utl_txn_cnt_12m\":88,\"core_eap_txn_cnt_6m\":84,\"core_blp_txn_amt_pct_12m\":4.0,\"core_days_since_first_txn\":128,\"core_onl_avg_txn_cnt_6m\":100.0,\"core_txn_cnt_3m\":5050,\"core_nic_txn_amt_pct_3m\":53.29,\"core_dom_txn_amt_3m\":343.0,\"core_xb_txn_amt_6m\":4720.0,\"core_eds_txn_amt_pct_6m\":1.73,\"core_ins_txn_amt_pct_3m\":0.18,\"core_xb_txn_cnt_pct_12m\":98.97,\"core_dom_txn_cnt_pct_6m\":0.93,\"core_xb_txn_cnt_pct_6m\":99.07,\"core_utl_txn_amt_pct_1m\":1.7,\"core_blp_txn_cnt_12m\":213,\"core_tkn_avg_txn_cnt_12m\":41.7,\"core_trv_txn_cnt_12m\":311,\"core_gro_txn_cnt_3m\":99,\"core_cte_txn_amt_pct_6m\":2.41,\"core_tkn_avg_txn_cnt_6m\":100.0,\"core_fue_txn_amt_pct_6m\":0.41,\"core_nfc_txn_amt_3m\":600.0,\"core_cte_txn_cnt_1m\":122,\"core_nfc_txn_cnt_1m\":400,\"core_nec_txn_amt_pct_3m\":19.7,\"core_xb_txn_cnt_12m\":5194,\"core_eap_txn_amt_pct_6m\":1.61,\"core_trv_txn_cnt_6m\":306,\"core_utl_txn_amt_pct_6m\":1.67,\"core_dom_txn_amt_1m\":330.0,\"core_lux_txn_amt_pct_6m\":6.27,\"core_nic_txn_amt_pct_1m\":53.26,\"core_dom_txn_amt_pct_3m\":6.79,\"core_recur_txn_amt_1m\":120.0,\"core_nec_txn_cnt_12m\":1052,\"core_nfc_txn_cnt_12m\":100,\"core_ris_txn_amt_pct_1m\":4.08,\"core_nag_txn_cnt_12m\":1253,\"core_txn_cnt_6m\":5149,\"core_fue_txn_cnt_6m\":22,\"core_xb_txn_amt_pct_1m\":93.34,\"core_ris_txn_cnt_1m\":205,\"core_nag_to_nec_txn_amt_ratio_3m\":1.2,\"core_gro_txn_cnt_1m\":98,\"core_lux_txn_amt_pct_12m\":6.29,\"core_cas_txn_amt_pct_12m\":0.95,\"core_blp_txn_cnt_1m\":204,\"core_tkn_txn_amt_6m\":600.0,\"core_cte_txn_cnt_3m\":124,\"core_nfc_txn_cnt_3m\":200,\"core_hcs_txn_amt_pct_6m\":0.08,\"core_eds_txn_cnt_6m\":91,\"core_lux_to_nec_txn_amt_ratio_6m\":0.3,\"core_trv_txn_amt_pct_1m\":5.88,\"core_cas_txn_cnt_6m\":50,\"core_utl_txn_cnt_1m\":85,\"core_nic_txn_cnt_12m\":2753,\"core_onl_avg_txn_cnt_12m\":50.0,\"core_xb_txn_cnt_pct_1m\":99.29,\"core_eds_txn_amt_pct_1m\":1.72,\"core_dom_txn_cnt_12m\":54,\"core_dom_txn_amt_pct_1m\":6.66,\"core_trv_txn_amt_pct_12m\":5.83,\"core_ins_txn_cnt_6m\":11,\"core_recur_txn_amt_3m\":130.0,\"core_fue_txn_amt_pct_3m\":0.4,\"core_recur_txn_cnt_1m\":111,\"core_nfc_txn_amt_6m\":600.0,\"core_nag_to_nec_txn_amt_ratio_12m\":1.2,\"core_cte_txn_amt_pct_12m\":2.4,\"core_dom_txn_cnt_pct_1m\":0.71,\"core_nfc_avg_txn_cnt_3m\":66.7,\"core_tkn_txn_cnt_6m\":600,\"core_nag_to_nec_txn_amt_ratio_1m\":1.2,\"core_xb_txn_amt_pct_3m\":93.21,\"core_eds_txn_cnt_12m\":93,\"core_ris_txn_cnt_3m\":208,\"core_blp_txn_cnt_3m\":207,\"core_dom_txn_cnt_pct_12m\":1.03}",
        "predictive": "{\"pred_gen_txn_amt_pct_3m\":13.99,\"pred_fsv_kurtosis_12m\":-60.0,\"pred_txn_cnt_24m_12m\":100,\"pred_cash_txn_cnt_12m_24m\":55,\"pred_lastseen_date\":10,\"pred_aaf_txn_amt_1m\":3.0,\"pred_hpc_txn_amt_12m\":227.0,\"pred_dom_cash_txn_cnt_24m_12m\":50,\"pred_fis_std_dev_txn_amt_12m\":300.0,\"pred_fis_kurtosis_txn_cnt_12m\":300.0,\"pred_fl_txn_small_business\":1,\"pred_txn_amt_24m_12m\":1000.0,\"pred_aap_txn_cnt_3m\":129,\"pred_fis_max_txn_amt_12m\":200.0,\"pred_mov_txn_amt_1m\":126.0,\"pred_onl_txn_amt_3m\":200.0,\"pred_active_month_12m\":7,\"pred_weekend_weekday_txn_amt_ratio_12m\":66.0,\"pred_fl_contactless_1m\":1,\"pred_gro_txn_amt_1m\":97.0,\"pred_grf_txn_amt_6m\":241.0,\"pred_weekend_txn_amt_12m\":500.0,\"pred_txn_amt_3m\":5052.0,\"pred_fsv_std_dev_txn_cnt_12m\":200.0,\"pred_fsv_max_txn_amt_12m\":400.0,\"pred_cec_txn_amt_3m\":150.0}",
        "diagnostic": "{\"diag_recur_txn_amt_chng_pct_yoy\":-46.67,\"diag_blp_txn_chng_amt_qoq\":201.0,\"diag_avg_ticket_size_chng_pct_qoq\":null,\"diag_recur_txn_cnt_chng_pct_yoy\":-51.5,\"diag_dis_txn_amt_chng_pct_qoq\":4773.21,\"diag_ins_txn_chng_amt_qoq\":8.0,\"diag_nec_txn_amt_chng_pct_hoh\":5236.84,\"diag_nag_txn_chng_amt_qoq\":1157.0,\"diag_recur_txn_amt_chng_pct_qoq\":1200.0,\"diag_txn_amt_chng_pct_yoy\":425.0,\"diag_fue_txn_amt_chng_pct_qoq\":1900.0,\"diag_recur_txn_cnt_chng_pct_qoq\":272.73,\"diag_avg_ticket_size_chng_pct_yoy\":-90.0,\"diag_xb_txn_chng_cnt_qoq\":4919,\"diag_eap_txn_amt_chng_pct_qoq\":8100.0,\"diag_nec_txn_chng_amt_qoq\":976.0,\"diag_txn_cnt_chng_pct_yoy\":5148.0,\"diag_hcs_txn_amt_chng_pct_qoq\":200.0,\"diag_nag_txn_chng_amt_hoh\":1181.0,\"diag_recur_txn_amt_chng_pct_hoh\":-90.41,\"diag_dis_txn_chng_amt_qoq\":2673.0,\"diag_recur_txn_cnt_chng_pct_hoh\":-87.99,\"diag_lux_txn_amt_chng_pct_qoq\":4414.29,\"diag_fue_txn_chng_amt_hoh\":20.0,\"diag_trv_txn_amt_chng_pct_hoh\":5920.0,\"diag_dom_txn_chng_amt_qoq\":255.0,\"diag_nag_txn_amt_chng_pct_hoh\":4920.83,\"diag_blp_txn_amt_chng_pct_qoq\":6700.0,\"diag_eds_txn_chng_amt_qoq\":85.0,\"diag_ris_txn_amt_chng_pct_qoq\":6733.33,\"diag_avg_ticket_size_chng_pct_hoh\":null,\"diag_trv_txn_chng_amt_qoq\":291.0,\"diag_gro_txn_amt_chng_pct_hoh\":9800.0,\"diag_nec_txn_amt_chng_pct_qoq\":5136.84,\"diag_cas_txn_amt_chng_pct_hoh\":4800.0,\"diag_txn_cnt_chng_pct_hoh\":5101.01,\"diag_dis_txn_amt_chng_pct_hoh\":4873.21,\"diag_txn_amt_chng_pct_hoh\":5103.03,\"diag_dom_txn_chng_amt_yoy\":522.0,\"diag_eap_txn_chng_amt_qoq\":81.0,\"diag_nic_txn_amt_chng_pct_hoh\":4985.19,\"diag_nec_txn_chng_amt_hoh\":995.0,\"diag_dom_txn_chng_amt_hoh\":340.0,\"diag_fue_txn_amt_chng_pct_hoh\":2000.0,\"diag_lux_txn_amt_chng_pct_hoh\":4514.29,\"diag_blp_txn_amt_chng_pct_hoh\":6800.0,\"diag_cas_txn_amt_chng_pct_qoq\":4700.0,\"diag_cas_txn_chng_amt_qoq\":47.0,\"diag_nic_txn_amt_chng_pct_qoq\":4885.19,\"diag_eap_txn_chng_amt_hoh\":82.0,\"diag_trv_txn_amt_chng_pct_qoq\":5820.0,\"diag_lux_txn_chng_amt_hoh\":316.0,\"diag_ris_txn_amt_chng_pct_hoh\":6833.33,\"diag_nag_txn_amt_chng_pct_qoq\":4820.83,\"diag_xb_txn_amt_chng_pct_hoh\":58900.0,\"diag_xb_txn_cnt_chng_pct_hoh\":5384.95,\"diag_xb_txn_chng_amt_yoy\":4668.0,\"diag_hcs_txn_chng_amt_hoh\":3.0,\"diag_txn_chng_amt_yoy\":4250.0,\"diag_eds_txn_amt_chng_pct_qoq\":4250.0,\"diag_cte_txn_chng_amt_hoh\":122.0,\"diag_xb_txn_chng_amt_hoh\":4712.0,\"diag_txn_chng_amt_qoq\":4953.0,\"diag_utl_txn_chng_amt_qoq\":84.0,\"diag_cas_txn_chng_amt_hoh\":48.0,\"diag_ins_txn_amt_chng_pct_qoq\":800.0,\"diag_cte_txn_chng_amt_qoq\":120.0,\"diag_txn_chng_amt_hoh\":5052.0,\"diag_xb_txn_amt_chng_pct_qoq\":42709.09,\"diag_xb_txn_cnt_chng_pct_qoq\":5405.49,\"diag_gro_txn_chng_amt_qoq\":97.0,\"diag_recur_txn_chng_amt_hoh\":-1320.0,\"diag_lux_txn_chng_amt_qoq\":309.0,\"diag_nic_txn_chng_amt_qoq\":2638.0,\"diag_xb_txn_chng_amt_qoq\":4698.0,\"diag_hcs_txn_chng_amt_qoq\":2.0,\"diag_cte_txn_amt_chng_pct_hoh\":6100.0,\"diag_xb_txn_cnt_chng_pct_yoy\":6392.5,\"diag_xb_txn_amt_chng_pct_yoy\":7780.0,\"diag_xb_txn_chng_cnt_hoh\":5008,\"diag_eap_txn_amt_chng_pct_hoh\":8200.0,\"diag_dom_txn_chng_cnt_qoq\":32,\"diag_hcs_txn_amt_chng_pct_hoh\":300.0,\"diag_recur_txn_chng_amt_yoy\":-1400.0,\"diag_utl_txn_chng_amt_hoh\":85.0,\"diag_ins_txn_chng_amt_hoh\":9.0,\"diag_fue_txn_chng_amt_qoq\":19.0,\"diag_ins_txn_amt_chng_pct_hoh\":900.0,\"diag_ris_txn_chng_amt_qoq\":202.0,\"diag_blp_txn_chng_amt_hoh\":204.0,\"diag_dom_txn_chng_cnt_yoy\":4,\"diag_eds_txn_chng_amt_hoh\":87.0,\"diag_spd_stability_pct_1m\":377.37,\"diag_dom_txn_amt_chng_pct_qoq\":289.77,\"diag_dom_txn_cnt_chng_pct_qoq\":400.0,\"diag_utl_txn_amt_chng_pct_qoq\":8400.0,\"diag_gro_txn_amt_chng_pct_qoq\":9700.0,\"diag_eds_txn_amt_chng_pct_hoh\":4350.0,\"diag_trv_txn_chng_amt_hoh\":296.0,\"diag_txn_amt_chng_pct_qoq\":5003.03,\"diag_nic_txn_chng_amt_hoh\":2692.0,\"diag_txn_chng_amt_mom\":4553.0,\"diag_xb_txn_chng_cnt_yoy\":5114,\"diag_ris_txn_chng_amt_hoh\":205.0,\"diag_txn_cnt_chng_pct_qoq\":5001.01,\"diag_cte_txn_amt_chng_pct_qoq\":6000.0,\"diag_dom_txn_amt_chng_pct_yoy\":null,\"diag_dom_txn_cnt_chng_pct_yoy\":8.0,\"diag_utl_txn_amt_chng_pct_hoh\":8500.0,\"diag_dom_txn_amt_chng_pct_hoh\":373.63,\"diag_dom_txn_cnt_chng_pct_hoh\":700.0,\"diag_dis_txn_chng_amt_hoh\":2729.0,\"diag_txn_amt_chng_pct_mom\":1138.25,\"diag_dom_txn_chng_cnt_hoh\":42,\"diag_avg_ticket_size_chng_pct_mom\":-49.98,\"diag_recur_txn_chng_amt_qoq\":120.0,\"diag_txn_cnt_chng_pct_mom\":2375.5,\"diag_gro_txn_chng_amt_hoh\":98.0}"
    }
}
```

Tip: Refer to the [Reference App](https://developer.mastercard.com/consumer-credit-analytics/documentation/developer-tools/reference-app/index.md) for more details.

## Step 5: Promote the same project to Production {#step-5-promote-the-same-project-to-production}

After testing the implementation in the Sandbox environments, the next step is to **Move to Production**.

### Steps to Moving to Production {#steps-to-moving-to-production}

1. Within your project, select **Request Production Access** .  
   ![Summary](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/cca-proj-summary.png)
2. Fill in your profile details by providing your name, company information, legal business address, and other information and select **Proceed** . ![Complete Your Profile](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/complete-your-profile.png)
3. Provide your service details such as legally registered company name and company Interbank Card Association (ICA) number in the respective fields. Note: Payment ICAs have a length of 4 to 6 digits and non-payment ICAs have a length of 7 to 11 digits. ![Request Production Access](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/add-company-details.png)
4. Create and securely store a key alias and keystore password for the OAuth 1.0a project keys, then select **Proceed** . Alert: You must capture and store the key alias and keystore password. The keystore password is used in conjunction with the .p12 file and Client ID for OAuth authentication. ![Set Project Credentials](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/prod-project-credentials.png)
5. Create and record a key alias and keystore password for the encryption keys, then select **Create Project** . Note: Create your credentials:
   * key alias: It must be 8 to 75 characters long and consist of only letters and numbers.
   * keystore password: It must be at least 8 characters long and include at least two of the following:
     * letters
     * numbers
     * symbols These credentials will be used to access the API.
   ![Set Additional Credentials](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/prod-add-credentials.png)

Note: API requests contain Customer PANs, so both request and response payloads must be encrypted. The steps outlined above generate a public encryption key for encrypting data sent to Mastercard APIs and a private key for decrypting the responses received from Mastercard APIs.

8. Select **Download key file** and securely store the OAuth and encryption keys, then select **Open Project** to view the production access request status. Alert: Ensure that you store this file securely, as it will not be available for download later. ![Download Production Credentials](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/updating-your-project.png)

* Production keys are generated instantly, but they must be approved before you can access the production environment and go live.
* After your access request is reviewed, you will receive a notification confirming whether your access has been approved or denied.
* You will receive an email from Mastercard Developers at your registered email address with the outcome of the review. ![Production Credentials page showing OAuth project keys, API encryption keys, key status, validity dates, and key management options for a Consumer Credit Analytics API project.](https://static.developer.mastercard.com/content/consumer-credit-analytics/uploads/manage-prod-keys.png) Note: The review and approval process for the Consumer Credit Analytics API production access request typically takes 3-5 business days.

For the complete onboarding process including contracting, sandbox (MTF), service‑level agreements (SLAs), and escalation procedures see the [Onboarding Checklist](https://developer.mastercard.com/consumer-credit-analytics/documentation/tutorials-and-guides/onboarding-checklist/index.md).

### Next Steps {#next-steps}

Continue with the documentation that matches your next task:

* [API Reference](https://developer.mastercard.com/consumer-credit-analytics/documentation/api-reference/index.md) for endpoint details
* [API Basics](https://developer.mastercard.com/consumer-credit-analytics/documentation/api-basics/index.md) for authentication, encryption, and client configuration
* [Testing](https://developer.mastercard.com/consumer-credit-analytics/documentation/testing/index.md) for additional request scenarios
* [Onboarding Checklist](https://developer.mastercard.com/consumer-credit-analytics/documentation/tutorials-and-guides/onboarding-checklist/index.md) for the full operational go-live process
