BexioApiClient. Payroll
(bexio_api_client v2.0.0)
Copy Markdown
Bexio API for the payroll part of the API (the /4.0/payroll endpoints).
Summary
Functions
Create an employee.
Create an absence for an employee.
Delete an absence of an employee.
Download the paystub PDF for an employee for a given month.
Fetch a single employee on a specific date.
Fetch a single absence of an employee.
Fetch the absences of an employee for a given business year.
Fetch a list of all active employees.
Update an employee.
Update an existing absence of an employee.
Types
Functions
@spec create_employee( req :: Req.Request.t(), employee :: BexioApiClient.Payroll.Employee.t() ) :: {:ok, BexioApiClient.Payroll.Employee.t()} | api_error_type()
Create an employee.
The nation (nationality) should be in ISO Alpha-2 format; the special
values '11' mean 'unknown' and '22' mean 'stateless'.
@spec create_employee_absence( req :: Req.Request.t(), employee_id :: String.t(), absence :: BexioApiClient.Payroll.Absence.t() ) :: {:ok, BexioApiClient.Payroll.Absence.t()} | api_error_type()
Create an absence for an employee.
Currently supported reasons: Injury, Sickness, MaternityLeave,
MilitaryLeave, Vacation, InterruptionOfWork (new reasons might be added
by bexio in the future).
@spec delete_employee_absence( req :: Req.Request.t(), employee_id :: String.t(), absence_id :: String.t() ) :: {:ok, true} | api_error_type()
Delete an absence of an employee.
@spec download_paystub_pdf( req :: Req.Request.t(), employee_id :: String.t(), year :: integer(), month :: integer() ) :: {:ok, {String.t(), any()}} | api_error_type()
Download the paystub PDF for an employee for a given month.
Returns the PDF file contents together with the response's content type.
@spec fetch_employee( req :: Req.Request.t(), employee_id :: String.t(), date :: Date.t() ) :: {:ok, BexioApiClient.Payroll.Employee.t()} | api_error_type()
Fetch a single employee on a specific date.
The date is the date of the employee's state that is retrieved.
@spec fetch_employee_absence( req :: Req.Request.t(), employee_id :: String.t(), absence_id :: String.t() ) :: {:ok, BexioApiClient.Payroll.Absence.t()} | api_error_type()
Fetch a single absence of an employee.
@spec fetch_employee_absences( req :: Req.Request.t(), employee_id :: String.t(), business_year :: integer() ) :: {:ok, [BexioApiClient.Payroll.Absence.t()]} | api_error_type()
Fetch the absences of an employee for a given business year.
@spec fetch_employees(req :: Req.Request.t()) :: {:ok, [BexioApiClient.Payroll.Employee.t()]} | api_error_type()
Fetch a list of all active employees.
@spec update_employee( req :: Req.Request.t(), employee :: BexioApiClient.Payroll.Employee.t() ) :: {:ok, true} | api_error_type()
Update an employee.
@spec update_employee_absence( req :: Req.Request.t(), employee_id :: String.t(), absence :: BexioApiClient.Payroll.Absence.t() ) :: {:ok, true} | api_error_type()
Update an existing absence of an employee.
Unlike when creating an absence, all fields of the absence are required by the API.