# Fortnox\FortnoxFinancialYearsApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**financialYearControllerDoCreate()**](FortnoxFinancialYearsApi.md#financialYearControllerDoCreate) | **POST** /3/financialyears | Create a financial year |
| [**financialYearControllerDoIndex()**](FortnoxFinancialYearsApi.md#financialYearControllerDoIndex) | **GET** /3/financialyears | Retrieve a list of financial years |
| [**financialYearControllerDoShow()**](FortnoxFinancialYearsApi.md#financialYearControllerDoShow) | **GET** /3/financialyears/{Id} | Retrieve financial year by id |


## `financialYearControllerDoCreate()`

```php
financialYearControllerDoCreate($financial_year): \Fortnox\Model\FortnoxBfFinancialYearSingleItemWrap
```

Create a financial year

Create a financial year

### Example

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



$apiInstance = new Fortnox\Api\FortnoxFinancialYearsApi(
    // 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()
);
$financial_year = new \Fortnox\Model\FortnoxBfFinancialYearSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxBfFinancialYearSinglePayloadItemWrap | Request body for create financial year

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **financial_year** | [**\Fortnox\Model\FortnoxBfFinancialYearSinglePayloadItemWrap**](../Model/FortnoxBfFinancialYearSinglePayloadItemWrap.md)| Request body for create financial year | [optional] |

### Return type

[**\Fortnox\Model\FortnoxBfFinancialYearSingleItemWrap**](../Model/FortnoxBfFinancialYearSingleItemWrap.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)

## `financialYearControllerDoIndex()`

```php
financialYearControllerDoIndex($date): \Fortnox\Model\FortnoxBfFinancialYearListItemWrap
```

Retrieve a list of financial years

Add the query param to filter on specific date.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxFinancialYearsApi(
    // 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()
);
$date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | date to filter on, for example 2020-06-30

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **date** | **\DateTime**| date to filter on, for example 2020-06-30 | [optional] |

### Return type

[**\Fortnox\Model\FortnoxBfFinancialYearListItemWrap**](../Model/FortnoxBfFinancialYearListItemWrap.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)

## `financialYearControllerDoShow()`

```php
financialYearControllerDoShow($id): \Fortnox\Model\FortnoxBfFinancialYearSingleItemWrap
```

Retrieve financial year by id

Retrieve a financial year

### Example

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



$apiInstance = new Fortnox\Api\FortnoxFinancialYearsApi(
    // 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()
);
$id = 56; // int | identifies the year

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| identifies the year | |

### Return type

[**\Fortnox\Model\FortnoxBfFinancialYearSingleItemWrap**](../Model/FortnoxBfFinancialYearSingleItemWrap.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)
