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.

Account Service
Account Service WSDL

Data types

Saving accounting entries

The method SaveBundleList is used to save financial transactions.
To create an transaction there are some steps that needs to be considered:

  1. Please make sure that the accounting year (YearId) has been defined in the client’s Accounting setup. Information on how to do this can be found in this help article (norwegian language).
  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 TransactionNo of the voucher get the next available number by sending a request to GetEntryId. The GetEntryId 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.
  4. When creating a bundle or a voucher the Sort property needs to filled with the No property by sending a request to GetTransactionTypes on the TransactionService. Ignored when SaveOption = 0.
  5. The Amount property operates with max 2 decimal places.

TIP

Please note that the EntryNo property is not set and does not need to be set when using the method GetEntryId.

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>2019</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>
                                <Date>2019-01-01T00:00:00</Date>
                                <DueDate>2019-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>2019-01-02T00:00:00</Date>
                                <DueDate>2019-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>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

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.

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

<Links>
  <LinkModel>
    <LineId></LineId>
    <LinkId></LinkId>
  </LinkModel>
</Links>
1
2
3
4
5
6

Here you have LineId which refers to the existing entry. You can get the value through GetTransactions. 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>
1
2
3
4
5
6
7
8
9

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 entries to existing entries that have already been created.

Methods

Method Input type Return type Description
CheckAccountNo accountList AccountDataErrors[]
GetAccountList - AccountData[]
GetTaxCodeList - TaxCodeElement[] Return a list with all the tax codes
GetTypeList - TypeData[]
SaveBundleList BundleList SaveBundleListResult
GetEntryId argEntryId GetEntryIdResult

Exceptions

  1. Error message “Could not finish last Bundle! iError:2” when trying to use AccountService – SaveBundleList
  • Please make sure that the accounting year has been defined in the client’s Accounting setup. Information on how to do this can be found in this help article.