Using Loan Calc Flags

How to use the loanCalcSettings object to update calculator settings and flags.

LoanPro's calculator settings can now be updated at the account level, meaning individual loan accounts can be configured to calculate in different ways. The calculator uses "calc flags" to determine how to calculate loan terms and balances. There are currently eleven different flags.

This article explains how to update a loan account's calculator settings and which calc settings to use depending on the calculation scenario.

Getting started

Before starting, ensure you have valid LMS API credentials for your environment. View the Quickstart Guide 🏁 to generate new credentials.

ℹ️

Ensure your API token has access to the LoanCalcSettings endpoint.

LoanPro's Role-Based Access Controls (RBAC) allow you to determine which API endpoints and HTTP methods are available for individual bearer tokens.

Before moving on, ensure your token has access to the LoanCalcSettings endpoint by navigating to Settings > Company > Access > Role-Based Access within the LoanPro UI to view and update access settings.

To learn more, view Creating Agent User-Based Access ↗

The LoanCalcSettings entity

Loan calc settings are stored within the LoanCalcSettings entity. This entity is not stored within the Loans entity, meaning loan calc settings cannot be found by sending a GET request to the /Loans endpoint.

Loan calc settings may or may not exist on a loan account depending on when the loan was created. If they do not exist for a given loan, they can manually added. To do so, send a POST /LoanCalcSettings request ↓

Here's a sample of the information stored within the LoanCalcSettings entity:

{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": "https: //loanpro.simnang.com/api/public/api/1/odata.svc/LoanCalcSettings(id=80)",
                    "type": "Entity.LoanCalcSettings"
                },
                "id": 80, //<---- LoanCalcSettingsId
                "entityId": 3535, //<---- LoanId
                "entityType": "Entity.Loan",
                "setting": "roll-schedule-interest-only-with-irc", //<---- Calc flag
                "value": "1",
                "modified": "/Date(1744833606)/",
                "modifiedBy": 19327
            }
        ],
        "summary": {
            "start": 0,
            "pageSize": 50,
            "total": 1
        }
    }
}

Available calc flags

Calc flags are enumerated values that represent different calculator settings. Here's a breakdown of available flag options and how they affect loan calculations:

Flag nameDescriptionDefault valueDefault for new calculator
balance-lessthan-pmtamtWhen this flag is set to 0 and the principal balance + accrued interest for the period is less than the regular scheduled payment amount for that same period, the loans scheduled payment amount will be decreased to match principal balance + accrued interest in that period.

When this flag is set to 1, the regularly scheduled payment amount will stay constant and unaffected by the remaining principal balance. In this case, only the forecasted payment will adjust to cover the payoff at the time of the forecasted payment date.
11
int-adjustment-in-forecasted-pmtWhen this flag is set to 0, interest adjustments will be included in the forecasted payment calculation in what has "come due" on the customer's account. This will not affect delinquency on the accounts—only the forecasted payments. When this flag is set to 1, interest adjustments will be excluded from what has "come due" on the customer's account for forecasted payment calculations.

Example: The customer has an upcoming due payment of $100.00, in addition to an interest adjustment increasing due interest by $50.00 on the same day.

When this flag is set to 0, the customer will need to pay $150.00 to fully satisfy the upcoming forecasted payment.

When this flag is set to 1, the customer will need to pay $100.00 to fully satisfy the upcoming forecasted payment.
00
roll-schedule-interest-only-with-ircThis calc setting corrected a bug in the system that exists when you have an interest only roll schedule in addition to an interest rate change. When the flag is set to 0, Schedule Rolls that are set to interest only or interest only plus will ignore interest rate changes.

When we created this value, we migrated all existing loans to have the value of 0, but when a new loans are created, it's created with a value of 1 so that the new setting takes affect.
11
forecastext-pastdueint-altThis calc setting corrected a bug that exists in a very rare circumstances. The use case for this flag is when there is an extremely high interest rate on the loan, a roll schedule exists on the account, and the loan pushes out its forecasted payment for several periods.

When the loan has the above circumstances present and the forecast payment is pushed out, updating the flag to 1 should correct it.
null
(not created by default)
0
dpd-resetting-capitalized-interestThis calc setting corrects a bug that occurs in interest capitalization scenarios where the days past due value would incorrectly reset on unexpected dates. In these scenarios, the amount past due would continue to increment, but the days past due would reset to zero.00
forecasted-extra-towards-fixThis calc setting corrects two issues with forecasted extra towards options (One Period Forecasted, Two Period Forecasted, and Next Forecasted).

The first issue can occur when a payment is applied in a period wherein the next next scheduled payment amount was either higher or lower than the current scheduled payment amount. With this flag set to "off", the loan calculates amounts to pay ahead on the current period payment amount. With this flag set to "on", the loan calculates amounts to pay ahead on the next scheduled payment amounts, resulting in the correct allocation towards due components and Principal Only extra towards.

The second issue can occur when multiple payments are applied to a loan on the same day and the following criteria is met:

- the loan was already past due
- the sum of the payments results in past due amounts being satisfied
- the loan was paid ahead by some amountWith this flag set to "off", these payments will split between due components and extra towards in an unexpected way that results in the account becoming delinquent. With the flag set to "on", these payments correctly satisfy the past due amount before beginning to pay ahead on the account and any Principal Only extra towards.
01
intOnly-carriedInt-removeFromPDThis calc setting corrects an issue that can occur when a loan has a period of simple interest payments in which the amount of interest accrued in any given period is greater than the scheduled payment amount, followed by a period of Interest Only payments.

With this flag set to "off", any extra accrued interest immediately becomes past due upon entering the interest only period on the loan.

With the flag set to "on", the loan will correctly base past due amounts on the actual scheduled payment amounts minus what has been paid towards due components.
null
(not created by default)
0
last-as-final-interest-continueThis calc setting flag corrects a behavior identified in loans with an Interest application of 'Between Periods' and the 'Last as Final' setting enabled in the loan setup.

With the flag set to "off", the loan will stop accruing interest on the original maturity date when the above setup configuration is present.

With the flag set to "on", the calculator correctly continues interest accrual on these accounts until the loan is paid off or until interest is halted by either an interest rate change or a suspend interest accrual transaction.
01
payoff-pmt-round-componentsThis calc setting flag corrects a rounding behavior when a loan has at least one payoff payment on the account that does not fully pay off the account.

In this scenario, rounding would result in unexpected application of any additional payoff payments meant to fully pay off the loan.
01
rule78-closeFinanceCharge-forceRegSmooth-changeDueDateIntPersistThis calc setting flag corrects a series of known behaviors with the Rule 78 loan calculation type to ensure with a true Rule 78 calculation.

First, this flag fixes an issue that sometimes occurs at the end of a loan that caused the forecasted loan calculations to continue perpetually, resulting in the account never being fully paid off.

Second, this flag fixes an issue that causes interest accrual to change from period to period when a change due date or other loan-affecting transaction was applied to the account. This was in contrary to a true Rule 78 calculation type where the interest schedule is locked.

With this flag set to "on", both of these behaviors are corrected. This flag should be on for lenders utilizing Rule 78 loan calculation type.
11

Updating a loan's new calc settings

Updating a loan's calc settings involves the following steps:

  1. Send GET /LoanCalcSettings request to retrieve existing configuration information
  2. Send POST /LoanCalcSettings request (if the loan has no existing settings configuration)
  3. Send PUT /LoanCalcSettings request to update configuration

1. Retrieve existing configuration information

To update a loan account's calc settings, first determine if settings exist for the account. Send a GET request with a $filter param that references the ID of the loan:

curl --request GET \
     --url {baseUrl}/odata.svc/LoanCalcSettings?$filter=entityId eq {loanID} \
     --header 'Authorization: Bearer {token}' \
     --header 'Autopal-Instance-Id: {tenant ID}' \
     --header 'content-type: application/json' \
     --data ''

If the account has no existing loan calc settings configuration, the response will return no results:

{
    "d": {
        "results": [],
        "summary": {
            "start": 0,
            "pageSize": 50,
            "total": 0
        }
    }
}

In this scenario, send a POST /LoanCalcSettings request to create a configuration.

If the account has existing configuration data, the response will return the following:

{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": "https://loanpro.simnang.com/api/public/api/1/odata.svc/LoanCalcSettings(id=1)",
                    "type": "Entity.LoanCalcSettings"
                },
                "id": 1,
                "entityId": 11115,
                "entityType": "Entity.Loan",
                "setting": "balance-lessthan-pmtamt",
                "value": "1",
                "modified": "/Date(1745000600)/",
                "modifiedBy": 12926
            }
        ],
        "summary": {
            "start": 0,
            "pageSize": 50,
            "total": 1
        }
    }
}

This response returns an ID that represents existing loan calc settings. The ID is stored within the "id" field (d.results[0].id), and it's used to update a loan's calc settings in subsequent requests. We'll reference this ID as {loan-calc-settings-id}.

In this scenario, send a PUT /LoanCalcSettings request to update an existing configuration.

2. Send POST request to create loan calc settings object

ℹ️

This request is only necessary if the loan account has no existing loan calc settings configuration

If a settings configuration already exists, skip to step 3.

To create a loan account's calc settings configuration, send a POST request:

curl --request POST \
     --url {baseUrl}/odata.svc/LoanCalcSettings \
     --header 'Authorization: Bearer {token}' \
     --header 'Autopal-Instance-Id: {tenant ID}' \
     --header 'content-type: application/json' \
     --data '
     {
        "entityId": {{loan-id}}, 
        "entityType": "Entity.Loan",
        "setting": "{{calc-flag}}",
        "value": 1
}
'

Here's a breakdown of the body params included in this request:

Param nameData typeDescriptionRequired?
entityIdstringThe ID of the loan account.Yes ✅
entityTypestringThe type of entity to which the loan calc settings are being added.

Set this to "Entity.Loan"
Yes ✅
settingenumThe calc flag that is being updated.

See Available calc flags for more information
Yes ✅
valueintDetermines whether the chosen calc flag is enabled or not.

Use 1 to enable the flag
Use 0 to disable the flag
Yes ✅

A successful request will return the following response structure:

{
    "d": {
        "__metadata": {
            "uri": "https://loanpro.simnang.com/api/public/api/1/odata.svc/LoanCalcSettings(id=2)",
            "type": "Entity.LoanCalcSettings"
        },
        "id": 2,
        "entityId": 10011,
        "entityType": "Entity.Loan",
        "setting": "balance-lessthan-pmtamt",
        "value": "1",
        "modified": "/Date(1745945901)/",
        "modifiedBy": 12926
    }
}

This request returns an ID that represents the newly created loan calc settings. The ID is stored within the "id" field (d.results.id), and it's used to update a loan's calc settings if desired. We'll reference this ID as {loan-calc-settings-id}.

3. Send PUT request to update settings

To update existing loan calc settings configurations, send a PUT request that includes the loan calc settings ID as a path parameter and the new settings within the payload body:

curl --request PUT \
     --url {baseUrl}/odata.svc/LoanCalcSettings({loan-calc-settings-id}) \
     --header 'Authorization: Bearer {token}' \
     --header 'Autopal-Instance-Id: {tenant ID}' \
     --header 'content-type: application/json' \
     --data '
     {
        "entityId": {{loan-id}}, 
        "entityType": "Entity.Loan",
        "setting": "{{calc-flag}}",
        "value": 1
}
'

Here's a breakdown of the body params included in this request:

Param nameData typeDescriptionRequired?
entityIdstringThe ID of the loan account.Yes ✅
entityTypestringThe type of entity to which the loan calc settings are being added.

Set this to "Entity.Loan"
Yes ✅
settingenumThe calc flag that is being updated.

See Available calc flags for more information
Yes ✅
valueintDetermines whether the chosen calc flag is enabled or not.

Use 1 to enable the flag
Use 0 to disable the flag
Yes ✅

Did this page help you?