Create lookup type and codes Use case
In this scenario, we will create a lookup type code STATUS with status codes for the LOAN.LOAN_APPLICATION entity.
Use case data
API parameters with values
The first path parameter is the entity name (in this case, LOAN.LOAN_APPLICATION ).
In the body, we will enter the status codes that we want to create.
Sample API call
To create the lookup type code, use the following endpoint:
Sample request
The sample request body is as follows:
JSON
Copy {
"lookupTypeName": "Loan application status codes",
"lookups": [
{
"lookupCode": "CREATED",
"translations": [
{
"languageCode": "en",
"translation": "Loan application created"
}
]
},
{
"lookupCode": "ACCEPTED",
"translations":[
{
"languageCode": "en",
"translation": "Loan application accepted"
}
]
}
]
}
cURL
Copy curl --location 'https://lookup-api.sandbox.tuumplatform.com/api/v1/entity/LOAN.LOAN_APPLICATION/lookup-type/STATUS' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDgtMDJUMTg6NDQ6MDciLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTEwMDE4NDd9.cUy-j4fFxoXfRrNMoh20uhLalDOkL5yIxs5tO3_gF4A' \
--header 'x-channel-code: system' \
--header 'Content-Type: application/json' \
--data '{
"lookupTypeName": "Loan application status codes",
"lookups": [
{
"lookupCode": "CREATED",
"translations": [
{
"languageCode": "en",
"translation": "Loan application created"
}
]
},
{
"lookupCode": "ACCEPTED",
"translations":[
{
"languageCode": "en",
"translation": "Loan application accepted"
}
]
}
]
}'
Sample response
Below you will find the response to the sample request:
Response
Copy {
"errors": null,
"validationErrors": null,
"data": null
}
Result
We have created the look type code called STATUS
with the lookup types ACCEPTED
and CREATED
for loan applications.