Payroll Integrations Base
Usage
Fetch payroll integration codes:
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
codes = factorialhr.CodesEndpoint(api)
response = await codes.all()
for code in response.data():
print(code.code, code.description)
asyncio.run(main())
- class factorialhr.CodesEndpoint(api: ApiClient)[source]
Endpoint for payroll_integrations_base/codes operations.
- async all(**kwargs) ListApiResponse[Payrollintegrationsbasecode][source]
Get all payroll integration codes records.
Official documentation: payroll_integrations_base/codes
- 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) Payrollintegrationsbasecode[source]
Create a new payroll integration code.
Official documentation: payroll_integrations_base/codes
- 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(code_id: int | str, **kwargs) Payrollintegrationsbasecode[source]
Delete a payroll integration code.
Official documentation: payroll_integrations_base/codes
- Parameters:
code_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 get(**kwargs) MetaApiResponse[Payrollintegrationsbasecode][source]
Get payroll integration codes with pagination metadata.
Official documentation: payroll_integrations_base/codes
- 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 update(code_id: int | str, data: Mapping[str, Any], **kwargs) Payrollintegrationsbasecode[source]
Update a payroll integration code.
Official documentation: payroll_integrations_base/codes
- Parameters:
code_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.Payrollintegrationsbasecode(*, id: int, company_id: int, code: str, codeable_id: int, codeable_type: str, integration: Integration)[source]
Model for payroll_integrations_base_code.
- code: str
Code value
- codeable_id: int
Related object ID. Used together with codeable_type
- codeable_type: str
Related object type. Used together with codeable_id (Employee | Company | LegalEntity | Location | TimeoffLeaveType)
- company_id: int
Company ID where the code belongs to
- id: int
Code identifier
- integration: Integration
Integration name