# Fortnox\FortnoxCurrenciesApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**currencyControllerDoCreate()**](FortnoxCurrenciesApi.md#currencyControllerDoCreate) | **POST** /3/currencies | Create a currency |
| [**currencyControllerDoDelete()**](FortnoxCurrenciesApi.md#currencyControllerDoDelete) | **DELETE** /3/currencies/{Code} | Remove a currency |
| [**currencyControllerDoIndex()**](FortnoxCurrenciesApi.md#currencyControllerDoIndex) | **GET** /3/currencies | Retrieve a list of currencies |
| [**currencyControllerDoShow()**](FortnoxCurrenciesApi.md#currencyControllerDoShow) | **GET** /3/currencies/{Code} | Retrieve a single currency |
| [**currencyControllerDoUpdate()**](FortnoxCurrenciesApi.md#currencyControllerDoUpdate) | **PUT** /3/currencies/{Code} | Update a currency |


## `currencyControllerDoCreate()`

```php
currencyControllerDoCreate($currency): \Fortnox\Model\FortnoxCurrencySingleItemWrap
```

Create a currency

Create a currency

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCurrenciesApi(
    // 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()
);
$currency = new \Fortnox\Model\FortnoxCurrencySinglePayloadItemWrap(); // \Fortnox\Model\FortnoxCurrencySinglePayloadItemWrap | Request body for create currency

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **currency** | [**\Fortnox\Model\FortnoxCurrencySinglePayloadItemWrap**](../Model/FortnoxCurrencySinglePayloadItemWrap.md)| Request body for create currency | [optional] |

### Return type

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

## `currencyControllerDoDelete()`

```php
currencyControllerDoDelete($code)
```

Remove a currency

Delete a currency

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCurrenciesApi(
    // 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()
);
$code = 'code_example'; // string | Code of currency to delete

try {
    $apiInstance->currencyControllerDoDelete($code);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxCurrenciesApi->currencyControllerDoDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| Code of currency 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)

## `currencyControllerDoIndex()`

```php
currencyControllerDoIndex(): \Fortnox\Model\FortnoxCurrencyListItemWrap
```

Retrieve a list of currencies

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

### Example

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



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

### Parameters

This endpoint does not need any parameter.

### Return type

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

## `currencyControllerDoShow()`

```php
currencyControllerDoShow($code): \Fortnox\Model\FortnoxCurrencySingleItemWrap
```

Retrieve a single currency

Retrieve a currency

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCurrenciesApi(
    // 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()
);
$code = 'code_example'; // string | Code of currency to show

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| Code of currency to show | |

### Return type

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

## `currencyControllerDoUpdate()`

```php
currencyControllerDoUpdate($code, $currency): \Fortnox\Model\FortnoxCurrencySingleItemWrap
```

Update a currency

Update a currency

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCurrenciesApi(
    // 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()
);
$code = 'code_example'; // string | Code of currency to update
$currency = new \Fortnox\Model\FortnoxCurrencySinglePayloadItemWrap(); // \Fortnox\Model\FortnoxCurrencySinglePayloadItemWrap | Request body for update currency

try {
    $result = $apiInstance->currencyControllerDoUpdate($code, $currency);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxCurrenciesApi->currencyControllerDoUpdate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| Code of currency to update | |
| **currency** | [**\Fortnox\Model\FortnoxCurrencySinglePayloadItemWrap**](../Model/FortnoxCurrencySinglePayloadItemWrap.md)| Request body for update currency | [optional] |

### Return type

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