Adding a custom scoring module to your decision model

Custom scoring allows lenders to assess loan applicants using tailored criteria designed to match their specific business needs.

Unlike default scoring systems, custom scoring provides the flexibility to incorporate external data sources via API calls into the decision-making process. 

Lendsqr’s custom scoring model

Lendsqr integrates custom scoring modules into decision models, allowing lenders to design tailored logic using external data. This improves assessments, helping identify creditworthy customers, reduce risks, and stay competitive.

To add a custom scoring module in the Lendsqr admin console, insert a JSON model into the default decision model structure.

Here is a step by step of how you can configure this on the admin console 

1. Login to the admin console 

2. Navigate to “Decision Models” under “Product Management” tab.

Adding a custom scoring module to your decision model

3. To create a new decision model, click the “New Decision Model” button. To update one, locate it in the list and click “Edit” next to it.

Adding a custom scoring module to your decision model

4. Scroll down to the “Decision Model Settings” section of the page.

Adding a custom scoring module to your decision model

5. Add or update the existing JSON logic with your custom module payload. Then, insert the following JSON payload under the correct sequence in your decision model settings:

Adding a custom scoring module to your decision model

Example JSON logic

Below are different configurations of the custom scoring module:

Simple Case: GET Request (No API Key, Simple Scoring)

Description: This simple configuration performs a “GET ” request to retrieve scoring data. No authentication or additional payload is required.

"custom": {
  "required": true,
  "sequence": 4,
  "continue_on_failure": false,
  "pre_offer": true,
  "identifier": "scoring-check1",
  "host": "https://example.com/simple",
  "method": "get",
  "minimum": 80
}

GET with query payload

Description: This configuration sends a “GET ” request with query parameters (e.g., bvn and loan amount) and additional authentication.

"custom": {
  "required": true,
  "sequence": 5,
  "continue_on_failure": true,
  "pre_offer": false,
  "identifier": "scoring-check2",
  "host": "https://example.com/query",
  "method": "get",
  "headers": {
    "authorization": "Bearer xxx"
  },
  "query": {
    "bvn": "{{bvn}}",
    "loan_amount": 50000
  },
  "minimum": 70
}

POST with body payload

Description: This configuration uses a POST request with a JSON body payload to send scoring data.

"custom": {
  "required": true,
  "sequence": 6,
  "continue_on_failure": false,
  "pre_offer": true,
  "identifier": "scoring-check3",
  "host": "https://example.com/post",
  "headers": {
    "authorization": "Bearer xxx"
  },
  "method": "post",
  "body": {
    "bvn": "{{bvn}}",
    "loan_amount": 50000,
    "credit_score": 750
  },
  "minimum": 75
}

Complex Case: Scoring with Collection

Description: This configuration uses a POST request with a body payload containing a collection of users and their loan details.

"custom": {
  "required": true,
  "sequence": 8,
  "continue_on_failure": false,
  "pre_offer": true,
  "identifier": "scoring-check5",
  "host": "https://example.com/complex",
  "method": "post",
  "body": {
    "users": [
      {"user_id": "12345", "loan_amount": 50000},
      {"user_id": "67890", "loan_amount": 75000}
    ]
  },
  "minimum": 90
}

  6. Configure each JSON field 

  • Ensure that each field is correctly configured according to your custom module’s requirements.
S/NVariableDescription
1requiredType: boolean (true or false)
Description: This setting shows whether the module is mandatory for the decision process. If set to true, the module must run successfully. If set to false, it can be skipped without affecting the overall decision flow.
2sequenceType: integer
Description: This setting defines the module’s execution order in the decision model. A lower number runs it earlier in the sequence, helping determine the order in which modules or rules are applied.
3continue_on_failureType: boolean (true or false)
Description: This setting decides if the process continues when the module fails.
4pre_offerType: boolean (true or false)
Description: This setting specifies whether the module runs before generating a loan offer.
5identifierType: string (URL)
Description: This is a unique identifier for the custom scoring module. It is used to reference the module in the system and logs. The identifier must be unique across all modules.
6hostType: string (URL)
Description: This is the endpoint URL where the scoring logic or API is hosted.
7method Type: string (HTTP method, e.g., "get""post")
Description: This setting specifies the HTTP method used when calling the host URL.
8minimumType: integer
Description: This sets the minimum score a customer must achieve to pass this module’s requirements.
9headersType: string
Description: This is the authentication key or bearer token needed to call the host.
10queryType: object (optional)
Description: Key-value pairs sent as query parameters
11bodyType: object (optional)
Description: Key-value pairs sent as query parameters for POST requests.

   7. After adding the JSON payload, click on the “Save Changes” button to apply the changes to the decision model.

Adding a module to your decision model

Also read: Earn extra income by helping businesses access better lending solutions

Was this page helpful?