# Fortnox\FortnoxExpensesApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**expensesControllerDoCreate()**](FortnoxExpensesApi.md#expensesControllerDoCreate) | **POST** /3/expenses | Create an expense |
| [**expensesControllerDoIndex()**](FortnoxExpensesApi.md#expensesControllerDoIndex) | **GET** /3/expenses | Retrieve expenses |
| [**expensesControllerDoShow()**](FortnoxExpensesApi.md#expensesControllerDoShow) | **GET** /3/expenses/{ExpenseCode} | Retrieve an expense |


## `expensesControllerDoCreate()`

```php
expensesControllerDoCreate($expense): \Fortnox\Model\FortnoxLonExpensesSingleItemWrap
```

Create an expense

Create an expense

### Example

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



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

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

### Parameters

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

### Return type

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

## `expensesControllerDoIndex()`

```php
expensesControllerDoIndex(): \Fortnox\Model\FortnoxLonExpensesListItemWrap
```

Retrieve expenses

Retrieve expense codes.

### Example

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



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

### Parameters

This endpoint does not need any parameter.

### Return type

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

## `expensesControllerDoShow()`

```php
expensesControllerDoShow($expense_code): \Fortnox\Model\FortnoxLonExpensesSingleItemWrap
```

Retrieve an expense

Retrieves expense information for specified expense.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxExpensesApi(
    // 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()
);
$expense_code = 'expense_code_example'; // string | expenseCode

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **expense_code** | **string**| expenseCode | |

### Return type

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