# AccountService

This is the API used for accounting tasks. You can save entries directly to the journal or to the registration module in 24SevenOffice and also get account and tax lists.

Warning

This is an older version of the AccountService, please see our latest version

Account Service (opens new window)
Account Service WSDL (opens new window)

Data types

# Guides

# Saving accounting entries

The method SaveBundleList (opens new window) is used to save financial transactions.
To create an transaction there are some steps that need to be considered:

  1. Please make sure that the accounting year (YearId) has been set up in the client accounting setup.
  2. The SaveOption property can be either 1 or 0. Setting 1 saves the bundle as a journal which can then be reviewed and edited on the 24SevenOffice web site. Setting 0 saves the bundle directly to the ledger. Default value is 1.
  3. To set the TransactionNo of the voucher you need to get the next available number by sending a request to GetEntryId (opens new window). The method takes a Date property which must be some date within the given fiscal year of the voucher. It also takes a SortNo property, here you must provide an EntrySeriesId property value, which can be obtained by sending a request to GetTypeList (opens new window). The EntryNo property is the value that is returned from the method and does not need to be set. (it can be set to 0 if your programming environment requires a value here.)
  4. When creating a bundle or a voucher the Sort property can be set to the TypeNo property by sending a request to GetTypeList (opens new window).
    Below you see a list of default types on a Norwegian client:

TIP

Please note that the EntryNo property does not need to be set when sending a request to GetEntryId (opens new window), it is part of the response from the method.

Example of a SaveBundleList request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SaveBundleList xmlns="http://24sevenOffice.com/webservices">
    <bundlelist>
        <AllowDifference>false</AllowDifference>
        <DirectLedger>false</DirectLedger>
        <SaveOption>1</SaveOption>
        <DefaultCustomerId>0</DefaultCustomerId>
        <Bundles>
            <Bundle>
                <YearId>2033</YearId>
                <Sort>1</Sort>
                <Name>This is a test bundle</Name>
                <BundleDirectAccounting>false</BundleDirectAccounting>
                <Vouchers>
                    <Voucher>
                        <TransactionNo>12345678</TransactionNo>
                        <Sort>5</Sort>
                        <Entries>
                            <Entry>
                                <AccountId>1500</AccountId>
                                <CustomerId>123</CustomerId>
                                <Date>2033-01-01T00:00:00</Date>
                                <DueDate>2033-01-01T00:00:00</DueDate>
                                <Amount>123.00</Amount>
                                <CurrencyId>SEK</CurrencyId>
                                <CurrencyRate>0.9</CurrencyRate>
                                <CurrencyUnit>1</CurrencyUnit>
                                <Comment>Comment 1</Comment>
                                <LinkId>00000000-0000-0000-0000-000000000000</LinkId>
                            </Entry>
                            <Entry>
                                <AccountId>3000</AccountId>
                                <Date>2033-01-01T00:00:00</Date>
                                <DueDate>2033-01-02T00:00:00</DueDate>
                                <Amount>-123.00</Amount>
                                <CurrencyId>SEK</CurrencyId>
                                <CurrencyRate>0.9</CurrencyRate>
                                <CurrencyUnit>1</CurrencyUnit>
                                <Comment>Comment 2</Comment>
                                <LinkId>00000000-0000-0000-0000-000000000000</LinkId>
                            </Entry>
                        </Entries>
                    </Voucher>
                </Vouchers>
            </Bundle>
        </Bundles>
    </bundlelist>
</SaveBundleList>

# Bundlelist Model

Since the SOAP service does not display the whole model it is described in more detail here.
The BundleList model has the property Bundles which consists of an array of Bundle.
Inside the bundle model there is a property Vouchers which is an array of Voucher.
And inside the Vouchers model a property Entries which is an array of Entry.

# How to handle VAT/Taxes

When you are saving bundles with SaveOption 1 and have set TaxNo on an Entry the VAT lines are automatically calculated in the 24SevenOffice user interface. However, if you are saving bundles with SaveOption 0 (saving directly to the ledger without review in the user interface), you have to add the VAT Entry before sending your request. You can find a simplified example below.

Here TaxNo is set to 2 which in this example is a 25% VAT and a separate VAT Entry (Account 2700) has been added with the VAT amount:


                        <Entries>
                            <Entry>
                                <AccountId>1500</AccountId>
                                <CustomerId>123</CustomerId>
                                <Date>2033-01-01T00:00:00</Date>
                                <Amount>80.00</Amount>
								<TaxNo>2</TaxNo>
                            </Entry>
                            <Entry>
                                <AccountId>2700</AccountId>
                                <Date>2033-01-01T00:00:00</Date>
                                <Amount>20.00</Amount>
                            </Entry>
                            <Entry>
                                <AccountId>3000</AccountId>
                                <Date>2033-01-01T00:00:00</Date>
                                <Amount>-100</Amount>
                            </Entry>
                        </Entries>

In order to link entries you have to set the Links property:

<Links>
  <LinkModel>
    <LineId></LineId>
    <LinkId></LinkId>
  </LinkModel>
</Links>

Here you have LineId which refers to the existing entry. You can get the value through GetTransactions (opens new window). The LinkId property is a GUID that you generate on your end. The LinkId GUID has to be set in the LinkModel and in the Entry object. Below you see an example of this:

<Entry>
<LinkId>eba705a5-7814-4976-a88b-d94a807984d4</LinkId>
  <Links>
  <LinkModel>
    <LineId>9b6cffe5-f4e6-4d0b-aac4-24d0164e5455</LineId>
    <LinkId>eba705a5-7814-4976-a88b-d94a807984d4</LinkId>
  </LinkModel>
  </Links>
</Entry>

Here the GUID eba705a5-7814-4976-a88b-d94a807984d4 is the LinkId that you have generated and the GUID 9b6cffe5-f4e6-4d0b-aac4-24d0164e5455 is the Id that you have gotten from GetTransactions. Please note that it is not possible to link two entries when they are both in the bundle that is being saved. You can only link new entries to existing transactions that have already been created.

# Methods

Method Input type Return type Description
CheckAccountNo (opens new window) accountList AccountDataErrors[] Check if an account exists
GetAccountList (opens new window) - AccountData[] Returns a list of accounts
GetTaxCodeList (opens new window) - TaxCodeElement[] Returns a list with all the tax codes
GetTypeList (opens new window) - TypeData[] Returns a list with all types
SaveBundleList (opens new window) BundleList SaveBundleListResult Save Bundles either directly to the ledger or to the user interface for further review
GetEntryId (opens new window) argEntryId GetEntryIdResult Get the next available EntryID which is used as TransactionNo on vouchers in SaveBundleList
Last Updated: 5/19/2023, 8:00:13 AM