Finance
Usage
List accounts, contacts, and journal entries:
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
accounts = factorialhr.AccountsEndpoint(api)
for acc in (await accounts.all()).data():
print(acc.name, acc.account_type)
contacts = factorialhr.ContactsEndpoint(api)
response = await contacts.get(params={"limit": 20})
for c in response.data():
print(c.name)
entries = factorialhr.JournalEntriesEndpoint(api)
for e in (await entries.get(params={"page": 1})).data():
print(e.date, e.journal_entry_type)
asyncio.run(main())
- class factorialhr.Account(*, id: int, name: str | None = None, legal_entity_id: int, number: str, disabled: bool, type: AccountType, external_id: str | None = None, updated_at: datetime)[source]
Model for finance_account.
- disabled: bool
Whether the ledger account is disabled
- external_id: str | None
Id of the ledger account on the external system
- id: int
Unique identifier in factorial for the ledger account
- legal_entity_id: int
Legal entity ID of the ledger account
- name: str | None
Name of the ledger account
- number: str
Number of the ledger account
- type: AccountType
Type of the ledger account
- updated_at: datetime
Last updated date of the ledger account
- class factorialhr.AccountingSetting(*, id: int, external_id: str | None = None, company_id: int, legal_entity_id: int, updated_at: datetime, default_account_for_purchase_invoices_id: int | None = None, default_account_for_vendors_id: int | None = None, default_account_for_banks_id: int | None = None, default_account_for_suspense_id: int | None = None, default_account_for_expenses_id: int | None = None, default_account_for_employees_id: int | None = None, default_account_for_sale_invoices_id: int | None = None, default_account_for_clients_id: int | None = None, default_account_for_benefits_id: int | None = None)[source]
Model for finance_accounting_setting.
- company_id: int
ID of the associated Company
- default_account_for_banks_id: int | None
Default account for banks
- default_account_for_benefits_id: int | None
Default account for benefits
- default_account_for_clients_id: int | None
Default account for clients
- default_account_for_employees_id: int | None
Default account for employees
- default_account_for_expenses_id: int | None
Default account for expenses
- default_account_for_purchase_invoices_id: int | None
Default account for purchase invoices
- default_account_for_sale_invoices_id: int | None
Default account for sale invoices
- default_account_for_suspense_id: int | None
Default suspense account
- default_account_for_vendors_id: int | None
Default account for vendors
- external_id: str | None
External ID for the accounting setting
- id: int
Identifier for the AccountingSetting
- legal_entity_id: int
ID of the associated Legal Entity
- updated_at: datetime
Timestamp when the accounting setting was last updated
- class factorialhr.AccountingSettingsEndpoint(api: ApiClient)[source]
Endpoint for finance/accounting_settings operations.
- async all(**kwargs) ListApiResponse[AccountingSetting][source]
Get all accounting settings.
Official documentation: finance/accounting_settings
- 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[AccountingSetting][source]
Get accounting settings with pagination metadata.
Official documentation: finance/accounting_settings
- 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(setting_id: int | str, **kwargs) AccountingSetting[source]
Get a specific accounting setting by ID.
Official documentation: finance/accounting_settings
- Parameters:
setting_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 upsert(data: Mapping[str, Any], **kwargs) AccountingSetting[source]
Upsert an accounting setting.
Official documentation: finance/accounting_settings
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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:
Result.
- Return type:
- class factorialhr.AccountsEndpoint(api: ApiClient)[source]
Endpoint for finance/accounts operations.
- async all(**kwargs) ListApiResponse[Account][source]
Get all accounts.
Official documentation: finance/accounts
- 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 create(data: Mapping[str, Any], **kwargs) Account[source]
Create a new account.
Official documentation: finance/accounts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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 created record.
- Return type:
- async get(**kwargs) MetaApiResponse[Account][source]
Get accounts with pagination metadata.
Official documentation: finance/accounts
- 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(account_id: int | str, **kwargs) Account[source]
Get a specific account by ID.
Official documentation: finance/accounts
- Parameters:
account_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(account_id: int | str, data: Mapping[str, Any], **kwargs) Account[source]
Update an account.
Official documentation: finance/accounts
- Parameters:
account_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.BudgetOption(*, id: int, name: str, description: str | None = None, currency: str, legal_entity_id: int)[source]
Model for finance_budget_option. Budget with limited information for general viewing.
- currency: str
Currency code
- description: str | None
Description of the budget
- id: int
Budget option identifier
- legal_entity_id: int
Legal entity identifier
- name: str
Name of the budget
- class factorialhr.BudgetOptionsEndpoint(api: ApiClient)[source]
Endpoint for finance/budget_options operations.
- async all(**kwargs) ListApiResponse[BudgetOption][source]
Get all budget options.
Official documentation: finance/budget_options
- 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[BudgetOption][source]
Get budget options with pagination metadata.
Official documentation: finance/budget_options
- 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(budget_option_id: int | str, **kwargs) BudgetOption[source]
Get a specific budget option by ID.
Official documentation: finance/budget_options
- Parameters:
budget_option_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:
- class factorialhr.Contact(*, id: int, name: str, legal_name: str | None = None, tax_id: str | None = None, address: Mapping[str, Any], external_id: str | None = None, email: str | None = None, website: str | None = None, phone_number: str | None = None, updated_at: datetime, iban: str | None = None, bank_code: str | None = None, preferred_payment_method: PreferredPaymentMethod | None = None)[source]
Model for finance_contact.
- address: Mapping[str, Any]
The address object containing street, city, etc.
- bank_code: str | None
Bank or branch code for the Contact if relevant
- email: str | None
Contact email
- external_id: str | None
The external id of the contact
- iban: str | None
International Bank Account Number if provided
- id: int
Unique identifier for the Contact
- legal_name: str | None
The official or legal name of the Contact
- name: str
The commercial name of the Contact
- phone_number: str | None
Contact phone number
- preferred_payment_method: PreferredPaymentMethod | None
Preferred payment method for the Contact (e.g. wire_transfer, paypal)
- tax_id: str | None
Tax identification number assigned to the Contact
- updated_at: datetime
Timestamp when the Contact was last updated
- website: str | None
Contact website
- class factorialhr.ContactsEndpoint(api: ApiClient)[source]
Endpoint for finance/contacts operations.
- async all(**kwargs) ListApiResponse[Contact][source]
Get all contacts.
Official documentation: finance/contacts
- 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 create(data: Mapping[str, Any], **kwargs) Contact[source]
Create a new contact.
Official documentation: finance/contacts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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 created record.
- Return type:
- async get(**kwargs) MetaApiResponse[Contact][source]
Get contacts with pagination metadata.
Official documentation: finance/contacts
- 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(contact_id: int | str, **kwargs) Contact[source]
Get a specific contact by ID.
Official documentation: finance/contacts
- Parameters:
contact_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(contact_id: int | str, data: Mapping[str, Any], **kwargs) Contact[source]
Update a contact.
Official documentation: finance/contacts
- Parameters:
contact_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.CostCenter(*, id: int, name: str, company_id: int, legal_entity_id: int | None = None, code: str | None = None, description: str | None = None, active_employees_count: int, historical_employees_count: int, status: str, deactivation_date: str | None = None)[source]
Model for finance_cost_center.
- active_employees_count: int
Number of active employees in the cost center
- code: str | None
Code of the cost center
- company_id: int
Company identifier
- deactivation_date: str | None
Date when the cost center was deactivated
- description: str | None
Description of the cost center
- historical_employees_count: int
Total historical count of employees
- id: int
Unique identifier for the cost center
- legal_entity_id: int | None
Legal entity identifier
- name: str
Name of the cost center
- status: str
Status of the cost center
- class factorialhr.CostCenterMembership(*, id: int, employee_id: int, cost_center_id: int, start_date: date, end_date: date | None = None, percentage: float)[source]
Model for finance_cost_center_membership.
- cost_center_id: int
The identifier of the associated cost center
- employee_id: int
The identifier of the associated employee
- end_date: date | None
The date the employee stopped being assigned to the cost center
- id: int
The unique identifier of the cost center membership
- percentage: float
The percentage allocation of the employee to the cost center
- start_date: date
The date the employee started being assigned to the cost center
- class factorialhr.CostCenterMembershipsEndpoint(api: ApiClient)[source]
Endpoint for finance/cost_center_memberships operations.
- async all(**kwargs) ListApiResponse[CostCenterMembership][source]
Get all cost center memberships.
Official documentation: finance/cost_center_memberships
- 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 bulk_create_update(data: Mapping[str, Any], **kwargs) Sequence[CostCenterMembership][source]
Bulk create/update cost center memberships.
Official documentation: finance/cost_center_memberships
- Parameters:
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 created record.
- Return type:
Sequence[CostCenterMembership]
- async get(**kwargs) MetaApiResponse[CostCenterMembership][source]
Get cost center memberships with pagination metadata.
Official documentation: finance/cost_center_memberships
- 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:
- class factorialhr.CostCentersEndpoint(api: ApiClient)[source]
Endpoint for finance/cost_centers operations.
- async all(**kwargs) ListApiResponse[CostCenter][source]
Get all cost centers.
Official documentation: finance/cost_centers
- 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 create(data: Mapping[str, Any], **kwargs) CostCenter[source]
Create a new cost center.
Official documentation: finance/cost_centers
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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 created record.
- Return type:
- async delete(cost_center_id: int | str, **kwargs) CostCenter[source]
Delete a cost center.
Official documentation: finance/cost_centers
- Parameters:
cost_center_id (int | str) – The unique identifier of the record to delete.
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 deleted record.
- Return type:
- async edit(data: Mapping[str, Any], **kwargs) CostCenter[source]
Edit a cost center.
Official documentation: finance/cost_centers
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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:
Result.
- Return type:
- async get(**kwargs) MetaApiResponse[CostCenter][source]
Get cost centers with pagination metadata.
Official documentation: finance/cost_centers
- 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(cost_center_id: int | str, **kwargs) CostCenter[source]
Get a specific cost center by ID.
Official documentation: finance/cost_centers
- Parameters:
cost_center_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:
- class factorialhr.FinanceCategoriesEndpoint(api: ApiClient)[source]
Endpoint for finance/categories operations.
- async all(**kwargs) ListApiResponse[FinanceCategory][source]
Get all categories records.
Official documentation: finance/categories
- 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[FinanceCategory][source]
Get categories with pagination metadata.
Official documentation: finance/categories
- 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(category_id: int | str, **kwargs) FinanceCategory[source]
Get a specific category by ID.
Official documentation: finance/categories
- Parameters:
category_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:
- class factorialhr.FinanceCategory(*, id: int, name: str, company_id: int, created_at: datetime, updated_at: datetime)[source]
Model for finance_category.
- company_id: int
Company identifier
- created_at: datetime
Creation date
- id: int
Category identifier
- name: str
Category name
- updated_at: datetime
Last update date
- class factorialhr.FinancialDocument(*, id: int, net_amount_cents: int | None = None, total_amount_cents: int | None = None, document_number: str | None = None, currency: str | None = None, status: FinancialDocumentStatus, due_date: date | None = None, document_date: date | None = None, legal_entity_id: int | None = None, vendor_id: int | None = None, file: Mapping[str, Any] | None = None, updated_at: datetime, taxes: Sequence[Any], fully_reconciled_at: datetime | None = None, recorded_at: datetime | None = None, duplicate_financial_document_id: int | None = None, validated_at: datetime | None = None, validated_by_id: int | None = None, document_type: DocumentType, parent_financial_document_id: int | None = None, taxes_total_amount_cents: int | None = None, issuer_name: str | None = None, issuer_address_line_1: str | None = None, issuer_address_line_2: str | None = None, issuer_city: str | None = None, issuer_postal_code: str | None = None, issuer_state: str | None = None, issuer_country_code: str | None = None, issuer_tax_id: str | None = None, recipient_name: str | None = None, recipient_address_line_1: str | None = None, recipient_address_line_2: str | None = None, recipient_city: str | None = None, recipient_postal_code: str | None = None, recipient_state: str | None = None, recipient_country_code: str | None = None, recipient_tax_id: str | None = None)[source]
Model for finance_financial_document.
- currency: str | None
Document currency
- document_date: date | None
Document date
- document_number: str | None
Document number
- document_type: DocumentType
Type of the financial document. Using “invoice” as default
- due_date: date | None
Due date
- duplicate_financial_document_id: int | None
Factorial unique identifier for the duplicate financial document
- file: Mapping[str, Any] | None
File attached
- fully_reconciled_at: datetime | None
Date when was fully reconciled
- id: int
Factorial unique identifier
- issuer_address_line_1: str | None
First line of the issuer’s address
- issuer_address_line_2: str | None
Second line of the issuer’s address
- issuer_city: str | None
City of the issuer’s address
- issuer_country_code: str | None
Country code of the issuer’s address
- issuer_name: str | None
Name of the entity issuing the financial document
- issuer_postal_code: str | None
Postal code of the issuer’s address
- issuer_state: str | None
State or province of the issuer’s address
- issuer_tax_id: str | None
Tax identification number of the issuer
- legal_entity_id: int | None
Factorial unique identifier for the legal entity of the financial document
- net_amount_cents: int | None
Net amount in cents
- parent_financial_document_id: int | None
Factorial unique identifier for the parent financial document of the financial document
- recipient_address_line_1: str | None
First line of the recipient’s address
- recipient_address_line_2: str | None
Second line of the recipient’s address
- recipient_city: str | None
City of the recipient’s address
- recipient_country_code: str | None
Country code of the recipient’s address
- recipient_name: str | None
Name of the entity receiving the financial document
- recipient_postal_code: str | None
Postal code of the recipient’s address
- recipient_state: str | None
State or province of the recipient’s address
- recipient_tax_id: str | None
Tax identification number of the recipient
- recorded_at: datetime | None
Date when was recorded
- status: FinancialDocumentStatus
Current status
- taxes: Sequence[Any]
Taxes
- taxes_total_amount_cents: int | None
Taxes total amount in cents
- total_amount_cents: int | None
Total amount in cents
- updated_at: datetime
Updation date
- validated_at: datetime | None
Date when was validated
- validated_by_id: int | None
Factorial unique identifier for the user who validated the financial document
- vendor_id: int | None
Factorial unique identifier for the vendor of the financial document
- class factorialhr.FinancialDocumentsEndpoint(api: ApiClient)[source]
Endpoint for finance/financial_documents operations.
- async all(**kwargs) ListApiResponse[FinancialDocument][source]
Get all financial documents.
Official documentation: finance/financial_documents
- 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[FinancialDocument][source]
Get financial documents with pagination metadata.
Official documentation: finance/financial_documents
- 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(document_id: int | str, **kwargs) FinancialDocument[source]
Get a specific financial document by ID.
Official documentation: finance/financial_documents
- Parameters:
document_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:
- class factorialhr.JournalEntriesEndpoint(api: ApiClient)[source]
Endpoint for finance/journal_entries operations.
- async all(**kwargs) ListApiResponse[JournalEntry][source]
Get all journal entries.
Official documentation: finance/journal_entries
- 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 create(data: Mapping[str, Any], **kwargs) JournalEntry[source]
Create a new journal entry.
Official documentation: finance/journal_entries
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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 created record.
- Return type:
- async get(**kwargs) MetaApiResponse[JournalEntry][source]
Get journal entries with pagination metadata.
Official documentation: finance/journal_entries
- 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(entry_id: int | str, **kwargs) JournalEntry[source]
Get a specific journal entry by ID.
Official documentation: finance/journal_entries
- Parameters:
entry_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:
- class factorialhr.JournalEntry(*, id: int, number: int, published_at: datetime, type: JournalEntryType, source_id: int | None = None, source_type: JournalEntrySourceType | None = None, reference_date: str, description: str | None = None, legal_entity_id: int, external_id: str | None = None, status: JournalEntryStatus, updated_at: datetime)[source]
Model for finance_journal_entry.
- description: str | None
Description of the journal entry
- external_id: str | None
External identifier for the journal entry
- id: int
Journal entry ID
- legal_entity_id: int
The associated Legal Entity ID
- number: int
Incremental number assigned to the journal entry
- published_at: datetime
Timestamp when the journal entry was published
- reference_date: str
Date of the associate source
- source_id: int | None
Source id related with this journal entry
- source_type: JournalEntrySourceType | None
Source type related with this journal entry
- status: JournalEntryStatus
The status of the journal entry (draft, published, etc.)
- type: JournalEntryType
Journal entry type (e.g. bank, invoice, tax)
- updated_at: datetime
Timestamp when the journal entry was last updated
- class factorialhr.JournalLine(*, id: int, number: int, debit_amount_cents: int, credit_amount_cents: int, journal_entry_id: int, account_id: int, fully_reconciled_at: datetime | None = None, external_id: str | None = None, updated_at: datetime)[source]
Model for finance_journal_line.
- account_id: int
ID of the associated account
- credit_amount_cents: int
The credit amount in cents
- debit_amount_cents: int
The debit amount in cents
- external_id: str | None
External identifier for the journal line
- fully_reconciled_at: datetime | None
Timestamp when the journal line was reconciled
- id: int
Factorial id
- journal_entry_id: int
ID of the parent journal entry
- number: int
Sequential number assigned to the line
- updated_at: datetime
Timestamp when the journal line was last updated
- class factorialhr.JournalLinesEndpoint(api: ApiClient)[source]
Endpoint for finance/journal_lines operations.
- async all(**kwargs) ListApiResponse[JournalLine][source]
Get all journal lines.
Official documentation: finance/journal_lines
- 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[JournalLine][source]
Get journal lines with pagination metadata.
Official documentation: finance/journal_lines
- 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(line_id: int | str, **kwargs) JournalLine[source]
Get a specific journal line by ID.
Official documentation: finance/journal_lines
- Parameters:
line_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:
- class factorialhr.LedgerAccountResource(*, id: int, resource_type: ResourceType, resource_id: int, account_id: int, balance_type: BalanceType | None = None, updated_at: datetime, external_id: str | None = None, legal_entity_id: int | None = None)[source]
Model for finance_ledger_account_resource.
- account_id: int
Factorial Ledger Account identifier
- balance_type: BalanceType | None
Ledger account balance type
- external_id: str | None
External identifier
- id: int
Factorial unique identifier
- legal_entity_id: int | None
Factorial unique identifier of the Legal entity
- resource_id: int
Factorial unique identifier of the resource associated to the ledger account resource
- resource_type: ResourceType
Ledger account resource type
- updated_at: datetime
Last time the resource was updated
- class factorialhr.LedgerAccountResourcesEndpoint(api: ApiClient)[source]
Endpoint for finance/ledger_account_resources operations.
- async all(**kwargs) ListApiResponse[LedgerAccountResource][source]
Get all ledger account resources.
Official documentation: finance/ledger_account_resources
- 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[LedgerAccountResource][source]
Get ledger account resources with pagination metadata.
Official documentation: finance/ledger_account_resources
- 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(resource_id: int | str, **kwargs) LedgerAccountResource[source]
Get a specific ledger account resource by ID.
Official documentation: finance/ledger_account_resources
- Parameters:
resource_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 upsert(data: Mapping[str, Any], **kwargs) LedgerAccountResource[source]
Upsert a ledger account resource.
Official documentation: finance/ledger_account_resources
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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:
Result.
- Return type:
- class factorialhr.TaxRate(*, id: int, rate: float, description: str | None = None, tax_type_id: int, external_id: str | None = None, updated_at: datetime)[source]
Model for finance_tax_rate.
- description: str | None
An optional text describing the tax rate’s purpose or context
- external_id: str | None
The external id of the tax rate
- id: int
Factorial id
- rate: float
Specifies the numerical percentage for the tax rate between -1 and 1
- tax_type_id: int
The identifier of the related TaxType record
- updated_at: datetime
Last update date of the tax rate
- class factorialhr.TaxRatesEndpoint(api: ApiClient)[source]
Endpoint for finance/tax_rates operations.
- async all(**kwargs) ListApiResponse[TaxRate][source]
Get all tax rates.
Official documentation: finance/tax_rates
- 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 create(data: Mapping[str, Any], **kwargs) TaxRate[source]
Create a new tax rate.
Official documentation: finance/tax_rates
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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 created record.
- Return type:
- async get(**kwargs) MetaApiResponse[TaxRate][source]
Get tax rates with pagination metadata.
Official documentation: finance/tax_rates
- 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(rate_id: int | str, **kwargs) TaxRate[source]
Get a specific tax rate by ID.
Official documentation: finance/tax_rates
- Parameters:
rate_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(rate_id: int | str, data: Mapping[str, Any], **kwargs) TaxRate[source]
Update a tax rate.
Official documentation: finance/tax_rates
- Parameters:
rate_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.TaxType(*, id: int, name: str, type: TaxTypeCategory, country_code: str | None = None, external_id: str | None = None, updated_at: datetime)[source]
Model for finance_tax_type.
- country_code: str | None
The country code where this tax type applies
- external_id: str | None
The external id of the tax type
- id: int
Factorial id
- name: str
The name assigned to the tax type
- type: TaxTypeCategory
The tax category used to distinguish different tax kinds
- updated_at: datetime
Last update date of the tax type
- class factorialhr.TaxTypesEndpoint(api: ApiClient)[source]
Endpoint for finance/tax_types operations.
- async all(**kwargs) ListApiResponse[TaxType][source]
Get all tax types.
Official documentation: finance/tax_types
- 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 create(data: Mapping[str, Any], **kwargs) TaxType[source]
Create a new tax type.
Official documentation: finance/tax_types
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (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 created record.
- Return type:
- async get(**kwargs) MetaApiResponse[TaxType][source]
Get tax types with pagination metadata.
Official documentation: finance/tax_types
- 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(type_id: int | str, **kwargs) TaxType[source]
Get a specific tax type by ID.
Official documentation: finance/tax_types
- Parameters:
type_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(type_id: int | str, data: Mapping[str, Any], **kwargs) TaxType[source]
Update a tax type.
Official documentation: finance/tax_types
- Parameters:
type_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: