Bookkeeping can be done in a myriad of ways. In Denmark we’re embedded in the ‘journal’ / ‘cashbook’ way of registering our bookkeeping entries. Other countries are more prone to the ‘ledger’ approach. In e-conomic we support both of these two main entry methods. We call them Standard Journal and International Ledger.

From an API point of view, each method should be approached differently. The Standard Journal is mainly supported via our SOAP API, albeit some data is also exposed in REST via GETs only. International Ledger is only supported in the REST API and is currently only in play on Swedish and Spanish agreement types.

Attachments on vouchers
International Ledger is built around vouchers. For this reason all entries in an International Ledger is found at the /vouchers endpoint.

As the latest addition to the REST API, you’re now able to GET, POST, PUT and DELETE attachments on vouchers. This enables you to build integrations with e-conomic that can create, edit and delete the documentation on vouchers. Obvious use cases for this could be registration of expense receipts or adding documentation for a supplier invoice.

Voucher attachments are structured so that an attachment contains a number of items. If you GET an attachment, you will receive JSON showing how many items are in the attachment, but also a link to a PDF with all items (the entire attachment).

The collection of items in the attachment allow you to get at the individual items, which contain a link to a thumbnail and a JPG version of the item. POST’ing to the items on an attachment allows you to add more items as either PDF, JPG, JPEG or PNG. This needs to be POST’ed as multipart/form-data content-type.

To replace an existing item, you can PUT with the same requirements as posting, but to a specific item number. Also, you can DELETE all items, or individual ones by item number.

All of the examples given has been for draft vouchers, but the same methods are also available for booked vouchers.

Checking for ledger type in REST
If you want to know which ledger type is used on a specific agreement, you can check this at:
https://restapi.e-conomic.com/self?demo=true (‘demo’ parameter appended for convenience).

On this /self resource the “internationalLedger” property will be exposed with value ‘true’ if, and only if, the agreement is using the Internation Ledger. Our demo agreement uses Standard Journal and does therefore not display this property. If you were to look at a Swedish agreement, the settings properties would instead look like this:

   "settings": {
   "internationalLedger": "true",
   "baseCurrency": "SEK"
}

Which ledger type an agreement uses is often tied to the agreement type. In most cases Swedish and Spanish type agreements will use the International Ledger. Whilst you shouldn’t always trust this to be the case, it’s a good rule of thumb and an important distinction to keep in mind when building integrations for multiple countries.

Agreement type is exposed at the /self endpoint as…

   "agreementType": { 
   "agreementTypeNumber": "[INTEGER]",
   "name": "[STRING]"
}

Checking for ledger type in SOAP
You can perform the check in our SOAP API via this method:
https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=HasInternationalLedger

This method simply returns a true/false boolean for whether or not the specific agreement is using the International Ledger.