Introducing FraudLabs Pro Kotlin SDK

FraudLabs Pro Kotlin SDK

Introduction

Kotlin, a modern programming language that runs on the JVM, is widely used for Android development and scalable backend applications. With the release of the FraudLabs Pro Kotlin SDK, developers can now easily implement fraud detection features into their Kotlin solutions using the FraudLabs Pro API.

This SDK simplifies the integration process, making it possible for developers to protect their applications against fraud with just a few lines of code.

Key Features of the Kotlin SDK

Below are the features of this Kotlin module:

  • Fraud analysis and scoring
    Every transaction is analyzed against multiple elements such as IP, email, billing address, shipping address, and so on. The SDK returns a fraud score that indicates the likelihood of fraud, helping businesses decide whether to approve, review, or reject a transaction.
  • IP address geolocation & proxy validation
    Identify the geographical location of the transaction’s IP address and check whether it is associated with proxies, VPNs, or TOR networks. This helps detect users hiding their real identity or location.
  • Email address validation
    Validate whether the provided email is from a trustworthy domain or if it belongs to a disposable, free, or high-risk provider.
  • Credit card issuing bank validation
    Verify that the credit card’s issuing bank information matches the billing details provided by the customer. This reduces the risk of fraudulent purchases using stolen or fake card numbers.
  • Transaction velocity validation
    Track how often a particular email, IP, or card is used across multiple transactions within a short time frame. Suspiciously high frequency may indicate automated fraud attempts.
  • Device transaction validation
    Detect anomalies in device fingerprints by monitoring information such as browser type, operating system, and device identifiers. This ensures the same fraudster isn’t repeatedly transacting with different accounts from the same device.
  • Blacklist validation
    Compare incoming transactions against FraudLabs Pro’s global blacklist of known fraudsters or use your own custom blacklist to block suspicious orders.
  • Custom rules trigger
    Define your own rules based on business requirements. For example, block orders from specific countries, flag transactions with mismatched billing and shipping details and so on.
  • Email notification of fraud orders
    Receive instant email alerts whenever a potentially fraudulent order is detected, so you can take action quickly.
  • Mobile app notification of fraud orders
    Get real-time push notifications on your mobile device through the FraudLabs Pro app, allowing you to respond to fraud threats even when you are on the move.

How to Use FraudLabs Pro Kotlin SDK

1. Get Your API Key

You’ll need an API key to use the SDK. Sign up for a free account and obtain your key here:

👉 https://www.fraudlabspro.com/checkout-micro

2. Validate an Order (Sample Code)

Here’s a simple example showing how to validate an order using FraudLabs Pro in Kotlin.

object TestValidate {
    @JvmStatic
    fun main(args: Array<String>) {
        // Configures FraudLabs Pro API key
        FraudLabsPro.APIKEY = "YOUR_API_KEY"

        // Screen Order API
        val order = Order()

        // Sets order details
        val data = java.util.Hashtable<String?, String?>()

        data["ip"] = "146.112.62.105" // IP parameter is mandatory
        data["first_name"] = "Hector"
        data["last_name"] = "Henderson"
        data["email"] = "hh5566@gmail.com"
        data["user_phone"] = "561-628-8674"

        // Billing information
        data["bill_addr"] = "1766 PowderHouse Road"
        data["bill_city"] = "West Palm Beach"
        data["bill_state"] = "FL"
        data["bill_country"] = "US"
        data["bill_zip_code"] = "33401"
        data["number"] = "4556553172971283"

        // Order information
        data["user_order_id"] = "67398"
        data["user_order_memo"] = "Online shop"
        data["amount"] = "79.89"
        data["quantity"] = "1"
        data["currency"] = "USD"
        data["payment_gateway"] = "stripe"
        data["payment_mode"] = order.CREDIT_CARD // Please refer reference section for full list of payment methods

        // Shipping information
        data["ship_first_name"] = "Hector"
        data["ship_last_name"] = "Henderson"
        data["ship_addr"] = "4469 Chestnut Street"
        data["ship_city"] = "Tampa"
        data["ship_state"] = "FL"
        data["ship_zip_code"] = "33602"
        data["ship_country"] = "US"

        val result = order.validate(data) // Sends order details to FraudLabs Pro
        print(result)
    }
}

Run the Kotlin program to get the validation result.

This is the sample output:

{
    "ip_geolocation": {
        "ip": "146.112.62.105",
        "continent": "North America",
        "country_code": "US",
        "country_name": "United States of America",
        "region": "Washington",
        "city": "Vancouver",
        "latitude": 45.6386,
        "longitude": -122.6615,
        "zip_code": "98663",
        "timezone": "-07:00",
        "isp_name": "Cisco OpenDNS LLC",
        "domain": "opendns.com",
        "netspeed": "T1",
        "mobile_mnc": null,
        "mobile_mcc": null,
        "mobile_brand": null,
        "elevation": 53,
        "usage_type": [
            "Content Delivery Network"
        ],
        "is_proxy": false,
        "proxy_type": null,
        "is_in_blacklist": false
    },
    "billing_address": {
        "ip_distance_in_km": 4295.37,
        "ip_distance_in_mile": 2669.02,
        "is_ip_country_match": true
    },
    "shipping_address": {
        "is_address_ship_forward": false,
        "is_bill_country_match": true,
        "is_bill_state_match": true,
        "is_bill_city_match": false,
        "is_bill_postcode_match": false,
        "is_export_controlled_country": null,
        "is_in_blacklist": false
    },
    "email_address": {
        "is_free": true,
        "is_disposable": false,
        "is_domain_exist": true,
        "is_new_domain_name": false,
        "is_in_blacklist": false
    },
    "phone_number": {
        "is_disposable": null,
        "is_in_blacklist": false
    },
    "username": {
        "is_high_risk": null,
        "is_in_blacklist": null
    },
    "credit_card": {
        "card_brand": null,
        "card_type": null,
        "card_issuing_bank": null,
        "card_issuing_country": null,
        "is_prepaid": false,
        "is_bin_exist": true,
        "is_bin_country_match": null,
        "is_in_blacklist": false
    },
    "device": {
        "is_malware_exploit": false,
        "is_in_blacklist": null
    },
    "user_order_id": "67398",
    "fraudlabspro_id": "20250917-2M2CQZ",
    "fraudlabspro_score": 74,
    "fraudlabspro_status": "REVIEW",
    "fraudlabspro_rules": [],
    "api_version": "2.0.0",
    "remaining_credits": 500
}

This example sends an order validation request to FraudLabs Pro and prints the fraud analysis result.

For detailed documentation and other examples, visit the official FraudLabs Pro Kotlin SDK page.

For developer guides, visit the FraudLabs Pro Developer Guide page.

Conclusion

The FraudLabs Pro Kotlin SDK provides developers with a simple and reliable way to integrate fraud prevention features into their Kotlin applications. With advanced fraud scoring, geolocation analysis, device checks, velocity monitoring, and customizable rules, it helps businesses reduce chargebacks and block fraudulent activities before they happen.

Start building secure, reliable applications today with the FraudLabs Pro Kotlin SDK and stay ahead of online fraud.


Fortify Your Business Against Fraud

Streamline your works with our fraud detection API now!

Was this article helpful?

Related Articles