CustomersClient

class moloni.api.CustomersClient(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: CustomersCountModel | dict, **kwargs)
Parameters:

data (Union[CustomersCountModel, dict]) –

A model instance or dictionary containing the following fields:

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

Returns:

The response from the API.

Return type:

ApiResponse

count_by_name(self, data: CustomersCountByNameModel | dict, **kwargs)
Parameters:

data (Union[CustomersCountByNameModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • name (str): name of the CustomersCountByNameModel.

Returns:

The response from the API.

Return type:

ApiResponse

count_by_number(self, data: CustomersCountByNumberModel | dict, **kwargs)
Parameters:

data (Union[CustomersCountByNumberModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • number (str): number of the CustomersCountByNumberModel.

Returns:

The response from the API.

Return type:

ApiResponse

Parameters:

data (Union[CustomersCountBySearchModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • search (str): search of the CustomersCountBySearchModel.

Returns:

The response from the API.

Return type:

ApiResponse

count_by_vat(self, data: CustomersCountByVatModel | dict, **kwargs)
Parameters:

data (Union[CustomersCountByVatModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • vat (str): vat of the CustomersCountByVatModel.

Returns:

The response from the API.

Return type:

ApiResponse

count_modified_since(self, data: CustomersCountModifiedSinceModel | dict, **kwargs)
Parameters:

data (Union[CustomersCountModifiedSinceModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • lastmodified (str): lastmodified of the CustomersCountModifiedSinceModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[CustomersDeleteModel, dict]) –

A model instance or dictionary containing the following fields:

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

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

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[CustomersGetAllModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • offset (str): offset of the CustomersGetAllModel.

  • qty (str): qty of the CustomersGetAllModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_by_name(self, data: CustomersGetByNameModel | dict, **kwargs)
Parameters:

data (Union[CustomersGetByNameModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • name (str): name of the CustomersGetByNameModel.

  • offset (str): offset of the CustomersGetByNameModel.

  • qty (str): qty of the CustomersGetByNameModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_by_number(self, data: CustomersGetByNumberModel | dict, **kwargs)
Parameters:

data (Union[CustomersGetByNumberModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • number (str): number of the CustomersGetByNumberModel.

  • offset (str): offset of the CustomersGetByNumberModel.

  • qty (str): qty of the CustomersGetByNumberModel.

Returns:

The response from the API.

Return type:

ApiResponse

Parameters:

data (Union[CustomersGetBySearchModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • offset (str): offset of the CustomersGetBySearchModel.

  • qty (str): qty of the CustomersGetBySearchModel.

  • search (str): search of the CustomersGetBySearchModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_by_vat(self, data: CustomersGetByVatModel | dict, **kwargs)
Parameters:

data (Union[CustomersGetByVatModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • offset (str): offset of the CustomersGetByVatModel.

  • qty (str): qty of the CustomersGetByVatModel.

  • vat (str): vat of the CustomersGetByVatModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_last_number(self, data: CustomersGetLastNumberModel | dict, **kwargs)
Parameters:

data (Union[CustomersGetLastNumberModel, dict]) –

A model instance or dictionary containing the following fields:

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

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[CustomersGetModifiedSinceModel, dict]) –

A model instance or dictionary containing the following fields:

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

  • lastmodified (str): lastmodified of the CustomersGetModifiedSinceModel.

  • offset (str): offset of the CustomersGetModifiedSinceModel.

  • qty (str): qty of the CustomersGetModifiedSinceModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[CustomersGetOneModel, dict]) –

A model instance or dictionary containing the following fields:

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

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

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[CustomersInsertModel, dict]) –

A model instance or dictionary containing the following fields:

  • address (str): address of the CustomersInsertModel.

  • city (str): city of the CustomersInsertModel.

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

  • contact_email (str): contact_email of the CustomersInsertModel.

  • contact_name (str): contact_name of the CustomersInsertModel.

  • contact_phone (str): contact_phone of the CustomersInsertModel.

  • country_id (Union[str, int]): country_id of the CustomersInsertModel.

  • credit_limit (str): credit_limit of the CustomersInsertModel.

  • delivery_method_id (Union[str, int]): delivery_method_id of the CustomersInsertModel.

  • discount (str): discount of the CustomersInsertModel.

  • email (str): email of the CustomersInsertModel.

  • fax (str): fax of the CustomersInsertModel.

  • field_notes (str): field_notes of the CustomersInsertModel.

  • language_id (Union[str, int]): language_id of the CustomersInsertModel.

  • maturity_date_id (Union[str, int]): maturity_date_id of the CustomersInsertModel.

  • name (str): name of the CustomersInsertModel.

  • notes (str): notes of the CustomersInsertModel.

  • number (str): number of the CustomersInsertModel.

  • payment_day (str): payment_day of the CustomersInsertModel.

  • payment_method_id (Union[str, int]): payment_method_id of the CustomersInsertModel.

  • phone (str): phone of the CustomersInsertModel.

  • qty_copies_document (str): qty_copies_document of the CustomersInsertModel.

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

  • vat (str): vat of the CustomersInsertModel.

  • website (str): website of the CustomersInsertModel.

  • zip_code (str): zip_code of the CustomersInsertModel.

Returns:

The response from the API.

Return type:

ApiResponse

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

data (Union[CustomersUpdateModel, dict]) –

A model instance or dictionary containing the following fields:

  • address (str): address of the CustomersUpdateModel.

  • city (str): city of the CustomersUpdateModel.

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

  • contact_email (str): contact_email of the CustomersUpdateModel.

  • contact_name (str): contact_name of the CustomersUpdateModel.

  • contact_phone (str): contact_phone of the CustomersUpdateModel.

  • country_id (Union[str, int]): country_id of the CustomersUpdateModel.

  • credit_limit (str): credit_limit of the CustomersUpdateModel.

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

  • delivery_method_id (Union[str, int]): delivery_method_id of the CustomersUpdateModel.

  • discount (str): discount of the CustomersUpdateModel.

  • email (str): email of the CustomersUpdateModel.

  • fax (str): fax of the CustomersUpdateModel.

  • field_notes (str): field_notes of the CustomersUpdateModel.

  • language_id (Union[str, int]): language_id of the CustomersUpdateModel.

  • maturity_date_id (Union[str, int]): maturity_date_id of the CustomersUpdateModel.

  • name (str): name of the CustomersUpdateModel.

  • notes (str): notes of the CustomersUpdateModel.

  • number (str): number of the CustomersUpdateModel.

  • payment_day (str): payment_day of the CustomersUpdateModel.

  • payment_method_id (Union[str, int]): payment_method_id of the CustomersUpdateModel.

  • phone (str): phone of the CustomersUpdateModel.

  • qty_copies_document (str): qty_copies_document of the CustomersUpdateModel.

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

  • vat (str): vat of the CustomersUpdateModel.

  • website (str): website of the CustomersUpdateModel.

  • zip_code (str): zip_code of the CustomersUpdateModel.

Returns:

The response from the API.

Return type:

ApiResponse

Models:

class moloni.api.CustomersCountModel(*, 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.CustomersCountByNameModel(*, company_id: str | int, name: 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
name: 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), 'name': 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.CustomersCountByNumberModel(*, company_id: str | int, number: 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
number: 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), 'number': 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.CustomersCountBySearchModel(*, company_id: str | int, search: 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
search: 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), 'search': 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.CustomersCountByVatModel(*, company_id: str | int, vat: 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
vat: 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), 'vat': 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.CustomersCountModifiedSinceModel(*, 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.CustomersDeleteModel(*, company_id: str | int, customer_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
customer_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), 'customer_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.CustomersGetAllModel(*, company_id: str | int, offset: str | int | None = 0, qty: str | int | None = 25)

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
offset: str | int | None
qty: 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), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25)}

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.CustomersGetByNameModel(*, company_id: str | int, name: str | None = None, offset: str | int | None = 0, qty: str | int | None = 25)

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
name: str | None
offset: str | int | None
qty: 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), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25)}

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.CustomersGetByNumberModel(*, company_id: str | int, number: str | None = None, offset: str | int | None = 0, qty: str | int | None = 25)

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
number: str | None
offset: str | int | None
qty: 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), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25)}

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.CustomersGetBySearchModel(*, company_id: str | int, offset: str | int | None = 0, qty: str | int | None = 25, search: 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
offset: str | int | None
qty: str | int | None
search: 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), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25), 'search': 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.CustomersGetByVatModel(*, company_id: str | int, offset: str | int | None = 0, qty: str | int | None = 25, vat: 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
offset: str | int | None
qty: str | int | None
vat: 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), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25), 'vat': 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.CustomersGetLastNumberModel(*, 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.CustomersGetModifiedSinceModel(*, company_id: str | int, lastmodified: str | None = None, offset: str | int | None = 0, qty: str | int | None = 25)

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
offset: str | int | None
qty: 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), 'lastmodified': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'offset': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=0), 'qty': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=25)}

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.CustomersGetOneModel(*, company_id: str | int, customer_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
customer_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), 'customer_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.CustomersInsertModel(*, company_id: str | int, address: str | None = None, city: str | None = None, contact_email: str | None = None, contact_name: str | None = None, contact_phone: str | None = None, country_id: str | int | None = None, credit_limit: str | None = None, delivery_method_id: str | int | None = None, discount: str | None = None, email: str | None = None, fax: str | None = None, field_notes: str | None = None, language_id: str | int | None = None, maturity_date_id: str | int | None = None, name: str | None = None, notes: str | None = None, number: str | None = None, payment_day: str | None = None, payment_method_id: str | int | None = None, phone: str | None = None, qty_copies_document: str | None = None, salesman_id: str | int | None = None, vat: str | None = None, website: str | None = None, zip_code: 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
address: str | None
city: str | None
contact_email: str | None
contact_name: str | None
contact_phone: str | None
country_id: str | int | None
credit_limit: str | None
delivery_method_id: str | int | None
discount: str | None
email: str | None
fax: str | None
field_notes: str | None
language_id: str | int | None
maturity_date_id: str | int | None
name: str | None
notes: str | None
number: str | None
payment_day: str | None
payment_method_id: str | int | None
phone: str | None
qty_copies_document: str | None
salesman_id: str | int | None
vat: str | None
website: str | None
zip_code: 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]] = {'address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'city': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'contact_email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'contact_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'contact_phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'country_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'credit_limit': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'delivery_method_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'discount': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'fax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'field_notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'language_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'maturity_date_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'payment_day': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'payment_method_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'qty_copies_document': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'vat': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'website': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'zip_code': 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.CustomersUpdateModel(*, company_id: str | int, address: str | None = None, city: str | None = None, contact_email: str | None = None, contact_name: str | None = None, contact_phone: str | None = None, country_id: str | int | None = None, credit_limit: str | None = None, customer_id: str | int | None = None, delivery_method_id: str | int | None = None, discount: str | None = None, email: str | None = None, fax: str | None = None, field_notes: str | None = None, language_id: str | int | None = None, maturity_date_id: str | int | None = None, name: str | None = None, notes: str | None = None, number: str | None = None, payment_day: str | None = None, payment_method_id: str | int | None = None, phone: str | None = None, qty_copies_document: str | None = None, salesman_id: str | int | None = None, vat: str | None = None, website: str | None = None, zip_code: 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
address: str | None
city: str | None
contact_email: str | None
contact_name: str | None
contact_phone: str | None
country_id: str | int | None
credit_limit: str | None
customer_id: str | int | None
delivery_method_id: str | int | None
discount: str | None
email: str | None
fax: str | None
field_notes: str | None
language_id: str | int | None
maturity_date_id: str | int | None
name: str | None
notes: str | None
number: str | None
payment_day: str | None
payment_method_id: str | int | None
phone: str | None
qty_copies_document: str | None
salesman_id: str | int | None
vat: str | None
website: str | None
zip_code: 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]] = {'address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'city': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'contact_email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'contact_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'contact_phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'country_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'credit_limit': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'customer_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'delivery_method_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'discount': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'fax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'field_notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'language_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'maturity_date_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'payment_day': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'payment_method_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'qty_copies_document': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'vat': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'website': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'zip_code': 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.