Manage custom fields In this section, we will learn about the operations we can perform with custom fields for the Loan API entities.
Insert custom field values Use case
We want to enter values for a custom field in a particular loan contract.
Use case data
API parameter with values
The field ID and the value you want to enter for the field.
Copy "fieldId": "AssetVal",
"fieldValue": "5000"
The entity name and the contract for which you want to enter the value.
Copy "sourceName": "LOAN.CONTRACT_HEADER",
"sourceRef": "INST2-1000"
Sample API call
To enter the custom field value, use the following endpoint:
https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/value
Sample request
The sample request body is as follows:
JSON
Copy {
"fieldValues": [
{
"fieldId": "AssetVal",
"fieldValue": "5000"
}
],
"source": {
"sourceName": "LOAN.CONTRACT_HEADER",
"sourceRef": "INST2-1000"
}
}
cURL
Copy curl -X 'POST' \
'https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/value' \
-H 'accept: */*' \
-H 'x-channel-code: SYSTEM' \
-H 'x-tenant-code: MB' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDgtMjZUMTM6MjE6NDIiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTMwNTYxMDJ9.Z1frJzD4gdb6P9sQ_D74s7tjj4Httc5cXEKuihXEHP4' \
-H 'Content-Type: application/json' \
-d '{
"fieldValues": [
{
"fieldId": "AssetVal",
"fieldValue": "5000"
}
],
"source": {
"sourceName": "LOAN.CONTRACT_HEADER",
"sourceRef": "INST2-1000"
}
}'
Sample response
Below you will find the response to the sample request:
Response
Copy {
"errors": null,
"validationErrors": null,
"data": null
}
Result
We have entered a custom field value for a loan contract. The field ID is AssetVal
with the value 5000.
Copy custom field values Use case
In this scenario, we want to copy the value of a custom field from a particular loan application to a loan offer.
Use case data
API parameter with values
The entity and the ID from which you want to copy the values (in this case, LOAN.APPLICATION ).
Copy "fromSource": {
"sourceName": "LOAN.APPLICATION",
"sourceRef": "ID-1664282430" }
The entity and the ID to which you want to copy the values (in this case, LOAN.OFFER ).
Copy "toSource": {
"sourceName": "LOAN.OFFER",
"sourceRef": "ID-1664282438" }
Sample API call
To copy the custom field values, use the following endpoint:
https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/copy-values
Sample request
The sample request body is as follows:
JSON
Copy {
"fromSource": {
"sourceName": "LOAN.APPLICATION",
"sourceRef": "ID-1664282430"
},
"toSource": {
"sourceName": "LOAN.OFFER",
"sourceRef": "ID-1664282438"
}
}
cURL
Copy curl -X 'POST' \
'https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/copy-values' \
-H 'accept: */*' \
-H 'x-channel-code: SYSTEM' \
-H 'x-tenant-code: MB' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDgtMjdUMTg6MDQ6MDAiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTMxNTk0NDB9.BANujXLC6EGVcD2lVe5vtr2Tbwz5gzGpQkA8gCOPSlc' \
-H 'Content-Type: application/json' \
-d '{
"fromSource": {
"sourceName": "LOAN.APPLICATION",
"sourceRef": "ID-1664282430"
},
"toSource": {
"sourceName": "LOAN.OFFER",
"sourceRef": "ID-1664282438"
}
}'
Sample response
Below you will find the response to the sample request:
Response
Copy {
"errors": null,
"validationErrors": null,
"data": null
}
Result
With this API call, we have copied the values of the custom field from the LOAN.APPLICATION
entity to the LOAN.OFFER
entity.
Deactivate field Use case
If you do not want to use a custom field for an entity, you can deactivate it. Here we will learn how to do this.
Use case data
API parameter with values
The first path parameter is the entity name (in this case, LOAN.CONTRACT_HEADER ).
Copy "...custom-fields/LOAN.CONTRACT_HEADER..."
The second path parameter is the field ID of the custom field that you want to deactivate.
Copy "...field/AssetVal..."
Sample API call
To deactivate the custom field, use the following endpoint:
https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/LOAN.CONTRACT_HEADER/field/AssetVal/deactivate
Sample response
Below you will find the response to the sample request:
Response
Copy {
"errors": null,
"validationErrors": null,
"data": {
"fieldId": "AssetVal",
"name": "AssetAmount",
"fieldSetId": "Contract Extras",
"entityName": "LOAN.CONTRACT_HEADER",
"valueType": "NUMBER",
"unique": false,
"required": false,
"active": false,
"copyFromEntityName": null,
"copyFromFieldId": null,
"activityCode": null,
"lookupEntityName": null,
"lookupTypeCode": null
}
}
Result
The custom field AssetVal
has been deactivated and will not be usable for the loan contract header entity.
Delete custom field value Use case
In this scenario, we have a value for one of the custom fields in a particular loan contract. Here we will see how to delete the custom field value.
Use case data
API parameter with values
The entity name (in this case, LOAN.CONTRACT_HEADER ).
Copy "sourceName": "LOAN.CONTRACT_HEADER"
The loan contract number.
Copy "sourceRef": "INST2-1000"
The field ID whose value you want to delete.
Copy "fieldId": "AssetVal"
Sample API call
To delete the custom field value, use the following endpoint:
https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/value
Sample request
The sample request body is as follows:
JSON
Copy {
"source": {
"sourceName": "LOAN.CONTRACT_HEADER",
"sourceRef": "INST2-1000"
},
"fieldId": "AssetVal"
}
cURL
Copy curl -X 'DELETE' \
'https://loan-api.sandbox.tuumplatform.com/api/v1/custom-fields/value' \
-H 'accept: */*' \
-H 'x-channel-code: SYSTEM' \
-H 'x-tenant-code: MB' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDgtMjZUMTU6MDA6MTAiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTMwNjIwMTB9.gScjkG6yEBnptOA9H4jGw5Jss8t5g5sOM7KU_AFpbCg' \
-H 'Content-Type: application/json' \
-d '{
"source": {
"sourceName": "LOAN.CONTRACT_HEADER",
"sourceRef": "INST2-1000"
},
"fieldId": "AssetVal"
}'
Sample response
Below you will find the response to the sample request:
Response
Copy {
"errors": null,
"validationErrors": null,
"data": null
}
Result
The value of the custom field AssetVal
of the LOAN.CONTRACT_HEADER
entity has been deleted.