!!!
APIv1 is deprecated - APIv2 is available at https://api.fiken.no/
!!!
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
Field | Type | Required | Description |
---|---|---|---|
description |
String | Yes | |
journalEntries |
Array of Create Journal Entry | Yes | At least one journal entry is required. |
Create Journal Entry
Field | Type | Required | Description |
---|---|---|---|
description |
String | Yes | |
date |
Date | Yes | |
lines |
Array of Create Journal Entry Line | Yes | At least one line is required. |
Create Journal Entry Line
Field | Type | Required | Description |
---|---|---|---|
debit |
Amount | Yes | The net debit amount. Can be positive or negative, but not 0. |
debitAccount |
Account | Maybe | The debit account code. Either debit account, credit account or both are required. |
debitVatCode |
VatCode | No | |
creditAccount |
Account | Maybe | The credit account code. Either debit account, credit account or both are required. |
creditVatCode |
VatCode | No |
Links
Link Relation | References |
---|---|
attachments |
Attachments of this journal entry |
Attachment
The content to post should be a form/multipart with the following parts:
- "JournalAttachmentInfo" of content-type application/json
- "AttachmentFile" of one of the following content-types:
- image/png
- image/jpeg
- image/gif
- application/pdf
JournalAttachment
Field | Type | Required | Description |
---|---|---|---|
filename |
String (max 200) | Yes | The 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:
Combination | Product with unitPrice | unitNetPrice | net | vat | gross |
---|---|---|---|---|---|
Combination 1 | Optional | Present | Present | Present | Present |
Combination 2 | Absent | Absent | Present | Present | Present |
Combination 3 | Present | Absent | Present | Present | Present |
Combination 4 | Present | Absent | Absent | Absent | Absent |
Combination 5 | Absent | Present | Absent | Absent | Absent |
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
Field | Type | Required | Description |
---|---|---|---|
issueDate |
Date | Yes | |
dueDate |
Date | Yes | |
lines |
Array of Create Invoice Party | Yes | At least one line is required. |
ourReference |
String | No | A reference for the sender. Visible on the invoice. |
yourReference |
String | No | A reference for the receiver. Visible on the invoice. |
customer |
Create Invoice Customer | Yes | The customer (receiver) for this invoice. |
bankAccountUrl |
URL | Yes | The bank account's number will be printed on the invoice. |
currency |
String | No | The currency of this invoice, if different than NOK |
invoiceText |
String | No | Comment/description printed above the invoice lines, max length 250 characters. |
cash |
Boolean | No | True if this is a "Cash Invoice"/Receipt ("kontantfaktura") |
paymentAccount |
Account | maybe | For Cash Invoices only. For instance "1920:10001". |
Create Invoice Line
Field | Type | Required | Description |
---|---|---|---|
netAmount |
Amount | Maybe | |
vatAmount |
Amount | Maybe | |
grossAmount |
Amount | Maybe | |
vatType |
String | Maybe | One of: {"HIGH", "MEDIUM", "LOW", "EXEMPT", "EXEMPT_IMPORT_EXPORT", "EXEMPT_REVERSE", "OUTSIDE", "NONE"}. "HIGH" is the most common. |
vatPercent |
Number | Maybe | |
unitNetAmount |
Amount | Maybe | |
discountPercent |
Number | No | Defaults to 0. |
quantity |
Number | No | Defaults to 1. |
description |
String | Maybe | Max length 200 characters. |
comment |
String | No | Max length 200 characters. |
productUrl |
URL | Maybe | Used to fill in missing fields. |
incomeAccount |
Account | Maybe |
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
Field | Type | Required | Description |
---|---|---|---|
url |
URL | Maybe | The URL must reference a contact that is a customer (has a customer number) |
Create Invoice Response
The server will response with a Invoice Resource
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:
resource
: The URL to the document to send.method
: The method of sending. Has to beauto
,email
,ehf
,vipps
orsms
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:
Field | Type | Required | Description |
---|---|---|---|
resource |
URL | Yes | The URL of the document to send. |
method |
String | Yes | Has to be auto . |
recipientEmail |
Email address | No | |
recipientName |
String | No | |
organizationNumber |
String | No |
Payload fields when sending as email:
Field | Type | Required | Description |
---|---|---|---|
resource |
URL | Yes | The URL of the document to send. |
method |
String | Yes | Has to be email . |
recipientEmail |
Email address | No | Defaults to the customers email if not provided. |
recipientName |
String | No | Defaults to the customers name if not provided. |
emailSendOption |
String | No | document_link , attachment or auto . Defaults to auto which uses customer/company settings (normally defaults to document_link ) |
message |
String | No | Additional message to include in the email body. |
Payload fields when sending as EHF:
Field | Type | Required | Description |
---|---|---|---|
resource |
URL | Yes | The URL of the document to send. |
method |
String | Yes | Has to be ehf . |
organizationNumber |
String | No | Defaults to the customers organization number if not provided. |
Payload fields when sending as Vipps eFaktura:
Field | Type | Required | Description |
---|---|---|---|
resource |
URL | Yes | The URL of the document to send. |
method |
String | Yes | Has to be vipps . |
mobileNumber |
String | No | Defaults to the customers phone number. |
Payload fields when sending as SMS:
Field | Type | Required | Description |
---|---|---|---|
resource |
URL | Yes | The URL of the document to send. |
method |
String | Yes | Has to be SMS . |
mobileNumber |
String | No | Defaults to the customers phone number. |