TaxesClient

class moloni.api.TaxesClient(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_modified_since(self, data: TaxesCountModifiedSinceModel | dict, **kwargs)
Parameters:

data (Union[TaxesCountModifiedSinceModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • lastmodified (str): lastmodified of the TaxesCountModifiedSinceModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[TaxesDeleteModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • tax_id (Union[str, int]): tax_id of the TaxesDeleteModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[TaxesGetAllModel, dict]) –

A model instance or dictionary containing the following fields:

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

Returns:

The response from the API.

Return type:

ApiResponse

get_modified_since(self, data: TaxesGetModifiedSinceModel | dict, **kwargs)
Parameters:

data (Union[TaxesGetModifiedSinceModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • lastmodified (str): lastmodified of the TaxesGetModifiedSinceModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[TaxesInsertModel, dict]) –

A model instance or dictionary containing the following fields:

  • active_by_default (str): active_by_default of the TaxesInsertModel.

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

  • exemption_reason (str): exemption_reason of the TaxesInsertModel.

  • fiscal_zone (str): fiscal_zone of the TaxesInsertModel.

  • name (str): name of the TaxesInsertModel.

  • saft_type (str): saft_type of the TaxesInsertModel.

  • stamp_tax (str): stamp_tax of the TaxesInsertModel.

  • type (str): type of the TaxesInsertModel.

  • value (str): value of the TaxesInsertModel.

  • vat_type (str): vat_type of the TaxesInsertModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[TaxesUpdateModel, dict]) –

A model instance or dictionary containing the following fields:

  • active_by_default (str): active_by_default of the TaxesUpdateModel.

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

  • exemption_reason (str): exemption_reason of the TaxesUpdateModel.

  • fiscal_zone (str): fiscal_zone of the TaxesUpdateModel.

  • name (str): name of the TaxesUpdateModel.

  • saft_type (str): saft_type of the TaxesUpdateModel.

  • stamp_tax (str): stamp_tax of the TaxesUpdateModel.

  • tax_id (Union[str, int]): tax_id of the TaxesUpdateModel.

  • type (str): type of the TaxesUpdateModel.

  • value (str): value of the TaxesUpdateModel.

  • vat_type (str): vat_type of the TaxesUpdateModel.

Returns:

The response from the API.

Return type:

ApiResponse

Models:

class moloni.api.TaxesCountModifiedSinceModel(*, company_id: str | int, lastmodified: 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
lastmodified: 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), 'lastmodified': 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.TaxesDeleteModel(*, company_id: str | int, tax_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
tax_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), 'tax_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.TaxesGetAllModel(*, company_id: str | int)

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

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.TaxesGetModifiedSinceModel(*, company_id: str | int, lastmodified: 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
lastmodified: 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), 'lastmodified': 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.TaxesInsertModel(*, company_id: str | int, active_by_default: str | None = None, exemption_reason: str | None = None, fiscal_zone: str | None = None, name: str | None = None, saft_type: str | None = None, stamp_tax: str | None = None, type: str | None = None, value: str | None = None, vat_type: 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
active_by_default: str | None
exemption_reason: str | None
fiscal_zone: str | None
name: str | None
saft_type: str | None
stamp_tax: str | None
type: str | None
value: str | None
vat_type: 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]] = {'active_by_default': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'exemption_reason': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'fiscal_zone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'saft_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'stamp_tax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'value': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'vat_type': 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.TaxesUpdateModel(*, company_id: str | int, active_by_default: str | None = None, exemption_reason: str | None = None, fiscal_zone: str | None = None, name: str | None = None, saft_type: str | None = None, stamp_tax: str | None = None, tax_id: str | int | None = None, type: str | None = None, value: str | None = None, vat_type: 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
active_by_default: str | None
exemption_reason: str | None
fiscal_zone: str | None
name: str | None
saft_type: str | None
stamp_tax: str | None
tax_id: str | int | None
type: str | None
value: str | None
vat_type: 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]] = {'active_by_default': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'exemption_reason': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'fiscal_zone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'saft_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'stamp_tax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'tax_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'value': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'vat_type': 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.