Skip to main content

3. Create a unit

Observed — aligned with the end-user docs “Création d’un LOT dans le Patrimoine” and the createUnit mutation.

Why

A unit (UnitV2) is the rentable property. A rental folder can only reference a unit that already exists.

Prerequisites

  1. List unit templates (configured beforehand in the UI):
query listUnitTemplates {
unitTemplates {
data {
id
name
unitTypeId
archived
}
}
}
  1. (Optional) types / groups / categories:
query Lookups {
unitTypes { id name category kind active }
availableUnitGroupReferences
managementCategories { data { id name customReference } }
}

Step — Create the unit

mutation createUnit($unit: UnitInputV2!) {
createUnit(unit: $unit) {
id
name
customReference
externalId
address {
number
street
zip
city
country
}
}
}
{
"unit": {
"name": "Example T2 apartment",
"customReference": "U000014",
"externalId": "APT-T2-EXT-001",
"unitTemplateId": "00000000-0000-4000-8000-000000000010",
"address": {
"number": "16",
"street": "Quai Henri IV",
"city": "Paris",
"zip": "75004",
"country": "FR",
"coordinates": {
"latitude": 48.848251,
"longitude": 2.363691
}
}
}
}

Read

query GetUnit($id: UUID!) {
unit(id: $id) {
id
name
customReference
state
}
}
End-user docs

After create, the UI flags still-required sections with a red badge (address/location, ownership, rent…). On the API side, that maps to successive updateUnit calls — see Complete a unit.

Next

Accounting & templates · Complete a unit