Flow of general ledger


Authentication

To authenticate, use basic auth.

Choose account (originator)

A user in SendRegning may have access to several accounts.

An account will be referred to as an originator for the rest of the document.

To choose an originator, specify the Originator-Id header with the originator id as value for every request.

To fetch all originators for a user - do a GET request to /user/originators.

This results in the following JSON.

1
2
3
4
5
6
7
8
9
10
11
{
    "items": [
        {
            "id": 1,
            "name": "Some Name",
            "role": "OWNER",
            "loggedIn": true
        }
    ],
    "total": 1
}

Create a series

You can create several series that will keep track of what’s exported.

To create a series - do a POST request to /generalledger/series with a JSON where you specify the start date. E.g:

1
2
3
{
    "startDate": "2014-11-12 00:00"
}

Fetch series

You can fetch all series by doing a GET request to /generalledger/series - which will result in the following JSON:

1
2
3
4
[{
    "number": 1,
    "salesLedgerAccountNumber": 5000
}]

Get new entries to export

To get new entries to export - do a GET request to /generalledger/series/{numberOfSeries}/entries/new.

This will result in a JSON array like this:

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
[{
    "ledgerEntry": {
        "id": 1,
        "entryDate": "2014-01-01",
        "amounts": [{
            "vatRate": "0",
            "accountNo": 3000,
            "amount": "100,00"
        }, {
            "vatRate": "25",
            "accountNo": 3000,
            "amount": "125,00"
        }],
        "transactionId": 2014
    },
    "invoice": {
        "number": "1",
        "issueDate": "2014-01-01",
        "dueDate": "2014-01-14",
        "customerNo": "2",
        "name": "Test name",
        "address": {
            "address1": "addr1",
            "address2": "addr2",
            "zip": "0665",
            "city": "Oslo",
            "country": "NORGE"
        },
        "deliveryAddress": {
            "address": "delAddr1",
            "zip": "2040",
            "city": "Kløfta",
            "country": "NORGE"
        },
        "currency": {
            "code": "NOK",
            "exchangeRate": 7.237622,
            "currencyAmount": "230,00"
        },
        "KID": "0034246611",
        "tax": "25,00",
        "total": "225,00"
    }
}]

Mark as exported

To mark entries as exported - do a POST request to /generalledger/settings/{number} with a JSON array with the ids of the entries that has been exported.

Example

1
[1, 5, 7]