- 14 Aug 2024
- 9 Minutes To Read
- Print
- DarkLight
- PDF
Loan Products Configuration
- Updated On 14 Aug 2024
- 9 Minutes To Read
- Print
- DarkLight
- PDF
A loan product allows for pre-setting parameters for customized loans. Configuration as Code enables batch configuration of loan products via Mambu API v2 using YAML. API operations support requests for loan products. Additional headers are required for asynchronous PUT requests. GET configuration retrieves loan products based on product types. PUT configuration allows for updating loan product configurations. Input requirements include various settings for loan products. Validation errors must be fixed for a successful PUT request.
A loan product allows you to set up, in advance, the parameters for a type of loan that you wish to offer. Loan products are flexible and highly customizable templates for creating individual loans. For more information, see Setting Up New Loan Products.
With Configuration as Code (CasC), you may batch configure your loan products configuration via Mambu API v2 using YAML. For general information on CasC, see Configuration as Code Overview.
API operations
CasC for loan products supports two operations.
| Action | Endpoint | Description |
|---|---|---|
GET | /configuration/loanproducts.yaml | Get current loan products configuration. |
PUT | /configuration/loanproducts.yaml | Write a new loan products configuration to Mambu. |
If you write a PUT configuration to Mambu, any loan products not included in the new YAML configuration will be deleted - if possible.
If the loan products cannot be deleted, you will receive warnings.
Requests
For general information on CasC requests such as authentication and required headers, see Configuration as Code Overview.
The following section shows sample requests using curl and basic authentication. For all examples, replace TENANT_NAME with your actual tenant name. {auth} is the base64 encoded value of username:password. For more information, see Authentication in our API reference.
Additional headers
You may send synchronous or asynchronous PUT requests.
If you have more than 60 loan products, we recommend you make your request asynchronous.
To use the endpoint asynchronously, you must provide two additional headers:
X-Mambu-Asyncwith a value oftrue.X-Mambu-Callbackwith the callback URL.
The expected status code in case of a successful asynchronous request is 202 Accepted. When the update configuration operation is completed, a message will be posted to the provided URL with information about whether the updated request completed successfully or not.
GET configuration
Get loan products for all product types
curl -X GET 'https://TENANT_NAME.mambu.com/api/configuration/loanproducts.yaml' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Authorization: Basic {auth}'
Get loan products for specific product types
To retrieve loan products for specific product types, you may use the type query parameter. You may specify more than one product type.
The following example returns all loan products for the revolving credit and dynamic term loan product types.
curl -X GET 'https://TENANT_NAME.mambu.com/api/configuration/loanproducts.yaml?type=REVOLVING_CREDIT&type=DYNAMIC_TERM_LOAN' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Authorization: Basic {auth}'
PUT configuration
curl -X PUT 'https://TENANT_NAME.mambu.com/api/configuration/loanproducts.yaml' \
-H 'Accept: application/vnd.mambu.v2+yaml' \
-H 'Content-Type: application/yaml' \
-H 'Authorization: Basic {auth}' \
--data-binary @loanproducts.yaml
@loanproducts.yaml represents the absolute path of the file on your device. Use the --data-raw flag if you want to specify the YAML body inline.
Configuration body example
---
id: "6354"
name: "house_mortgage"
notes: "loan product secured by a property that the loan applicant already owns"
type: "DYNAMIC_TERM_LOAN"
category: "COMMERCIAL"
state: "INACTIVE"
loanAmountSettings:
loanAmount:
minValue: 1
maxValue: 100
defaultValue: 10
trancheSettings:
maxNumberOfTranches: 1
scheduleSettings:
repaymentScheduleMethod: "FIXED"
scheduleDueDatesMethod: "FIXED_DAYS_OF_MONTH"
defaultRepaymentPeriodCount: 4
repaymentPeriodUnit: "MONTHS"
fixedDaysOfMonth:
- 2
- 4
shortMonthHandlingMethod: "LAST_DAY_IN_MONTH"
roundingSettings:
roundingRepaymentScheduleMethod: "NO_ROUNDING"
repaymentCurrencyRounding: "ROUND_TO_NEAREST_WHOLE_UNIT"
repaymentElementsRoundingMethod: "ROUND_ALL"
numInstallments:
defaultValue: 77
maxValue: 7
firstRepaymentDueDateOffset:
defaultValue: 77
maxValue: 7
repaymentScheduleEditOptions:
- "ADJUST_NUMBER_OF_INSTALLMENTS"
- "ADJUST_FEE_PAYMENT_SCHEDULE"
repaymentReschedulingMethod: "NEXT_WORKING_DAY"
billingCycles:
enabled: true
startDays:
- 9
- 5
- 7
previewSchedule:
previewScheduleEnabled: true
numberOfPreviewedInstalments: 3
paymentSettings:
paymentMethod: "VERTICAL"
amortizationMethod: "OPTIMIZED_PAYMENTS"
prepaymentSettings:
prepaymentRecalculationMethod: "RECALCULATE_SCHEDULE_KEEP_SAME_NUMBER_OF_TERMS"
elementsRecalculationMethod: "PRINCIPAL_EXPECTED_FIXED"
prepaymentAcceptance: "ACCEPT_PREPAYMENTS"
futurePaymentsAcceptance: "ACCEPT_FUTURE_PAYMENTS"
applyInterestOnPrepaymentMethod: "AUTOMATIC"
principalPaidInstallmentStatus: "PARTIALLY_PAID"
latePaymentsRecalculationMethod: "LAST_INSTALLMENT_INCREASE"
repaymentAllocationOrder:
- "FEE"
- "PRINCIPAL"
principalPaymentSettings:
amount:
minValue: 1
maxValue: 100
defaultValue: 10
percentage:
minValue: 1
maxValue: 100
defaultValue: 10
principalPaymentMethod: "OUTSTANDING_PRINCIPAL_PERCENTAGE"
totalDuePayment: "OUTSTANDING_PRINCIPAL_PERCENTAGE"
defaultPrincipalRepaymentInterval: 6
principalCeilingValue: 5
principalFloorValue: 3
totalDueAmountFloor: 2
includeFeesInFloorAmount: true
gracePeriodSettings:
gracePeriod:
defaultValue: 77
maxValue: 7
gracePeriodType: "NONE"
newAccountSettings:
idGeneratorType: "RANDOM_PATTERN"
idPattern: "@@@###"
accountInitialState: "PENDING_APPROVAL"
interestSettings:
interestApplicationMethod: "REPAYMENT_DUE_DATE"
interestBalanceCalculationMethod: "PRINCIPAL_AND_INTEREST"
interestCalculationMethod: "DECLINING_BALANCE"
daysInYear: "ACTUAL_ACTUAL_ISDA"
scheduleInterestDaysCountMethod: "REPAYMENT_PERIODICITY"
interestType: "SIMPLE_INTEREST"
indexRateSettings:
indexSourceId: "index source id"
interestRate:
minValue: 1
maxValue: 100
defaultValue: 10
interestRateSource: "FIXED_INTEREST_RATE"
interestRateTerms: "TIERED"
interestChargeFrequency: "EVERY_DAY"
interestRateReviewUnit: "MONTHS"
interestRateReviewCount: 6
interestChargeFrequencyCount: 9
accrueInterestAfterMaturity: true
interestRateCeilingValue: 34
interestRateFloorValue: 12
allowNegativeInterestRate: true
interestRateTiers:
- endingBalance: 17
interestRate: 45
- endingBalance: 17
interestRate: 45
accrueLateInterest: true
compoundingFrequency: "DAILY"
interestRateSettings:
- interestRateSource: "INDEX_INTEREST_RATE"
indexSourceId: "index rate source id"
interestRate:
minValue: 1
maxValue: 100
defaultValue: 10
interestRateCeilingValue: 45
interestRateFloorValue: 87
interestRateReviewCount: 7
interestRateReviewUnit: "DAYS"
- interestRateSource: "INDEX_INTEREST_RATE"
indexSourceId: "index rate source id"
interestRate:
minValue: 1
maxValue: 100
defaultValue: 10
interestRateCeilingValue: 45
interestRateFloorValue: 87
interestRateReviewCount: 7
interestRateReviewUnit: "DAYS"
penaltySettings:
penaltyRate:
minValue: 1
maxValue: 100
defaultValue: 10
loanPenaltyCalculationMethod: "OUTSTANDING_PRINCIPAL"
loanPenaltyGracePeriod: 4
arrearsSettings:
toleranceCalculationMethod: "ARREARS_TOLERANCE_PERIOD"
dateCalculationMethod: "ACCOUNT_FIRST_WENT_TO_ARREARS"
nonWorkingDaysMethod: "EXCLUDED"
toleranceFloorAmount: 45
tolerancePeriod:
defaultValue: 77
maxValue: 7
tolerancePercentageOfOutstandingPrincipal:
minValue: 1
maxValue: 100
defaultValue: 10
monthlyToleranceDay: 4
feesSettings:
allowArbitraryFees: true
fees:
- name: "fee_name"
id: "fee_id"
amount: 10
amountCalculationMethod: "LOAN_AMOUNT_PERCENTAGE"
trigger: "ARBITRARY"
feeApplication: "OPTIONAL"
state: "INACTIVE"
applyDateMethod: "FIRST_OF_EVERY_MONTH"
accountingRules:
- glAccountId: "gl_account_code"
financialResource: "FUND_SOURCE"
transactionChannelId: "transaction_channel_id"
- glAccountId: "gl_account_code"
financialResource: "FUND_SOURCE"
transactionChannelId: "transaction_channel_id"
percentageAmount: 4.5
amortizationSettings:
frequency: "CUSTOM_INTERVAL"
periodUnit: "DAYS"
periodCount: 5
intervalType: "PREDEFINED_INTERVALS"
intervalCount: 7
amortizationProfile: "EFFECTIVE_INTEREST_RATE"
feeAmortizationUponRescheduleRefinanceOption: "END_AMORTIZATION_ON_THE_ORIGINAL_ACCOUNT"
taxSettings:
taxableCalculationMethod: "CUSTOM_TAX"
- name: "fee_name"
id: "fee_id"
amount: 10
amountCalculationMethod: "LOAN_AMOUNT_PERCENTAGE"
trigger: "ARBITRARY"
feeApplication: "OPTIONAL"
state: "INACTIVE"
applyDateMethod: "FIRST_OF_EVERY_MONTH"
accountingRules:
- glAccountId: "gl_account_code"
financialResource: "FUND_SOURCE"
transactionChannelId: "transaction_channel_id"
- glAccountId: "gl_account_code"
financialResource: "FUND_SOURCE"
transactionChannelId: "transaction_channel_id"
percentageAmount: 4.5
amortizationSettings:
frequency: "CUSTOM_INTERVAL"
periodUnit: "DAYS"
periodCount: 5
intervalType: "PREDEFINED_INTERVALS"
intervalCount: 7
amortizationProfile: "EFFECTIVE_INTEREST_RATE"
feeAmortizationUponRescheduleRefinanceOption: "END_AMORTIZATION_ON_THE_ORIGINAL_ACCOUNT"
taxSettings:
taxableCalculationMethod: "CUSTOM_TAX"
accountingSettings:
accountingMethod: "ACCRUAL"
interestAccruedAccountingMethod: "DAILY"
interestAccrualCalculation: "NONE"
accountingRules:
- glAccountId: "gl_account_code"
financialResource: "FUND_SOURCE"
transactionChannelId: "transaction_channel_id"
- glAccountId: "gl_account_code"
financialResource: "FUND_SOURCE"
transactionChannelId: "transaction_channel_id"
accountLinkSettings:
enabled: true
linkableDepositProductId: "deposit id"
linkedAccountOptions:
- "AUTO_CREATE_LINKED_ACCOUNTS"
- "AUTO_LINK_ACCOUNTS"
settlementMethod: "FULL_DUE_AMOUNTS"
taxSettings:
taxesOnInterestEnabled: true
taxesOnFeesEnabled: true
taxesOnPenaltyEnabled: true
taxSourceId: "here_should_be_an_id"
taxCalculationMethod: "EXCLUSIVE"
internalControls:
dormancyPeriodDays: 4
lockSettings:
lockPeriodDays: 4
cappingMethod: "OUTSTANDING_PRINCIPAL_PERCENTAGE"
cappingConstraintType: "HARD_CAP"
cappingPercentage: 9
fourEyesPrinciple:
activeForLoanApproval: true
securitySettings:
isGuarantorsEnabled: true
isCollateralEnabled: true
creditArrangementSettings:
creditArrangementRequirement: "NOT_REQUIRED"
fundingSettings:
enabled: true
requiredFunds: 10
funderInterestCommissionAllocationType: "PERCENTAGE_OF_LOAN_FUNDING"
organizationInterestCommission:
minValue: 1
maxValue: 100
defaultValue: 10
funderInterestCommission:
minValue: 1
maxValue: 100
defaultValue: 10
lockFundsAtApproval: true
availabilitySettings:
branchSettings:
forAllBranches: true
availableProductBranches:
- "branchid1"
- "branchid2"
availableFor:
- "SOLIDARITY_GROUPS"
- "INDIVIDUALS"
offsetSettings:
allowOffset: true
redrawSettings:
allowRedraw: true
allowCustomRepaymentAllocation: true
currency:
code: "AED"
Input requirements
The input requirements are in addition to any existing validations or input requirements for loan products. The same loan product requirements apply whether a loan product is made via the Mambu UI, Mambu API v2, or through CasC.
Basic fields
| Name | Validations | Required |
|---|---|---|
id | Must not be empty, must not exceed a length of 16 characters, and must not be duplicate. | YES |
name | Must not be blank, and must be between 1 and 255 characters. | YES |
Credit Arrangement Settings
| Name | Validations | Required |
|---|---|---|
creditArrangementSettings | - | NO |
creditArrangementRequirement | If creditArrangementSettings are defined, must not be null. | YES |
Offset Settings
| Name | Validations | Required |
|---|---|---|
offsetSettings | - | NO |
allowOffset | If offsetSettings are defined, must not be null. | YES |
Redraw Settings
| Name | Validations | Required |
|---|---|---|
redrawSettings | - | NO |
allowRedraw | If redrawSettings are defined, must not be null. | YES |
Currency
| Name | Validations | Required |
|---|---|---|
currency | - | NO |
code | If currency is defined, must not be null and must contain existing currencies. | YES |
Loan Amount Settings
| Name | Validations | Required |
|---|---|---|
loanAmountSettings | - | NO |
trancheSettings.maxNumberOfTranches | If loanAmountSettings are defined, must not be null. | YES |
Grace Period Settings
| Name | Validations | Required |
|---|---|---|
gracePeriodSettings | - | NO |
gracePeriodType | If gracePeriodSettings are defined, must not be null. | YES |
New Account Settings
| Name | Validations | Required |
|---|---|---|
newAccountSettings | - | NO |
idGeneratorType | If newAccountSettings are defined, must not be null. | YES |
idPattern | If newAccountSettings are defined, must not be null. | YES |
accountInitialState | If newAccountSettings are defined, must not be null. | YES |
Interest Settings
| Name | Validations | Required |
|---|---|---|
interestSettings | - | YES |
interestApplicationMethod | Must not be null. | YES |
interestBalanceCalculationMethod | Must not be null. | YES |
interestCalculationMethod | Must not be null. | YES |
daysInYear | Must not be null. | YES |
scheduleInterestDaysCountMethod | Must not be null. | YES |
interestType | Must not be null. | YES |
indexRateSettings | - | NO |
indexRateSettings.indexSourceId | If indexRateSettings is defined, must contain existing ID. | YES |
indexRateSettings.interestRate | If indexRateSettings is defined, then it must respect the condition min<=def<=max | YES |
indexRateSettings.interestRateTerms | If indexRateSettings is defined, must not be null. | YES |
indexRateSettings.interestRateSource | If indexRateSettings is defined, must not be null. | YES |
interestRateSettings | If indexRateSettings is not null then interestRateSettings must be empty. | YES |
indexSourceId | Must not be duplicate, must contain existing ID. | YES |
Fees Settings
| Name | Validations | Required |
|---|---|---|
feesSettings | - | NO |
fees | - | NO |
fees.id | If fees is defined, must not be blank. | YES |
fees.trigger | If fees is defined, must not be null. | YES |
fees.feeApplication | If fees is defined, must not be null. | YES |
fees.state | If fees is defined, must not be null. | YES |
accountingRules.glAccountId | If feesSettings is defined, must not be null, must contain existing ID. | YES |
accountingRules.financialResource | If feesSettings is defined, must not be null. | YES |
accountingRules.transactionChannelId | If feesSettings is defined, must contain existing ID. | YES |
Payment Settings
| Name | Validations | Required |
|---|---|---|
paymentSettings | - | NO |
paymentMethod | If paymentSettings is defined, must not be null. | YES |
amortizationMethod | If paymentSettings is defined, must not be null. | YES |
prepaymentSettings | - | NO |
prepaymentSettings.prepaymentAcceptance | If prepaymentSettings is defined, must not be null. | YES |
prepaymentSettings.futurePaymentsAcceptance | If prepaymentSettings is defined, must not be null. | YES |
latePaymentsRecalculationMethod | If paymentSettings is defined, must not be null. | YES |
repaymentAllocationOrder | If paymentSettings is defined, must not be null. | YES |
principalPaymentSettings | - | NO |
principalPaymentSettings.amount | If principalPaymentSettings is defined and it is not null, then it must respect the condition min<=def<=max | NO |
principalPaymentSettings.percentage | If principalPaymentSettings is defined and it is not null, then it must respect the condition min<=def<=max | NO |
principalPaymentSettings.principalPaymentMethod | If principalPaymentSettings is defined and if product type is revolving credit, you must define either principalPaymentMethod or totalDuePayment and the other must be null. | YES |
principalPaymentSettings.totalDuePayment | If principalPaymentSettings is defined and if product type is revolving credit, you must define either principalPaymentMethod or totalDuePayment and the other must be null. | YES |
principalPaymentSettings.principalFloorValue | If principalPaymentSettings is defined, must be null if totalDueAmountFloor is not null. | YES |
principalPaymentSettings.totalDueAmountFloor | If principalPaymentSettings is defined, must be null if principalFloorValue is not null. | YES |
Internal Controls
| Name | Validations | Required |
|---|---|---|
internalControls | - | NO |
internalControls.dormancyPeriodDays | Value must be between 0 and 2000000000. | NO |
internalControls.lockSettings | - | NO |
lockSettings.lockPeriodDays | Value must be between 1 and 2000000000. | NO |
lockSettings.cappingPercentage | Value must be between 0 and 1999999973982208 | NO |
Tax Settings
| Name | Validations | Required |
|---|---|---|
taxSettings | - | NO |
taxSourceId | If defined, must contain existing ID. | NO |
Account Link Settings
| Name | Validations | Required |
|---|---|---|
accountLinkSettings | - | NO |
accountLinkSettings.linkableDepositProductId | If defined, must contain existing ID. | NO |
accountLinkSettings.settlementMethod | If accountLinkSettings is defined, must not be null. | YES |
Accounting Settings
| Name | Validations | Required |
|---|---|---|
accountingSettings | - | NO |
accountingSettings.accountingMethod | If accountingSettings is defined, must not be null. | YES |
accountingSettings.interestAccrualCalculation | If accountingSettings is defined, must not be null. | YES |
accountingRules.glAccountId | If accountingSettings is defined, must not be null and must contain existing ID. | YES |
accountingRules.financialResource | If accountingSettings is defined, must not be null. | YES |
accountingRules.transactionChannelId | If accountingSettings is defined, must not be null. Can only specify one rule per financialResource. | YES |
Penalty Settings
| Name | Validations | Required |
|---|---|---|
penaltySettings | - | NO |
penaltySettings.loanPenaltyCalculationMethod | If penaltySettings are defined, must not be null. | YES |
Availability Settings
| Name | Validations | Required |
|---|---|---|
availabilitySettings | - | NO |
availabilitySettings.branchSettings | - | NO |
branchSettings.availableProductBranches | If defined, must contain existing ID. | NO |
branchSettings.allBranches | If branchSettings is defined, must not be null. | YES |
branchSettings.branches | If branchSettings is defined, must not be null. | YES |
availabilitySettings.availableFor | If defined, must not be null. | NO |
Schedule Settings
| Name | Validations | Required |
|---|---|---|
scheduleSettings | Not mandatory, except for the revolving credit loan product type. | NO |
roundingSettings | - | NO |
roundingSettings.repaymentElementsRoundingMethod | If roundingSettings is defined, must not be null. | YES |
billingCycles | - | NO |
billingCycles.enabled | If billingCycles is defined, must not be null. | YES |
previewSchedule | - | NO |
previewSchedule.enabled | If previewSchedule is defined, must not be null. | YES |
Replies
If you do not receive a 200 OK status code then fix any validation errors and make another PUT request until you receive a 200 OK status code.
If you PUT a valid YAML configuration to the API and you do not receive a 200 OK status code within 60 seconds, you may receive a 504 Gateway Timeout status code. We expect all responses to be below 60 seconds.
If you encounter this issue, please contact us through Mambu Support so we can investigate it.
