ehf

GET /companies/{companySlug}/ehf/{ehfDocumentId}

Changed on

Returns the received EHF document with the specified id.

Request

  • Base URL
    https://api.fiken.no/api/v2
  • URL
    https://api.fiken.no/api/v2/companies/{companySlug}/ehf/{ehfDocumentId}
  • Auth
    OAuth 2
    Authorization code: https://fiken.no/oauth/authorize
    Token URL: https://fiken.no/oauth/token

Response

OK

ehfDocumentIdinteger
status'unprocessed' | 'used' | 'processed' | 'deleted'

Processing state of the document. Note that used and processed are distinct: attaching a document is not the same as booking it. Through this API the only state change available for an EHF document is attaching it (which sets used, see the attachment endpoints); booking and deleting are done in Fiken (the web application), so processed and deleted are never reached through this API.

  • unprocessed – received and still in the inbox, not yet handled.
  • used – attached as documentation to another record (a purchase, sale, or journal entry, or a draft of these) via the attachment endpoints. The document itself has not been booked. It stays used even when the record it is attached to is itself already booked — attaching does not transition it to processed.
  • processed – the document itself has been booked as a purchase, which populates purchaseId. Booking an EHF is done in Fiken; this API has no endpoint to book one, so a document does not become processed through the API, and attaching it to an existing purchase does not make it processed.
  • deleted – removed from the inbox (done in Fiken).
documentType'invoice' | 'creditNote'

Whether the document is an invoice or a credit note.

invoiceNumberstring

The supplier's invoice or credit note number as stated in the EHF document.

issueDatestring date

Invoice/credit note date from the EHF document.

dueDatestring date

Payment due date, if present.

supplierNamestring

Supplier name as stated in the EHF document.

supplierOrganizationNumberstring

Supplier organization number as stated in the EHF document.

supplierContactIdinteger

Id of the matched Fiken contact for the supplier, if any.

netinteger

Total net amount in cents.

vatinteger

Total VAT amount in cents.

grossinteger

Total gross amount (= net + VAT) in cents.

amountDueinteger

Total amount to be paid, in cents (NOK), if present.

currencystring

ISO 4217 currency code.

kidstring
accountNumberstring

Bank account number for payment, if present.

bicstring
ibanstring
descriptionstring

Free-text description of the document.

purchaseIdinteger

Id of the purchase this document was booked as (i.e. when status is processed). Null for documents that are unprocessed, used, or deleted. Booking is done in Fiken, not through this API.

documentUrlstring

URL to download the document PDF. For use with API credentials (bearer token or oauth 2).

documentUrlWithFikenNormalUserCredentialsstring

URL to download the document PDF. Requires the user to login with username and password in Fiken.

xmlUrlstring

URL to download the raw EHF XML. For use with API credentials (bearer token or oauth 2).

xmlUrlWithFikenNormalUserCredentialsstring

URL to download the raw EHF XML. Requires the user to login with username and password in Fiken.

createdAtstring date-time

When the document was received.

Example response

{
  "ehfDocumentId": 1234134
}

Changes