API – Create a Loan

Introduction

Loans in LoanPro are detailed. They include information about insuranceloan settings, loan setupcollateral, etc. As a result, payloads for creating a loan are broken into several sections to make it easier to read and understand. This article explains the minimum required payload to create a loan. Separate articles will discuss other loan topics in greater detail, like linking loans with customers, logging payments, and more.

When a loan is successfully created, LoanPro will return the loan information that was saved, including the ID of the loan as saved in the LoanPro database. Keeping track of that ID will make it easier to manage the loan later on. Additionally, any dates returned from LoanPro will be in a timestamp format, but any dates sent to LoanPro must be in a “YYYY-MM-DD” format.

This article will go over the endpoint, headers, JSON payload, and response for the call.

How To

Your headers will need to be set up like the following:

Authorization: Bearer API_TOKEN
Autopal-Instance-ID: INSTANCE_ID
Content-Type: application/json

This header is just an example—you'll need to use an actual API token and Autopal-Instance-ID to send a request. You can find these by logging into LoanPro and navigating to Settings > Company > API > Overview.

Here's the endpoint required for the request:

POST https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans

Loan Information in the Payload

The payload for a loan includes two main entities: "displayId" and the "LoanSetup". But there are dozens of smaller entities nested inside "LoanSetup". Both of the main sections are required, but many of the entities nested inside of "LoanSetup" are not.

Here's a sample JSON payload:

{
"displayId": "L-z0k6BklfEE79sIkJRNhzs5587",
"LoanSetup": {
"loanClass": "loan.class.carLoan",
"loanType": "loan.type.installment",
"loanAmount": 12000,
"discount": 500,
"underwriting": 0,
"loanRate": 12.0212,
"loanRateType": "loan.rateType.annually",
"loanTerm": 36,
"contractDate": "2021-05-12",
"firstPaymentDate": "2021-06-11",
"amountDown": 0,
"reserve": 5,
"salesPrice": 12000,
"gap": 1120,
"warranty": 2500,
"dealerProfit": 1000,
"taxes": 125.25,
"creditLimit": 15500,
"discountSplit": 1,
"paymentFrequency": "loan.frequency.monthly",
"calcType": "loan.calcType.simpleInterest",
"daysInYear": "loan.daysInYear.frequency",
"interestApplication": "loan.interestApplication.betweenTransactions",
"begEnd": "loan.begend.end",
"firstPeriodDays": "loan.firstPeriodDays.frequency",
"firstDayInterest": "loan.firstdayinterest.yes",
"discountCalc": "loan.discountCalc.straightLine",
"diyAlt": "loan.diyAlt.no",
"daysInPeriod": "loan.daysinperiod.24",
"roundDecimals": 5,
"lastAsFinal": "loan.lastasfinal.no",
"curtailPercentBase": "loan.curtailpercentbase.loanAmount",
"nddCalc": "loan.nddCalc.standard",
"endInterest": "loan.endInterest.no",
"feesPaidBy": "loan.feesPaidBy.date",
"graceDays": 5,
"lateFeeType": "loan.lateFee.3",
"lateFeeAmount": 30,
"lateFeePercent": 10,
"lateFeeCalc": "loan.lateFeeCalc.standard",
"lateFeePercentBase": "loan.latefeepercentbase.regular",
"paymentDateApp": "loan.pmtdateapp.actual",
"CustomFieldValues": {
"results": [
{
"customFieldId": 1,
"customFieldValue": ""
}
]
}
}
}

Base Information

The base information payload will include:

  • displayId – The id displayed to the user

There are some other fields that you could include at the base level, but they're not required (and not particularly useful in this scenario):

  • active – Must be “1” and determines if the loan is “live" in the software
  • loanAlert – The alert for the loan
  • deleted – “0” if the loan has not been deleted, “1” otherwise. Temporary loans are marked as deleted and will be permanently deleted within 24 hours from the time of creation.

Loan Setup

Aside from the displayId, the other main entity is "LoanSetup", which nests dozens of other fields. Our article on Loan Setup Collections lists and explains all the acceptable values for each field.

There are only two fields that must be included in your payload to create the LoanSetup entity. If you are trying to create a loan, you should also include the fields that are required to run the calculator. However, the two absolutely required fields are:

  • loanType
  • loanClass

The following fields are required to run the calculator, and will be set to default values if they are not included in your payload:

  • loanAmount
  • loanRate
  • loanRateType
  • loanTerm
  • contractDate
  • firstPaymentDate
  • paymentFrequency

Again, you can find all the valid values for these fields on our Loan Setup Collections article. Here's a sample payload with the bare minimum amount of fields to run the calculator:

{
"displayId": "L-z0k748522154",
"LoanSetup": {
"loanClass": "loan.class.carLoan",
"loanType": "loan.type.installment",
"loanAmount": 12000,
"loanRate": 12.0212,
"loanRateType": "loan.rateType.annually",
"loanTerm": 36,
"contractDate": "2021-05-12",
"firstPaymentDate": "2021-06-11",
"paymentFrequency": "loan.frequency.monthly"
}
}

There are some fields that are required to run the calculator, but values from your company defaults will be used if they are not included in the payload. These fields are:

  • discountSplit
  • calcType
  • daysInYear
  • InterestApplication
  • scheduleTemplate
  • begEnd
  • firstPeriodDays
  • firstDayInterest
  • discountCalc
  • diyAlt
  • daysInPeriod
  • roundDecimals
  • lastAsFinal
  • curtailPercentBase
  • nddCalc
  • endInterest
  • feesPaidBy
  • graceDays
  • lateFeeType
  • lateFeeCalc
  • lateFeePercentBase
  • paymentDateApp

The loan setup section stores the values used for the calculation of the loan. The specifics of the fields are discussed in the API Loan Setup article.

Response

Here's the response:

{
"d": {
"__metadata": {
"uri": "http://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(id=9163)",
"type": "Entity.Loan"
},
"id": 9163,
"displayId": "remember that one time an imbecile mocked us",
"title": "remember that one time an imbecile mocked us",
"settingsId": 8789,
"setupId": 9143,
"insurancePolicyId": 0,
"collateralId": 0,
"linkedLoan": 0,
"modId": 0,
"modTotal": 0,
"humanActivityDate": null,
"created": null,
"lastMaintRun": null,
"createdBy": 9816,
"active": 1,
"archived": 0,
"loanAlert": null,
"temporaryAccount": 0,
"deleted": 0,
"deletedAt": null,
"Insurance": {
"__deferred": {
"uri": "Loans(9163)/Insurance"
}
},
"CustomFieldValues": {
"__deferred": {
"uri": "Loans(9163)/CustomFieldValues"
}
},
"ChecklistItemValues": {
"__deferred": {
"uri": "Loans(9163)/ChecklistItemValues"
}
},
"Documents": {
"__deferred": {
"uri": "Loans(9163)/Documents"
}
},
"Collateral": {
"__deferred": {
"uri": "Loans(9163)/Collateral"
}
},
"LoanSettings": {
"__metadata": {
"uri": "http://loanpro.simnang.com/api/public/api/1/odata.svc/LoanSettings(id=8789)",
"type": "Entity.LoanSettings"
},
"id": 8789,
"loanId": 9163,
"cardFeeAmount": 5,
"cardFeeType": "loan.cardfee.types.1",
"cardFeePercent": 5,
"agent": 0,
"loanStatusId": 1,
"loanSubStatusId": 1,
"sourceCompany": 0,
"paymentTypeDefault": 0,
"eBilling": 0,
"ECOACode": "loan.ecoacodes.1",
"coBuyerECOACode": "loan.ecoacodes.0",
"creditStatus": "loan.creditstatus.0",
"creditBureau": "loan.creditbureau.00",
"reportingType": "loan.reportingtype.I",
"secured": 1,
"autopayEnabled": 0,
"repoDate": null,
"closedDate": null,
"liquidationDate": null,
"followUpDate": null,
"isStoplightManuallySet": 0,
"merchantProcessorGroupId": 0,
"Loan": {
"__deferred": {
"uri": "LoanSettings(8789)/Loan"
}
},
"LoanStatus": {
"__deferred": {
"uri": "LoanSettings(8789)/LoanStatus"
}
},
"LoanSubStatus": {
"__deferred": {
"uri": "LoanSettings(8789)/LoanSubStatus"
}
},
"CustomFieldValues": {
"__deferred": {
"uri": "LoanSettings(8789)/CustomFieldValues"
}
},
"SrcCompany": {
"__deferred": {
"uri": "LoanSettings(8789)/SrcCompany"
}
},
"MerchantProcessorGroup": {
"__deferred": {
"uri": "LoanSettings(8789)/MerchantProcessorGroup"
}
}
},
"LoanSetup": {
"__metadata": {
"uri": "http://loanpro.simnang.com/api/public/api/1/odata.svc/LoanSetup(id=9143)",
"type": "Entity.LoanSetup"
},
"id": 9143,
"loanId": 9163,
"modId": 0,
"active": 0,
"apr": 0,
"aprForceSingle": 0,
"payment": 0,
"origFinalPaymentDate": "/Date(-62169984000)/",
"origFinalPaymentAmount": 0,
"tilFinanceCharge": 0,
"tilTotalOfPayments": 0,
"tilLoanAmount": 0,
"tilSalesPrice": 0,
"tilPaymentSchedule": "",
"regzCustomEnabled": 0,
"regzApr": 0,
"regzFinanceCharge": 0,
"regzAmountFinanced": 0,
"regzTotalOfPayments": 0,
"loanAmount": 12000,
"discount": 500,
"underwriting": 0,
"loanRate": 12.0212,
"loanRateType": "loan.rateType.annually",
"loanTerm": 36,
"moneyFactor": 0,
"residual": 0,
"contractDate": "/Date(1620777600)/",
"firstPaymentDate": "/Date(1623369600)/",
"scheduleRound": 0,
"amountDown": 0,
"reserve": 5,
"salesPrice": 12000,
"gap": 1120,
"warranty": 2500,
"dealerProfit": 1000,
"taxes": 125.25,
"creditLimit": 15500,
"reportingCreditLimit": 0,
"loanClass": "loan.class.carLoan",
"loanType": "loan.type.installment",
"discountSplit": 1,
"paymentFrequency": "loan.frequency.monthly",
"calcType": "loan.calcType.simpleInterest",
"daysInYear": "loan.daysInYear.frequency",
"interestApplication": "loan.interestApplication.betweenTransactions",
"begEnd": "loan.begend.end",
"firstPeriodDays": "loan.firstPeriodDays.frequency",
"firstDayInterest": 0,
"discountCalc": "loan.discountCalc.straightLine",
"diyAlt": 0,
"dueDateOnLastDOM": 0,
"dueDatesOnBusinessDays": "loan.businessduedates.disabled",
"daysInPeriod": "loan.daysinperiod.24",
"roundDecimals": 5,
"lastAsFinal": 0,
"nddCalc": "loan.nddCalc.standard",
"endInterest": "loan.endInterest.no",
"scheduleTemplate": 0,
"curtailmentTemplate": 0,
"feesPaidBy": "loan.feesPaidBy.date",
"useInterestTiers": 0,
"calcHistoryEnabled": 0,
"calcDatesEnabled": 0,
"graceDays": 5,
"lateFeeType": "loan.lateFee.3",
"lateFeeAmount": 30,
"lateFeePercent": 10,
"lateFeeCalc": "loan.lateFeeCalc.standard",
"lateFeePercentBase": "loan.latefeepercentbase.regular",
"rollLastPayment": 0,
"paymentDateApp": "loan.pmtdateapp.actual",
"suspendForecastTo": "/Date(-62169984000)/",
"isSetupValid": false,
"usuryAlert": null,
"CustomFieldValues": {
"results": []
}
},
"Notes": {
"__deferred": {
"uri": "Loans(9163)/Notes"
}
},
"Promises": {
"__deferred": {
"uri": "Loans(9163)/Promises"
}
},
"Bankruptcies": {
"__deferred": {
"uri": "Loans(9163)/Bankruptcies"
}
},
"Charges": {
"__deferred": {
"uri": "Loans(9163)/Charges"
}
},
"Payments": {
"__deferred": {
"uri": "Loans(9163)/Payments"
}
},
"LoanFunding": {
"__deferred": {
"uri": "Loans(9163)/LoanFunding"
}
},
"Advancements": {
"__deferred": {
"uri": "Loans(9163)/Advancements"
}
},
"Credits": {
"__deferred": {
"uri": "Loans(9163)/Credits"
}
},
"DueDateChanges": {
"__deferred": {
"uri": "Loans(9163)/DueDateChanges"
}
},
"CurtailmentDates": {
"__deferred": {
"uri": "Loans(9163)/CurtailmentDates"
}
},
"StatusArchive": {
"__deferred": {
"uri": "Loans(9163)/StatusArchive"
}
},
"Transactions": {
"__deferred": {
"uri": "Loans(9163)/Transactions"
}
},
"EscrowCalculatedTx": {
"__deferred": {
"uri": "Loans(9163)/EscrowCalculatedTx"
}
},
"ScheduleRolls": {
"__deferred": {
"uri": "Loans(9163)/ScheduleRolls"
}
},
"StopInterestDates": {
"__deferred": {
"uri": "Loans(9163)/StopInterestDates"
}
},
"APDAdjustments": {
"__deferred": {
"uri": "Loans(9163)/APDAdjustments"
}
},
"DPDAdjustments": {
"__deferred": {
"uri": "Loans(9163)/DPDAdjustments"
}
},
"LoanModifications": {
"__deferred": {
"uri": "Loans(9163)/LoanModifications"
}
},
"EscrowAdjustments": {
"__deferred": {
"uri": "Loans(9163)/EscrowAdjustments"
}
},
"EscrowTransactions": {
"__deferred": {
"uri": "Loans(9163)/EscrowTransactions"
}
},
"EscrowSubsetOptions": {
"__deferred": {
"uri": "Loans(9163)/EscrowSubsetOptions"
}
},
"EscrowCalculators": {
"__deferred": {
"uri": "Loans(9163)/EscrowCalculators"
}
},
"EstimatedDisbursements": {
"__deferred": {
"uri": "Loans(9163)/EstimatedDisbursements"
}
},
"Loans": {
"__deferred": {
"uri": "Loans(9163)/Loans"
}
},
"LinkedLoanValues": {
"__deferred": {
"uri": "Loans(9163)/LinkedLoanValues"
}
},
"LoanChilds": {
"__deferred": {
"uri": "Loans(9163)/LoanChilds"
}
},
"RecurrentCharges": {
"__deferred": {
"uri": "Loans(9163)/RecurrentCharges"
}
},
"PayNearMeOrders": {
"__deferred": {
"uri": "Loans(9163)/PayNearMeOrders"
}
},
"Customers": {
"__deferred": {
"uri": "Loans(9163)/Customers"
}
},
"Portfolios": {
"__deferred": {
"uri": "Loans(9163)/Portfolios"
}
},
"SubPortfolios": {
"__deferred": {
"uri": "Loans(9163)/SubPortfolios"
}
},
"EscrowSubsets": {
"__deferred": {
"uri": "Loans(9163)/EscrowSubsets"
}
},
"RuleAppliedLoanSettings": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedLoanSettings"
}
},
"RuleAppliedChargeOff": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedChargeOff"
}
},
"RuleAppliedAPDReset": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedAPDReset"
}
},
"RuleAppliedChecklists": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedChecklists"
}
},
"RuleAppliedChangeDueDates": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedChangeDueDates"
}
},
"RuleAppliedStopInterest": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedStopInterest"
}
},
"RuleAppliedAccountTools": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedAccountTools"
}
},
"RuleAppliedCustomerTools": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedCustomerTools"
}
},
"RuleAppliedAutopay": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedAutopay"
}
},
"RuleAppliedLoanSetup": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedLoanSetup"
}
},
"RuleAppliedBankruptcy": {
"__deferred": {
"uri": "Loans(9163)/RuleAppliedBankruptcy"
}
},
"Autopays": {
"__deferred": {
"uri": "Loans(9163)/Autopays"
}
},
"ActionResultNotes": {
"__deferred": {
"uri": "Loans(9163)/ActionResultNotes"
}
},
"LoanFundingTransactions": {
"__deferred": {
"uri": "Loans(9163)/LoanFundingTransactions"
}
}
}
}


How did we do?


Powered by HelpDocs (opens in a new tab)