# Fortnox\FortnoxContractAccrualsApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**contractAccrualControllerDoCreate()**](FortnoxContractAccrualsApi.md#contractAccrualControllerDoCreate) | **POST** /3/contractaccruals | Create a contract accrual |
| [**contractAccrualControllerDoDelete()**](FortnoxContractAccrualsApi.md#contractAccrualControllerDoDelete) | **DELETE** /3/contractaccruals/{DocumentNumber} | Remove a contract accrual |
| [**contractAccrualControllerDoIndex()**](FortnoxContractAccrualsApi.md#contractAccrualControllerDoIndex) | **GET** /3/contractaccruals | Retrieve a list of contract accruals |
| [**contractAccrualControllerDoShow()**](FortnoxContractAccrualsApi.md#contractAccrualControllerDoShow) | **GET** /3/contractaccruals/{DocumentNumber} | Retrieve a single contract accrual |
| [**contractAccrualControllerDoUpdate()**](FortnoxContractAccrualsApi.md#contractAccrualControllerDoUpdate) | **PUT** /3/contractaccruals/{DocumentNumber} | Update a contract accrual |


## `contractAccrualControllerDoCreate()`

```php
contractAccrualControllerDoCreate($contract_accrual): \Fortnox\Model\FortnoxContractInvoiceContractAccrualSingleItemWrap
```

Create a contract accrual

Create a contract accrual

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractAccrualsApi(
    // 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()
);
$contract_accrual = new \Fortnox\Model\FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap | Request body for create contract accrual

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **contract_accrual** | [**\Fortnox\Model\FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap**](../Model/FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap.md)| Request body for create contract accrual | [optional] |

### Return type

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

## `contractAccrualControllerDoDelete()`

```php
contractAccrualControllerDoDelete($document_number)
```

Remove a contract accrual

Delete a contract accrual

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractAccrualsApi(
    // 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()
);
$document_number = 'document_number_example'; // string | Document number of contract accrual to delete

try {
    $apiInstance->contractAccrualControllerDoDelete($document_number);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxContractAccrualsApi->contractAccrualControllerDoDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **document_number** | **string**| Document number of contract accrual to delete | |

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

## `contractAccrualControllerDoIndex()`

```php
contractAccrualControllerDoIndex(): \Fortnox\Model\FortnoxContractInvoiceContractAccrualListItemWrap
```

Retrieve a list of contract accruals

The contract accruals register can return a list of records or a single record. By specifying a DocumentNumber in the URL, a single record will be returned. Not specifying a DocumentNumber will return a list of records.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractAccrualsApi(
    // 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->contractAccrualControllerDoIndex();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxContractAccrualsApi->contractAccrualControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

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

## `contractAccrualControllerDoShow()`

```php
contractAccrualControllerDoShow($document_number): \Fortnox\Model\FortnoxContractInvoiceContractAccrualSingleItemWrap
```

Retrieve a single contract accrual

Retrieve a contract accrual

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractAccrualsApi(
    // 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()
);
$document_number = 'document_number_example'; // string | Document number of contract accrual to show

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **document_number** | **string**| Document number of contract accrual to show | |

### Return type

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

## `contractAccrualControllerDoUpdate()`

```php
contractAccrualControllerDoUpdate($document_number, $contract_accrual): \Fortnox\Model\FortnoxContractInvoiceContractAccrualSingleItemWrap
```

Update a contract accrual

Update a contract accrual

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractAccrualsApi(
    // 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()
);
$document_number = 'document_number_example'; // string | Document number of contract accrual to update
$contract_accrual = new \Fortnox\Model\FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap | Request body for update contract accrual

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **document_number** | **string**| Document number of contract accrual to update | |
| **contract_accrual** | [**\Fortnox\Model\FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap**](../Model/FortnoxContractInvoiceContractAccrualSinglePayloadItemWrap.md)| Request body for update contract accrual | [optional] |

### Return type

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