# 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.

TIP

This is our newest version of the API. If you're looking for details on the previous version see: old version

TERMINOLOGY

In the following documentation the terms Entry and Transaction are used somewhat interchangeably. In the scope of the AccountService Entry is the main term used, while the TransactionService refers to Transaction. The refer to the same thing: lines i the journal of the client.

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

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.

If the response from GetEntryId (opens new window) returns -1, the fiscal year has not been set up on the client. This must be done first.

  1. 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 Norwegian clients:

PLEASE NOTE

You can only use positive valued TypeNos. Negative valued Types are system types and cannot be used with the SaveBundleList method.

Example of a SaveBundleList request:

<SaveBundleList>
    <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>
                                <AccountNo>1500</AccountNo>
                                <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>
                                <AccountNo>3000</AccountNo>
                                <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>
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

# 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 you have the 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>
                                <AccountNo>1500</AccountNo>
                                <CustomerId>123</CustomerId>
                                <Date>2033-01-01T00:00:00</Date>
                                <Amount>80.00</Amount>
				<TaxNo>2</TaxNo>
                            </Entry>
                            <Entry>
                                <AccountNo>2700</AccountNo>
                                <Date>2033-01-01T00:00:00</Date>
                                <Amount>20.00</Amount>
                            </Entry>
                            <Entry>
                                <AccountNo>3000</AccountNo>
                                <Date>2033-01-01T00:00:00</Date>
                                <Amount>-100</Amount>
                            </Entry>
                        </Entries>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

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 (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>
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 new entries to existing transactions that have already been created when using the SaveBundleList method.

# Linking existing transactions

There are methods available that let you create new LinkIds, connect existing Transactions to a LinkId or replace a LinkId for existing Transactions. You can get LineIds and existing LinkIds from the GetTransactions method.

If you want to create a new link between Entries you first send a request to CreateLink (opens new window) and then send a request to AddLinkEntries (opens new window) with the LinkId from the CreateLink (opens new window) response and the LineIds that should be linked.

If you want to add LineIds to an existing Link, AddLinkEntries (opens new window) is used with the existing LinkId and any LineIds you want to add.

You can also replace the LinkId for linked LineIds with the ReplaceLinkEntries (opens new window) method.

# Set UserDefined Dimensions

You can specify UserDefined Dimensions for an Entry

<Entries>
  <Entry>
    <UserDefinedDimensions>
      <Type>101</Type>
      <Value>1</Value>
    </UserDefinedDimensions>
  </Entry>
</Entries>
1
2
3
4
5
6
7
8

The Type is set to the appropriate TypeId which can be fetched from GetUserDefinedDimensions (opens new window) and Value to the appropriate Value which can be fetched from GetUserDefinedDimensionValues (opens new window)

# Methods

Method Input type Return type Description
AddLinkEntries (opens new window) LinkEntryItem AddLinkEntriesResult(bool) Connect LineIds to a LinkId
CheckAccountNo (opens new window) accountList AccountDataErrors[] Check if an account exists
CreateLink (opens new window) - CreateLinkResult(int) Creates a new LinkId (integer) that can be used for linking Entries
GetAccountList (opens new window) - AccountData[] Returns a list of accounts
GetEntryId (opens new window) argEntryId GetEntryIdResult Get the next available EntryID which is used as TransactionNo on vouchers in SaveBundleList
GetTaxCodeList (opens new window) - TaxCodeElement[] Returns a list with all the tax codes
GetTypeList (opens new window) - TypeData[] Returns a list with all types
ReplaceLinkEntries (opens new window) LinkEntryItem ReplaceLinkEntriesResult(bool) Replace LinkId for all LineIds in array
SaveBundleList (opens new window) BundleList SaveBundleListResult Save Bundles either directly to the ledger or to the user interface for further review
UpdateEntryDueDate (opens new window) EntryItem[] EntryItem[] Update the due date of Entries