DebitnotesClient

class moloni.api.DebitnotesClient(environment: MoloniBaseUrl = MoloniBaseUrl.PROD, *, auth_config: AuthConfig = AuthConfig(client_id=None, client_secret=None, refresh_token=None, username=None, password=None), version: str = 'v1', validate: bool = True, log_level: str = 'INFO')
count(self, data: DebitnotesCountModel | dict, **kwargs)
Parameters:

data (Union[DebitnotesCountModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the DebitnotesCountModel.

  • customer_id (Union[str, int]): customer_id of the DebitnotesCountModel.

  • date (str): date of the DebitnotesCountModel.

  • document_set_id (Union[str, int]): document_set_id of the DebitnotesCountModel.

  • expiration_date (str): expiration_date of the DebitnotesCountModel.

  • number (str): number of the DebitnotesCountModel.

  • our_reference (str): our_reference of the DebitnotesCountModel.

  • salesman_id (Union[str, int]): salesman_id of the DebitnotesCountModel.

  • supplier_id (Union[str, int]): supplier_id of the DebitnotesCountModel.

  • year (str): year of the DebitnotesCountModel.

  • your_reference (str): your_reference of the DebitnotesCountModel.

Returns:

The response from the API.

Return type:

ApiResponse

delete(self, data: DebitnotesDeleteModel | dict, **kwargs)
Parameters:

data (Union[DebitnotesDeleteModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the DebitnotesDeleteModel.

  • document_id (Union[str, int]): document_id of the DebitnotesDeleteModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_all(self, data: DebitnotesGetAllModel | dict, **kwargs)
Parameters:

data (Union[DebitnotesGetAllModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the DebitnotesGetAllModel.

  • customer_id (Union[str, int]): customer_id of the DebitnotesGetAllModel.

  • date (str): date of the DebitnotesGetAllModel.

  • document_set_id (Union[str, int]): document_set_id of the DebitnotesGetAllModel.

  • expiration_date (str): expiration_date of the DebitnotesGetAllModel.

  • number (str): number of the DebitnotesGetAllModel.

  • offset (str): offset of the DebitnotesGetAllModel.

  • our_reference (str): our_reference of the DebitnotesGetAllModel.

  • qty (str): qty of the DebitnotesGetAllModel.

  • salesman_id (Union[str, int]): salesman_id of the DebitnotesGetAllModel.

  • supplier_id (Union[str, int]): supplier_id of the DebitnotesGetAllModel.

  • year (str): year of the DebitnotesGetAllModel.

  • your_reference (str): your_reference of the DebitnotesGetAllModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_one(self, data: DebitnotesGetOneModel | dict, **kwargs)
Parameters:

data (Union[DebitnotesGetOneModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the DebitnotesGetOneModel.

  • customer_id (Union[str, int]): customer_id of the DebitnotesGetOneModel.

  • date (str): date of the DebitnotesGetOneModel.

  • document_id (Union[str, int]): document_id of the DebitnotesGetOneModel.

  • document_set_id (Union[str, int]): document_set_id of the DebitnotesGetOneModel.

  • expiration_date (str): expiration_date of the DebitnotesGetOneModel.

  • number (str): number of the DebitnotesGetOneModel.

  • our_reference (str): our_reference of the DebitnotesGetOneModel.

  • salesman_id (Union[str, int]): salesman_id of the DebitnotesGetOneModel.

  • supplier_id (Union[str, int]): supplier_id of the DebitnotesGetOneModel.

  • year (str): year of the DebitnotesGetOneModel.

  • your_reference (str): your_reference of the DebitnotesGetOneModel.

Returns:

The response from the API.

Return type:

ApiResponse

insert(self, data: DebitnotesInsertModel | dict, **kwargs)
Parameters:

data (Union[DebitnotesInsertModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the DebitnotesInsertModel.

  • customer_id (Union[str, int]): customer_id of the DebitnotesInsertModel.

  • date (str): date of the DebitnotesInsertModel.

  • document_set_id (Union[str, int]): document_set_id of the DebitnotesInsertModel.

  • expiration_date (str): expiration_date of the DebitnotesInsertModel.

  • notes (str): notes of the DebitnotesInsertModel.

  • products (str): products of the DebitnotesInsertModel.

  • salesman_commission (str): salesman_commission of the DebitnotesInsertModel.

  • salesman_id (Union[str, int]): salesman_id of the DebitnotesInsertModel.

  • status (str): status of the DebitnotesInsertModel.

  • your_reference (str): your_reference of the DebitnotesInsertModel.

Returns:

The response from the API.

Return type:

ApiResponse

update(self, data: DebitnotesUpdateModel | dict, **kwargs)
Parameters:

data (Union[DebitnotesUpdateModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the DebitnotesUpdateModel.

  • customer_id (Union[str, int]): customer_id of the DebitnotesUpdateModel.

  • date (str): date of the DebitnotesUpdateModel.

  • document_id (Union[str, int]): document_id of the DebitnotesUpdateModel.

  • document_set_id (Union[str, int]): document_set_id of the DebitnotesUpdateModel.

  • expiration_date (str): expiration_date of the DebitnotesUpdateModel.

  • notes (str): notes of the DebitnotesUpdateModel.

  • products (str): products of the DebitnotesUpdateModel.

  • salesman_commission (str): salesman_commission of the DebitnotesUpdateModel.

  • salesman_id (Union[str, int]): salesman_id of the DebitnotesUpdateModel.

  • status (str): status of the DebitnotesUpdateModel.

  • your_reference (str): your_reference of the DebitnotesUpdateModel.

Returns:

The response from the API.

Return type:

ApiResponse

Models:

class moloni.api.DebitnotesCountModel(*, company_id: str | int, customer_id: str | int | None = None, date: str | None = None, document_set_id: str | int | None = None, expiration_date: str | None = None, number: str | None = None, our_reference: str | None = None, salesman_id: str | int | None = None, supplier_id: str | int | None = None, year: str | None = None, your_reference: str | None = None)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

company_id: str | int
customer_id: str | int | None
date: str | None
document_set_id: str | int | None
expiration_date: str | None
number: str | None
our_reference: str | None
salesman_id: str | int | None
supplier_id: str | int | None
year: str | None
your_reference: str | None
request(self) ApiResponse

Make an API request using the initialized client.

This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.

Returns:

The response from the API.

Raises:

ValueError – If the client is not initialized via the connect method.

Example

# Assuming you have a model instance request_model and an API client api_client

..code-block:: python

with request_model.connect(auth_config=auth_config) as api:

response = api.request()

# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'customer_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'document_set_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'expiration_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'our_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'supplier_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'year': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'your_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class moloni.api.DebitnotesDeleteModel(*, company_id: str | int, document_id: str | int | None = None)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

company_id: str | int
document_id: str | int | None
request(self) ApiResponse

Make an API request using the initialized client.

This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.

Returns:

The response from the API.

Raises:

ValueError – If the client is not initialized via the connect method.

Example

# Assuming you have a model instance request_model and an API client api_client

..code-block:: python

with request_model.connect(auth_config=auth_config) as api:

response = api.request()

# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'document_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class moloni.api.DebitnotesGetAllModel(*, company_id: str | int, customer_id: str | int | None = None, date: str | None = None, document_set_id: str | int | None = None, expiration_date: str | None = None, number: str | None = None, offset: str | int | None = 0, our_reference: str | None = None, qty: str | int | None = 25, salesman_id: str | int | None = None, supplier_id: str | int | None = None, year: str | None = None, your_reference: str | None = None)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

company_id: str | int
customer_id: str | int | None
date: str | None
document_set_id: str | int | None
expiration_date: str | None
number: str | None
offset: str | int | None
our_reference: str | None
qty: str | int | None
salesman_id: str | int | None
supplier_id: str | int | None
year: str | None
your_reference: str | None
request(self) ApiResponse

Make an API request using the initialized client.

This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.

Returns:

The response from the API.

Raises:

ValueError – If the client is not initialized via the connect method.

Example

# Assuming you have a model instance request_model and an API client api_client

..code-block:: python

with request_model.connect(auth_config=auth_config) as api:

response = api.request()

# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'customer_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'document_set_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'expiration_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'our_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'supplier_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'year': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'your_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class moloni.api.DebitnotesGetOneModel(*, company_id: str | int, customer_id: str | int | None = None, date: str | None = None, document_id: str | int | None = None, document_set_id: str | int | None = None, expiration_date: str | None = None, number: str | None = None, our_reference: str | None = None, salesman_id: str | int | None = None, supplier_id: str | int | None = None, year: str | None = None, your_reference: str | None = None)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

company_id: str | int
customer_id: str | int | None
date: str | None
document_id: str | int | None
document_set_id: str | int | None
expiration_date: str | None
number: str | None
our_reference: str | None
salesman_id: str | int | None
supplier_id: str | int | None
year: str | None
your_reference: str | None
request(self) ApiResponse

Make an API request using the initialized client.

This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.

Returns:

The response from the API.

Raises:

ValueError – If the client is not initialized via the connect method.

Example

# Assuming you have a model instance request_model and an API client api_client

..code-block:: python

with request_model.connect(auth_config=auth_config) as api:

response = api.request()

# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'customer_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'document_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'document_set_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'expiration_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'our_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'supplier_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'year': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'your_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class moloni.api.DebitnotesInsertModel(*, company_id: str | int, customer_id: str | int | None = None, date: str | None = None, document_set_id: str | int | None = None, expiration_date: str | None = None, notes: str | None = None, products: List[Products] | None = None, salesman_commission: str | None = None, salesman_id: str | int | None = None, status: str | None = None, your_reference: str | None = None)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

company_id: str | int
customer_id: str | int | None
date: str | None
document_set_id: str | int | None
expiration_date: str | None
notes: str | None
products: List[Products] | None
salesman_commission: str | None
salesman_id: str | int | None
status: str | None
your_reference: str | None
request(self) ApiResponse

Make an API request using the initialized client.

This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.

Returns:

The response from the API.

Raises:

ValueError – If the client is not initialized via the connect method.

Example

# Assuming you have a model instance request_model and an API client api_client

..code-block:: python

with request_model.connect(auth_config=auth_config) as api:

response = api.request()

# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'customer_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'document_set_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'expiration_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'products': FieldInfo(annotation=Union[List[Products], NoneType], required=False, default=None), 'salesman_commission': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'status': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'your_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

class moloni.api.DebitnotesUpdateModel(*, company_id: str | int, customer_id: str | int | None = None, date: str | None = None, document_id: str | int | None = None, document_set_id: str | int | None = None, expiration_date: str | None = None, notes: str | None = None, products: List[Products] | None = None, salesman_commission: str | None = None, salesman_id: str | int | None = None, status: str | None = None, your_reference: str | None = None)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

company_id: str | int
customer_id: str | int | None
date: str | None
document_id: str | int | None
document_set_id: str | int | None
expiration_date: str | None
notes: str | None
products: List[Products] | None
salesman_commission: str | None
salesman_id: str | int | None
status: str | None
your_reference: str | None
request(self) ApiResponse

Make an API request using the initialized client.

This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.

Returns:

The response from the API.

Raises:

ValueError – If the client is not initialized via the connect method.

Example

# Assuming you have a model instance request_model and an API client api_client

..code-block:: python

with request_model.connect(auth_config=auth_config) as api:

response = api.request()

# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'customer_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'document_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'document_set_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'expiration_date': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'products': FieldInfo(annotation=Union[List[Products], NoneType], required=False, default=None), 'salesman_commission': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'status': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'your_reference': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.