---
title: "GET /companies/{companySlug}/ehf"
method: GET
path: "/companies/{companySlug}/ehf"
tags: ["ehf"]
---

# GET /companies/{companySlug}/ehf

`GET /companies/{companySlug}/ehf`

Returns received EHF documents (incoming electronic invoices and credit
notes) for the given company. By default returns all documents; use the
`status` parameter to return only unprocessed documents (still in the
inbox) or processed documents (already booked as a purchase).

## Query parameters

- `page` integer
- `pageSize` integer
- `sortBy` 'createdDate asc' | 'createdDate desc' | 'issueDate asc' | 'issueDate desc'
- `status` 'unprocessed' | 'used' | 'processed' | 'deleted'
- `issueDate` string, date
- `issueDateLe` string, date
- `issueDateLt` string, date
- `issueDateGe` string, date
- `issueDateGt` string, date

## Response `200`

OK

- EhfDocumentResult[]
  - `ehfDocumentId` integer
  - `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.
  - `invoiceNumber` string — The supplier's invoice or credit note number as stated in the EHF document.
  - `issueDate` string, date — Invoice/credit note date from the EHF document.
  - `dueDate` string, date — Payment due date, if present.
  - `supplierName` string — Supplier name as stated in the EHF document.
  - `supplierOrganizationNumber` string — Supplier organization number as stated in the EHF document.
  - `supplierContactId` integer — Id of the matched Fiken contact for the supplier, if any.
  - `net` integer — Total net amount in cents.
  - `vat` integer — Total VAT amount in cents.
  - `gross` integer — Total gross amount (= net + VAT) in cents.
  - `amountDue` integer — Total amount to be paid, in cents (NOK), if present.
  - `currency` string — ISO 4217 currency code.
  - `kid` string
  - `accountNumber` string — Bank account number for payment, if present.
  - `bic` string
  - `iban` string
  - `description` string — Free-text description of the document.
  - `purchaseId` integer — 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.
  - `documentUrl` string — URL to download the document PDF. For use with API credentials (bearer token or oauth 2).
  - `documentUrlWithFikenNormalUserCredentials` string — URL to download the document PDF. Requires the user to login with username and password in Fiken.
  - `xmlUrl` string — URL to download the raw EHF XML. For use with API credentials (bearer token or oauth 2).
  - `xmlUrlWithFikenNormalUserCredentials` string — URL to download the raw EHF XML. Requires the user to login with username and password in Fiken.
  - `createdAt` string, date-time — When the document was received.
  - `lines` EhfDocumentLine[]
    - `description` string — Line description (product name and/or comment).
    - `net` integer — Net amount for the line in cents.
    - `vat` integer — VAT amount for the line in cents.
    - `vatType` string — VAT type resolved for purchase booking.

---

[API](https://skmtc.dev/fiken/apis/fiken-api.md) · [All operations](https://skmtc.dev/fiken/apis/fiken-api/llms.txt) · [OpenAPI document](https://skmtc.dev/fiken/apis/fiken-api/revisions/91d77352f816?raw)
