# \ExpenseApi
All URIs are relative to *http://localhost*
[**delete_delete_expense**](ExpenseApi.md#delete_delete_expense) | **DELETE** /api/expenses/{id} | Delete an existing expense record
[**get_get_expense**](ExpenseApi.md#get_get_expense) | **GET** /api/expenses/{id} | Returns one expense
[**get_get_expense_categories**](ExpenseApi.md#get_get_expense_categories) | **GET** /api/expenses/categories | Get all visible expense categories (requires \"manage_expense_category\" permission)
[**get_get_expenses**](ExpenseApi.md#get_get_expenses) | **GET** /api/expenses | Returns a collection of expenses
[**patch_duplicate_expense**](ExpenseApi.md#patch_duplicate_expense) | **PATCH** /api/expenses/{id}/duplicate | Duplicates an existing expense record
[**patch_kimaiplugin_expenses_api_expense_meta**](ExpenseApi.md#patch_kimaiplugin_expenses_api_expense_meta) | **PATCH** /api/expenses/{id}/meta | Sets the value of a meta-field for an existing expense
[**patch_patch_expense**](ExpenseApi.md#patch_patch_expense) | **PATCH** /api/expenses/{id} | Update an existing expense
[**post_post_expense**](ExpenseApi.md#post_post_expense) | **POST** /api/expenses | Creates a new expense
## delete_delete_expense
> delete_delete_expense(id)
Delete an existing expense record
### Parameters
**id** | **String** | Expense record ID to delete | [required] |
### Return type
(empty response body)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_get_expense
> models::ExpenseEntity get_get_expense(id)
Returns one expense
### Parameters
**id** | **String** | Expense ID to fetch | [required] |
### Return type
[**models::ExpenseEntity**](ExpenseEntity.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_get_expense_categories
> models::ExpenseCategory get_get_expense_categories()
Get all visible expense categories (requires \"manage_expense_category\" permission)
### Parameters
This endpoint does not need any parameter.
### Return type
[**models::ExpenseCategory**](ExpenseCategory.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_get_expenses
> Vec<models::ExpenseEntity> get_get_expenses(users_left_square_bracket_right_square_bracket, customers_left_square_bracket_right_square_bracket, projects_left_square_bracket_right_square_bracket, activities_left_square_bracket_right_square_bracket, begin, end, refundable, exported, term, order_by, order, page, size)
Returns a collection of expenses
The result is paginated, by default limited to 50 entries.
### Parameters
**users_left_square_bracket_right_square_bracket** | Option<**String**> | User IDs | |
**customers_left_square_bracket_right_square_bracket** | Option<**String**> | Customer IDs | |
**projects_left_square_bracket_right_square_bracket** | Option<**String**> | Project IDs | |
**activities_left_square_bracket_right_square_bracket** | Option<**String**> | Activity IDs | |
**begin** | Option<**String**> | Only records after this date will be included (format: HTML5) | |
**end** | Option<**String**> | Only records before this date will be included (format: HTML5) | |
**refundable** | Option<**String**> | Use this flag if you want to filter for refundable expenses. Allowed values: 0=not refundable, 1=refundable (default: all) | |
**exported** | Option<**String**> | Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all) | |
**term** | Option<**String**> | Free search term | |
**order_by** | Option<**String**> | The field by which results will be ordered. Allowed values: begin, end, duration, total, category, cost, user, customer, project, activity, description, exported, refundable, multiplier (default: begin) | |
**order** | Option<**String**> | The result order. Allowed values: ASC, DESC (default: DESC) | |
**page** | Option<**String**> | The page to display, renders a 404 if not found (default: 1) | |
**size** | Option<**String**> | The amount of entries for each page (default: 50) | |
### Return type
[**Vec<models::ExpenseEntity>**](ExpenseEntity.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## patch_duplicate_expense
> models::ExpenseEntity patch_duplicate_expense(id)
Duplicates an existing expense record
### Parameters
**id** | **String** | Expense record ID to duplicate | [required] |
### Return type
[**models::ExpenseEntity**](ExpenseEntity.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## patch_kimaiplugin_expenses_api_expense_meta
> models::ExpenseEntity patch_kimaiplugin_expenses_api_expense_meta(id, patch_kimaiplugin_expenses_api_expense_meta_request)
Sets the value of a meta-field for an existing expense
### Parameters
**id** | **String** | Expense record ID to set the meta-field value for | [required] |
**patch_kimaiplugin_expenses_api_expense_meta_request** | Option<[**PatchKimaipluginExpensesApiExpenseMetaRequest**](PatchKimaipluginExpensesApiExpenseMetaRequest.md)> | | |
### Return type
[**models::ExpenseEntity**](ExpenseEntity.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## patch_patch_expense
> models::ExpenseEntity patch_patch_expense(id, expense_edit_form)
Update an existing expense
Update an existing expense, you can pass all or just a subset of all attributes
### Parameters
**id** | **String** | Expense ID to update | [required] |
**expense_edit_form** | [**ExpenseEditForm**](ExpenseEditForm.md) | | [required] |
### Return type
[**models::ExpenseEntity**](ExpenseEntity.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## post_post_expense
> models::ExpenseEntity post_post_expense(expense_edit_form)
Creates a new expense
Creates a new expense and returns it afterwards
### Parameters
**expense_edit_form** | [**ExpenseEditForm**](ExpenseEditForm.md) | | [required] |
### Return type
[**models::ExpenseEntity**](ExpenseEntity.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)