API – Custom Fields

Introduction

When LoanPro doesn't track a value by default, you can create a custom field to track it. Like many settings, custom fields are configured in the LMS UI, not the API. Our article Using Custom Fields explains how to set up new custom fields, and from there you can use the API to edit the values of those fields on an individual loan, customer, or other entity.

You'll also need the system IDs for the custom field and the entity you are editing. If you don't have them, see the System IDs section below.

Request Body

The endpoint will be specific to whatever entity you are editing. Whatever the endpoint, your method should be a PUT request.

This endpoint is for custom fields on loans:

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(id=1237)

Use this endpoint for customers:

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers(id=8724)

The payload will include the object you want to edit, and an array variable with the specific custom fields you want to update.

{
"LoanSettings": {
"CustomFieldValues": {
"results": [
{
"customFieldId": 16,
"customFieldValue": "Sample 1"
},
{
"customFieldId": 30,
"customFieldValue": "Sample 2"
}
]
},
"__id": 5621, // Settings Id
"__update": true
},
"__id": 5919, // Loan Id
"__update": true
}

Values:

  • LoanSettings – This example uses loan settings, but in your payload, this will be replaced with the name of the entity you're editing.
  • CustomFieldValues – This object nests all the custom fields for this entity. You can include as many of these custom fields as you want in the same request.
  • customFieldId – The ID of the custom field (found in your settings in the LMS UI, see Custom Field IDs below)
  • customFieldValue – The value to set for the custom field
  • __id – When dealing with custom fields that are nested, you'll need an ID for the nested entity as well. This example payload gives the Settings ID.
  • __update – This should be set to "true". This flag tells the system that you want to make changes, not create something else.

System IDs

To edit a custom field, you'll need the system IDs for both the custom field and the entity you are editing, such as a loan or customer.

Custom Field IDs

To retrieve custom field IDs, log into the LMS UI and navigate to the item you want to edit. To find the IDs for a loan's custom fields, for instance, you'd navigate to Settings > Loan > Custom Fields > Custom.

Then, click the tab for a specific section, like Setup Terms or Bankruptcy. The IDs are shown on the left.

IDs for Customers, Loans, and Other Entities

Depending on which entity you'll want to edit, the system IDs are found in different places. If you don't have the ID for a loan or customer, our article API – Finding Customer and Loan IDs can show you where to find them in the UI.

To find a Nested Entity's system ID, send a GET request to either the loan or customer endpoint.

This endpoint is for loans:

GET https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(id=1237)

Use this endpoint for customers:

GET https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers(id=8724)

In either case, put the ID of the loan or customer in the parenthesis at the end.

The system ID for those entities will be in the response, near the end:

{
"d": { ... },
"id": 8,
"displayId": "L-741585",
"title": "L-741585",
"settingsId": 8,
"setupId": 10,
"insurancePolicyId": "0",
"collateralId": 0,
"linkedLoan": null,
"modId": null,
"modTotal": 0,
"humanActivityDate": "/Date(1626307200)/",
"created": "/Date(1626370126)/",
"lastMaintRun": "/Date(0)/",
"createdBy": 7220,
"active": 1,
"archived": 0,
"loanAlert": null,
"temporaryAccount": 0,
"deleted": 0,
"deletedAt": null,
"_relatedMetadata": null,
"_dynamicProperties": null
}
}


How did we do?


Powered by HelpDocs (opens in a new tab)