# Fortnox\FortnoxContractTemplatesApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**contractTemplateControllerDoCreate()**](FortnoxContractTemplatesApi.md#contractTemplateControllerDoCreate) | **POST** /3/contracttemplates | Create a contract template |
| [**contractTemplateControllerDoIndex()**](FortnoxContractTemplatesApi.md#contractTemplateControllerDoIndex) | **GET** /3/contracttemplates | Retrieve a list of contract templates |
| [**contractTemplateControllerDoShow()**](FortnoxContractTemplatesApi.md#contractTemplateControllerDoShow) | **GET** /3/contracttemplates/{TemplateNumber} | Retrieve a single contract template |
| [**contractTemplateControllerDoUpdate()**](FortnoxContractTemplatesApi.md#contractTemplateControllerDoUpdate) | **PUT** /3/contracttemplates/{TemplateNumber} | Update a contract template |


## `contractTemplateControllerDoCreate()`

```php
contractTemplateControllerDoCreate($contract_template): \Fortnox\Model\FortnoxContractInvoiceContractTemplateResponseWrap
```

Create a contract template

Create a contract template

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractTemplatesApi(
    // 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_template = new \Fortnox\Model\FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap | Request body for create contract template

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **contract_template** | [**\Fortnox\Model\FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap**](../Model/FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap.md)| Request body for create contract template | [optional] |

### Return type

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

## `contractTemplateControllerDoIndex()`

```php
contractTemplateControllerDoIndex(): \Fortnox\Model\FortnoxContractInvoiceContractTemplateListResponseWrap
```

Retrieve a list of contract templates

The contract template resource can return a list of records or a single record. By specifying a TemplateNumber in the URL, a single record will be returned. Not specifying a TemplateNumber will return a list of records.

### Example

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



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

### Parameters

This endpoint does not need any parameter.

### Return type

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

## `contractTemplateControllerDoShow()`

```php
contractTemplateControllerDoShow($template_number): \Fortnox\Model\FortnoxContractInvoiceContractTemplateResponseWrap
```

Retrieve a single contract template

Retrieve a contract template

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractTemplatesApi(
    // 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()
);
$template_number = 56; // int | identifies the contract template

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **template_number** | **int**| identifies the contract template | |

### Return type

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

## `contractTemplateControllerDoUpdate()`

```php
contractTemplateControllerDoUpdate($template_number, $contract_template): \Fortnox\Model\FortnoxContractInvoiceContractTemplateResponseWrap
```

Update a contract template

Update a contract template

### Example

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



$apiInstance = new Fortnox\Api\FortnoxContractTemplatesApi(
    // 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()
);
$template_number = 56; // int | identifies the contract template
$contract_template = new \Fortnox\Model\FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap | Request body for update contract template

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **template_number** | **int**| identifies the contract template | |
| **contract_template** | [**\Fortnox\Model\FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap**](../Model/FortnoxContractInvoiceContractTemplateSinglePayloadItemWrap.md)| Request body for update contract template | [optional] |

### Return type

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