What is a data type?

LUSID has a set of built-in data types that can be used to describe and constrain property values loaded into LUSID. Create your own custom data type.

For example, LUSID has a rating data type that only allows users to specify values such as AAA or BB into properties of this data type (see the definition of rating below). In this way, LUSID guarantees that all data of the same type is consistent and valid at the point it is inserted or updated. 

To list the built-in data types, obtain an API access token and call the LUSID ListDataTypes API for your domain as follows:

curl -X GET "https://<your-domain>.lusid.com/api/api/datatypes/system?includeSystem=true"
  -H "Authorization: Bearer <your-API-access-token>"

For example, the rating data type has the following definition:

{
  "values": [
    {
      "href": "https://<your-domain>.lusid.com/api/api/datatypes/system/rating",
      "typeValueRange": "Closed",
      "id": {
        "scope": "system",
        "code": "rating"
      },
      "displayName": "Rating",
      "description": "Example rating data",
      "valueType": "String",
      "acceptableValues": [
        "A",
        "NR",
        "CCCC",
        "B",
        "BB",
        "D",
        "CC",
        "C",
        "AAA",
        "BBB",
        "AA"
      ],
      "unitSchema": "NoUnits",
      "acceptableUnits": [],
      "referenceData": {
        "fieldDefinitions": [],
        "values": []
      }
    }
  ],
  ...
}

Note that because typeValueRange is Closed, users can only enter or load property values from the list of acceptableValues.

A note on value types

A data type itself has a primitive valueType such as String, Int, Boolean, DateTime and so on. Possible types are listed here.

A note on units

A data type has a unitSchema that identifies the unit of measurement of values; this is either Basic, Iso4217Currency or NoUnits. Acceptable units are always text values.