8. Créer un dossier de location
Reconstruit — PDF « Création dossier de location » + createRentalFolder / CreateRentalFolderInput.
Mapping métier → API
| Étape UI (PDF) | Côté API |
|---|---|
| Collaborateur signataire | representativeId (obligatoire) |
| Dates effet / fin, reconduction | contractDetails (startDate, leaseEndingDate, leaseRenewalOption…) |
| Lot + profil locataire | units[] + profiles[] |
| Période / cycle / échéance | invoicingConfig (+ champs contrat) |
| Planifier / confirmer l’entrée | mutations d’événements / états du dossier (hors capture — voir schéma RentalFolder) |
| Solde initial | parcours comptable dédié (souvent UI) |
Prérequis
unitIdexistantpersonalProfileIdoumoralProfileIdrepresentativeId(collaborateur / représentant)- Idéalement
accountingInvoiceConfigId - Lot + profil créés avant (comme l’indique la doc utilisateur)
Mutation
- GraphQL
- Node.js
- curl
mutation createRentalFolder($rentalFolder: CreateRentalFolderInput!) {
createRentalFolder(rentalFolder: $rentalFolder) {
id
reference
}
}
{
"rentalFolder": {
"representativeId": "00000000-0000-4000-8000-000000000050",
"accountingInvoiceConfigId": "00000000-0000-4000-8000-000000000060",
"externalId": "RF-EXT-001",
"isAutomaticInvoicingEnabled": true,
"isSubletting": false,
"units": [
{ "unitId": "00000000-0000-4000-8000-000000000020" }
],
"profiles": [
{
"personalProfileId": "00000000-0000-4000-8000-000000000070",
"associationType": "tenant",
"isProxySignatory": true
}
],
"contractDetails": {
"startDate": "2026-09-01",
"leaseEndingDate": "2029-08-31",
"leaseRenewalOption": "tacit",
"paymentDueDay": 5,
"invoiceFrequency": "monthly",
"securityDeposit": 300000
},
"invoicingConfig": {
"invoicingStartDate": "2026-09-01",
"invoicingFrequency": "monthly",
"invoicingTimeWindow": "current_period",
"dueDateMethod": "fixed_day",
"dueDatePositioning": "in_arrears",
"paymentDueDay": 5
}
}
}
const { createRentalFolder } = await ublo(
`mutation createRentalFolder($rentalFolder: CreateRentalFolderInput!) {
createRentalFolder(rentalFolder: $rentalFolder) { id reference }
}`,
{
rentalFolder: {
representativeId: process.env.REPRESENTATIVE_ID,
accountingInvoiceConfigId: process.env.INVOICE_CONFIG_ID,
externalId: 'RF-EXT-001',
units: [{ unitId: process.env.UNIT_ID }],
profiles: [
{
personalProfileId: process.env.TENANT_PROFILE_ID,
// associationType: vérifier RentalFolderProfileAssociationTypeEnum
},
],
contractDetails: {
startDate: '2026-09-01',
leaseEndingDate: '2029-08-31',
leaseRenewalOption: 'tacit',
paymentDueDay: 5,
},
invoicingConfig: {
invoicingStartDate: '2026-09-01',
invoicingFrequency: 'monthly',
invoicingTimeWindow: 'current_period',
dueDateMethod: 'fixed_day',
dueDatePositioning: 'in_arrears',
paymentDueDay: 5,
},
},
},
);
- Bearer
- Cookie session
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @create-rental-folder.json
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @create-rental-folder.json
Enums à valider par introspection
Les valeurs associationType, leaseRenewalOption, invoicingFrequency, etc. sont illustratives. Introspectez RentalFolderProfileAssociationTypeEnum, LeaseRenewalOptionTypeEnum, InvoicingFrequencyEnum, DueDateMethodEnum… avant mise en production. Les noms exacts font foi dans le schéma de votre tenant.
Après création
- Vérifier le dossier via
rentalFoldersPaginated/ query détail. - Planifier l’entrée / activer la facturation : chercher dans le schéma les mutations d’événements / états (
RentalFolderdomain). - Solde initial : souvent un flux comptable séparé (PDF étapes 8–9) — à confirmer sur votre version.
Voir aussi
- Domaine Location
- Liste des dossiers