# eis-accounting
The EMIL AccountingService API description

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0
- Package version: 1.18.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://www.emil.de](https://www.emil.de)

## Requirements.

Python >=3.6

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install eis.accounting
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import eis.accounting
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import eis.accounting
```

## Getting Started

The environment variables must be set in order to properly use this SDK.

```shell 
export EMIL_USERNAME=XXXXXXX
export EMIL_PASSWORD=XXXXXXX
```

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
import time
import eis.accounting
from pprint import pprint
from eis.accounting.api import booking_entries_api
from eis.accounting.model.create_booking_entry_request_dto import CreateBookingEntryRequestDto
from eis.accounting.model.create_booking_entry_response_class import CreateBookingEntryResponseClass
from eis.accounting.model.get_booking_entry_response_class import GetBookingEntryResponseClass
from eis.accounting.model.list_booking_entries_response_class import ListBookingEntriesResponseClass
# Defining the host is optional and defaults to https://apiv2.emil.de
# See configuration.py for a list of all supported configuration parameters.
configuration = eis.accounting.Configuration(
    host = "https://apiv2.emil.de"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Bearer is automatically handled with exported environment variables. However, you
# can manuallay configure Bearer authorization (JWT): bearer
configuration = eis.accounting.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# After manual token becomes invalid, the SDK will default to re-login automatically
# with environment variable credentials.


# Enter a context with an instance of the API client
with eis.accounting.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = booking_entries_api.BookingEntriesApi(api_client)
    create_booking_entry_request_dto = CreateBookingEntryRequestDto(
        booking_date=dateutil_parser('2024-06-24T10:12:46.493Z'),
        document_date=dateutil_parser('2024-06-24T10:12:46.493Z'),
        entity_number="INV_2020",
        external_number="INV2405840",
        description="Invoice payment for policy 010101489/V",
        custom_fields={},
        financial_transactions=[
            FinancialTransactionDataDto(
                financial_account_number="40010001",
                personal_account_number="20010001",
                description="Monthly premium payment for policy 1234567890",
                amount=100,
                debit_credit="CREDIT",
                custom_fields={},
                transaction_type="NORMAL",
            ),
        ],
    ) # CreateBookingEntryRequestDto | 
    authorization = "Authorization_example" # str | Bearer Token: provided by the login endpoint under the name accessToken. (optional)

    try:
        # Create the booking entry
        api_response = api_instance.create_booking_entry(create_booking_entry_request_dto, authorization=authorization)
        pprint(api_response)
    except eis.accounting.ApiException as e:
        print("Exception when calling BookingEntriesApi->create_booking_entry: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to *https://apiv2.emil.de*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BookingEntriesApi* | [**create_booking_entry**](docs/BookingEntriesApi.md#create_booking_entry) | **POST** /accountingservice/v1/booking-entries | Create the booking entry
*BookingEntriesApi* | [**get_booking_entry**](docs/BookingEntriesApi.md#get_booking_entry) | **GET** /accountingservice/v1/booking-entries/{code} | Retrieve the booking entry
*BookingEntriesApi* | [**list_booking_entries**](docs/BookingEntriesApi.md#list_booking_entries) | **GET** /accountingservice/v1/booking-entries | List booking entries
*FinancialAccountsApi* | [**create_financial_account**](docs/FinancialAccountsApi.md#create_financial_account) | **POST** /accountingservice/v1/financial-accounts | Create the Financial Account
*FinancialAccountsApi* | [**delete_financial_account**](docs/FinancialAccountsApi.md#delete_financial_account) | **DELETE** /accountingservice/v1/financial-accounts/{code} | Delete the Financial Account
*FinancialAccountsApi* | [**get_financial_account**](docs/FinancialAccountsApi.md#get_financial_account) | **GET** /accountingservice/v1/financial-accounts/{code} | Retrieve the Financial Account
*FinancialAccountsApi* | [**list_financial_accounts**](docs/FinancialAccountsApi.md#list_financial_accounts) | **GET** /accountingservice/v1/financial-accounts | List Financial Accounts
*FinancialTransactionsApi* | [**get_financial_transaction**](docs/FinancialTransactionsApi.md#get_financial_transaction) | **GET** /accountingservice/v1/financial-transactions/{code} | Retrieve the financial transaction
*FinancialTransactionsApi* | [**list_financial_transactions**](docs/FinancialTransactionsApi.md#list_financial_transactions) | **GET** /accountingservice/v1/financial-transactions | List financial transactions
*HealthApi* | [**check**](docs/HealthApi.md#check) | **GET** /accountingservice/health | Health Check
*NumberRangesApi* | [**create_number_range**](docs/NumberRangesApi.md#create_number_range) | **POST** /accountingservice/v1/number-ranges | Create the Number Range
*NumberRangesApi* | [**delete_number_range**](docs/NumberRangesApi.md#delete_number_range) | **DELETE** /accountingservice/v1/number-ranges/{code} | Delete the Personal Account
*NumberRangesApi* | [**get_number_range**](docs/NumberRangesApi.md#get_number_range) | **GET** /accountingservice/v1/number-ranges/{code} | Retrieve the Financial Account
*NumberRangesApi* | [**list_number_ranges**](docs/NumberRangesApi.md#list_number_ranges) | **GET** /accountingservice/v1/number-ranges | List Financial Accounts
*PersonalAccountsApi* | [**create_personal_account**](docs/PersonalAccountsApi.md#create_personal_account) | **POST** /accountingservice/v1/personal-accounts | Create the Personal Account
*PersonalAccountsApi* | [**delete_personal_account**](docs/PersonalAccountsApi.md#delete_personal_account) | **DELETE** /accountingservice/v1/personal-accounts/{code} | Delete the Personal Account
*PersonalAccountsApi* | [**get_personal_account**](docs/PersonalAccountsApi.md#get_personal_account) | **GET** /accountingservice/v1/personal-accounts/{code} | Retrieve the Personal Account
*PersonalAccountsApi* | [**list_personal_accounts**](docs/PersonalAccountsApi.md#list_personal_accounts) | **GET** /accountingservice/v1/personal-accounts | List Personal Accounts


## Documentation For Models

 - [BookingEntryClass](docs/BookingEntryClass.md)
 - [CreateBookingEntryRequestDto](docs/CreateBookingEntryRequestDto.md)
 - [CreateBookingEntryResponseClass](docs/CreateBookingEntryResponseClass.md)
 - [CreateFinancialAccountRequestDto](docs/CreateFinancialAccountRequestDto.md)
 - [CreateFinancialAccountResponseClass](docs/CreateFinancialAccountResponseClass.md)
 - [CreateNumberRangeRequestDto](docs/CreateNumberRangeRequestDto.md)
 - [CreateNumberRangeResponseClass](docs/CreateNumberRangeResponseClass.md)
 - [CreatePersonalAccountRequestDto](docs/CreatePersonalAccountRequestDto.md)
 - [CreatePersonalAccountResponseClass](docs/CreatePersonalAccountResponseClass.md)
 - [FinancialAccountClass](docs/FinancialAccountClass.md)
 - [FinancialTransactionClass](docs/FinancialTransactionClass.md)
 - [FinancialTransactionDataDto](docs/FinancialTransactionDataDto.md)
 - [GetBookingEntryResponseClass](docs/GetBookingEntryResponseClass.md)
 - [GetFinancialAccountResponseClass](docs/GetFinancialAccountResponseClass.md)
 - [GetFinancialTransactionResponseClass](docs/GetFinancialTransactionResponseClass.md)
 - [GetNumberRangeResponseClass](docs/GetNumberRangeResponseClass.md)
 - [GetPersonalAccountResponseClass](docs/GetPersonalAccountResponseClass.md)
 - [InlineResponse200](docs/InlineResponse200.md)
 - [InlineResponse503](docs/InlineResponse503.md)
 - [ListBookingEntriesResponseClass](docs/ListBookingEntriesResponseClass.md)
 - [ListFinancialAccountsResponseClass](docs/ListFinancialAccountsResponseClass.md)
 - [ListFinancialTransactionsResponseClass](docs/ListFinancialTransactionsResponseClass.md)
 - [ListNumberRangeResponseClass](docs/ListNumberRangeResponseClass.md)
 - [ListPersonalAccountsResponseClass](docs/ListPersonalAccountsResponseClass.md)
 - [NumberRangeClass](docs/NumberRangeClass.md)
 - [PersonalAccountClass](docs/PersonalAccountClass.md)


## Documentation For Authorization


## bearer

- **Type**: Bearer authentication (JWT)


## Author

kontakt@emil.de


## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in eis.accounting.apis and eis.accounting.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1:
Use specific imports for apis and models like:
- `from eis.accounting.api.default_api import DefaultApi`
- `from eis.accounting.model.pet import Pet`

Solution 2:
Before importing the package, adjust the maximum recursion limit as shown below:
```
import sys
sys.setrecursionlimit(1500)
import eis.accounting
from eis.accounting.apis import *
from eis.accounting.models import *
```

