# Fortnox\FortnoxVouchersApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**voucherControllerDoCreate()**](FortnoxVouchersApi.md#voucherControllerDoCreate) | **POST** /3/vouchers | Create a voucher |
| [**voucherControllerDoIndex()**](FortnoxVouchersApi.md#voucherControllerDoIndex) | **GET** /3/vouchers | Retrieve all vouchers |
| [**voucherControllerDoShow()**](FortnoxVouchersApi.md#voucherControllerDoShow) | **GET** /3/vouchers/{VoucherSeries}/{VoucherNumber} | Retrieve a specific voucher |
| [**voucherControllerDoSubList()**](FortnoxVouchersApi.md#voucherControllerDoSubList) | **GET** /3/vouchers/sublist | Retrieve all vouchers for the current financial year |
| [**voucherControllerDoSublistWithParam()**](FortnoxVouchersApi.md#voucherControllerDoSublistWithParam) | **GET** /3/vouchers/sublist/{VoucherSeries} | Retrieve a list of vouchers for a specific series |


## `voucherControllerDoCreate()`

```php
voucherControllerDoCreate($financialyear, $voucher): \Fortnox\Model\FortnoxBfVoucherSingleItemWrap
```

Create a voucher

The created voucher will be returned if everything succeeded, if there were any problems an error will be returned.  If no query param is used the voucher will be created in the preselected financial year. Go to the financialyears endpoint to read on how to retreive the Financial year id.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxVouchersApi(
    // 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()
);
$financialyear = 56; // int | Financial year id, used to determine which financial year the voucher is created in
$voucher = new \Fortnox\Model\FortnoxBfVoucherSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxBfVoucherSinglePayloadItemWrap | Request body for create voucher

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **financialyear** | **int**| Financial year id, used to determine which financial year the voucher is created in | [optional] |
| **voucher** | [**\Fortnox\Model\FortnoxBfVoucherSinglePayloadItemWrap**](../Model/FortnoxBfVoucherSinglePayloadItemWrap.md)| Request body for create voucher | [optional] |

### Return type

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

## `voucherControllerDoIndex()`

```php
voucherControllerDoIndex($costcenter, $lastmodified, $fromdate, $todate, $voucherseries, $financialyear): \Fortnox\Model\FortnoxBfVoucherListItemWrap
```

Retrieve all vouchers

Note that vouchers have two keys, one for voucher series and one for voucher number. The financial year is also specified for each voucher, this is due to the same voucher series and number is used each year.  To get a unique voucher you need the voucher series, the voucher number and the financial year. These properties will always be returned where ever vouchers is used.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxVouchersApi(
    // 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()
);
$costcenter = 'costcenter_example'; // string | filter on cost center
$lastmodified = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on last modified date
$fromdate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on from date
$todate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on to date
$voucherseries = 'voucherseries_example'; // string | filter on voucher series
$financialyear = 56; // int | filter on financial year

try {
    $result = $apiInstance->voucherControllerDoIndex($costcenter, $lastmodified, $fromdate, $todate, $voucherseries, $financialyear);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxVouchersApi->voucherControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **costcenter** | **string**| filter on cost center | [optional] |
| **lastmodified** | **\DateTime**| filter on last modified date | [optional] |
| **fromdate** | **\DateTime**| filter on from date | [optional] |
| **todate** | **\DateTime**| filter on to date | [optional] |
| **voucherseries** | **string**| filter on voucher series | [optional] |
| **financialyear** | **int**| filter on financial year | [optional] |

### Return type

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

## `voucherControllerDoShow()`

```php
voucherControllerDoShow($voucher_series, $voucher_number, $financialyear): \Fortnox\Model\FortnoxBfVoucherSingleItemWrap
```

Retrieve a specific voucher

Retrieve a voucher

### Example

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



$apiInstance = new Fortnox\Api\FortnoxVouchersApi(
    // 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()
);
$voucher_series = 'voucher_series_example'; // string | identifies the voucher series
$voucher_number = 56; // int | identifies the voucher number
$financialyear = 56; // int | filter on financial year

try {
    $result = $apiInstance->voucherControllerDoShow($voucher_series, $voucher_number, $financialyear);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxVouchersApi->voucherControllerDoShow: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **voucher_series** | **string**| identifies the voucher series | |
| **voucher_number** | **int**| identifies the voucher number | |
| **financialyear** | **int**| filter on financial year | [optional] |

### Return type

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

## `voucherControllerDoSubList()`

```php
voucherControllerDoSubList($costcenter, $lastmodified, $fromdate, $todate, $voucherseries): \Fortnox\Model\FortnoxBfVoucherListItemWrap
```

Retrieve all vouchers for the current financial year

Get vouchers

### Example

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



$apiInstance = new Fortnox\Api\FortnoxVouchersApi(
    // 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()
);
$costcenter = 'costcenter_example'; // string | filter on cost center
$lastmodified = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on last modified date
$fromdate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on from date
$todate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on to date
$voucherseries = 'voucherseries_example'; // string | filter on voucher series

try {
    $result = $apiInstance->voucherControllerDoSubList($costcenter, $lastmodified, $fromdate, $todate, $voucherseries);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxVouchersApi->voucherControllerDoSubList: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **costcenter** | **string**| filter on cost center | [optional] |
| **lastmodified** | **\DateTime**| filter on last modified date | [optional] |
| **fromdate** | **\DateTime**| filter on from date | [optional] |
| **todate** | **\DateTime**| filter on to date | [optional] |
| **voucherseries** | **string**| filter on voucher series | [optional] |

### Return type

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

## `voucherControllerDoSublistWithParam()`

```php
voucherControllerDoSublistWithParam($voucher_series, $costcenter, $lastmodified, $fromdate, $todate, $financialyear): \Fortnox\Model\FortnoxBfVoucherListItemWrap
```

Retrieve a list of vouchers for a specific series

Get vouchers

### Example

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



$apiInstance = new Fortnox\Api\FortnoxVouchersApi(
    // 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()
);
$voucher_series = 'voucher_series_example'; // string | Voucher series of vouchers to list
$costcenter = 'costcenter_example'; // string | filter on cost center
$lastmodified = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on last modified date
$fromdate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on from date
$todate = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on to date
$financialyear = 56; // int | filter on financial year

try {
    $result = $apiInstance->voucherControllerDoSublistWithParam($voucher_series, $costcenter, $lastmodified, $fromdate, $todate, $financialyear);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxVouchersApi->voucherControllerDoSublistWithParam: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **voucher_series** | **string**| Voucher series of vouchers to list | |
| **costcenter** | **string**| filter on cost center | [optional] |
| **lastmodified** | **\DateTime**| filter on last modified date | [optional] |
| **fromdate** | **\DateTime**| filter on from date | [optional] |
| **todate** | **\DateTime**| filter on to date | [optional] |
| **financialyear** | **int**| filter on financial year | [optional] |

### Return type

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