Models¶
Here is the different models you can interact with through the Visma eAccounting API documented.
API Models¶
Account¶
-
class
visma.models.Account(*args, **kwargs)[source]¶ Represents a Bookkeeping Account in eAccounting
- endpoint
- /accounts
- allowed_methods
- [‘list’, ‘create’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Todo
There is more special cases endpoint for this objects that is not handled yet by the framework.
Parameters: - name (str) – The name of the account
Max length: 100 characters - number (str) –
requiredThe account number - vat_code_id (uuid.UUID) – = Reference to the
VatCodethat is associated with the account - vat_code_description (str) –
read-onlyDescribes theVatCodethat is associated with the account - fiscal_year_id (uuid.UUID) –
requiredReference to theFiscalYearthat the account belongs to. - reference_code (str) –
read-onlyThe reference code on the account.Dutch companies only - type (int) –
read-onlyThe account type number.Dutch companies only - type_description (str) –
read-onlyThe account type descripion.Dutch companies only - modified_utc (datetime.datetime) –
read_onlyModifed date. - is_active (bool) –
requiredIndicates if the account is active.default=False - is_project_allowed (bool) – Indicates if the account can be used for
project bookkeeping.
default=False - is_cost_center_allowed (bool) – Indicates if the account can be used
for cost center bookkeeping.
default=False - is_blocked_for_manual_booking (bool) – Indicates if the account can be used for manual verification registering.
AccountType¶
Article¶
-
class
visma.models.Article(*args, **kwargs)[source]¶ Represents an Article in eAccounting.
- endpoint
- /articles
- allowed_methods
- [‘list’, ‘get’, ‘create’, ‘update’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting. - is_active (bool) –
requiredIndicates if the article is active.default=True - number (str) –
requiredArticle numberMax length: 40 characters - name (str) –
requiredArticle nameMax length: 50 characters - name_english (str) – Article name in english
Max length: 50 characters - net_price (number) – Net price of article
Max Value: 10000000, Format: Max 2 decimals, default=0 - gross_price (number) – Gross price of article
Max Value: 10000000, Format: Max 2 decimals, default=0 - coding_id (uuid.UUID) –
requiredReference toArticleAccountCodingused for the article. - coding_name (str) –
read-onlyArticle account coding name. - unit_id (uuid.UUID) –
requiredReference toUnitused for the article. - unit_name (str) –
read-onlyName of unit specified in unit_id. - unit_abbreviation (str) –
read-onlyUnit abbreviation of unit specified in unit_id. - stock_balance (number) – Stock balance for the article.
default=0 - stock_balance_manually_changed_utc (datetime.datetime) –
read-onlySet when the stock balance is changed manually, for example after an inventory check. - stock_balance_reserved (number) –
read-onlyThe reserved stock balance for the article. - stock_balance_available (number) –
read-onlyThe available stock balance for the article. - changed_utc (datetime.datetime) – Date and time from when the last changes was made on the article
- house_work_type (int) – House Work Type
- purchase_price (number) – Purchase price
default=0 - purchase_price_manually_changed_utc (datetime.datetime) –
read-onlySet when the purchase price is changed manually - send_to_webshop (bool) – If True , will send article to VismaWebShop
(If company has the integration).
default=True - article_labels (list(ArticleLabel)) – A list of
ArticleLabel
Todo
work_house_type is not documented. Need to contact Visma API Team.
ArticleAccountCoding¶
-
class
visma.models.ArticleAccountCoding(*args, **kwargs)[source]¶ Represents article account coding
- endpoint
- /articleaccountcodings
- allowed_methods
- [‘list’, ‘get’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - name (string) – Name
- name_english (string) – English Name
- type (string) – Type
- vat_rate (string) – VAT rate
- is_active (bool) – Indicates if the Article account coding is active.
- vat_rate_percent (number) – VAT rate in percentage.
- domestic_sales_subject_to_reversed_construction_vat_account_number (int) – Account number for domestic sales subject to reversed construction VAT
- domestic_sales_subject_to_vat_account_number (int) – Account number for domestic sales subject to VAT.
- domestic_sales_vat_exempt_account_number (int) – Account number for domestic sales that are exempt from VAT.
- foreign_sales_subject_to_moss_account_number (int) – Account number for foreign sales subject to MOSS.
- foreign_sales_subject_to_third_party_sales_account_number (int) – Account number for foreign sales subject to third parrt sales rules.
- foreign_sales_subject_to_vat_within_eu_account_number (int) – Account number for foreign sales subject to VAT within EU.
- foreign_sales_vat_exempt_outside_eu_account_number (int) – Account number for foreign sales that are exempt VAT outside of EU.
- foreign_sales_vat_exempt_within_eu_account_number (int) – Account number for foreign sales that are exempt VAT within EU.
- domestic_sales_vat_code_exempt_account_number (int) – Account number for domestic sales exempt a VAT Code.
- changed_utc (datetime.datetime) –
read-onlyLast Changed Time
Todo
It is not yet supported to filter on date for the account.
ArticleLabel¶
Bank¶
BankAccount¶
-
class
visma.models.BankAccount(*args, **kwargs)[source]¶ Represents a bank account in eAccounting.
- endpoint
- /bankaccounts
- allowed_methods
- [‘list’, ‘create’, ‘get’, ‘update’, ‘delete’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - bank (uuid.UUID) – Reference to a
Bank. Not required for bank accounts of cash or tax account type - bank_account_type (int) –
required1 = ChequeAccount, 2 = CashAccount, 3 = SavingsAccount, 4 = CurrencyAccount, 5 = DigitalWalletAccount, 6 = CashCreditAccount, 7 = TaxAccount - bank_account_type_description (str) –
read-onlyDescription of the Bank Account type - bban (str) – Bank Account number. Not required for bank accounts of cash or tax account type
- iban (str) – IBAN number
- name (str) – Name of Bank account.
- is_active (bool) – Indicates if the account is active.
default=False - ledger_account_number (int) –
requiredAccount number to do bookkeeping on for the bank account. - has_active_bank_agreement (bool) – Indicates if the bank account has
an active bank agreement.
default=False - is_default_cheque_account (bool) – Indicates if the account is the
default cheque account. Only used when having several cheque accounts.
default=False
CompanySettings¶
-
class
visma.models.CompanySettings(*args, **kwargs)[source]¶ The company settings for current user
- endpoint
- /companysettings
- allowed_methods
- [‘list’, ‘update’]
Note
As of now there is no special way to handle an endpoint that only contains a singel object accesses without an id. So even if it is a single object you will need to use the following to get the data.
>>> company_settings = CompanySettings.objects.all().first()
Parameters: - id (uuid.UUID) – Is set to empty string. This is to allow for updates on the model.
- name (str) –
requiredCompany name. - email (str) – Company email.
- phone (str) – Company phone.
- mobile_phone (str) – Company mobile phone.
- address1 (str) – Company address, Row 1
- address2 (str) – Company address, Row 2
- country_code (str) – Country code.
- postal_code (str) – Company postal code.
- city (str) – Company city.
- website (str) – Company website.
- currency_code (str) – Standard Currency code.
- terms_of_payment_id (uuid.UUID) – Reference to standard
TermsOfPaymentfor company. - corporate_identity_number (str) –
read-onlyCorporate Identity Number - vat_code (str) – VAT identification number
- bank_giro (str) – Bankgiro number. Only used in Sweden.
- plus_giro (str) – Plusgiro number. Only used in Sweden.
- bank_account (str) – Bank account number.
- iban (str) – IBAN number.
- accounting_locked_to (datetime.datetime) – Datetime where the accounting is locked to.
- gln (str) – Global Location Number.
- product_variant (int) –
read-onlyVariant of eAccounting. 1 = Standard/Smart, 2 = Invoicing, 3 = Bookkeeping, 4 = Start/Solo, 5 = Pro, 6 = InvoicingCollaboration - type_of_business (int) –
read-onlyIndicates the companys business type. 1 = Corporation, 2 = SoleProprietorship, 3 = EconomicAssociation, 4 = NonProfitOrganization, 5 = GeneralPartnership, 6 = LimitedPartnership, 7 = Cooperatives, 9 = PublicLimited - vat_period (int) –
read-onlyPeriod when VAT report should be sent. 1 = OnceAMonth12th, 2 = OnceAMonth26th, 3 = OnceAQuarter, 4 = OnceAYear, 5 = Never, 6 = Bimonthly, 7 = OnceAMonth, 8 = TwiceAYear, 9 = OnceAQuarterFloating - activated_modules (list(str)) – List of activated modules.
- company_text (CompanyText) – A
CompanyText: object. - next_customer_number (int) –
read-onlyNext customer number in sequence. - next_supplier_number (int) –
read-onlyNext supplier number in sequence. - next_customer_invoice_number (int) –
read-onlyNext customer invoice number in sequence. - next_quote_number (int) –
read-onlyNext quote number in sequence. - show_prices_excl_vat_pc (bool) – Indicates if prices should be shown excluding VAT for private individuals/customers.
CostCenter¶
-
class
visma.models.CostCenter(*args, **kwargs)[source]¶ Represents a cost center. A cost center is a way of splitting up costs and earnings between different parts of the company so it is possible to follow up better.
- endpoint
- /costcenters
- allowed_methods
- [‘list’, ‘update’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting. - name (str) – Cost center name.
- number (int) – Cost center number.
- is_active (bool) – Indicates if the cost center is active.
default=False - items (list(CostCenterItem)) – List of
CostCenterItembelonging to the cost center.
CostCenterItem¶
-
class
visma.models.CostCenterItem(*args, **kwargs)[source]¶ The actual cost center item in a cost center where the expence gets booked.
- endpoint
- /costcenteritems
- allowed_methods
- ‘create’, ‘get’, ‘update’]
:argument uuid.UUID id =
read-onlyUnique Id provided by eAccounting. :argument uuid.UUID cost_center_id:requiredReference toCostCenterholding the cost center item. :argument str name: Name of cost center item.Max length: 50 characters:argument str short_name: Short name of cost center item.Max length: 9 characters:argument bool is_active: Indicates if the cost center item is active.
Country¶
Currency¶
Customer¶
-
class
visma.models.Customer(*args, **kwargs)[source]¶ Models the customer object in Visma e-Accounting.
- endpoint
- /customers
- allowed_methods
- [‘list’, ‘get’, ‘create’, ‘update’, ‘dlete’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
- scopes
- ea:sales,
- ea.local:mobile_user
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - customer_number (str) – Unique identifier for customer. If none is provided Visma eAccounting API will generate one on creation. Max length: 20 characters.
- corporate_identity_number (str) – Legal identifier of the customer. If the customer is a private person this field should be their social number. Max lenght = 20 characters.
- contact_person_email (str) – Email for the contact person at the customer. Max lenght = 255 characters
- contact_person_mobile (str) – Customer contact person’s mobile number
- contact_person_name (str) – Customer contact person’s name
- contact_person_phone (str) – Customer contact person’s phone number
- currency_code (str) – The code of the currency used when dealing with
this customer. Example SEK or EUR
default = Currency code in company settings - gln (str) –
ObsoleteUseedi_gln_numberinstead. - email_address (str) – Customer email address. Used for sending invoices.
- invoice_address1 (str) –
Max length: 50 characters - invoice_address2 (str) –
Max length: 50 characters - invoice_postal_code (str) –
Max length: 10 characters - invoice_city (str) –
Max length: 50 characters - invoice_country_code (str) –
Max length: 2 characters - delivery_customer_name (str) – Use if name on deliver differs from
customer name.
Max length: 100 characters - delivery_address1 (str) – Use if delivery address differs from
customer invoice address.
Max length: 50 characters - delivery_address2 (str) – Use if delivery address differs from
customer invoice address.
Max length: 50 characters - delivery_city (str) – Use if delivery address differs from customer
invoice address.
Max length: 50 characters - delivery_country_code (str) – Use if delivery address differs from
customer invoice address.
Max length: 2 characters - delivery_postal_code (str) – Use if delivery address differs from
customer invoice address.
Max length: 10 characters - delivery_method_id (uuid.UUID) – Reference to the
DeliveryMethodused. - delivery_term_id (uuid.UUID) – Referenct to the
DeliveryTermused. - pay_to_account_id (uuid.UUID) –
read-onlyReferece toAccountwhere payments are registered. - name (str) – Customer name.
Max length: 50 characters - note (str) – Note on customer. Free text.
Max length: 4000 characters - reverse_charge_on_construction_services (bool) –
default=False. If True, VatNumber must be set as well. - webshop_customer_number (int) – Reference to customer i webshop.
- mobile_phone (str) – Customer mobile phone number.
Max length: 50 characters - telephone (str) – Customer mobile phone number.
Max length: 50 characters - terms_of_payment_id (uuid.UUID) –
RequiredReference to theTermsOfPaymentused. - terms_of_payment (TermsOfPayment) –
read-onlyTheTermsOfPaymentused. - vat_number (str) – Customers VAT Number. Format: 2 character country
code followed by 8-12 numbers.
Max length: 20 characters - www_address (str) – Customers website.
Max length: 255 characters - last_invoice_date (datetime.datetime) –
read-onlyLast invoice date. - is_private_person (bool) –
requireddefault=False - discount_percentage – Customer wide discount specified like 0.9 for 10% discount. Only allows 4 decimals.
- changed_utc (datetime.datetime) –
read-onlyLast date and time from when a change was made on the customer - is_active (bool) –
requireddefault=True - force_bookkeep_vat (bool) –
default=TrueNot entrirely sure what setting this to false will do.Usage Unknown - sales_document_language – Language code for sales documents.
Max length: 2 characters - edi_gln_number (str) – What is this used for??
Unknown Use - electronic_address (str) –
Unknown UseProbarbly have something to do with sending and recieveing electronic invoices. - electronic_reference (str) –
Unknown UseProbarbly have something to do with sending and recieveing electronic invoices. - edi_service_deliverer_id (str) –
Unknown UseProbarbly have something to do with sending and recieveing electronic invoices. - auto_invoice_activation_email_sent_date (datetime.datetime) – Date when electronic invoicing was activated.
- auto_invoice_registration_request_sent_date (datetime.datetime) – Date when electronic invoicing was requested
- email_addresses (list(str)) – List if email addresses.
Todo
Need to contact Visma API Team to get proper explanation on:
- force_bookkeep_vat
- edi_gln_number
- electronic_address
- electronic_reference
- edi_service_deliverer_id
- Which emails are used for invoicing? all?
CustomerInvoiceDraft¶
-
class
visma.models.CustomerInvoiceDraft(*args, **kwargs)[source]¶ Represents a Customer Invoice Draft.
- endpoint
- /customerinvoicedrafts
- allowed_methods
- [‘list’, ‘get’, ‘create’, ‘update’, ‘delete’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
- scope
- ea:sales
- ea:sales_readonly
- ea.local:mobile_user
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - customer_id (uuid.UUID) –
requiredReference toCustomer - created_utc (datetime.datetime) –
read-onlyCreation time. Is automatically set - is_credit_invoice (bool) – Indicates if the invoice is a credit
invoice.
default=False - rot_reduced_invoicing_type (int) – Indicates the invoicing type in
respect to ROT and RUT. (Sweden) 0 = Normal, 1 = ROT, 2 = RUT.
default=0 - rot_reduced_invoicing_property_name (str) –
Unknown useMax length: 40 characters - rot_reduced_invoicing_org_number (str) –
Unknown useMax length: 11 characters - rot_reduced_invoicing_amount (number) –
Unknown useFormat: 2 decimals,default=0.00 - rot_reduced_invoicing_automatic_distribution (bool) –
Unknown usedefault=False - rot_property_type (int) –
Unknown use - house_work_other_costs (number) –
Unknown use - rows (list(CustomerInvoiceDraftRow)) – List of
CustomerInvoiceDraftRowwith the details of the invoice.default=list() - persons (list(SalesDocumentRotRutReductionPerson)) – List of
SalesDocumentRotRutReductionPersonwhen using ROT and RUT.Unknown usedefault=list() - your_reference (str) – Customers reference.
Max length: 100 characters - our_reference (str) – Companys reference.
Max length: 100 characters - invoice_customer_name (str) –
Read-onlyCustomer name on invoice.Max length: 50 characters - invoice_address1 (str) – Invoice address row 1
Max length: 50 characters - invoice_address2 (str) – Invoice address row 2
Max length: 50 characters - invoice_postal_code (str) – = Invoice postal code.
Max length: 10 characters - invoice_city (str) – Invoice city.
Max length: 50 characters - invoice_country_code (str) – Invoice country code.
Max length: 2 characters,default=SE - invoice_currency_code (str) –
read-onlyInvoice currency code - delivery_customer_name (str) –
Max length: 50 characters - delivery_address1 (str) –
Max length: 50 characters - delivery_address2 (str) –
Max length: 50 characters - delivery_postal_code (str) –
Max length: 10 characters - delivery_city (str) –
Max length: 50 characters - delivery_country_code (str) –
Max length: 2 characters - delivery_method_name (str) –
Max length: 50 characters - delivery_term_name (str) –
Max length: 50 characters - delivery_method_code (str) –
Max length: 20 characters - delivery_term_code (str) –
Max length: 50 characters - eu_third_party (bool) – Indicates if the invoice is subject to rules
about EU third pary invoicing.
default=False - customer_is_private_person (bool) –
requiredIndicates if the reciever of the invoice is a private person.default=False - reverse_charge_on_construction_services (bool) –
read-onlyUnknown useNeed investigation. - sales_document_attachments (list(uuid.UUID)) –
read-onlyList of references to attached documents. - invoice_date (datetime.datetime) – invoice date
- delivery_date (datetime.datetime) – delivery date
- total_amount (number) –
read-onlyCalculated by eAccounting API - total_vat_amount (number) –
read-onlyCalculated by eAccounting API - total_roundings (number) –
read-onlyCalculated by eAccounting API - total_amount_base_currency (number) –
read-onlyCalculated by eAccounting API - total_vat_amount_base_currency (number) –
read-onlyCalculated by eAccounting API - customer_number (str) –
read-onlyMax length: 16 characters - includes_vat (bool) –
read-onlyIf true the unit prices on rows include VAT. The value is set upon creation depending whether “Show prices excl. VAT for private individuals” in company’ settings is marked or not’
Todo
Contact Visma API Team about rules for ROT and RUT so it can be documented
CustomerLabel¶
DeliveryMethod¶
DeliveryTerm¶
FiscalYear¶
-
class
visma.models.FiscalYear(*args, **kwargs)[source]¶ Represents a fiscal year.
Fiscal years must be created in sequence. For example if you only have 2018 you can’t create 2020 until you have created 2019. If you want to create earlier fiscal year they aslo have to be adjacent to an existing fiscal year
- endpoint
- /fiscalyears
- allowed_methods
- [‘list’, ‘create’, ‘get’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - start_date (datetime.date) –
required - end_date (datetime.date) –
required - is_locked_for_accounting (bool) –
read-onlyIndicates if it is still possible bookkeep on the year. - bookkeeping_method (int) –
read-only0 = Invoicing, 1 = Cash, 2 = NoBookkeeping. When posting fiscalyear, previous years bookkeeping method is chosen. ‘
ForeignPaymentCodes¶
Project¶
-
class
visma.models.Project(*args, **kwargs)[source]¶ Represents a Project in eAccounting
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting’ - number (str) – Project number.
Max length: 9 characters - name (str) –
requiredProject name.Max length: 50 characters - start_date (datetime.datetime) –
requiredProject start. Will turn a datetime into date automatically. - end_date (datetime.datetime) – Project end.
- customer_id (uuid.UUID) – Reference to
Customerfor project. - customer_name (str) –
read-onlyCustomer name depending on customer_id - notes (str) – Notes
Max length: 500 characters - status (int) – Project status. 1 = Ongoing, 2 = Finished
- modified_utc (datetime.datetime) – Last modufied datetime in UTC.
# TODO: make custom field to handle the parsing and printing of dates.
- id (uuid.UUID) –
OpeningBalances¶
Supplier¶
-
class
visma.models.Supplier(*args, **kwargs)[source]¶ Represents a Supplier in eAccounting.
- endpoint
- /suppliers
- allowed_methods
- [‘list’, ‘create’, ‘get’, ‘update’, ‘delete’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - supplier_number (str) – Unique identifier. If not provided,
eAccounting will provide one.
Max length: 16 characters - address1 (str) – Supplier address row 1.
Max length: 50 characters - address2 (str) – Supplier address row 1.
Max length: 50 characters - automatic_payment_service (bool) – Sweden only. Indicates if the
supplier is paid by an automatic payment service. Supplier invoices to
such suppliers will not be sent to the bank via the bank integration.
default=False - bank_account_number (str) – Only used in norwegian and danish eAccounting for domestic payments.``Max length: 50 characters``
- bank_bban (str) – Used on foreign payments to identify a bankaccount
together with Bank Code (SupplierBankCode)’
Format NO: 11 characters, Format DK: 11-14 characters - bank_bic (str) – Used on foreign payments to identify a bankaccount together with IBAN (SupplierBankIban) Format: 6 letters followed by 2 or 5 characters (total length 8 or 11)
- bank_code (str) – Used on foreign payments to identify a bankaccount
together with BBAN (SupplierBankBban)
Format: 2 letters followed by at least 3 characters - bank_country_code (str) – Bank country code.
default=Country of the supplier - bankgiro_number (str) – Only used in swedish eAccounting, for
swedish suppliers.
Max length: 10 characters - bank_iban (str) – Used on foreign payments to identify a bankaccount together with BIC (SupplierBankBic). Format: 2 letters for country code, 2 control digits, 3 characters for bank identification
- bank_name (str) – Bank name.
Max length: 50 characters - city (str) – Supplier city.
Max length: 50 characters - contact_person_email (str) –
Max length: 255 characters - contact_person_mobile (str) –
Max length: 50 characters - contact_person_name (str) –
Max length: 50 characters - contact_person_phone (str) –
Max length: 50 characters - corporate_identity_number (str) –
Max length: 20 characters - country_code (str) – Country code:
Max length: 2 characters - created_utc (datetime.datetime) –
read-onlySupplier creation time. - currency_code (str) – Currency of the supplier.
default=Currency of the user company - email_address (str) –
Max length: 255 characters - mobile_phone (str) –
Max length: 255 characters - modified_utc (datetime.datetime) –
read-onlyLast modified time. - name (str) – Supplier name
Max length: 50 characters - note (str) – Supplier notes.
Max length: 4000 characters - plusgiro_number (str) – Only used in swedish eAccounting, for swedish suppliers.
- postal_code (str) –
Max length: 10 characters - telephone (str) –
Max length: 50 characters - terms_of_payment_id (uuid.UUID) –
requiredReference toTermsOfPaymentused for supplier. - www_address (str) – Supplier website.
Max length: 255 characters - bank_fee_code (int) – Used for foreign payments to determine which
party that pays for aditional bank fees. 0 = Not set,
1 = SenderPaysAllBankCharges, 2 = RecieverPaysAllBankCharges,
3 = RecieverPaysForeignCosts (Choices taken from app js sourcecode)
default=0 - pay_from_bank_account_id (uuid.UUID) – Reference to the
BankAccountis used for foreign payments. - foreign_payment_code_id (uuid.UUID) – Reference to
ForeignPaymentCode. Used for categorization of foreign purchases (NO and SE only) - uses_payment_reference_numbers (bool) –
requiredTrue if the supplier uses payment reference numbers. (OCR, KID etc.)default=True - is_active (bool) –
default=True - self_employed_without_fixed_address (bool) –
default=False
Unit¶
User¶
-
class
visma.models.User(*args, **kwargs)[source]¶ Represents a User in eAccounting
Parameters: - id (uuid.UUID) – Unique identifier.
- email (str) – Email.
- first_name (str) – First name.
- last_name (str) – Last name.
- is_active (bool) – Indicates if the user is active.
- is_current_user (bool) – Indicate if the user is the one set up with the current API session.
- is_consultant (bool) – Indicates if the user is a hired consultant.
VatCode¶
-
class
visma.models.VatCode(*args, **kwargs)[source]¶ Represents the diffent VAT Codes used in eAccounting.
- endpoint
- /vatcodes
- allowed_methods
- [‘list’, ‘get’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - code (str) – VAT code
- description (str) – Description
- vat_rate (number) – VAT Rate (in percentage??)
- related_accounts (RelatedAccounts) – A
RelatedAccountsobject that holds the accounts related to this VAT code.
Todo
How is vat rate represented? 0.25 or 25 for 25% VAT?
VatReport¶
-
class
visma.models.VatReport(*args, **kwargs)[source]¶ Represents a VAT Report
Parameters: - id (uuid.UUID) – Unique identifier.
- name (str) – Name.
- start_date (datetime.datetime) – Start date of the report.
- end_date (datetime.datetim) – End date of the report.
- document_approval_status (int) – Describes the vat reports approval status. 0 = None, 1 = Approved, 2 = Rejected, 3 = ReadyForApproval
- document_id (uuid.UUID) – Reference to the
Document. - created_utc (datetime.datetime) – Creatin time in UTC.
- is_regretted (bool) – Indicates whether the vat report was undone
- regretted_by_user_id (uuid.UUID) – Reference to the
Userthat undid the report. - regretted_date (datetime.datetime) – Date the report was undone.
- modified_utc (datetime.datetime) – Last modified datetime.
- sent_for_approval_by_user_id (uuid.UUID) – Reference to
Userthat send the report for approval. - voucher_id (uuid.UUID) – Reference to
Voucher - total_amount (number) – Predicted vat amount to pay or be refunded.
- approval_events_history (list(DocumentApprovalEvent)) – List of
references to
DocumentApprovalEventto show the approval history of the VAT Report.
TermsOfPayment¶
-
class
visma.models.TermsOfPayment(*args, **kwargs)[source]¶ Describes a term of payment that can be set on customers.
- endpoint
- /termsofpayments
- allowed_methods
- [‘list’, ‘get’]
- envelopes
- {‘list’: {‘class’: PaginatedResponse, ‘data_attr’: ‘Data’}}
- scopes
- ea:sales
- ea:sales_readonly
- ea:purchase
- ea:purchase_readonly
- ea.local:mobile_user
Parameters: - id (uuid.UUID) –
read-onlyUnique Id provided by eAccounting - name (str) – Name of term
- name_english (str) – English name if term.
- number_of_days (int) – Number of days until payment.
- terms_of_payment_type_id (int) – Need more info on how to interpret.
Unknown Use - terms_of_payment_type_text (str) – Description of term.
- available_for_sales (bool) – Indicates if term can be used for customer invoies.
- available_for_purchase (bool) – Indicates if the term can be used for supplier invoices.
Todo
What different types of terms_of_payment_types are there?
Models without endpoints¶
CompanyTexts¶
-
class
visma.models.CompanyTexts(*args, **kwargs)[source]¶ Collects company wide texts.
Parameters: - customer_invoice_text_domestic (str) – Text used for domestic
invoices.
Max length: 180 characters - customer_invoice_text_foreign (str) – Text used for foreign
invoices.
Max length: 180 characters - order_text_domestic (str) – Text used for domestic orders.
Max length: 180 characters - order_text_foreign (str) – Text used for foreign orders.
Max length: 180 characters - over_due_text_domestic (str) – Text used for domestic over due
invoices.
Max length: 180 characters - over_due_text_foreign (str) – Text used for foreign over due
invoices.
Max length: 180 characters
- customer_invoice_text_domestic (str) – Text used for domestic
invoices.
CustomerInvoiceDraftRow¶
-
class
visma.models.CustomerInvoiceDraftRow(*args, **kwargs)[source]¶ Represents a row on a
CustomerInvoiceDraftParameters: - line_number (int) –
requiredUsed to sort the rows. Nothing prevenst to have the same line numer on several rows. But the order of these will be random.Max=1000 - article_id (uuid.UUID) – Reference to
ArticleRequired if is text_row=False, - article_number (str) – If not filled eAccouting will get the article number from the speicfied article ID.
- is_text_row (bool) – Specifies if row i a text row or article row.
default=False - text (str) – Article name or Text if is_text_row=True.
Max length: 2000 - unit_price (number) – Use if you want to set a custom price on the
article. If not set eAccounting will use the price from the article registry
in creation.
Format: 2 decimals - discount_percentage (number) – Discount on the incoice row. Ex. 10%
discount = 0.1
default=0.00 - quantity (number) – The amount of specified article.
Format: 2 decimals - work_cost_type (int) – Probarbly has with ROT and RUT to do.
Unknown usagedefault=0 - is_work_cost (bool) – Probarbly has with ROT and RUT to do.
Unknown usagedefault=False - work_hours (number) – Probarbly has with ROT and RUT to do. Unknown usage`
- material_costs (number) – Probarbly has with ROT and RUT to do.
Unknown usage - reversed_construction_services_vat_free (bool) – Probarbly has with
ROT and RUT to do.
Unknown usagedefault=False - cost_center_item_id1 (uuid.UUID) – reference to
CostCenterItemon invoice row - cost_center_item_id2 (uuid.UUID) – reference to
CostCenterItemon invoice row - cost_center_item_id3 (uuid.UUID) – reference to
CostCenterItemon invoice row - unit_abbreviation (str) – unit abbreviation of the article
- vat_rate_id (str) –
read-onlysource fromArticleAccountCoding - unit_name (str) – Name of article unit
- project_id (uuid.UUID) – reference to
Project
Todo
Contact Visma API Team about how to handle ROT and RUT.
- line_number (int) –
DocumentApprovalEvent¶
-
class
visma.models.DocumentApprovalEvent(*args, **kwargs)[source]¶ Represents a Document Approval Event
Parameters: - document_approval_status (int) – Describes the status if the document. 0 = None, 1 = Approved, 2 = Rejected, 3 = ReadyForApproval
- created_utc (datetime.datetime) – Created time
- created_by_user_id (uuid.UUID) – Reference to
Userthat created the event.
PaginatedResponse¶
PaginationMetadata¶
-
class
visma.models.PaginationMetadata(*args, **kwargs)[source]¶ Represents the data structure of the meta data for all paginated responses.
Parameters: - current_page (int) – The current page of the pagination.
- page_size (int) – Number of object on page.
- total_number_of_pages (int) – Number of pages
- total_number_of_results (int) – Total of objects in results.
- server_time_utc (datetime.datetime) – The servers time serving the request