All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

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:

{
  "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 --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
{
  "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.

The second path parameter is the lookup type code that we want to create (in this case, STATUS). Note: This must be a unique value. If you want to create lookup codes for an existing type, see the topic.

https://lookup-api.sandbox.tuumplatform.com/api/v1/entity/LOAN.LOAN_APPLICATION/lookup-type/STATUS

Learn more about the endpoint in the Tuum developer portal.

"...entity/LOAN.LOAN_APPLICATION..."
"...lookup-type/STATUS"
"lookupCode": "CREATED",
"lookupCode": "ACCEPTED"
create lookup type and codes
Create lookup code for existing type

Create lookup translation

You can create or update the lookup code translation for a language using the language code.

Use case

Here we will create a translation for the lookup code DECLINED.

Use case data
API parameters with values

The first path parameter is the entity name (in this case, LOAN.LOAN_APPLICATION).

The second path parameter is the existing lookup type code (in this case, STATUS).

The third path parameter is the lookup code for which we want to create or update the translation (in this case, DECLINED).

The body consists of the language code and the translation text.

Sample API call

To create the translation, use the following endpoint:

Sample request

The sample request body is as follows:

{
  "languageCode": "en",
  "translation": "Loan application declined"
}
curl -X 'POST' \
  'https://lookup-api.dev.tuum.xyz/api/v1/entity/LOAN.APPLICATION/lookup-type/STATUS/lookup/DECLINED/translation' \
  -H 'accept: */*' \
  -H 'x-channel-code: SYSTEM' \
  -H 'x-tenant-code: MB' \
  -H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDgtMTVUMTQ6MzQ6MTciLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIuRVUiLCJleHAiOjE2OTIxMTAwNTd9.TQNjpwGcewRRmkWGxeWiIWkC3heUcu25_lKgxYVcNJ8' \
  -H 'Content-Type: application/json' \
  -d '{
  "languageCode": "en",
  "translation": "Loan application declined"
}'

Sample response

Below you will find the response to the sample request:

Response
{
  "errors": null,
  "validationErrors": null,
  "data": {
    "languageCode": "en",
    "translation": "Loan application declined"
  }
}

Result

We have created a translation for the DECLINED lookup code. You can also update the translation using the same endpoint.

Create lookup code for existing type

Use case

Here we will create a lookup code DECLINED for an existing lookup type code STATUS for the LOAN.LOAN_APPLICATION entity.

Sample API call

To create the lookup code, use the following endpoint:

Sample request

The sample request body is as follows:

Sample response

Below you will find the response to the sample request:

Response

Result

We have created a new lookup code for the STATUS lookup type for loan applications.

https://lookup-api.sandbox.tuumplatform.com/api/v1/entity/LOAN.APPLICATION/lookup-type/STATUS/lookup/DECLINED/translation

Learn more about the endpoint in the Tuum developer portal.

Use case data
API parameters with values

https://lookup-api.sandbox.tuumplatform.com/api/v1/entity/LOAN.LOAN_APPLICATION/lookup-type/STATUS/lookup

Learn more about the endpoint in the Tuum developer portal.

"...entity/LOAN.LOAN_APPLICATION..."
"...lookup-type/STATUS/..."
"../DECLINED/translation..."
{
  "languageCode": "en",
  "translation": "Loan application declined"
}
create lookup transaction
{
  "lookupCode": "DECLINED",
  "translations": [
    {
      "languageCode": "en",
      "translation": "Loan application declined"
    }
  ]
}
curl --location 'https://lookup-api.sandbox.tuumplatform.com/api/v1/entity/LOAN.LOAN_APPLICATION/lookup-type/STATUS/lookup' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDgtMDJUMjA6MjU6MzYiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTEwMDc5MzZ9.O4yMuD2hILuixy1bavlUdF7qTiPNjh1IzH5e_B54hsY' \
--header 'x-channel-code: system' \
--header 'Content-Type: application/json' \
--data '{
  "lookupCode": "DECLINED",
  "translations": [
    {
      "languageCode": "en",
      "translation": "Loan application declined"
    }
  ]
}'
{
    "errors": null,
    "validationErrors": null,
    "data": null
}
create lookup code

The first path parameter is the entity name (in this case, LOAN.LOAN_APPLICATION).

"...entity/LOAN.LOAN_APPLICATION..."
"...lookup-type/STATUS"

The lookup code we want to create.

"lookupCode": "DECLINED"

The second path parameter is the existing lookup type code (in this case, STATUS). Note: The lookup type must exist. If you want to create new lookup types, see the topic.

Create a lookup type and codes

Create lookup values

To meet your business requirements, you can create lookup types and codes for existing entities. These values will be assigned to the lookup group EXTERNAL.

Use case

In this section, we will create lookup types and codes for the loan module using the Lookup API.

When you create lookup values, the lookup group code that will be assigned is EXTERNAL. You cannot edit the lookup groups that are available.

First, we will learn how to with the codes.

Then, we will see how to for existing lookup types.

We will also for a lookup code.

create new lookup types
create lookup codes
create a lookup translation