API Integration Flow

Understand how Application Submission APIs and Active Loan Servicing APIs work together for the complete lending lifecycle

API Integration Flow

📘

End-to-End Integration

This guide explains how LendFoundry's two API systems work together to support the complete lending lifecycle from application to payoff.

LendFoundry's platform consists of two integrated systems that handle different phases of the lending lifecycle. Understanding how data flows between these systems is critical for successful integration.


Complete Lending Lifecycle

%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'mainBkg': '#ffffff', 'clusterBkg': '#f9fafb', 'clusterBorder': '#2563eb', 'primaryColor': '#2563eb', 'primaryTextColor': '#ffffff', 'titleColor': '#000000', 'lineColor': '#374151'}, 'flowchart': {'padding': 25, 'nodeSpacing': 40, 'rankSpacing': 50}}}%%
flowchart TB
    subgraph PHASE1[📋 Phase 1: Application Submission APIs]
        direction LR
        A[📝 Submit] --> B[📄 Docs]
        B --> C[🔍 Verify]
        C --> D{⚖️ Decide}
        D -->|✅| E[✅ Approve]
        D -->|❌| F[❌ Decline]
    end
    
    subgraph PHASE2[💰 Phase 2: Active Loan Servicing APIs]
        direction LR
        G[🏦 Onboard] --> H[💵 Fund]
        H --> I[📋 Service]
        I --> J[💳 Pay]
        J --> K{📊 Status?}
        K -->|Current| L[✅ Payoff]
        K -->|Late| M[📞 Collect]
    end
    
    E -->|Board Loan| G
    
    style A fill:#2563eb,stroke:#1e40af,color:#fff
    style B fill:#2563eb,stroke:#1e40af,color:#fff
    style C fill:#2563eb,stroke:#1e40af,color:#fff
    style D fill:#6b7280,stroke:#4b5563,color:#fff
    style E fill:#059669,stroke:#047857,color:#fff
    style F fill:#dc2626,stroke:#b91c1c,color:#fff
    style G fill:#059669,stroke:#047857,color:#fff
    style H fill:#2563eb,stroke:#1e40af,color:#fff
    style I fill:#2563eb,stroke:#1e40af,color:#fff
    style J fill:#2563eb,stroke:#1e40af,color:#fff
    style K fill:#6b7280,stroke:#4b5563,color:#fff
    style L fill:#059669,stroke:#047857,color:#fff
    style M fill:#d97706,stroke:#b45309,color:#fff

Phase 1 (Application Submission APIs):

  • Submit — Borrower submits loan application
  • Docs — Upload required documents
  • Verify — Complete identity, income, and business verifications
  • Decide — Automated or manual underwriting decision
  • Approve/Decline — Final application decision

Phase 2 (Active Loan Servicing APIs):

  • Onboard — Board approved loan to servicing system
  • Fund — Disburse loan proceeds to borrower
  • Service — Ongoing loan management and accounting
  • Pay — Process borrower payments
  • Payoff/Collect — Handle loan completion or collections

Phase 1: Application Submission & Approval

Application Submission APIs handle the complete loan origination process from application intake through funding approval.

Key Endpoints

StepEndpointPurpose
SubmitPOST /borrower-application-intakeCreate new application
DocumentsPOST /upload-documentUpload supporting documents
VerifyPOST /add-stipulationsAdd verification requirements
CreditPOST /get-credit-dataPull credit report
StatusPOST /get-borrower-application-by-uidCheck application status
TasksPOST /create-taskCreate underwriting tasks

Authentication

Authorization: YOUR_API_KEY
⚠️

No Bearer Prefix

Application Submission APIs use API Key authentication without the Bearer prefix.

Example: Submit Application

curl -X POST "https://loc.demo.kendra.lendfoundry.com/v1/darbaan/back-office/rest/api/borrower-application-intake" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "borrower_name": "John Doe",
    "email": "[email protected]",
    "phone": "(555) 123-4567",
    "loan_amount": 50000,
    "loan_purpose": "Business Expansion"
  }'
const submitApplication = async (applicationData, apiKey) => {
  const response = await fetch(
    'https://loc.demo.kendra.lendfoundry.com/v1/darbaan/back-office/rest/api/borrower-application-intake',
    {
      method: 'POST',
      headers: {
        'Authorization': apiKey,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(applicationData)
    }
  );
  
  return await response.json();
};

const result = await submitApplication({
  borrower_name: 'John Doe',
  email: '[email protected]',
  phone: '(555) 123-4567',
  loan_amount: 50000,
  loan_purpose: 'Business Expansion'
}, process.env.LOS_API_KEY);
import requests

def submit_application(application_data, api_key):
    """Submit new loan application."""
    url = "https://loc.demo.kendra.lendfoundry.com/v1/darbaan/back-office/rest/api/borrower-application-intake"
    headers = {
        "Authorization": api_key,
        "Content-Type": "application/json"
    }
    
    response = requests.post(url, json=application_data, headers=headers)
    response.raise_for_status()
    return response.json()

result = submit_application({
    "borrower_name": "John Doe",
    "email": "[email protected]",
    "phone": "(555) 123-4567",
    "loan_amount": 50000,
    "loan_purpose": "Business Expansion"
}, os.getenv('LOS_API_KEY'))
public String submitApplication(String applicationJson, String apiKey) throws Exception {
    HttpClient client = HttpClient.newHttpClient();
    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://loc.demo.kendra.lendfoundry.com/v1/darbaan/back-office/rest/api/borrower-application-intake"))
        .header("Authorization", apiKey)
        .header("Content-Type", "application/json")
        .POST(HttpRequest.BodyPublishers.ofString(applicationJson))
        .build();
    
    HttpResponse<String> response = client.send(request, 
        HttpResponse.BodyHandlers.ofString());
    return response.body();
}

Application Status Flow

%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'mainBkg': '#ffffff', 'clusterBkg': '#f9fafb', 'clusterBorder': '#2563eb', 'primaryColor': '#2563eb', 'primaryTextColor': '#ffffff', 'titleColor': '#000000', 'lineColor': '#374151'}, 'flowchart': {'padding': 25, 'nodeSpacing': 45, 'rankSpacing': 50}}}%%
flowchart LR
    subgraph STATUS[📋 Application Status Flow]
        A[Draft] --> B[Submitted]
        B --> C[Under Review]
        C --> D[Approved]
        C --> E[Declined]
        D --> F[Funded]
    end
    
    style A fill:#6b7280,stroke:#4b5563,color:#fff
    style B fill:#2563eb,stroke:#1e40af,color:#fff
    style C fill:#d97706,stroke:#b45309,color:#fff
    style D fill:#059669,stroke:#047857,color:#fff
    style E fill:#dc2626,stroke:#b91c1c,color:#fff
    style F fill:#059669,stroke:#047857,color:#fff

The Handoff: LOS to LMS

When an application is approved, it must be "boarded" to the Active Loan Servicing system. This is the critical transition point between origination and servicing.

Boarding Endpoint

POST /application/submit/business/onboard

Full URL:

https://api.demo.lms.lendfoundry.com/v1/lms-application-processor/application/submit/business/onboard

Data Transferred

CategoryData Elements
Borrower InfoName, SSN/EIN, contact details, address
Loan TermsAmount, rate, term, purpose
CollateralType, value, description
DocumentsDocument references and verification status

Boarding Example

curl -X POST "https://api.demo.lms.lendfoundry.com/v1/lms-application-processor/application/submit/business/onboard" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "application_uid": "0x1234567890abcdef",
    "application_number": "APP-2025-001234",
    "loan_amount": 50000,
    "interest_rate": 5.5,
    "loan_term": 60,
    "loan_start_date": "2025-12-20"
  }'
const boardLoan = async (boardingData, jwtToken) => {
  const response = await fetch(
    'https://api.demo.lms.lendfoundry.com/v1/lms-application-processor/application/submit/business/onboard',
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${jwtToken}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(boardingData)
    }
  );
  
  return await response.json();
};

const result = await boardLoan({
  application_uid: '0x1234567890abcdef',
  application_number: 'APP-2025-001234',
  loan_amount: 50000,
  interest_rate: 5.5,
  loan_term: 60,
  loan_start_date: '2025-12-20'
}, jwtToken);
import requests

def board_loan(boarding_data, jwt_token):
    """Board approved loan to LMS."""
    url = "https://api.demo.lms.lendfoundry.com/v1/lms-application-processor/application/submit/business/onboard"
    headers = {
        "Authorization": f"Bearer {jwt_token}",
        "Content-Type": "application/json"
    }
    
    response = requests.post(url, json=boarding_data, headers=headers)
    response.raise_for_status()
    return response.json()

result = board_loan({
    "application_uid": "0x1234567890abcdef",
    "application_number": "APP-2025-001234",
    "loan_amount": 50000,
    "interest_rate": 5.5,
    "loan_term": 60,
    "loan_start_date": "2025-12-20"
}, jwt_token)
public String boardLoan(String boardingJson, String jwtToken) throws Exception {
    HttpClient client = HttpClient.newHttpClient();
    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://api.demo.lms.lendfoundry.com/v1/lms-application-processor/application/submit/business/onboard"))
        .header("Authorization", "Bearer " + jwtToken)
        .header("Content-Type", "application/json")
        .POST(HttpRequest.BodyPublishers.ofString(boardingJson))
        .build();
    
    HttpResponse<String> response = client.send(request, 
        HttpResponse.BodyHandlers.ofString());
    return response.body();
}

Boarding Response

{
  "loan_number": "LN-2025-001234",
  "status": "boarded",
  "message": "Loan successfully boarded to LMS",
  "loan_id": "12345",
  "boarded_at": "2025-12-15T10:30:00Z",
  "application_uid": "0x1234567890abcdef",
  "application_number": "APP-2025-001234"
}

Phase 2: Active Loan Servicing

Active Loan Servicing APIs handle all post-origination activities including payment processing, accounting, and collections.

Microservices Architecture

%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'mainBkg': '#ffffff', 'clusterBkg': '#f9fafb', 'clusterBorder': '#2563eb', 'primaryColor': '#2563eb', 'primaryTextColor': '#ffffff', 'titleColor': '#000000', 'lineColor': '#374151'}, 'flowchart': {'padding': 25, 'nodeSpacing': 40, 'rankSpacing': 50}}}%%
flowchart TB
    subgraph LMS[💰 Active Loan Servicing Microservices]
        direction TB
        A[🏦 Loan Management] --> B[💳 Payment Processor]
        A --> C[📊 Loan Accounting]
        B --> C
        A --> D[👤 Business Applicant]
        A --> E[🔍 Loan Filters]
        A --> F[💵 DrawDown Processor]
        B --> G[📞 Call Management]
    end
    
    style A fill:#2563eb,stroke:#1e40af,color:#fff
    style B fill:#2563eb,stroke:#1e40af,color:#fff
    style C fill:#2563eb,stroke:#1e40af,color:#fff
    style D fill:#2563eb,stroke:#1e40af,color:#fff
    style E fill:#2563eb,stroke:#1e40af,color:#fff
    style F fill:#2563eb,stroke:#1e40af,color:#fff
    style G fill:#d97706,stroke:#b45309,color:#fff

Key Endpoints by Microservice

MicroserviceEndpointPurpose
Loan ManagementPOST /insertCreate new loan record
Loan ManagementPOST /amortizeGenerate amortization schedule
Loan ManagementGET /search/{loanNumber}/detailsGet loan details
Payment ProcessorPOST /paymentProcess payment
Payment ProcessorPOST /schedule-paymentSchedule future payment
Loan AccountingPOST /transactionRecord transaction
Loan AccountingGET /balance/{loanNumber}Get current balance
DrawDown ProcessorPOST /process-drawdownProcess LOC draw
Call ManagementPOST /log-callLog collection call
Loan FiltersPOST /filter-loansSearch/filter loans

Authentication

Authorization: Bearer YOUR_JWT_TOKEN
⚠️

Bearer Prefix Required

Active Loan Servicing APIs require the Bearer prefix before the JWT token.

Loan Status Flow

%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'mainBkg': '#ffffff', 'clusterBkg': '#f9fafb', 'clusterBorder': '#2563eb', 'primaryColor': '#2563eb', 'primaryTextColor': '#ffffff', 'titleColor': '#000000', 'lineColor': '#374151'}, 'flowchart': {'padding': 25, 'nodeSpacing': 45, 'rankSpacing': 50}}}%%
flowchart LR
    subgraph LOAN[💰 Loan Status Flow]
        A[Boarding] --> B[Active]
        B --> C[Current]
        C --> D[Paid Off]
        B --> E[Delinquent]
        E --> F[Collections]
        F --> G[Charged Off]
        E --> C
    end
    
    style A fill:#6b7280,stroke:#4b5563,color:#fff
    style B fill:#2563eb,stroke:#1e40af,color:#fff
    style C fill:#059669,stroke:#047857,color:#fff
    style D fill:#059669,stroke:#047857,color:#fff
    style E fill:#d97706,stroke:#b45309,color:#fff
    style F fill:#dc2626,stroke:#b91c1c,color:#fff
    style G fill:#374151,stroke:#1f2937,color:#fff

Integration Best Practices

✅ DO

PracticeReason
Verify prerequisites before boardingPrevents boarding failures
Implement webhook listenersReal-time status updates
Use idempotency keysPrevent duplicate operations
Validate data before submissionReduce validation errors
Log all API interactionsAudit trail and debugging

❌ DON'T

Anti-PatternRisk
Skip status verificationOperations on invalid states
Ignore error responsesSilent failures
Hardcode credentialsSecurity exposure
Poll excessivelyRate limiting

Data Linking

Applications and loans are linked through unique identifiers:

%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'mainBkg': '#ffffff', 'clusterBkg': '#f9fafb', 'clusterBorder': '#2563eb', 'primaryColor': '#2563eb', 'primaryTextColor': '#ffffff', 'titleColor': '#000000', 'lineColor': '#374151'}, 'flowchart': {'padding': 25, 'nodeSpacing': 60, 'rankSpacing': 50}}}%%
flowchart LR
    subgraph LINK[🔗 Data Linking]
        A[📋 APP-2025-001] -.->|Links To| B[💰 LN-2025-001]
    end
    
    style A fill:#2563eb,stroke:#1e40af,color:#fff
    style B fill:#059669,stroke:#047857,color:#fff
LOS FieldLMS FieldPurpose
application_uidapplication_uidUnique application identifier
application_numberapplication_numberHuman-readable application ID
loan_numberUnique loan identifier (created at boarding)

Key Takeaways

ConceptDetails
Two SystemsLOS for origination, LMS for servicing
Different AuthLOS uses API Key, LMS uses Bearer JWT
Handoff PointPOST /application/submit/business/onboard
Data Linkingapplication_uid links LOS and LMS records
MicroservicesLMS has 7+ microservices for different functions

Next Steps

ResourceDescription
WorkflowsDetailed workflow guides
Error CodesHandle errors gracefully
Rate LimitingUnderstand rate limits

Ready to Build?

Explore the Workflow Guides for step-by-step implementation examples.