Skip to main content

CalculationDetails

At the core of MRE functionality is generating reports for a calculation request. A calculation request may be sent towards a generate report endpoint, in which case the calculation request is immediately calculated against the engine's logic, or, the calculation request is sent to a create session endpoint for the MyCRM integration, in which case that calculation is deferred for later and just stored in the database.

In both of those cases, the calculation request contains a Details  object which defines the key input parameters for the calculation with all relevant financial information. 

Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$defs": {
    "Lender": {
      "type": [
        "string",
        "null"
      ],
      "description": "The [lender (bank)](https://docs.blackfin.tools/books/mortgagerecenginemycrm/page/lenders) which the existing loan is with/from - eg. 'Westpac' this field is only present if LoanType=Existing",
      "enum": [
        null,
        "AbodeMortgagesLimited",
        "AccessHomeLoansLimited",
        "Accuro",
        "AIA",
        "AlliedDunbar",
        "AMBL",
        "AMPLifetrack",
        "AMPRPP",
        "ANZ",
        "Argosy",
        "ASAPFinanceLimited",
        "ASB",
        "AscendFinance",
        "AssetFinanceSelect",
        "AsteronLife",
        "AvantiFinance",
        "BankofChinaNewZealandLimited",
        "BasecorpFinance",
        "BasecorpFinance",
        "Bluestone",
        "BNZ",
        "CBS",
        "CFML",
        "ChinaConstructionBankNewZealandLimited",
        "Cigna",
        "CommixGroupLimited",
        "CressidaCapital",
        "DBR",
        "DBRLimited",
        "EconomyHomeLoans",
        "FamilyFinance",
        "FidelityLife",
        "FirstMortgageTrust",
        "FreedomMortgages",
        "FreedomMortgagesLtd",
        "GEMoney",
        "GemHomeLoans",
        "GeneralFinance",
        "GoldBandFinance",
        "Greenwich",
        "HeartlandBank",
        "HeartlandBankONHOLD",
        "HomeTrustMortgagesCentralWestLtd",
        "HSBC",
        "IndustrialandCommercialBankofChinaNewZealandLimited",
        "Kiwibank",
        "KMMHO",
        "LibertyFinancial",
        "LibertyFinancialLimited",
        "MARAC",
        "MetroMoneyLtd",
        "MortgageNorth",
        "MTF",
        "MutualFinanceLimited",
        "NationalBank",
        "NBS",
        "Neo",
        "NIB",
        "NZFinance",
        "NZGuardianTrust",
        "NZCUSouth",
        "NZF",
        "OriginANZ",
        "Other",
        "OtherLenders",
        "OtherNonBankLenders",
        "Oxford",
        "PacificHomeLoans",
        "PacificRetailFinance",
        "PartnersLife",
        "Pepper",
        "PFS",
        "PinnacleLife",
        "Pioneer",
        "Presto",
        "PropertyEquityFinance",
        "PropertyFinanceSecuritiesLimited",
        "PROSPA",
        "Provident",
        "PublicTrust",
        "RESIMAC",
        "SBSBank",
        "SCF",
        "SelectHomeLoan",
        "Simplify",
        "SouthernCross",
        "SouthernCross",
        "SouthernCrossBuildingSociety",
        "SouthernCrossFinanceLtd",
        "Sovereign",
        "SuperBank",
        "TasmanMortgages",
        "TheCooperativeBank",
        "Tower",
        "TrustUs",
        "TSB",
        "UDCFinance",
        "UnitedHomeLoans",
        "Unity",
        "Westpac",
        "WizardHomeloans",
        "XEMoneyTransfer",
        "ZipBusiness"
      ],
      "default": null
    },
    "Frequency": {
      "type": "string",
      "enum": [
        "Yearly",
        "HalfYearly",
        "Quarterly",
        "Monthly",
        "Fortnightly",
        "Weekly"
      ]
    },
    "FrequencyOrNull": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        null,
        "Yearly",
        "HalfYearly",
        "Quarterly",
        "Monthly",
        "Fortnightly",
        "Weekly"
      ]
    },
    "Security": {
      "type": "object",
      "description": "Security/property details for the loan. Contains all property-related information used for LVR calculations and risk assessment.",
      "properties": {
        "SecurityId": {
          "type": "number",
          "minimum": 1,
          "description": "Unique identifier for the loan, starting from 1 and incremented for each security in the request"
        },
        "Value": {
          "type": "number",
          "description": "Value of the security/property used for LVR calculations",
          "minimum": 0,
          "examples": [
            600000,
            1170000
          ]
        },
        "IsRBNZExempt": {
          "type": "boolean",
          "description": "Whether the property is exempt from RBNZ (Reserve Bank of New Zealand) lending restrictions"
        },
        "Location": {
          "type": [
            "string",
            "null"
          ],
          "description": "Property location/address. Can be null for privacy or when not required",
          "examples": [
            "13 Zealandia Road, Whangaparaoa Auckland 0930, New Zealand",
            null
          ]
        },
        "PropertyType": {
          "type": "array",
          "description": "Up to three levels of property categorisation. [0] array item is level 1, [1] is level 2, [2] is level 3. See [property type](https://docs.blackfin.tools/books/mortgagerecenginemycrm/page/loan-security-property-types) table",
          "items": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "ResidentialProperty",
              "FreeHoldResidential",
              "TerracedHousing",
              "FeeSimpleCrossLease",
              "UnitTitle",
              "Townhouse",
              "LifestyleBlock",
              "0to10ha",
              "over10ha",
              "LeaseholdResidential",
              "Apartments",
              "FreeholdApartment",
              "over50sqm",
              "40to50sqm",
              "38to40sqm",
              "under38sqm",
              "LeaseholdApartment",
              "ServicedApartment",
              "StudentAccommodation",
              "BedsitterStudioWarehouseApartments",
              "NewBuildConstruction",
              "FixedPriceContracts",
              "LabourOnlySelfOwnerBuild",
              "Relocations",
              "VacantLand",
              "ServicedVacantLand",
              "UnservicedVacantLand",
              "LifestyleWithoutDwelling",
              "Other",
              "MultipleDwellingsOnOneTitle",
              "3Dwellings",
              "4Dwellings",
              "5Dwellings",
              "6Dwellings",
              "7OrMoreDwellings"
            ]
          },
          "default": []
        },
        "SecurityType": {
          "type": "string",
          "description": "Defines whether the Security is already owned by the Applicant or not",
          "enum": [
            "Existing",
            "Proposed"
          ]
        },
        "UsageType": {
          "type": [
            "string",
            "null"
          ],
          "description": "How the property will be used - eg. 'Owner Occupied'",
          "enum": [
            null,
            "OwnerOccupied",
            "InvestmentProperty"
          ],
          "default": null
        },
        "ValuationType": {
          "type": [
            "string",
            "null"
          ],
          "description": "Type of valuation performed on the property",
          "enum": [
            null,
            "CouncilValuation",
            "EVal",
            "FullRegisteredValuation",
            "SalePurchaseAgreement"
          ]
        }
      },
      "required": [
        "SecurityId",
        "Value",
        "SecurityType"
      ]
    }
  },
  "title": "Mortgage Recommendation Engine - Calculation Details Payload",
  "description": "Schema for calculation details fields passed into the generate report endpoint. This payload contains all the financial and property information needed to calculate mortgage recommendations across multiple lenders.",
  "type": "object",
  "properties": {
    "Loan": {
      "type": "array",
      "description": "Array of loan objects representing loans being applied for or existing loans. Each loan represents a mortgage application.",
      "items": {
        "type": "object",
        "description": "Loan object represents the loan user is applying for or an existing loan. Contains all loan-specific details including amount, terms.",
        "properties": {
          "LoanId": {
            "type": "integer",
            "description": "Unique identifier for the loan, starting from 1 and incremented for each loan in the request",
            "minimum": 1
          },
          "LoanType": {
            "type": "string",
            "description": "Type of loan - whether it's a new application or existing loan being refinanced",
            "enum": [
              "New",
              "Existing"
            ]
          },
          "Lender": {
            "$ref": "#/$defs/Lender"
          },
          "LendingAction": {
            "type": [
              "string",
              "null"
            ],
            "description": "Defines what action the applicant wants to take on an existing loan, only set if LoanType=Existing",
            "enum": [
              null,
              "None",
              "Refinance",
              "TopUp"
            ],
            "default": null
          },
          "LiabilityType": {
            "type": "string",
            "description": "The type of loan being applied for",
            "enum": [
              "HomeLoan"
            ],
            "default": "HomeLoan"
          },
          "LoanAmount": {
            "type": "number",
            "description": "The amount of the loan (in $) being requested",
            "examples": [
              500000,
              852000
            ]
          },
          "TopUpAmount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Additional top-up amount if applicable, null if not applicable"
          },
          "TotalTermMonths": {
            "type": "integer",
            "description": "Total term length of the loan in months, including any interest-only period",
            "minimum": 1,
            "examples": [
              360,
              300,
              240
            ]
          },
          "InterestOnlyTermMonths": {
            "type": "integer",
            "description": "Number of months for interest-only payments at the start of the loan term",
            "minimum": 0,
            "examples": [
              0,
              12,
              24
            ]
          }
        },
        "required": [
          "LoanId",
          "LoanType",
          "LoanAmount",
          "TotalTermMonths"
        ]
      },
      "minItems": 1
    },
    "Security": {
      "type": "array",
      "description": "Array of security/property details. Each security represents a property used for LVR calculations and risk assessment.",
      "items": {
        "$ref": "#/$defs/Security"
      },
      "minItems": 1
    },
    "LoanSecurityMapping": {
      "type": "array",
      "description": "Array of mappings between loans and securities.",
      "items": {
        "type": "object",
        "properties": {
          "LoanId": {
            "type": "integer",
            "description": "The ID of the loan"
          },
          "SecurityId": {
            "type": "integer",
            "description": "The ID of the security"
          }
        },
        "required": [
          "LoanId",
          "SecurityId"
        ]
      },
      "minItems": 1
    },
    "ApplicantParty": {
      "type": "array",
      "description": "Array of applicant party objects. This object groups applicants into a party (e.g., a married couple is 1 party). At the moment, only 1 party at a time is supported. Contains all applicant financial information including income, expenses, and liabilities.",
      "items": {
        "type": "object",
        "description": "Represents a group of applicants applying together for the loan, with their combined financial information",
        "properties": {
          "Applicant": {
            "type": "array",
            "description": "Array of individual applicants in the party. Each applicant is a person applying for the loan.",
            "items": {
              "type": "object",
              "description": "Individual applicant information",
              "properties": {
                "ApplicantId": {
                  "type": "integer",
                  "description": "Numerical identifier for the individual Applicant, typically an incremental ID starting with 1",
                  "minimum": 1
                },
                "Name": {
                  "type": "string",
                  "description": "Full name of the individual Applicant"
                }
              },
              "required": [
                "ApplicantId"
              ]
            },
            "minItems": 1
          },
          "Expense": {
            "type": "array",
            "description": "Array of expense objects for the applicant party. Expenses can be linked to specific applicants or shared across the party.",
            "items": {
              "type": "object",
              "description": "Individual expense item with type, amount, and frequency",
              "properties": {
                "ApplicantId": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Reference to specific applicant for applicant-specific expenses, or null for shared expenses across the party"
                },
                "ExpenseType": {
                  "type": "string",
                  "description": "Type/category of expense. Maps to [API_ExpenseType](https://airtable.com/appK16RVohBeqXaxe/tblK69O5ItAWWYGIv/viwNHJCL9qZ0tsSZR?blocks=hide) table for validation and processing.",
                  "enum": [
                    "ChildCare",
                    "ChildMaintenance",
                    "HigherEducationAndVocationalTraining",
                    "OtherEducation",
                    "PrivateSchoolCosts",
                    "PublicSchoolCosts",
                    "Groceries",
                    "OtherGroceries",
                    "BuildingInsurance",
                    "ContentsInsurance",
                    "HealthInsurance",
                    "IncomeProtection",
                    "LifeInsurance",
                    "OtherInsurance",
                    "VehicleInsurance",
                    "BodyCorporateInvestmentProperty",
                    "BuildingInsuranceInvestmentProperty",
                    "CouncilRatesInvestmentProperty",
                    "ElectricityAndGasInvestmentProperty",
                    "OtherInvestmentPropertyExpense",
                    "RepairsAndMaintenanceInvestmentProperty",
                    "RunningCostsInvestmentProperty",
                    "WaterAndSewerInvestmentProperty",
                    "MedicalAndHealth",
                    "NaturalTherapies",
                    "OtherMedical",
                    "Board",
                    "OtherOngoingRent",
                    "Rent",
                    "Kiwisaver",
                    "Other",
                    "RegularDonations",
                    "VoluntarySaving",
                    "VoluntarySuper",
                    "ClothingAndFootwear",
                    "Cosmetics",
                    "DryCleaning",
                    "OtherPersonalCare",
                    "PersonalCare",
                    "BodyCorporatePrimaryResidence",
                    "CouncilRatesPrimaryResidence",
                    "ElectricityAndGasPrimaryResidence",
                    "FurnishingsAndElectrical",
                    "HomeOperation",
                    "HomeRepairs",
                    "OtherPrimaryResidenceExpense",
                    "WaterAndSewerPrimaryResidence",
                    "AlcoholTobacco",
                    "CinemaConcertsMemberships",
                    "DiningOut",
                    "Gambling",
                    "GiftsAndMiscellaneous",
                    "GymSports",
                    "OtherRecreationalAndEntertainment",
                    "Pets",
                    "TravelAndHolidays",
                    "ContentsInsuranceSecondaryResidence",
                    "BodyCorporateSecondaryResidence",
                    "BuildingInsuranceSecondaryResidence",
                    "CouncilRatesSecondaryResidence",
                    "ElectricityAndGasSecondaryResidence",
                    "OtherSecondaryResidenceExpense",
                    "RepairsAndMaintenanceSecondaryResidence",
                    "RunningCostsSecondaryResidence",
                    "WaterAndSewerSecondaryResidence",
                    "HomeMobilePhone",
                    "InternetPayTVAndMediaStreamingSubscriptions",
                    "OtherTelephoneAndInternet",
                    "Petrol",
                    "PublicTransport",
                    "Registration",
                    "TaxiRideSharing",
                    "TollsParking",
                    "VehicleMaintenance"
                  ]
                },
                "Frequency": {
                  "type": "string",
                  "description": "Frequency of the expense. Maps to [API_Frequency](https://airtable.com/appK16RVohBeqXaxe/tbldIWnNaLIwSxMXW/viwsb8Z6mo4a2IWeq) table.",
                  "enum": [
                    "Weekly",
                    "Fortnightly",
                    "Monthly",
                    "Quarterly",
                    "HalfYearly",
                    "Yearly"
                  ]
                },
                "Amount": {
                  "type": "number",
                  "description": "Amount of the expense in the specified frequency",
                  "minimum": 0,
                  "examples": [
                    250.0,
                    1250,
                    800,
                    3000
                  ]
                }
              },
              "required": [
                "ExpenseType",
                "Frequency",
                "Amount"
              ]
            }
          },
          "Income": {
            "type": "array",
            "description": "Array of income objects for the applicant party. Income defines a certain group/category of income that can be linked to a specific applicant or represent common income in the party.",
            "items": {
              "type": "object",
              "description": "Individual income item with type, amount, frequency, and additional attributes",
              "properties": {
                "ApplicantId": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Reference to specific applicant for applicant-specific income, or null for shared income across the party"
                },
                "IncomeType": {
                  "type": "string",
                  "description": "Type/category of income. 'Code' representation that maps to [API_IncomeType](https://airtable.com/appK16RVohBeqXaxe/tblUMOVEDTQHzRUQO/viwPpM8vU5jhXmmmF?blocks=hide) table.",
                  "enum": [
                    "CarAllowance",
                    "Companycar",
                    "DisabilityAllowance",
                    "WorkAllowance",
                    "Bonus",
                    "Commission",
                    "CompanyProfitBeforeTax",
                    "ChildSupport",
                    "FamilyAllowance",
                    "Other",
                    "UnemployedAllowance",
                    "WidowAllowance",
                    "Annuities",
                    "Dividends",
                    "Interest",
                    "OtherIncome",
                    "OtherNetIncome",
                    "WorkersCompensation",
                    "RegularOvertime",
                    "BoarderIncome",
                    "RentalIncome",
                    "ForeignIncome",
                    "SalaryWages",
                    "PrivatePension",
                    "Superannuation"
                  ]
                },
                "Frequency": {
                  "type": "string",
                  "description": "Frequency of the income. Maps to [API_Frequency](https://airtable.com/appK16RVohBeqXaxe/tbldIWnNaLIwSxMXW/viwsb8Z6mo4a2IWeq) table.",
                  "enum": [
                    "Weekly",
                    "Fortnightly",
                    "Monthly",
                    "Quarterly",
                    "HalfYearly",
                    "Yearly"
                  ]
                },
                "Amount": {
                  "type": "number",
                  "description": "Amount of the income in the specified frequency",
                  "minimum": 0,
                  "examples": [
                    80000.0,
                    568359,
                    500,
                    2000
                  ]
                },
                "AmountType": {
                  "type": "string",
                  "enum": [
                    null,
                    "Gross",
                    "Net"
                  ],
                  "description": "Type of income amount - Net or Gross, defaults to Gross",
                  "default": "Gross"
                },
                "Attributes": {
                  "type": "array",
                  "description": "Additional information about the income",
                  "items": {
                    "anyOf": [
                      {
                        "title": "Kiwisaver",
                        "type": "object",
                        "description": "Kiwisaver (set on SalaryWages)",
                        "properties": {
                          "name": {
                            "const": "Kiwisaver"
                          },
                          "value": {
                            "type": "boolean",
                            "default": false
                          }
                        }
                      },
                      {
                        "title": "KiwisaverContribution",
                        "type": "object",
                        "description": "KiwisaverContribution (set on SalaryWages, if Kiwisaver=true)",
                        "properties": {
                          "name": {
                            "const": "KiwisaverContribution"
                          },
                          "value": {
                            "type": "number",
                            "description": "Percentage value represented as a float - 0.06 for 6% contribution"
                          }
                        }
                      },
                      {
                        "title": "PropertyCountry",
                        "type": "object",
                        "description": "PropertyCountry (set on RentalIncome)",
                        "properties": {
                          "name": {
                            "const": "PropertyCountry"
                          },
                          "value": {
                            "type": "string",
                            "enum": [
                              "NZ",
                              "Offshore"
                            ]
                          }
                        }
                      },
                      {
                        "title": "PropertyBuildDate",
                        "type": "object",
                        "description": "PropertyBuildDate (set on RentalIncome)",
                        "properties": {
                          "name": {
                            "const": "PropertyBuildDate"
                          },
                          "value": {
                            "type": "string",
                            "format": "YYYY-MM-DD",
                            "description": "Date in ISO format: YYYY-MM-DD"
                          }
                        }
                      },
                      {
                        "title": "SalePurchaseDate",
                        "type": "object",
                        "description": "SalePurchaseDate (set on RentalIncome)",
                        "properties": {
                          "name": {
                            "const": "SalePurchaseDate"
                          },
                          "value": {
                            "type": "string",
                            "format": "YYYY-MM-DD",
                            "description": "Date in ISO format: YYYY-MM-DD"
                          }
                        }
                      },
                      {
                        "title": "IsTaxExempt",
                        "type": "object",
                        "description": "IsTaxExempt (set on RentalIncome)",
                        "properties": {
                          "name": {
                            "const": "IsTaxExempt"
                          },
                          "value": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "title": "BoarderIncomeType",
                        "type": "object",
                        "description": "BoarderIncomeType (set on BoarderIncome)",
                        "properties": {
                          "name": {
                            "const": "BoarderIncomeType"
                          },
                          "value": {
                            "type": "string",
                            "enum": [
                              "AllInclusive",
                              "RoomChargeOnly"
                            ]
                          }
                        }
                      }
                    ]
                  }
                }
              },
              "required": [
                "ApplicantId",
                "IncomeType",
                "Frequency",
                "Amount"
              ]
            }
          },
          "Liability": {
            "type": "array",
            "description": "One or more existing liabilities (debts) being declared by the applicant party.",
            "items": {
              "type": "object",
              "properties": {
                "ApplicantId": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The ID of the individual applicant who the liability belongs to. \n\nRequired when `LiabilityType` is StudentLoan, otherwise can be `null`."
                },
                "LoanId": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The ID of the connected loan"
                },
                "LiabilityType": {
                  "type": "string",
                  "description": "The type of liability being declaired - eg. 'Mortgage' or 'CreditCard'",
                  "enum": [
                    "ATOCentrelinkDebt",
                    "ChargeCard",
                    "CommercialBill",
                    "ContingentLiability",
                    "CourtRuledChildMaintenance",
                    "CourtRuledOtherDebt",
                    "CreditCard",
                    "StudentLoan",
                    "HirePurchase",
                    "Lease",
                    "LineOfCredit",
                    "LoanAsGuarantor",
                    "Maintenance",
                    "Other",
                    "Loan",
                    "OutstandingTaxAU",
                    "Overdraft",
                    "PersonalLoan",
                    "CarLoan",
                    "StoreCard",
                    "Mortgage",
                    "HomeLoan",
                    "BusinessLoan",
                    "OutstandingTaxNZ",
                    "BuyNowPayLater"
                  ]
                },
                "RepaymentAmount": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The amount (in $) which is being regularly repaid.\n\nRequired when `LiabilityType` is one of `BuyNowPayLater`, `StudentLoan`, `Overdraft`, `BusinessLoan`, `CarLoan`, `PersonalLoan`, `HomeLoan`, `LineOfCredit`, `LoanAsGuarantor`, `Mortgage`, or `Other`.",
                  "default": null
                },
                "RepaymentFrequency": {
                  "$ref": "#/$defs/FrequencyOrNull",
                  "description": "The frequency with which the applicant pays the liability - eg. 'Weekly'\n\nRequired when `LiabilityType` is one of `BuyNowPayLater`, `StudentLoan`, `Overdraft`, `BusinessLoan`, `CarLoan`, `PersonalLoan`, `HomeLoan`, `LineOfCredit`, `LoanAsGuarantor`, `Mortgage`, or `Other`."
                },
                "Limit": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The amount of the liability's limi (in $) - eg. the credit card limit.\n\nRequired when `LiabilityType` is one of `BuyNowPayLater` or `Overdraft`",
                  "default": null
                },
                "Balance": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The amount of the liability's balance (in $) - ie. the remaining amount owed.\n\nRequired when `LiabilityType` is one of `BuyNowPayLater`, `StudentLoan`, `BusinessLoan`, `CarLoan`, `PersonalLoan`, `HomeLoan`, `LineOfCredit`, `LoanAsGuarantor`, `Mortgage`, or `Other`.",
                  "default": null
                },
                "InterestRate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The rate of interest being charged (in %) on the liability - eg. 0.05 (=5%).\n\nRequired when `LiabilityType` is one of `HomeLoan`, `LineOfCredit`, `LoanAsGuarantor`, or `Mortgage`.",
                  "default": null
                },
                "RepaymentType": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    null,
                    "PrincipalInterest",
                    "InterestOnly"
                  ],
                  "description": "The repayment structure - either 'Principal & Interest' (default) or 'Interest Only'",
                  "default": null
                },
                "StartDate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "YYYY-MM-DD",
                  "description": "Start date of the loan",
                  "default": null
                },
                "TotalTermMonths": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The loan's total term in months.\n\nRequired when `LiabilityType` is one of `HomeLoan`, `LineOfCredit`, `LoanAsGuarantor`, or `Mortgage`. ",
                  "default": null
                },
                "InterestOnlyTermMonths": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The loan's interest only total term in months",
                  "default": null
                },
                "Lender": {
                  "$ref": "#/$defs/Lender"
                },
                "IsRevolvingCredit": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "Indicates whether the liability is a revolving credit",
                  "default": false
                }
              },
              "required": [
                "LiabilityType"
              ],
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "LiabilityType": {
                        "const": "BuyNowPayLater"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "RepaymentAmount",
                      "RepaymentFrequency",
                      "Balance",
                      "Limit"
                    ],
                    "properties": {
                      "RepaymentAmount": {
                        "type": "number"
                      },
                      "RepaymentFrequency": {
                        "type": "string"
                      },
                      "Balance": {
                        "type": "number"
                      },
                      "Limit": {
                        "type": "number"
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "LiabilityType": {
                        "const": "StudentLoan"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "ApplicantId",
                      "RepaymentAmount",
                      "RepaymentFrequency",
                      "Balance"
                    ],
                    "properties": {
                      "RepaymentAmount": {
                        "type": "number"
                      },
                      "RepaymentFrequency": {
                        "type": "string"
                      },
                      "Balance": {
                        "type": "number"
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "LiabilityType": {
                        "const": "Overdraft"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "RepaymentAmount",
                      "RepaymentFrequency",
                      "Limit"
                    ],
                    "properties": {
                      "RepaymentAmount": {
                        "type": "number"
                      },
                      "RepaymentFrequency": {
                        "type": "string"
                      },
                      "Limit": {
                        "type": "number"
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "LiabilityType": {
                        "enum": [
                          "BusinessLoan",
                          "CarLoan",
                          "PersonalLoan",
                          "Other"
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "RepaymentAmount",
                      "RepaymentFrequency",
                      "Balance"
                    ],
                    "properties": {
                      "RepaymentAmount": {
                        "type": "number"
                      },
                      "RepaymentFrequency": {
                        "type": "string"
                      },
                      "Balance": {
                        "type": "number"
                      }
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "LiabilityType": {
                        "enum": [
                          "HomeLoan",
                          "LineOfCredit",
                          "LoanAsGuarantor",
                          "Mortgage"
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "RepaymentAmount",
                      "RepaymentFrequency",
                      "Balance",
                      "InterestRate",
                      "TotalTermMonths"
                    ],
                    "properties": {
                      "RepaymentAmount": {
                        "type": "number"
                      },
                      "RepaymentFrequency": {
                        "type": "string"
                      },
                      "Balance": {
                        "type": "number"
                      },
                      "InterestRate": {
                        "type": "number"
                      },
                      "TotalTermMonths": {
                        "type": "integer"
                      }
                    }
                  }
                }
              ]
            },
            "default": []
          },
          "NumberOfDependents": {
            "type": "integer",
            "description": "Number of dependents (children, etc.) in the applicant party",
            "minimum": 0,
            "examples": [
              0,
              1,
              4
            ]
          },
          "NumberOfVehicles": {
            "type": "integer",
            "description": "Number of vehicles owned by the applicant party",
            "minimum": 0,
            "examples": [
              0,
              1,
              2
            ]
          }
        },
        "required": [
          "Applicant",
          "Expense",
          "Income",
          "Liability",
          "NumberOfDependents",
          "NumberOfVehicles"
        ]
      },
      "minItems": 1,
      "maxItems": 1
    }
  },
  "required": [
    "Loan",
    "Security",
    "LoanSecurityMapping",
    "ApplicantParty"
  ],
  "additionalProperties": false
}