Skip to Content
Docs
Get startedPartner API v4Partner API v3Android SDK
v1.0.8

Loan Operations

Core loan lifecycle methods – creating a loan case, pre-caching it, and generating the report.

Create Loan Case

AbleCredit.createNewLoanCase(this, payload) { result ->
    when (result) {
        is AbleCreditResult.Success -> {
            val applicationId = result.data.data.application._id
            // Pass applicationId to recordAudio, capturePhotos, requestReportGeneration
        }
        is AbleCreditResult.Failure -> { /* handle */ }
    }
}

Sample Payload

val payload = mapOf(
    "client_unique_id" to "CUST-20251017-1234",
    "product_id"       to "MUT-IND-3065",
    "branch_id"        to "ML1348",
    "source_system"    to "",
    "user_name"        to "Jane Officer",
    "branch_name"      to "Bangalore Main",
    "loan_reference"   to "LN-2026-1001",

    "data" to mapOf(
        "borrower_details" to mapOf(
            "state_name"         to "karnataka",
            "entity_type"        to "individual",
            "name"               to "Shwetanka Srivastava",
            "dob"                to "24/01/1988",
            "mobile"             to "8197837043",
            "owner_of_business"  to "Yes",
        ),
        "co_borrower_details" to listOf(
            mapOf(
                "entity_type"        to "individual",
                "name"               to "Shwetanka Srivastava",
                "dob"                to "24/01/1988",
                "relation"           to "Brother",
                "occupation"         to "IT Professional",
                "owner_of_business"  to "No",
            )
        ),
        "employment_details" to mapOf(
            "employer_name"           to "optimus",
            "employer_contact_number" to "9873654210",
            "doj"                     to "14/10/2020",
            "nature_of_employment"    to "Full-Time",
            "total_experience"        to "36",
            "working_location"        to "#23, Bangalore",
            "working_days_in_month"   to "28",
            "per_day_earnings"        to "500",
            "per_month_earnings"      to "30000",
        ),
        "loan_details" to mapOf(
            "business_name" to "trends",
            "quantum"       to "500000",
            "tenure"        to "24",
        ),
    ),

    "business_profile" to mapOf(
        "product"        to "MUT",
        "business_model" to "Retail",
        "industry"       to "Fashion Apparel",
    ),
)

AbleCredit.createNewLoanCase(this, payload) { result ->
    when (result) {
        is AbleCreditResult.Success -> {
            val applicationId = result.data.data.application._id
        }
        is AbleCreditResult.Failure -> { /* handle */ }
    }
}

Pre-cache a loan (optional)

// Pre-cache by external reference (most common)
AbleCredit.getLoanByReference(this, loanReference) { result ->
    when (result) {
        is AbleCreditResult.Success -> { /* loan is now cached locally */ }
        is AbleCreditResult.Failure -> { /* handle offline / not found */ }
    }
}

// Pre-cache by internal AbleCredit application ID
AbleCredit.getLoanById(this, applicationId) { result ->
    when (result) {
        is AbleCreditResult.Success -> { /* loan is now cached locally */ }
        is AbleCreditResult.Failure -> { /* handle offline / not found */ }
    }
}

Request Report Generation

AbleCredit.requestReportGeneration(this, applicationId) { result ->
    when (result) {
        is AbleCreditResult.Success -> { /* report triggered */ }
        is AbleCreditResult.Failure -> { /* check for pending uploads */ }
    }
}

Clear SDK data on logout

AbleCredit.clearSdkData { result ->
    if (result is AbleCreditResult.Success) {
        Log.d("AbleCredit", "SDK state cleared")
    }
}

On this page