- 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.
22 KiB
easybill-generated-sync
The first version of the easybill REST API. CHANGELOG
Authentication
You can choose between two available methods: Basic Auth or Bearer Token.
In each HTTP request, one of the following HTTP headers is required:
# Basic Auth
Authorization: Basic base64_encode('<email>:<api_key>')
# Bearer Token
Authorization: Bearer <api_key>
Limitations
Request Limit
- PLUS: 10 requests per minute
- BUSINESS: 60 requests per minute
If the limit is exceeded, you will receive the HTTP error: 429 Too Many Requests
Result Limit
All result lists are limited to 100 by default. This limit can be increased by the query parameter limit to a maximum of 1000.
Query filter
Many list resources can be filtered. In /documents you can filter e.g. by number with /documents?number=111028654. If you want to filter multiple numbers, you can either enter them separated by commas /documents?number=111028654,222006895 or as an array /documents?number[]=111028654&number[]=222006895.
Warning: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: 414 Request-URI Too Large
Escape commas in query
You can escape commans in query name=Patrick\\, Peter if you submit the header X-Easybill-Escape: true in your request.
Property login_id
This is the login of your admin or employee account.
Date and Date-Time format
Please use the timezone Europe/Berlin.
- date = Y-m-d =
2016-12-31 - date-time = Y-m-d H:i:s =
2016-12-31 03:13:37
Date or datetime can be null because the attributes have been added later and the entry is older.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.96.0
- Package version: 1.0.0
- Generator version: 7.22.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.10+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(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:
import easybill_generated_sync
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import easybill_generated_sync
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import easybill_generated_sync
from easybill_generated_sync.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_sync.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_sync.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_sync.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = easybill_generated_sync.AttachmentApi(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)
try:
# Fetch attachments list
api_response = await api_instance.attachments_get(limit=limit, page=page)
print("The response of AttachmentApi->attachments_get:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AttachmentApi->attachments_get: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.easybill.de/rest/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AttachmentApi | attachments_get | GET /attachments | Fetch attachments list |
| AttachmentApi | attachments_id_content_get | GET /attachments/{id}/content | Fetch attachment content |
| AttachmentApi | attachments_id_delete | DELETE /attachments/{id} | Delete attachment |
| AttachmentApi | attachments_id_get | GET /attachments/{id} | Fetch attachment |
| AttachmentApi | attachments_id_put | PUT /attachments/{id} | Update attachment |
| AttachmentApi | attachments_post | POST /attachments | Create attachment |
| ContactApi | customers_customer_id_contacts_get | GET /customers/{customerId}/contacts | Fetch customer contact list |
| ContactApi | customers_customer_id_contacts_id_delete | DELETE /customers/{customerId}/contacts/{id} | Delete contact |
| ContactApi | customers_customer_id_contacts_id_get | GET /customers/{customerId}/contacts/{id} | Fetch contact |
| ContactApi | customers_customer_id_contacts_id_put | PUT /customers/{customerId}/contacts/{id} | Update Contact |
| ContactApi | customers_customer_id_contacts_post | POST /customers/{customerId}/contacts | Create new contact |
| CustomerApi | customers_get | GET /customers | Fetch customers list |
| CustomerApi | customers_id_delete | DELETE /customers/{id} | Delete customer |
| CustomerApi | customers_id_get | GET /customers/{id} | Fetch customer |
| CustomerApi | customers_id_put | PUT /customers/{id} | Update Customer |
| CustomerApi | customers_post | POST /customers | Create customer |
| CustomerGroupApi | customer_groups_get | GET /customer-groups | Fetch customer group list |
| CustomerGroupApi | customer_groups_id_delete | DELETE /customer-groups/{id} | Delete customer group |
| CustomerGroupApi | customer_groups_id_get | GET /customer-groups/{id} | Fetch customer group |
| CustomerGroupApi | customer_groups_id_put | PUT /customer-groups/{id} | Update customer group |
| CustomerGroupApi | customer_groups_post | POST /customer-groups | Create customer group |
| DiscountApi | discounts_position_get | GET /discounts/position | Fetch list of position discounts |
| DiscountApi | discounts_position_group_get | GET /discounts/position-group | Fetch list of position-group discounts |
| DiscountApi | discounts_position_group_id_delete | DELETE /discounts/position-group/{id} | Delete the specified position-group discount |
| DiscountApi | discounts_position_group_id_get | GET /discounts/position-group/{id} | Fetch specified position-group discount by id |
| DiscountApi | discounts_position_group_id_put | PUT /discounts/position-group/{id} | Update a position-group discount |
| DiscountApi | discounts_position_group_post | POST /discounts/position-group | Create a new position-group discount |
| DiscountApi | discounts_position_id_delete | DELETE /discounts/position/{id} | Delete the specified position discount |
| DiscountApi | discounts_position_id_get | GET /discounts/position/{id} | Fetch specified position discount by id |
| DiscountApi | discounts_position_id_put | PUT /discounts/position/{id} | Update a position discount |
| DiscountApi | discounts_position_post | POST /discounts/position | Create a new position discount |
| DocumentApi | documents_get | GET /documents | Fetch documents list |
| DocumentApi | documents_id_cancel_post | POST /documents/{id}/cancel | Cancel document |
| DocumentApi | documents_id_delete | DELETE /documents/{id} | Delete document |
| DocumentApi | documents_id_done_put | PUT /documents/{id}/done | To complete a document. |
| DocumentApi | documents_id_download_get | GET /documents/{id}/download | Fetch the document in best fitting format to the given Accept header |
| DocumentApi | documents_id_get | GET /documents/{id} | Fetch document |
| DocumentApi | documents_id_jpg_get | GET /documents/{id}/jpg | Download a document as an jpeg-image |
| DocumentApi | documents_id_pdf_get | GET /documents/{id}/pdf | Fetch pdf document |
| DocumentApi | documents_id_put | PUT /documents/{id} | Update document |
| DocumentApi | documents_id_send_type_post | POST /documents/{id}/send/{type} | Send document |
| DocumentApi | documents_id_type_post | POST /documents/{id}/{type} | Convert an existing document to one of a different type |
| DocumentApi | documents_post | POST /documents | Create document |
| DocumentPaymentApi | document_payments_get | GET /document-payments | Fetch document payments list |
| DocumentPaymentApi | document_payments_id_delete | DELETE /document-payments/{id} | Delete document payment |
| DocumentPaymentApi | document_payments_id_get | GET /document-payments/{id} | Fetch document payment |
| DocumentPaymentApi | document_payments_post | POST /document-payments | Create document payment |
| DocumentVersionApi | documents_id_versions_get | GET /documents/{id}/versions | List all versions of a given document |
| DocumentVersionApi | documents_id_versions_version_id_get | GET /documents/{id}/versions/{versionId} | Show a single version of a given document |
| DocumentVersionApi | documents_id_versions_version_id_items_version_item_id_download_get | GET /documents/{id}/versions/{versionId}/items/{versionItemId}/download | Download a specific file for a single version of a given document |
| LoginsApi | logins_get | GET /logins | |
| LoginsApi | logins_id_get | GET /logins/{id} | |
| PdfTemplatesApi | pdf_templates_get | GET /pdf-templates | Fetch PDF Templates list |
| PositionApi | positions_get | GET /positions | Fetch positions list |
| PositionApi | positions_id_delete | DELETE /positions/{id} | Delete position |
| PositionApi | positions_id_get | GET /positions/{id} | Fetch position |
| PositionApi | positions_id_put | PUT /positions/{id} | Update position |
| PositionApi | positions_post | POST /positions | Create position |
| PositionGroupApi | position_groups_get | GET /position-groups | Fetch position group list |
| PositionGroupApi | position_groups_id_delete | DELETE /position-groups/{id} | Delete position group |
| PositionGroupApi | position_groups_id_get | GET /position-groups/{id} | Fetch position group |
| PositionGroupApi | position_groups_id_put | PUT /position-groups/{id} | Update position group |
| PositionGroupApi | position_groups_post | POST /position-groups | Create position group |
| PostBoxApi | post_boxes_get | GET /post-boxes | Fetch post box list |
| PostBoxApi | post_boxes_id_delete | DELETE /post-boxes/{id} | Delete post box |
| PostBoxApi | post_boxes_id_get | GET /post-boxes/{id} | Fetch post box |
| ProjectApi | projects_get | GET /projects | Fetch projects list |
| ProjectApi | projects_id_delete | DELETE /projects/{id} | Delete project |
| ProjectApi | projects_id_get | GET /projects/{id} | Fetch project |
| ProjectApi | projects_id_put | PUT /projects/{id} | Update project |
| ProjectApi | projects_post | POST /projects | Create project |
| SepaPaymentApi | sepa_payments_get | GET /sepa-payments | Fetch SEPA payments list |
| SepaPaymentApi | sepa_payments_id_delete | DELETE /sepa-payments/{id} | Delete SEPA payment |
| SepaPaymentApi | sepa_payments_id_get | GET /sepa-payments/{id} | Fetch SEPA payment |
| SepaPaymentApi | sepa_payments_id_put | PUT /sepa-payments/{id} | Update SEPA payment |
| SepaPaymentApi | sepa_payments_post | POST /sepa-payments | Create SEPA payment |
| SerialNumberApi | serial_numbers_get | GET /serial-numbers | Fetch a list of serial numbers for positions |
| SerialNumberApi | serial_numbers_id_delete | DELETE /serial-numbers/{id} | Delete a serial number for a position |
| SerialNumberApi | serial_numbers_id_get | GET /serial-numbers/{id} | Fetch a serial number for a position |
| SerialNumberApi | serial_numbers_post | POST /serial-numbers | Create s serial number for a position |
| StockApi | stocks_get | GET /stocks | Fetch a list of stock entries for positions |
| StockApi | stocks_id_get | GET /stocks/{id} | Fetch an stock entry for a position |
| StockApi | stocks_post | POST /stocks | Create a stock entry for a position |
| TaskApi | tasks_get | GET /tasks | Fetch tasks list |
| TaskApi | tasks_id_delete | DELETE /tasks/{id} | Delete task |
| TaskApi | tasks_id_get | GET /tasks/{id} | Fetch task |
| TaskApi | tasks_id_put | PUT /tasks/{id} | Update task |
| TaskApi | tasks_post | POST /tasks | Create task |
| TextTemplateApi | text_templates_get | GET /text-templates | Fetch text templates list |
| TextTemplateApi | text_templates_id_delete | DELETE /text-templates/{id} | Delete text template |
| TextTemplateApi | text_templates_id_get | GET /text-templates/{id} | Fetch text template |
| TextTemplateApi | text_templates_id_put | PUT /text-templates/{id} | Update text template |
| TextTemplateApi | text_templates_post | POST /text-templates | Create text template |
| TimeTrackingApi | time_trackings_get | GET /time-trackings | Fetch time trackings list |
| TimeTrackingApi | time_trackings_id_delete | DELETE /time-trackings/{id} | Delete time tracking |
| TimeTrackingApi | time_trackings_id_get | GET /time-trackings/{id} | Fetch time tracking |
| TimeTrackingApi | time_trackings_id_put | PUT /time-trackings/{id} | Update time tracking |
| TimeTrackingApi | time_trackings_post | POST /time-trackings | Create time tracking |
| WebhookApi | webhooks_get | GET /webhooks | Fetch WebHooks list |
| WebhookApi | webhooks_id_delete | DELETE /webhooks/{id} | Delete WebHook |
| WebhookApi | webhooks_id_get | GET /webhooks/{id} | Fetch WebHook |
| WebhookApi | webhooks_id_put | PUT /webhooks/{id} | Update WebHook |
| WebhookApi | webhooks_post | POST /webhooks | Create WebHook |
Documentation For Models
- AdvancedDataField
- Attachment
- Attachments
- Contact
- Contacts
- Customer
- CustomerGroup
- CustomerGroups
- CustomerSnapshot
- Customers
- Discount
- DiscountPosition
- DiscountPositionGroup
- DiscountPositionGroups
- DiscountPositions
- Document
- DocumentAddress
- DocumentPayment
- DocumentPayments
- DocumentPosition
- DocumentRecurring
- DocumentVersion
- DocumentVersionItem
- DocumentVersions
- Documents
- FileFormatConfig
- List
- Login
- LoginSecurity
- Logins
- PDFTemplate
- PDFTemplateSettings
- PDFTemplateSettingsEmail
- PDFTemplates
- Position
- PositionExportIdentifierExtended
- PositionGroup
- PositionGroups
- Positions
- PostBox
- PostBoxRequest
- PostBoxes
- Project
- Projects
- SEPAPayment
- SEPAPayments
- SerialNumber
- SerialNumbers
- ServiceDate
- Stock
- Stocks
- Task
- Tasks
- TextTemplate
- TextTemplates
- TimeTracking
- TimeTrackings
- WebHook
- WebHookLastResponse
- WebHooks
Documentation For Authorization
Authentication schemes defined for the API:
Bearer
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
basicAuth
- Type: HTTP basic authentication