# Fortnox\FortnoxTaxReductionsApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**taxReductionControllerDoCreate()**](FortnoxTaxReductionsApi.md#taxReductionControllerDoCreate) | **POST** /3/taxreductions | Create a Tax Reduction |
| [**taxReductionControllerDoDelete()**](FortnoxTaxReductionsApi.md#taxReductionControllerDoDelete) | **DELETE** /3/taxreductions/{Id} | Remove a tax reduction |
| [**taxReductionControllerDoIndex()**](FortnoxTaxReductionsApi.md#taxReductionControllerDoIndex) | **GET** /3/taxreductions | Retrieve a list of tax reductions |
| [**taxReductionControllerDoShow()**](FortnoxTaxReductionsApi.md#taxReductionControllerDoShow) | **GET** /3/taxreductions/{Id} | Retrieve a single tax reduction |
| [**taxReductionControllerDoUpdate()**](FortnoxTaxReductionsApi.md#taxReductionControllerDoUpdate) | **PUT** /3/taxreductions/{Id} | Update a tax reduction |


## `taxReductionControllerDoCreate()`

```php
taxReductionControllerDoCreate($tax_reduction): \Fortnox\Model\FortnoxTaxReductionSingleItemWrap
```

Create a Tax Reduction

Note that different types of tax reduction, i.e. ROT, RUT, or Green Technology, applications work differently.  When creating an application for Green Technology, the field <em>TaxReductionAmounts</em> becomes mandatory as  it is used to determine how much of the asked amount is intended for which type of work. Similarly, the <em>AskedAmount</em>  field of the <em>TaxReduction</em> becomes optional, as it will always be considered to be equal to the sum of the <em>TaxReductionAmounts</em>.   For the other types, ROT and RUT, this field is not required and should be omitted.   Unlike earlier iterations of this endpoint, specifying the type of reduction for the provided <em>TaxReduction</em> (e.g. ROT, RUT, or Green)  is not necessary as this value will always be equal to the type set on the provided document instead.   This endpoint can raise a variety of validation errors, some of which are only relevant for Green Technology applications.  Those errors will always return an HTTP Code of 400 and include, but are not limited to, those shown below:   <table>      <caption>Errors that can be raised by this endpoint.</caption>      <tr>          <th>Error Code</th>          <th>Types</th>          <th>Description</th>          <th>Solution</th>      </tr>      <tr>          <td>2000600</td>          <td>ROT, RUT, GREEN</td>          <td>The provided Social Security Number is already in use for this document.</td>          <td>Verify that the Social Security Number is different from any other applicants already added.</td>      </tr>      <tr>          <td>2004217, 2004218</td>          <td>ROT, RUT, GREEN</td>          <td>The total asked amount of the application is either in an invalid format or is negative.</td>          <td>Verify that the <em>AskedAmount</em>-field is a positive number (0 is valid for Green Technology) and that it is an integer.</td>      </tr>      <tr>          <td>2004209</td>          <td>GREEN</td>          <td>The <em>WorkType</em>-field contains a work type that is not valid for the given type of reduction.</td>          <td>Ensure that the <em>WorkType</em> contains a valid type of work for Green Technology.</td>      </tr>      <tr>          <td>2004263</td>          <td>GREEN</td>          <td>The <em>TaxReductionAmounts</em>-field is missing for a Green Technology application.</td>          <td>Ensure that the field is included, that it is an array, and that each contained object denotes a specific type's asked amount.</td>      </tr>      <tr>          <td>2004262</td>          <td>GREEN</td>          <td>There are more than one object denoting the asked amount for the same type in the <em>TaxReductionAmounts</em>-field.</td>          <td>Ensure that there is only one object denoting the asked amount per type contained in the array.</td>      </tr>  </table>

### Example

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



$apiInstance = new Fortnox\Api\FortnoxTaxReductionsApi(
    // 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()
);
$tax_reduction = new \Fortnox\Model\FortnoxTaxReductionCreatePayloadWrap(); // \Fortnox\Model\FortnoxTaxReductionCreatePayloadWrap | Request body for create tax reduction

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **tax_reduction** | [**\Fortnox\Model\FortnoxTaxReductionCreatePayloadWrap**](../Model/FortnoxTaxReductionCreatePayloadWrap.md)| Request body for create tax reduction | [optional] |

### Return type

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

## `taxReductionControllerDoDelete()`

```php
taxReductionControllerDoDelete($id)
```

Remove a tax reduction

Delete a tax reduction

### Example

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



$apiInstance = new Fortnox\Api\FortnoxTaxReductionsApi(
    // 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 tax reduction

try {
    $apiInstance->taxReductionControllerDoDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxTaxReductionsApi->taxReductionControllerDoDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| identifies the tax reduction | |

### Return type

void (empty response body)

### 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)

## `taxReductionControllerDoIndex()`

```php
taxReductionControllerDoIndex($filter): \Fortnox\Model\FortnoxTaxReductionListItemWrap
```

Retrieve a list of tax reductions

Get tax reductions

### Example

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



$apiInstance = new Fortnox\Api\FortnoxTaxReductionsApi(
    // 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()
);
$filter = 'filter_example'; // string | possibility to filter tax reductions

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **filter** | **string**| possibility to filter tax reductions | [optional] |

### Return type

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

## `taxReductionControllerDoShow()`

```php
taxReductionControllerDoShow($id): \Fortnox\Model\FortnoxTaxReductionSingleItemWrap
```

Retrieve a single tax reduction

Retrieve a tax reduction

### Example

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



$apiInstance = new Fortnox\Api\FortnoxTaxReductionsApi(
    // 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 tax reduction

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| identifies the tax reduction | |

### Return type

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

## `taxReductionControllerDoUpdate()`

```php
taxReductionControllerDoUpdate($id, $tax_reduction): \Fortnox\Model\FortnoxTaxReductionSingleItemWrap
```

Update a tax reduction

Update a tax reduction

### Example

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



$apiInstance = new Fortnox\Api\FortnoxTaxReductionsApi(
    // 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 tax reduction
$tax_reduction = new \Fortnox\Model\FortnoxTaxReductionUpdatePayloadWrap(); // \Fortnox\Model\FortnoxTaxReductionUpdatePayloadWrap | Request body for update tax reduction

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| identifies the tax reduction | |
| **tax_reduction** | [**\Fortnox\Model\FortnoxTaxReductionUpdatePayloadWrap**](../Model/FortnoxTaxReductionUpdatePayloadWrap.md)| Request body for update tax reduction | [optional] |

### Return type

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