- 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.
13 KiB
13 KiB
easybill_generated_sync.DocumentPaymentApi
All URIs are relative to https://api.easybill.de/rest/v1
| Method | HTTP request | Description |
|---|---|---|
| document_payments_get | GET /document-payments | Fetch document payments list |
| document_payments_id_delete | DELETE /document-payments/{id} | Delete document payment |
| document_payments_id_get | GET /document-payments/{id} | Fetch document payment |
| document_payments_post | POST /document-payments | Create document payment |
document_payments_get
DocumentPayments document_payments_get(limit=limit, page=page, document_id=document_id, payment_at=payment_at, reference=reference)
Fetch document payments list
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_sync
from easybill_generated_sync.models.document_payments import DocumentPayments
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.DocumentPaymentApi(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)
document_id = 'document_id_example' # str | Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. (optional)
payment_at = 'payment_at_example' # str | Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional)
reference = 'reference_example' # str | Filter payments by reference. You can add multiple references separate by comma like id,id,id. (optional)
try:
# Fetch document payments list
api_response = await api_instance.document_payments_get(limit=limit, page=page, document_id=document_id, payment_at=payment_at, reference=reference)
print("The response of DocumentPaymentApi->document_payments_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentPaymentApi->document_payments_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] |
| document_id | str | Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. | [optional] |
| payment_at | str | Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] |
| reference | str | Filter payments by reference. You can add multiple references separate by comma like id,id,id. | [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]
document_payments_id_delete
document_payments_id_delete(id)
Delete document payment
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
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.DocumentPaymentApi(api_client)
id = 56 # int | ID of document payment
try:
# Delete document payment
await api_instance.document_payments_id_delete(id)
except Exception as e:
print("Exception when calling DocumentPaymentApi->document_payments_id_delete: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document payment |
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 | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
document_payments_id_get
DocumentPayment document_payments_id_get(id)
Fetch document payment
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_sync
from easybill_generated_sync.models.document_payment import DocumentPayment
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.DocumentPaymentApi(api_client)
id = 56 # int | ID of document payment
try:
# Fetch document payment
api_response = await api_instance.document_payments_id_get(id)
print("The response of DocumentPaymentApi->document_payments_id_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentPaymentApi->document_payments_id_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | ID of document payment |
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]
document_payments_post
DocumentPayment document_payments_post(body, paid=paid)
Create document payment
Example
- Basic Authentication (basicAuth):
- Api Key Authentication (Bearer):
import easybill_generated_sync
from easybill_generated_sync.models.document_payment import DocumentPayment
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.DocumentPaymentApi(api_client)
body = easybill_generated_sync.DocumentPayment() # DocumentPayment |
paid = True # bool | Mark document as paid when amount less then payment amount. (optional)
try:
# Create document payment
api_response = await api_instance.document_payments_post(body, paid=paid)
print("The response of DocumentPaymentApi->document_payments_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DocumentPaymentApi->document_payments_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | DocumentPayment | ||
| paid | bool | Mark document as paid when amount less then payment amount. | [optional] |
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]