- Implement tests for basic and bearer authentication headers in `test_auth.py`. - Create tests for the `EasybillWebhookParser` in `test_webhooks.py`, covering JSON and form-encoded payloads, as well as a generic parse and acknowledgement method.
42 KiB
easybill_generated_async.DocumentApi
All URIs are relative to https://api.easybill.de/rest/v1
| Method | HTTP request | Description |
|---|---|---|
| documents_get | GET /documents | Fetch documents list |
| documents_id_cancel_post | POST /documents/{id}/cancel | Cancel document |
| documents_id_delete | DELETE /documents/{id} | Delete document |
| documents_id_done_put | PUT /documents/{id}/done | To complete a document. |
| documents_id_download_get | GET /documents/{id}/download | Fetch the document in best fitting format to the given Accept header |
| documents_id_get | GET /documents/{id} | Fetch document |
| documents_id_jpg_get | GET /documents/{id}/jpg | Download a document as an jpeg-image |
| documents_id_pdf_get | GET /documents/{id}/pdf | Fetch pdf document |
| documents_id_put | PUT /documents/{id} | Update document |
| documents_id_send_type_post | POST /documents/{id}/send/{type} | Send document |
| documents_id_type_post | POST /documents/{id}/{type} | Convert an existing document to one of a different type |
| documents_post | POST /documents | Create document |
documents_get
Documents documents_get(limit=limit, page=page, type=type, is_draft=is_draft, is_archive=is_archive, customer_id=customer_id, project_id=project_id, ref_id=ref_id, document_date=document_date, paid_at=paid_at, title=title, number=number, cancel_id=cancel_id, fulfillment_country=fulfillment_country, vat_country=vat_country, shipping_country=shipping_country, status=status, edited_at=edited_at)
Fetch documents list
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.documents import Documents
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.DocumentApi(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)
type = 'type_example' # str | Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. (optional)
is_draft = 'is_draft_example' # str | Filter documents by draft flag. (optional)
is_archive = 'is_archive_example' # str | Filter documents by archive flag. (optional)
customer_id = 'customer_id_example' # str | Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. (optional)
project_id = 'project_id_example' # str | Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. (optional)
ref_id = 'ref_id_example' # str | Filter documents by ref_id. (optional)
document_date = 'document_date_example' # str | Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. (optional)
paid_at = 'paid_at_example' # str | Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. (optional)
title = 'title_example' # str | Filter documents by title. (optional)
number = 'number_example' # str | Filter documents by number. (optional)
cancel_id = 'cancel_id_example' # str | Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. (optional)
fulfillment_country = 'fulfillment_country_example' # str | Filter documents by fulfillment_country. (optional)
vat_country = 'vat_country_example' # str | Filter documents by vat_country. (optional)
shipping_country = 'shipping_country_example' # str | Filter documents by shipping_country. (optional)
status = 'status_example' # str | Filter documents by status. Keep in mind that not every document type has a status. (optional)
edited_at = 'edited_at_example' # str | Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional)
try:
# Fetch documents list
api_response = await api_instance.documents_get(limit=limit, page=page, type=type, is_draft=is_draft, is_archive=is_archive, customer_id=customer_id, project_id=project_id, ref_id=ref_id, document_date=document_date, paid_at=paid_at, title=title, number=number, cancel_id=cancel_id, fulfillment_country=fulfillment_country, vat_country=vat_country, shipping_country=shipping_country, status=status, edited_at=edited_at)
print("The response of DocumentApi->documents_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_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] |
| type | str | Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. | [optional] |
| is_draft | str | Filter documents by draft flag. | [optional] |
| is_archive | str | Filter documents by archive flag. | [optional] |
| customer_id | str | Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. | [optional] |
| project_id | str | Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. | [optional] |
| ref_id | str | Filter documents by ref_id. | [optional] |
| document_date | str | Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] |
| paid_at | str | Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. | [optional] |
| title | str | Filter documents by title. | [optional] |
| number | str | Filter documents by number. | [optional] |
| cancel_id | str | Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. | [optional] |
| fulfillment_country | str | Filter documents by fulfillment_country. | [optional] |
| vat_country | str | Filter documents by vat_country. | [optional] |
| shipping_country | str | Filter documents by shipping_country. | [optional] |
| status | str | Filter documents by status. Keep in mind that not every document type has a status. | [optional] |
| edited_at | str | Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] |
Return type
Authorization
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] [Back to Model list] [Back to README]
documents_id_cancel_post
Document documents_id_cancel_post(id, use_text_from_template=use_text_from_template)
Cancel document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.document import Document
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.DocumentApi(api_client)
id = 56 # int | ID of document
use_text_from_template = False # bool | Use standard texts from the template. (optional) (default to False)
try:
# Cancel document
api_response = await api_instance.documents_id_cancel_post(id, use_text_from_template=use_text_from_template)
print("The response of DocumentApi->documents_id_cancel_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_cancel_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| use_text_from_template | bool | Use standard texts from the template. | [optional] [default to False] |
Return type
Authorization
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] [Back to Model list] [Back to README]
documents_id_delete
documents_id_delete(id)
Delete document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
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.DocumentApi(api_client)
id = 56 # int | ID of document
try:
# Delete document
await api_instance.documents_id_delete(id)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_delete: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | Successful operation | - |
| 404 | Not found | - |
| 409 | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
documents_id_done_put
Document documents_id_done_put(id, reason_for_change=reason_for_change)
To complete a document.
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.document import Document
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.DocumentApi(api_client)
id = 56 # int | ID of document
reason_for_change = 'reason_for_change_example' # str | A string that is saved on the document version as reason. (optional)
try:
# To complete a document.
api_response = await api_instance.documents_id_done_put(id, reason_for_change=reason_for_change)
print("The response of DocumentApi->documents_id_done_put:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_done_put: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| reason_for_change | str | A string that is saved on the document version as reason. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful operation | - |
| 404 | Not found | - |
| 409 | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
documents_id_download_get
bytes documents_id_download_get(id, accept=accept)
Fetch the document in best fitting format to the given Accept header
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
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.DocumentApi(api_client)
id = 56 # int | ID of document
accept = 'accept_example' # str | The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. (optional)
try:
# Fetch the document in best fitting format to the given Accept header
api_response = await api_instance.documents_id_download_get(id, accept=accept)
print("The response of DocumentApi->documents_id_download_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_download_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| accept | str | The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, if the 'format' parameter is specified, a 'version' parameter can be added, following SemVer, allowing \* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\.' can explicitly require a version of at least 3.0 and higher. | [optional] |
Return type
bytes
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/pdf, application/pdf;format=zugferd;version=1.0.0, application/pdf;format=zugferd;version=2.2.0, application/xml;format=xrechnung;version=2.3.0, application/xml;format=xrechnung;version=3.0.1
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful operation, a binary matching the defined expectations via 'Accept' header could be found and will be returned. The 'Content-Type' header of the response will contain the exact pdf format provided. | - |
| 404 | Not found | - |
| 406 | No matching format of the document is available | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
documents_id_get
Document documents_id_get(id)
Fetch document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.document import Document
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.DocumentApi(api_client)
id = 56 # int | ID of document
try:
# Fetch document
api_response = await api_instance.documents_id_get(id)
print("The response of DocumentApi->documents_id_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document |
Return type
Authorization
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] [Back to Model list] [Back to README]
documents_id_jpg_get
bytes documents_id_jpg_get(id, offset=offset, limit=limit)
Download a document as an jpeg-image
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
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.DocumentApi(api_client)
id = 56 # int | ID of document
offset = 56 # int | The page of the document where the image should start. (optional)
limit = 56 # int | The page of the document where the image should end. (optional)
try:
# Download a document as an jpeg-image
api_response = await api_instance.documents_id_jpg_get(id, offset=offset, limit=limit)
print("The response of DocumentApi->documents_id_jpg_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_jpg_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| offset | int | The page of the document where the image should start. | [optional] |
| limit | int | The page of the document where the image should end. | [optional] |
Return type
bytes
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: image/jpeg
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] [Back to Model list] [Back to README]
documents_id_pdf_get
bytes documents_id_pdf_get(id)
Fetch pdf document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
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.DocumentApi(api_client)
id = 56 # int | ID of document
try:
# Fetch pdf document
api_response = await api_instance.documents_id_pdf_get(id)
print("The response of DocumentApi->documents_id_pdf_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_pdf_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document |
Return type
bytes
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/pdf
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] [Back to Model list] [Back to README]
documents_id_put
Document documents_id_put(id, body, refresh_customer_data=refresh_customer_data, reason_for_change=reason_for_change)
Update document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.document import Document
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.DocumentApi(api_client)
id = 56 # int | ID of document
body = easybill_generated_async.Document() # Document |
refresh_customer_data = True # bool | Forces refreshing of the customer data. (optional)
reason_for_change = 'reason_for_change_example' # str | A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. (optional)
try:
# Update document
api_response = await api_instance.documents_id_put(id, body, refresh_customer_data=refresh_customer_data, reason_for_change=reason_for_change)
print("The response of DocumentApi->documents_id_put:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_put: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| body | Document | ||
| refresh_customer_data | bool | Forces refreshing of the customer data. | [optional] |
| reason_for_change | str | A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful operation | - |
| 400 | Invalid Document | - |
| 409 | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
documents_id_send_type_post
documents_id_send_type_post(id, type, body)
Send document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.post_box_request import PostBoxRequest
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.DocumentApi(api_client)
id = 56 # int | ID of document
type = 'type_example' # str |
body = easybill_generated_async.PostBoxRequest() # PostBoxRequest |
try:
# Send document
await api_instance.documents_id_send_type_post(id, type, body)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_send_type_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| type | str | ||
| body | PostBoxRequest |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | Successful operation | - |
| 404 | Not found | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
documents_id_type_post
Document documents_id_type_post(id, type, pdf_template=pdf_template)
Convert an existing document to one of a different type
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.document import Document
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.DocumentApi(api_client)
id = 56 # int | ID of document
type = 'type_example' # str | The target document type
pdf_template = 'DE' # str | The ID of the printer template to use. Defaults to 'DE' if not given. (optional) (default to 'DE')
try:
# Convert an existing document to one of a different type
api_response = await api_instance.documents_id_type_post(id, type, pdf_template=pdf_template)
print("The response of DocumentApi->documents_id_type_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_id_type_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document | |
| type | str | The target document type | |
| pdf_template | str | The ID of the printer template to use. Defaults to 'DE' if not given. | [optional] [default to 'DE'] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successful operation | * Location - Absolute URL to the newly created document |
| 400 | Invalid target document type | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
documents_post
Document documents_post(body)
Create document
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_async
from easybill_generated_async.models.document import Document
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.DocumentApi(api_client)
body = easybill_generated_async.Document() # Document |
try:
# Create document
api_response = await api_instance.documents_post(body)
print("The response of DocumentApi->documents_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentApi->documents_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | Document |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successful operation | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]