SDKs overview

Kount provides Software Development Kits (SDKs) and libraries designed to facilitate the integration of its fraud prevention services into various applications and platforms. These SDKs abstract the complexities of direct API calls, offering language-specific methods for data collection, transaction submission, and response processing. The primary goal of Kount's SDKs is to enable developers to embed fraud detection logic efficiently, supporting use cases such as e-commerce transaction screening, account takeover prevention, and payment fraud detection.

Developers typically use Kount SDKs to collect device and behavioral data from end-users, submit transaction details to Kount's risk engine, and interpret the returned fraud scores or decisions. This integration allows for real-time fraud analysis during critical user interactions, such as login attempts or checkout processes. Kount's documentation provides specific guides for integrating these tools, covering different programming environments and common integration patterns, as detailed on the Kount Support Portal.

Official SDKs by language

Kount offers official SDKs for several popular programming languages, designed to streamline the integration of its fraud prevention services. These SDKs provide structured ways to interact with Kount's APIs, handle data formatting, and manage communication protocols. The table below outlines the key official SDKs available, including their typical package names, installation methods, and general maturity levels.

Language Package/Library Name Installation Command Maturity
Java kount-java-sdk Add to pom.xml (Maven) or build.gradle (Gradle) Stable
.NET (C#) Kount.NET Install-Package Kount.NET (NuGet) Stable
PHP kount/php-sdk composer require kount/php-sdk Stable
Python kount-python-sdk pip install kount-python-sdk Stable
JavaScript (Client-Side) Kount Data Collector JS Include via <script> tag Stable

Each SDK is maintained by Kount and receives updates to support new features or address compatibility requirements. Developers are encouraged to refer to the specific integration guides available through the Kount documentation portal for the most current installation and usage instructions for each language.

Installation

The installation process for Kount SDKs varies depending on the programming language and ecosystem. Generally, server-side SDKs are installed using package managers, while client-side JavaScript libraries are typically included directly in web pages.

Java SDK Installation

For Java projects, the Kount SDK is usually integrated using Maven or Gradle. Developers add the SDK as a dependency in their project's build configuration file. For Maven, this involves adding a dependency block to the pom.xml file:

<dependency>
    <groupId>com.kount</groupId>
    <artifactId>kount-java-sdk</artifactId>
    <version>[LATEST_VERSION]</version>
</dependency>

The [LATEST_VERSION] placeholder should be replaced with the current SDK version, which can be found in the Kount Java SDK documentation.

.NET SDK Installation

In .NET environments, the Kount SDK is distributed via NuGet. Developers can install it using the NuGet Package Manager Console:

Install-Package Kount.NET

Alternatively, it can be installed through the NuGet Package Manager UI in Visual Studio. This command adds the necessary references and files to the .NET project, enabling access to Kount's functionalities, as described in the Kount .NET integration guide.

PHP SDK Installation

PHP projects typically use Composer for dependency management. To install the Kount PHP SDK, developers run the following command in their project directory:

composer require kount/php-sdk

This command downloads the SDK and its dependencies, making them available for use within the PHP application, following the instructions in the Kount PHP SDK documentation.

Python SDK Installation

For Python applications, the Kount SDK is installed using pip, the Python package installer:

pip install kount-python-sdk

This command retrieves the package from the Python Package Index (PyPI) and makes it available for import in Python scripts, as detailed in the Kount Python integration guide.

JavaScript (Client-Side) Installation

The Kount Data Collector JavaScript library is integrated by adding a <script> tag to the HTML of a web page. This tag points to the Kount-hosted JavaScript file, which then collects device and browser information. An example inclusion might look like:

<script type="text/javascript" src="https://assets.kount.com/collector/sdk.js"></script>

The specific URL and configuration parameters are provided in the Kount Client-Side Data Collector documentation. Integrating this script allows Kount to gather necessary data for device identification and risk assessment without requiring server-side interaction for data collection.

Quickstart example

This quickstart example demonstrates a basic transaction submission using a conceptual Kount SDK. While the specific methods and parameters may vary slightly across different language SDKs, the core process involves initializing the SDK, setting transaction parameters, and submitting the request for fraud analysis. This example uses a Python-like pseudocode for clarity.

Scenario: Submitting an e-commerce order for fraud screening.


import kount_sdk

# Configure Kount SDK with your Merchant ID and API Key
# These credentials are obtained from your Kount account settings.
kount_client = kount_sdk.Client(merchant_id="YOUR_MERCHANT_ID", api_key="YOUR_API_KEY")

# Collect device data (usually done via client-side JavaScript collector)
# The session ID links client-side data to the server-side transaction.
session_id = "UNIQUE_SESSION_ID_FROM_CLIENT_SIDE"

# Prepare transaction data
transaction_data = {
    "MODE": "P",  # Purchase mode
    "MERC": "YOUR_MERCHANT_ID",
    "SESS": session_id,
    "ORDR": "ORDER_12345",
    "TOTL": "100.00", # Total amount, format as string
    "CURR": "USD",
    "EMAL": "[email protected]",
    "IPAD": "192.0.2.1", # Customer IP address
    "NAME": "John Doe",
    "BTYP": "D", # Card Type (e.g., D for Discover, V for Visa)
    "CCFP": "CREDIT_CARD_FINGERPRINT", # Hashed/tokenized card number
    "AVST": "M", # AVS Street Match (M=Match, N=No Match)
    "AVSZ": "M", # AVS Zip Match (M=Match, N=No Match)
    "CVVR": "M", # CVV Match (M=Match, N=No Match)
    "PROD": [
        {"ITEM": "SKU001", "DESC": "Product A", "QTY": "1", "PRCE": "50.00"},
        {"ITEM": "SKU002", "DESC": "Product B", "QTY": "1", "PRCE": "50.00"}
    ],
    "BILL_NAME": "John Doe",
    "BILL_ADDR1": "123 Main St",
    "BILL_CITY": "Anytown",
    "BILL_STATE": "CA",
    "BILL_ZIP": "90210",
    "BILL_CTRY": "US",
    "SHIP_NAME": "John Doe",
    "SHIP_ADDR1": "123 Main St",
    "SHIP_CITY": "Anytown",
    "SHIP_STATE": "CA",
    "SHIP_ZIP": "90210",
    "SHIP_CTRY": "US"
}

try:
    # Submit the transaction to Kount
    response = kount_client.send_transaction(transaction_data)

    # Process the response
    if response.is_success():
        kount_decision = response.get_decision()
        kount_score = response.get_score()
        print(f"Kount Decision: {kount_decision}, Score: {kount_score}")

        if kount_decision == "APPROVE":
            print("Transaction approved by Kount.")
            # Proceed with order fulfillment
        elif kount_decision == "REVIEW":
            print("Transaction flagged for manual review.")
            # Route to fraud review queue
        else: # DECLINE
            print("Transaction declined by Kount.")
            # Cancel order, notify customer
    else:
        error_message = response.get_error_message()
        print(f"Kount API Error: {error_message}")
        # Log error, potentially fall back to internal fraud rules

except Exception as e:
    print(f"An unexpected error occurred: {e}")
    # Handle network issues or other exceptions

This example illustrates how to construct a request with essential transaction details, including customer information, billing and shipping addresses, and product specifics. The send_transaction method sends this data to Kount's risk engine. The response typically includes a fraud decision (e.g., APPROVE, REVIEW, DECLINE) and a risk score, which developers can use to automate or manual review processes. Further details on request parameters and response interpretation are available in the Kount API Reference.

Community libraries

While Kount primarily provides and supports its official SDKs, the broader developer community may create and maintain unofficial libraries or integrations. These community-driven projects can offer alternative approaches, specific framework integrations, or support for languages not officially covered by Kount.

Community libraries are often found on platforms like GitHub or package repositories (e.g., PyPI for Python, npm for Node.js). Developers exploring community options should consider factors such as:

  • Maintenance Status: How actively is the library maintained and updated?
  • Documentation: Is there clear and comprehensive documentation for setup and usage?
  • Community Support: Is there an active community to assist with issues or questions?
  • Security Practices: Does the library follow secure coding practices, especially when handling sensitive payment or customer data?
  • Compatibility: Is it compatible with the latest Kount API versions and your application's technology stack?

As an example of a general approach to community libraries, the Mozilla Developer Network's guide on JavaScript modules explains how third-party libraries can be integrated into projects, highlighting the importance of understanding their dependencies and usage patterns. While Kount does not officially endorse or support community-contributed libraries, they can sometimes offer specialized solutions or fill gaps for particular use cases. Developers are advised to exercise due diligence when using any unofficial library, reviewing its source code and community reputation before integrating it into production systems.