Building Your Own Loan Widget Like Lendflow

Become a fintech lender using only a few lines of code

Building Your Own Loan Widget Like Lendflow


In the fintech landscape, Lendflow's business loan widget has emerged as a game-changer. Their simple, yet incredibly effective embedded loan product has not only revolutionized the way businesses seek loans but has also established Lendflow as a major player in the space. But what if we told you that you could create your own embedded finance widget, tailor-made to your audience? And in doing so, you can tap into an untapped revenue stream, bringing in more clients, partners, and revenue. In this guide, we'll delve into that very process.

Who Should Build the Loan Widget & Why

Consultants: In today's data-driven business environment, consultants have to provide actionable insights fast. With a loan widget embedded on their platform, they can offer clients immediate feedback on their loan eligibility, based on various metrics. This not only enhances the consultancy's value proposition but can also serve as a lead-generation tool.

Brokers: For brokers, speed and efficiency in connecting clients to the right financial products are paramount. Having a loan widget simplifies this, allowing clients to see their potential loan amounts instantly, enabling brokers to serve them better and faster.

Tech Platforms: Modern businesses run on various tech platforms, from e-commerce to CRM tools. By integrating a loan widget, these platforms can offer additional services to their user base, increasing user engagement and potentially unlocking new revenue streams.

Diving into the Development

Let’s now delve into the crux of the development, laying the foundation with the code that drives the widget:

  1. Slide 1 - Basic Information: Start by capturing basic details like business duration, monthly revenue, and credit score. This sets the stage for the subsequent calculations and ensures the user is engaged right from the get-go.

  2. Slide 2 - Monthly Revenue Metrics: Here, provide options for users to specify their monthly revenue. It’s essential to cater to a wide range of businesses, from startups to established entities. With a simple button layout, users can easily select the bracket that their revenue falls into.

  3. Slide 3 - Credit Score Inquiry: In this step, ask users about their credit scores. Remember, this is a sensitive piece of information. Ensure that the design communicates trustworthiness and the data's confidentiality.

  4. Slide 4 - Business Duration: The longevity of a business often influences its loan eligibility. Offer users a simple interface to specify how long they've been operational, from startups to well-established entities.

Alright, let's create a step-by-step guide on developing a frontend credit application using React.

Step 1: Setting Up Your Project

If you haven't already set up a React project, start by initializing a new one using Create React App:

npx create-react-app credit-application
cd credit-application

Step 2: State Management

For this example, I'm using React's built-in hooks for state management. For more complex applications, consider tools like Redux.

import React, { useState } from 'react';

Declare state variables that will store the user's input:

const [personalInfo, setPersonalInfo] = useState({ name: '', address: '', email: '' });
const [loanAmount, setLoanAmount] = useState(1000);

Step 3: Building the Form

Craft a form that captures the necessary details. Here's an example for capturing personal information:

            onChange={(e) => setPersonalInfo({ ...personalInfo, name: })}
            onChange={(e) => setPersonalInfo({ ...personalInfo, address: })}
            onChange={(e) => setPersonalInfo({ ...personalInfo, email: })}
    {/* Additional fields for the credit application can be added here */}

Step 4: Loan Amount Slider

Implement a slider to let users select the loan amount:

    <label>Loan Amount: ${loanAmount}</label>
        onChange={(e) => setLoanAmount(}

Step 5: Modal Implementation

Now, implement a modal that is triggered by a button. To do this, you need another piece of state:

const [isModalOpen, setIsModalOpen] = useState(false);

And the button:

<button onClick={() => setIsModalOpen(true)}>Open Credit Application</button>

Step 6: Styling

Add some basic CSS to improve the appearance. This is a basic example:

input {
    padding: 5px;
    margin: 10px 0;
    display: block;

Step 7: Form Submission

You can use a simple function to handle form submissions:

const handleSubmit = (e) => {
    // Here, you can send the data to a server or do further processing

Ensure your form has the onSubmit property:

<form onSubmit={handleSubmit}>

Step 8: Integration with Backend

This is a vast topic, but at a high level, when you're ready to send your application data to a server for further processing, use a library like axios:

npm install axios

Then, in your handleSubmit:

const handleSubmit = async (e) => {
    try {
        const response = await'/path-to-your-backend-endpoint', personalInfo);
    } catch (error) {
        console.error("There was an error submitting the form", error);

Step 9: Testing

Always ensure you test your application in various scenarios to guarantee user-friendliness and compatibility.

Creating your backend command center

Building a backend for your credit application involves several key steps. In this guide, we'll use Node.js with the Express.js framework for our server. For our database, we'll leverage MongoDB and the Mongoose ORM.

Step 1: Setting Up Your Backend

1.1 Initialize a new Node project:

mkdir credit-backend
cd credit-backend
npm init -y

1.2 Install necessary dependencies:

npm install express mongoose body-parser

Step 2: Setting Up Express Server

2.1 Create a server file:

touch server.js

2.2 Basic server setup:

const express = require('express');
const bodyParser = require('body-parser');

const app = express();


const PORT = 5000;

app.listen(PORT, () => {
    console.log(`Server started on port ${PORT}`);

Step 3: Connect to MongoDB

First, ensure you have MongoDB installed and running on your system.

3.1. Set up the connection:

const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost:27017/creditAppDB', {
    useNewUrlParser: true,
    useUnifiedTopology: true,

mongoose.connection.on('connected', () => {
    console.log('Connected to MongoDB');

Step 4: Create Application Schema

Define what data you'll be storing:

const ApplicationSchema = new mongoose.Schema({
    name: String,
    address: String,
    email: String,
    loanAmount: Number,
    // Add other necessary fields

const Application = mongoose.model('Application', ApplicationSchema);

Step 5: Routes for Application

5.1 POST Route - to save the application:'/apply', (req, res) => {
    const application = new Application(req.body);, application) => {
        if (err) return res.status(500).send(err);
        return res.status(200).send(application);

Step 6: Creating Underwriting Logic

For the sake of this guide, we'll create a simple underwriting logic. Real-world logic is based on complex algorithms, credit scores, financial statements, etc.

const underwriteApplication = (application) => {
    if(application.loanAmount < 5000) {
        if(application.salary > 30000) {
            return "Approved";
        } else {
            return "Denied";
    } else if(application.loanAmount < 15000) {
        if(application.salary > 50000) {
            return "Approved";
        } else {
            return "Denied";
    // Further logic can be added for higher loan amounts or other conditions

Use this in your POST route:'/apply', (req, res) => {
    const application = new Application(req.body);
    application.status = underwriteApplication(req.body);, application) => {
        if (err) return res.status(500).send(err);
        return res.status(200).send(application);
Use tools like Postman or Insomnia to test your backend routes.

Step 7: Security and Production

  • Always hash sensitive data like passwords using libraries like bcrypt.

  • Use helmet to secure Express apps.

  • Set up a production database; don't use your development database.

  • Consider using services like AWS, Heroku, or DigitalOcean to deploy your backend.

Underwriting Logic & Pre-Qualification Decision

Now, while the front end of the widget interacts with users, the back end is where the magic happens. It's here that the user's details are processed through underwriting logic to determine their loan eligibility. By implementing your own logic, you can cater to your audience's specific needs and demographics. Furthermore, auto-qualifying applicants streamline the process, making it efficient and user-friendly.

I will release a more comprehensive detailed underwriting module that utilizes machine learning, bank and accounting integration, and complex algorithms in my next release

Taking the Next Steps

With the loan widget ready, what's next?

Lender Partnerships: Form partnerships with lenders and integrate their underwriting criteria into your pre-qualification module. This ensures that your widget's results align with real-world lending standards.

White-Labeling Opportunities: Your loan widget can be a revenue source in itself. Consider offering it as a white-label solution to other businesses or platforms. By charging a monthly fee, you can turn your tool into a passive revenue stream.


The journey from conceptualizing a loan widget to integrating it into your business operations might seem daunting. However, with the right approach, guided by insights and technical know-how, it can be a smooth process. By understanding your audience, partnering with the right entities, and continuously iterating on your product, you can unlock a whole new avenue for growth and revenue the same way Lendflow has. Remember, in the digital age, innovation and adaptability are keys to success. Happy coding!

Did you find this article valuable?

Support Paygeon Core Articles by becoming a sponsor. Any amount is appreciated!