Charges API
Manage service charges (charges locatives) for leases — utilities, maintenance, insurance, and other recurring costs billed to tenants. Track meter readings and validate charges against French regulations.
Quick Example
Code
Common Workflows
Set up charges for a lease
POST /api/charges/categories— Create charge categories (water, heating, maintenance)POST /api/charges/readings— Record meter readingsGET /api/charges/readings/{id}/validate— Validate against business rules
Annual charge settlement (regularisation)
GET /api/charges/readings— Get all readings for the period- Compare total readings vs. provisioned amounts
- Calculate settlement amount (surplus or deficit)
Overview
The Charges API is organized into two main sub-modules:
- Categories: Manage different types of service charges
- Readings: Handle meter readings and charge calculations
Authentication
All endpoints require authentication with the following permissions:
- LeasesRead: For GET operations
- LeasesWrite: For POST and PUT operations
- LeasesDelete: For DELETE operations
Base URL
All charge endpoints are prefixed with /api/charges
Service Charge Categories
List Categories
GET /api/charges/categories
Retrieve all service charge categories with optional filtering.
Query Parameters:
category_type(optional): Filter by specific charge category type
Response:
Code
Create Category
POST /api/charges/categories
Create a new service charge category.
Request Body:
Code
Response: 201 Created
Code
Get Category
GET /api/charges/categories/{id}
Retrieve a specific service charge category by ID.
Path Parameters:
id(UUID): The category ID
Response: 200 OK
Code
Update Category
PUT /api/charges/categories/{id}
Update an existing service charge category.
Path Parameters:
id(UUID): The category ID
Request Body:
Code
Response: 200 OK
Returns the updated category object.
Delete Category
DELETE /api/charges/categories/{id}
Delete a service charge category.
Path Parameters:
id(UUID): The category ID
Response: 204 No Content
Charge Readings
List Readings
GET /api/charges/readings
Retrieve all charge readings with optional filtering.
Response:
Code
Create Reading
POST /api/charges/readings
Create a new charge reading.
Request Body:
Code
Response: 201 Created
Returns the created reading object.
Get Reading
GET /api/charges/readings/{id}
Retrieve a specific charge reading by ID.
Path Parameters:
id(UUID): The reading ID
Response: 200 OK
Returns the reading object.
Update Reading
PUT /api/charges/readings/{id}
Update an existing charge reading.
Path Parameters:
id(UUID): The reading ID
Request Body:
Code
Response: 200 OK
Returns the updated reading object.
Delete Reading
DELETE /api/charges/readings/{id}
Delete a charge reading.
Path Parameters:
id(UUID): The reading ID
Response: 204 No Content
Validate Reading
GET /api/charges/readings/{id}/validate
Validate a charge reading against business rules.
Path Parameters:
id(UUID): The reading ID
Response: 200 OK
Code
Data Types
ChargeCategoryType
Enum values:
Utilities- Water, electricity, gas, internetMaintenance- Building maintenance, repairsInsurance- Property and liability insuranceAdministration- Management and administrative feesOther- Miscellaneous charges
MaintenanceDetails
Code
Error Responses
Validation Errors
400 Bad Request
Code
Not Found
404 Not Found
Code
Unauthorized
403 Forbidden
Code
Common Use Cases
Creating a New Utility Charge Category
- Create category with
POST /api/charges/categories - Set appropriate notification thresholds
- Configure maintenance details for recurring services
Recording Monthly Meter Readings
- Retrieve active leases
- For each meter, create reading with
POST /api/charges/readings - Validate readings with
GET /api/charges/readings/{id}/validate - Generate charge calculations based on readings
Managing Seasonal Charges
- Create seasonal categories (heating, cooling)
- Set up appropriate notification frequencies
- Track consumption patterns through readings
Notes
- All monetary values are stored as BigDecimal for precision
- Notification thresholds help identify unusual consumption patterns
- Readings can be marked as estimated for incomplete data
- The system supports various meter types (water, electricity, gas, etc.)
- Legal references ensure compliance with local regulations