# easybill_generated_async.SerialNumberApi

All URIs are relative to *https://api.easybill.de/rest/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**serial_numbers_get**](SerialNumberApi.md#serial_numbers_get) | **GET** /serial-numbers | Fetch a list of serial numbers for positions
[**serial_numbers_id_delete**](SerialNumberApi.md#serial_numbers_id_delete) | **DELETE** /serial-numbers/{id} | Delete a serial number for a position
[**serial_numbers_id_get**](SerialNumberApi.md#serial_numbers_id_get) | **GET** /serial-numbers/{id} | Fetch a serial number for a position
[**serial_numbers_post**](SerialNumberApi.md#serial_numbers_post) | **POST** /serial-numbers | Create s serial number for a position


# **serial_numbers_get**
> SerialNumbers serial_numbers_get(limit=limit, page=page, position_id=position_id, document_id=document_id, in_use=in_use)

Fetch a list of serial numbers for positions

### Example

* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):

```python
import easybill_generated_async
from easybill_generated_async.models.serial_numbers import SerialNumbers
from easybill_generated_async.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_async.Configuration(
    host = "https://api.easybill.de/rest/v1"
)

# 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.

# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_async.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'

# Enter a context with an instance of the API client
async with easybill_generated_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = easybill_generated_async.SerialNumberApi(api_client)
    limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional)
    page = 56 # int | Set current Page. Default is 1. (optional)
    position_id = 'position_id_example' # str | Filter serial numbers by position id. (optional)
    document_id = 'document_id_example' # str | Filter serial numbers by document id. (optional)
    in_use = True # bool | Filter serial numbers by usage. (optional)

    try:
        # Fetch a list of serial numbers for positions
        api_response = await api_instance.serial_numbers_get(limit=limit, page=page, position_id=position_id, document_id=document_id, in_use=in_use)
        print("The response of SerialNumberApi->serial_numbers_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SerialNumberApi->serial_numbers_get: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] 
 **page** | **int**| Set current Page. Default is 1. | [optional] 
 **position_id** | **str**| Filter serial numbers by position id. | [optional] 
 **document_id** | **str**| Filter serial numbers by document id. | [optional] 
 **in_use** | **bool**| Filter serial numbers by usage. | [optional] 

### Return type

[**SerialNumbers**](SerialNumbers.md)

### Authorization

[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation |  -  |
**429** | Too Many Requests |  -  |

[[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)

# **serial_numbers_id_delete**
> serial_numbers_id_delete(id)

Delete a serial number for a position

### Example

* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):

```python
import easybill_generated_async
from easybill_generated_async.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_async.Configuration(
    host = "https://api.easybill.de/rest/v1"
)

# 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.

# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_async.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'

# Enter a context with an instance of the API client
async with easybill_generated_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = easybill_generated_async.SerialNumberApi(api_client)
    id = 56 # int | ID of the serial number that needs to be deleted

    try:
        # Delete a serial number for a position
        await api_instance.serial_numbers_id_delete(id)
    except Exception as e:
        print("Exception when calling SerialNumberApi->serial_numbers_id_delete: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| ID of the serial number that needs to be deleted | 

### Return type

void (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Successful operation |  -  |
**400** | Serial number in use. Operation failed. |  -  |
**404** | Not found |  -  |
**429** | Too Many Requests |  -  |

[[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)

# **serial_numbers_id_get**
> SerialNumber serial_numbers_id_get(id)

Fetch a serial number for a position

### Example

* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):

```python
import easybill_generated_async
from easybill_generated_async.models.serial_number import SerialNumber
from easybill_generated_async.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_async.Configuration(
    host = "https://api.easybill.de/rest/v1"
)

# 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.

# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_async.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'

# Enter a context with an instance of the API client
async with easybill_generated_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = easybill_generated_async.SerialNumberApi(api_client)
    id = 56 # int | ID of the serial number that needs to be fetched

    try:
        # Fetch a serial number for a position
        api_response = await api_instance.serial_numbers_id_get(id)
        print("The response of SerialNumberApi->serial_numbers_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SerialNumberApi->serial_numbers_id_get: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| ID of the serial number that needs to be fetched | 

### Return type

[**SerialNumber**](SerialNumber.md)

### Authorization

[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation |  -  |
**404** | Not found |  -  |
**429** | Too Many Requests |  -  |

[[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)

# **serial_numbers_post**
> SerialNumber serial_numbers_post(body=body)

Create s serial number for a position

### Example

* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):

```python
import easybill_generated_async
from easybill_generated_async.models.serial_number import SerialNumber
from easybill_generated_async.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_async.Configuration(
    host = "https://api.easybill.de/rest/v1"
)

# 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.

# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_async.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'

# Enter a context with an instance of the API client
async with easybill_generated_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = easybill_generated_async.SerialNumberApi(api_client)
    body = easybill_generated_async.SerialNumber() # SerialNumber |  (optional)

    try:
        # Create s serial number for a position
        api_response = await api_instance.serial_numbers_post(body=body)
        print("The response of SerialNumberApi->serial_numbers_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SerialNumberApi->serial_numbers_post: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SerialNumber**](SerialNumber.md)|  | [optional] 

### Return type

[**SerialNumber**](SerialNumber.md)

### Authorization

[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation |  -  |
**400** | Invalid PositionID |  -  |
**429** | Too Many Requests |  -  |

[[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)

