API Reference

💭

If you have your partner credentials:

You can get the iBranch up and running quickly using this recipe.

Frontend Integration

Initialize the iBranch using credentials

Insert the following script tag in your application to access the Lendica iBranch widget:

<script src="static-idev.golendica.com/v2/lendica.js"></script>

With the script tag added to your codebase, you'll have access to Lendica's full iBranch functionality.

ParameterTypeDescriptionExample
partner_namestringThe name of the partner service - you will receive this from Lendica during onboarding'partner_dev', 'partner'
partner_company_uuidstringThe unique ID of the currently logged in company in the partner system'12345'
company_namestringThe name of the company currently logged in'DemoCo'
credentials = {
  partner_name: "<<partner_name>>", // replace with partner name received during onboarding
  partner_company_uuid: "12345", // replace with company ID
  company_name: "DemoCo" // replace with company Name
};

// Init with credentials
lendica.init(credentials).then(() => {
  lendica.ibranch.render();
});

🚧

Ensure dynamic data

  • Dynamic Value: The partner_company_uuid and company_name must be dynamically set to the unique identifier of the company that is currently logged into your platform.
  • Per-User Basis: As different users log into your system, partner_company_uuid should reflect the ID of each user's associated company.
  • Session-Based Retrieval: Retrieve this value from your application's user session or authentication context, ensuring it always corresponds to the active user.
  • Avoid Hard-Coding: Do not hard-code this value. Hard-coding can lead to incorrect associations and data inconsistencies.

Example Code

Here's how you might initialize the iBranch widget with dynamic credentials:

// Assuming you have a user session object with company details
const userSession = getUserSession(); // Replace with your session retrieval method

const credentials = {
  // Replace with the partner name provided during onboarding
  partner_name: "<<partner_name>>",
  
  // Dynamically set to the company ID of the currently logged-in user
  partner_company_uuid: userSession.companyId,
  
  // Dynamically set to the company name of the currently logged-in user
  company_name: userSession.companyName,
};

// Initialize the iBranch widget with credentials
lendica.init(credentials).then(() => {
  lendica.ibranch.render();
});

In this example:

  • getUserSession() is a placeholder function representing how you access the current user's session or authentication context in your application.
  • userSession.companyId and userSession.companyName are variables that should contain the dynamic company ID and name of the logged-in user.
  • The lendica.init(credentials) function initializes the iBranch widget with the provided credentials, and lendica.ibranch.render() renders the widget in your application.

Key Terms and Concepts

To ensure clarity and prevent misunderstandings, here are definitions for some key terms used throughout this documentation:

  1. partner_name:

    • This is the unique identifier for the partner platform (i.e., your company) in Lendica's system.
    • It is provided by Lendica during the onboarding process.
    • Example: If your company is called "AcmeERP", your partner_name might be "acme_erp".
    • For testing purposes, Lendica will create an additional partner_name (e.g., "acme_erp_dev") that connects to your development environment, allowing you to safely test the integration without affecting production data.
  2. partner_company_uuid:

    • This is the unique identifier for a specific company (user) within the partner's system.
    • It is generated and maintained by the partner (you), not by Lendica.
    • This should remain consistent for a given company across all API calls.
    • Example: If a company "XYZ Corp" is using your platform, you might have assigned them a UUID like "abc123-xyz789".
  3. company_name:

    • This is the actual name of the company (user) that is logged into the partner system.
    • It should match the official registered name of the company.
    • Example: "XYZ Corporation Ltd."

It's important to note that the company details (partner_company_uuid and company_name) refer to the end-user company that is logged into the partner system, not the partner company itself. The partner_company_uuid is how you, as the partner, uniquely identify this company in your database.

Common Misconceptions

  • The partner_name refers to your company (the partner integrating with Lendica), while company_name refers to your customer's company.
  • The partner_company_uuid is not provided by Lendica; it's your unique identifier for the company in your system.

Understanding these distinctions is crucial for a successful integration and proper data flow between your system and Lendica.

Once the frontend integration is complete, you can proceed with adding specific functionality for PayLater, FundNow, or DrawDown.