# Fortnox\FortnoxEmployeesApi



All URIs are relative to https://api.fortnox.se, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**employeeControllerDoCreate()**](FortnoxEmployeesApi.md#employeeControllerDoCreate) | **POST** /3/employees | Create a new employee |
| [**employeeControllerDoIndex()**](FortnoxEmployeesApi.md#employeeControllerDoIndex) | **GET** /3/employees | Retrieve a list of employees |
| [**employeeControllerDoShow()**](FortnoxEmployeesApi.md#employeeControllerDoShow) | **GET** /3/employees/{EmployeeId} | Retrieve a specific employee |
| [**employeeControllerDoUpdate()**](FortnoxEmployeesApi.md#employeeControllerDoUpdate) | **PUT** /3/employees/{EmployeeId} | Update employee |


## `employeeControllerDoCreate()`

```php
employeeControllerDoCreate($employee): \Fortnox\Model\FortnoxLonEmployeeSingleItemWrap
```

Create a new employee

EmployeeId is optional. If not supplied the program will generate a unique id.    VacationDaysSaved and all registered and pending vacationdays are read only.    Only one of DatedSchedules and ScheduleId may be supplied. If DatedSchedules are supplied  it must have one and only one record where FirstDay = '1970-01-01'.  All FirstDay values must greater or equal to '1970-01-01' and unique.   If DatedWages is supplied neither MonthlySalary nor HourlyPay may be supplied. If  MonthlySalary or HourlyPay are supplied, DatedWages may not be supplied.  If DatedWages are supplied it must have one and only one record where FirstDay = '1970-01-01'.  All FirstDay values must greater or equal to '1970-01-01' and unique.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxEmployeesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$employee = new \Fortnox\Model\FortnoxLonEmployeeSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxLonEmployeeSinglePayloadItemWrap | Request body for create employee

try {
    $result = $apiInstance->employeeControllerDoCreate($employee);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxEmployeesApi->employeeControllerDoCreate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **employee** | [**\Fortnox\Model\FortnoxLonEmployeeSinglePayloadItemWrap**](../Model/FortnoxLonEmployeeSinglePayloadItemWrap.md)| Request body for create employee | [optional] |

### Return type

[**\Fortnox\Model\FortnoxLonEmployeeSingleItemWrap**](../Model/FortnoxLonEmployeeSingleItemWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `employeeControllerDoIndex()`

```php
employeeControllerDoIndex(): \Fortnox\Model\FortnoxLonEmployeeListItemWrap
```

Retrieve a list of employees

ScheduleId, MonthlySalary and HourlyPay reflect current values, all  ScheduleIds are returned in DatedSchedules and all MonthlySalary and  HourlyPay pairs are returned in DatedWages.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxEmployeesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);

try {
    $result = $apiInstance->employeeControllerDoIndex();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxEmployeesApi->employeeControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

[**\Fortnox\Model\FortnoxLonEmployeeListItemWrap**](../Model/FortnoxLonEmployeeListItemWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `employeeControllerDoShow()`

```php
employeeControllerDoShow($employee_id): \Fortnox\Model\FortnoxLonEmployeeSingleItemWrap
```

Retrieve a specific employee

ScheduleId, MonthlySalary and HourlyPay reflect current values, all  ScheduleIds are returned in DatedSchedules and all MonthlySalary and  HourlyPay pairs are returned in DatedWages.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxEmployeesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$employee_id = 'employee_id_example'; // string | identifies the employee

try {
    $result = $apiInstance->employeeControllerDoShow($employee_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxEmployeesApi->employeeControllerDoShow: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **employee_id** | **string**| identifies the employee | |

### Return type

[**\Fortnox\Model\FortnoxLonEmployeeSingleItemWrap**](../Model/FortnoxLonEmployeeSingleItemWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `employeeControllerDoUpdate()`

```php
employeeControllerDoUpdate($employee_id, $employee): \Fortnox\Model\FortnoxLonEmployeeSingleItemWrap
```

Update employee

Only one of DatedSchedules and ScheduleId may be supplied. If DatedSchedules are supplied  it must have one and only one record where FirstDay = '1970-01-01'.  All FirstDay values must greater or equal to '1970-01-01' and unique.    VacationDaysSaved and all registered and pending vacationdays are read only.   If DatedWages is supplied neither MonthlySalary nor HourlyPay may be supplied. If  MonthlySalary or HourlyPay are supplied, DatedWages may not be supplied.  If DatedWages are supplied it must have one and only one record where FirstDay = '1970-01-01'.  All FirstDay values must greater or equal to '1970-01-01' and unique.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxEmployeesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$employee_id = 'employee_id_example'; // string | identifies the employee
$employee = new \Fortnox\Model\FortnoxLonEmployeeSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxLonEmployeeSinglePayloadItemWrap | Request body for update employee

try {
    $result = $apiInstance->employeeControllerDoUpdate($employee_id, $employee);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxEmployeesApi->employeeControllerDoUpdate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **employee_id** | **string**| identifies the employee | |
| **employee** | [**\Fortnox\Model\FortnoxLonEmployeeSinglePayloadItemWrap**](../Model/FortnoxLonEmployeeSinglePayloadItemWrap.md)| Request body for update employee | [optional] |

### Return type

[**\Fortnox\Model\FortnoxLonEmployeeSingleItemWrap**](../Model/FortnoxLonEmployeeSingleItemWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
