API – Custom Fields
API – Custom Fields
General
To change the custom field values for any LoanPro entity that supports custom fields (loan, source company, customer, payment, etc.), send a PUT request to edit that entity. Below is a sample body for a custom fields update request:
{
"CustomFieldValues": {
"results": [
{
"customFieldId": 26,
"customFieldValue": 0,
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2968
},
{
"customFieldId": 39,
"customFieldValue": null,
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2967
},
{
"customFieldId": 69,
"customFieldValue": "",
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2969
},
{
"customFieldId": 80,
"customFieldValue": 5,
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2971
},
{
"customFieldId": 29,
"customFieldValue": 0,
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2966
},
{
"customFieldId": 41,
"customFieldValue": null,
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2970
},
{
"customFieldId": 72,
"customFieldValue": "07/09/1992",
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2965
},
{
"customFieldId": 81,
"customFieldValue": 5,
"entityType": "Entity.LoanSettings",
"__update": true,
"__id": 2972
}
]
}
- customFieldId – The ID of the custom field (as set in tenant settings)
- customFieldValue – The value to set for the custom field
- entityType – The entity type that the custom field value is associated with
- __update – Set to true to update a custom field value that already exists
- __id – Set to the ID of a custom field value if updating (send a POST request to create a new value instead)
Note: Text custom fields can contain a maximum of 255 characters.
Adding a new Custom Field
To add a new custom field, do not do a POST request. Instead, do a PUT request to the parent entity (ie. loan, source company, etc.). Below is an example to create a custom field for LoanSettings:
PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(id=5) // ID of loan entity
{
"LoanSettings": {
"CustomFieldValues": {
"results": [
{
"customFieldValue": "5"
"customFieldId": 41,
"customFieldValue": "5",
"entityType": "Entity.LoanSettings"
}
]
},
"__id": 12, // ID of loan settings entity
"__update": true
}
}
Updating an Existing Custom Field
Below is an example to update a custom field (again, send a PUT request to the parent entity):
PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Loans(id=5) // ID of loan entity
{
"LoanSettings": {
"CustomFieldValues": {
"results": [
{
"customFieldValue": "5"
"__update": true,
"__id": 128 // ID of custom field value entity
}
]
},
"__id": 12, // ID of loan settings entity
"__update": true
},
"__id": 5 // ID of the loan
"__update": true
}