Services

Table of Contents

Search Service

Please see the Search Service documentation.

Create General Journal Entry Service

Beta Notice: The General Journal Entry section of the API is currently in beta. While fully functional there might be small changes in the interfaces and functionality.

Create General Journal Entry Request

FieldTypeRequiredDescription
descriptionStringYes
journalEntriesArray of Create Journal EntryYesAt least one journal entry is required.

Create Journal Entry

FieldTypeRequiredDescription
descriptionStringYes
dateDateYes
linesArray of Create Journal Entry LineYesAt least one line is required.
Create Journal Entry Line
FieldTypeRequiredDescription
debitAmountYesThe net debit amount. Can be positive or negative, but not 0.
debitAccountAccountMaybeThe debit account code. Either debit account, credit account or both are required.
debitVatCodeVatCodeNo
creditAccountAccountMaybeThe credit account code. Either debit account, credit account or both are required.
creditVatCodeVatCodeNo
Link RelationReferences
attachmentsAttachments of this journal entry

Attachment

The content to post should be a form/multipart with the following parts:

JournalAttachment

FieldTypeRequiredDescription
filenameString (max 200)YesThe filename. Must end with either .png, .jpeg, .jpg, .gif or .pdf

Create Invoice Service

There is a separate service for creating invoices that takes its own special object. The URL can be found by following the create-invoice-service relation from a company. Please note that the first invoice of a company must be created through the webapp for now, as that sets up the invoice number counters etc, which cannot be done through the API.

When creating lines the following combination of fields are allowed:

CombinationProduct with unitPriceunitNetPricenetvatgross
Combination 1OptionalPresentPresentPresentPresent
Combination 2AbsentAbsentPresentPresentPresent
Combination 3PresentAbsentPresentPresentPresent
Combination 4PresentAbsentAbsentAbsentAbsent
Combination 5AbsentPresentAbsentAbsentAbsent

The vatType field is taken from either 1) the line or 2) the product. At least vatType or vatPercent has to be specified. If both are specified, Fiken will assert that the given vat type matches the given vat percent for the issue date.

The incomeAccount field is similar to vatType, it defaults to the product's income account. Either the line or the product needs to have an income account set.

If discountPercent is set, all amounts must be given before the discount is applied. Fiken will calculate the new totals.

If bankAccountUrl points to a bank account with an KID/OCR agreement, a KID-number will be generated on the invoice automatically. There is currently no way to disable this behaviour.

Create Invoice Request

FieldTypeRequiredDescription
issueDateDateYes
dueDateDateYes
linesArray of Create Invoice PartyYesAt least one line is required.
ourReferenceStringNoA reference for the sender. Visible on the invoice.
yourReferenceStringNoA reference for the receiver. Visible on the invoice.
customerCreate Invoice CustomerYesThe customer (receiver) for this invoice.
bankAccountUrlURLYesThe bank account's number will be printed on the invoice.
currencyStringNoThe currency of this invoice, if different than NOK
invoiceTextStringNoComment/description printed above the invoice lines, max length 250 characters.
cashBooleanNoTrue if this is a "Cash Invoice"/Receipt ("kontantfaktura")
paymentAccountAccountmaybeFor Cash Invoices only. For instance "1920:10001".

Create Invoice Line

FieldTypeRequiredDescription
netAmountAmountMaybe
vatAmountAmountMaybe
grossAmountAmountMaybe
vatTypeStringMaybeOne of: {"HIGH", "MEDIUM", "LOW", "EXEMPT", "EXEMPT_IMPORT_EXPORT", "EXEMPT_REVERSE", "OUTSIDE", "NONE"}. "HIGH" is the most common.
vatPercentNumberMaybe
unitNetAmountAmountMaybe
discountPercentNumberNoDefaults to 0.
quantityNumberNoDefaults to 1.
descriptionStringMaybeMax length 200 characters.
commentStringNoMax length 200 characters.
productUrlURLMaybeUsed to fill in missing fields.
incomeAccountAccountMaybe

If some fields are left blank and there is a product URL specified, the fields will be filled out with values from the product.

Create Invoice Customer

FieldTypeRequiredDescription
urlURLMaybeThe URL must reference a contact that is a customer (has a customer number)

Create Invoice Response

The server will response with a Invoice Resource

Create Report Service

Beta Notice: The Report section of the API is currently in beta. While fully functional there might be small changes in the interfaces and functionality.

The create report sevice can be used to create reports with data similar to what can be found in the Fiken web application.

To create a report, submit a report request query:

FieldTypeRequiredDescription
typeStringYesThe type of report to generate, see below for valid types
embeddedBooleanYesSet to true to embed related resources
productSalesObjectRequired if type is PRODUCT_SALES, see below for fields

The payload and response is different for each report, and the API currently supports the following reports

Product Sales Report Request

FieldTypeRequiredDescription
fromStringYesStart date range for the report, inclusive, format yyyy-MM-dd
toStringYesEnd date range for the report, inclusive, format yyyy-MM-dd

Document Sending Service

The document sending service supports sending invoices by email and EHF. The URL can be found by following the from the document-sending-service relation from a company.

The payload is different for each method used for sending the documents but shares two fields:

Method: auto lets Fiken select the best channel for sending the document. This currently means EHF if EHF is available, Vipps eFaktura if it is enabled on the company and the receiver can receive Vipps eFaktura, otherwise email will be used.

Payload fields when sending as auto:

FieldTypeRequiredDescription
resourceURLYesThe URL of the document to send.
methodStringYesHas to be auto.
recipientEmailEmail addressNo
recipientNameStringNo
organizationNumberStringNo

Payload fields when sending as email:

FieldTypeRequiredDescription
resourceURLYesThe URL of the document to send.
methodStringYesHas to be email.
recipientEmailEmail addressNoDefaults to the customers email if not provided.
recipientNameStringNoDefaults to the customers name if not provided.
emailSendOptionStringNodocument_link, attachment or auto. Defaults to auto which uses customer/company settings (normally defaults to document_link)
messageStringNoAdditional message to include in the email body.

Payload fields when sending as EHF:

FieldTypeRequiredDescription
resourceURLYesThe URL of the document to send.
methodStringYesHas to be ehf.
organizationNumberStringNoDefaults to the customers organization number if not provided.

Payload fields when sending as Vipps eFaktura:

FieldTypeRequiredDescription
resourceURLYesThe URL of the document to send.
methodStringYesHas to be vipps.
mobileNumberStringNoDefaults to the customers phone number.

Payload fields when sending as SMS:

FieldTypeRequiredDescription
resourceURLYesThe URL of the document to send.
methodStringYesHas to be SMS.
mobileNumberStringNoDefaults to the customers phone number.