Bookkeepers Management
Usage
Fetch bookkeeper incidences (e.g. for accounting sync):
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
bookkeepers = factorialhr.BookkeepersManagementEndpoint(api)
response = await bookkeepers.get(params={"page": 1})
for inc in response.data():
print(inc.id, inc.type)
asyncio.run(main())
- class factorialhr.BookkeepersManagementEndpoint(api: ApiClient)[source]
Endpoint for bookkeepers management incidences operations.
- async all(**kwargs) ListApiResponse[BookkeepersManagementIncidence][source]
Get all incidences records.
Official documentation: bookkeepers_management/incidences
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async get(**kwargs) MetaApiResponse[BookkeepersManagementIncidence][source]
Get incidences with pagination metadata.
Official documentation: bookkeepers_management/incidences
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(incidence_id: int | str, **kwargs) BookkeepersManagementIncidence[source]
Get a specific incidence by ID.
Official documentation: bookkeepers_management/incidences
- Parameters:
incidence_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(incidence_id: int | str, data: Mapping[str, Any], **kwargs) BookkeepersManagementIncidence[source]
Update an incidence.
Official documentation: bookkeepers_management/incidences
- Parameters:
incidence_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.BookkeepersManagementIncidence(*, id: int, employee_id: int | None = None, legal_entity_id: int, name: str, custom_name: str | None = None, target_id: int, target_type: str, starts_on: date | None = None, ends_on: date | None = None, read_at: date | None = None, status: str, company_id: int, message_from: str | None = None, has_message: bool | None = None, created_at: datetime, is_reopened: bool, legal_entity_name: str | None = None, employee_first_name: str | None = None, employee_last_name: str | None = None)[source]
Model for bookkeepers_management_incidence.
- company_id: int
Identifier of company related
- created_at: datetime
Date in which incidence (aka employee update) was created
- custom_name: str | None
Custom name of the incidence
- employee_first_name: str | None
Employee first name
- employee_id: int | None
Identifier of employee related
- employee_last_name: str | None
Employee last name
- ends_on: date | None
The date the incidence (aka employee update) ends
- has_message: bool | None
Boolean that indicates if the incidence (aka employee update) has unread messages
- id: int
Identifier of the incidence (aka employee update)
- is_reopened: bool
Boolean that indicates if the incidence (aka employee update) has been reopened
- legal_entity_id: int
Identifier of legal entity related
- legal_entity_name: str | None
Legal entity name
- message_from: str | None
Indicate the message sender on the incidence (aka employee update). It can be any of ‘bookkeeper’, ‘admin’
- name: str
Name of the incidence (aka employee update). It also represent the incidence type
- read_at: date | None
The date the incidence (aka employee update) was read
- starts_on: date | None
The date the incidence (aka employee update) starts
- status: str
Status of the incidence
- target_id: int
The incidence is also related to another resource, for example for a leave target, the target identifier will be the leave id
- target_type: str
The incidence is also related to another resource type. Examples: Employee, Contracts::ContractVersion, BookkeepersManagement::ManualIncidence, Finance::CostCenterMembership