Skip to main content

User Domicile information

User Domicile is information which applies only to Finnish users. Domicile information is about their current home municipality (kotikunta).

Domicile information is stored at User and Legal levels. User level information is modifiable and can be used to store information provided by the User or other sources. Legal level information is sourced from DVV (or suomi.fi) and is not otherwise modifiable.

Usually when the municipality of an User is known, the municipality code is available. If the user has an active protection order, the code may be unavailable but domicile classes may still have available values. If no domicile information is available, code is missing (or null) and classes is missing or an empty array.

Reading Domicile information

Domicile information can be read through the Management API, the UserInfo endpoint, and the Management UI’s Account editor.

Management API

Example User level information request:

GET /api/rest/v1/user/{userId}

Example response:

{
...,
"domicile": {
"names": {
"fi": "Turku",
"sv": "Åbo"
},
"code": "853",
"classes": [
"central_pricing"
],
"movedInDate": "2023-09-18",
"movedOutDate": "2023-09-18"
},
"temporaryDomicile": {
"names": {
"fi": "Turku",
"sv": "Åbo"
},
"code": "853",
"classes": [
"central_pricing"
],
"movedInDate": "2023-09-18",
"movedOutDate": "2023-09-18"
},
...
}

The response will contain domicile and temporaryDomicile objects for “Kotikunta” and “Tilapäinen kunta”.

GET /api/rest/v1/user/{userId}/legal

Example response:

{
...
"domicile": {
"names": {
"fi": "Turku",
"sv": "Åbo"
},
"code": "853",
"classes": [
"central_pricing"
],
"movedInDate": "2023-09-18",
"movedOutDate": "2023-09-18"
},
"temporaryDomicile": {
"names": {
"fi": "Turku",
"sv": "Åbo"
},
"code": "853",
"classes": [
"central_pricing"
],
"movedInDate": "2023-09-18",
"movedOutDate": "2023-09-18"
},
"formerDomiciles": [
{
"names": {
"fi": "Turku",
"sv": "Åbo"
},
"code": "853",
"classes": [
"central_pricing"
],
"movedInDate": "2023-09-18",
"movedOutDate": "2023-09-18"
}
],
...
}

The same objects in the same format are returned. Additionally a formerDomiciles array may be available.

UserInfo endpoint

Domicile information is provided with the domicile claim. It can be requested by using the address scope during OIDC authentication.

Legal level domicile information is provided if the additional scope https://oneportal.trivore.com/scope/legalinfo.readonly is used.

Example claim content:

{
"userDomicile" : {
"names" : {
"sv" : "Åbo",
"fi" : "Turku"
},
"code" : "853",
"classes" : [ "turun-seutu" ]
},
"userTemporaryDomicile" : {
"names" : {
"sv" : "S:t Karins",
"fi" : "Kaarina"
},
"code" : "202",
"classes" : [ "turun-seutu" ]
},
"legalDomicile" : {
"names" : {
"sv" : "Helsingfors",
"fi" : "Helsinki"
},
"code" : "91",
"classes" : [ "pkseutu" ]
},
"legalTemporaryDomicile" : {
"names" : {
"sv" : "Vanda",
"fi" : "Vantaa"
},
"code" : "92",
"classes" : [ "pkseutu" ]
}
}

The claim contains both User and Legal level information in the same format as the Management API provides it.

Management UI

User level domicile information, including the Temporary Domicile, can be viewed and modified in the User editor’s Extra tab.

Image

Legal level domicile information can be viewed in the Legal tab.

Image