---
title: "POST /companies/{companySlug}/invoices"
method: POST
path: "/companies/{companySlug}/invoices"
tags: ["invoices"]
---

# POST /companies/{companySlug}/invoices

`POST /companies/{companySlug}/invoices`

## Request

- Base URL: `https://api.fiken.no/api/v2`
- URL: `https://api.fiken.no/api/v2/companies/{companySlug}/invoices`
- Auth: OAuth 2
  - Authorization code: `https://fiken.no/oauth/authorize`
  - Token URL: `https://fiken.no/oauth/token`

Creates an invoice. This corresponds to "Ny faktura" in Fiken.
There are two types of invoice lines that can be added to an invoice line: product line or free text line.
Provide a product Id if you are invoicing a product. All information regarding the price and VAT for this product will be added to the invoice.
It is however also possible to override the unit amount by sending information in both fields "productId" and "unitAmount".
An invoice line can also be a free text line meaning that no existing product will be associated with the invoiced line.
In this case all information regarding the price and VAT of the product or service to be invoiced must be provided.

## Request body

- InvoiceRequest
  - `uuid` string: UUID are represented as 32 hexadecimal (base-16) digits, displayed in 5 groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters. If not provided, API will generate a UUID.
  - `issueDate` string, date, required: Date that the invoice was issued, format yyyy-mm-dd
  - `dueDate` string, date, required: Due date of invoice, format yyyy-mm-dd
  - `lines` InvoiceLineRequest[], required
    - `net` integer: Net amount of invoice line in cents in original currency.
    - `vat` integer: VAT amount of invoice line in cents in original currency.
    - `vatType` string: 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. One of: {"HIGH", "MEDIUM", "LOW", "EXEMPT", "EXEMPT_IMPORT_EXPORT", "EXEMPT_REVERSE", "OUTSIDE", "NONE"}. "HIGH" is the most common.
    - `gross` integer: Gross amount of invoice line in cents.
    - `vatInPercent` number: Percentage value of VAT charged on invoice line. Should be a value between 0 and 100. Can be decimal values such as 25.5
    - `unitPrice` integer: Net price per unit in invoice currency (in cents). WARNING - if specified here and different from unitPrice of the product, then this amount overwrites the product price on the invoice.
    - `quantity` number, required: Number of units to be invoiced.
    - `discount` number: If field is set, all amounts must be given before the discount is applied. The API will calculate the new totals. Discount value should be a value between 0 and 100.
    - `productName` string: Name of product to be printed on invoice line. Should only be specified when productId is not provided.
    - `productId` integer: Product Id of product associated with invoice line.
    - `description` string: Description of the invoiced product or service. WARNING - if specified here and different from description of the product, then thisoverwrites the product description on the invoice.
    - `comment` string: Additional information to be printed on invoice.
    - `incomeAccount` string: 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. WARNING - if specified here and different from income account of the product, then this account overwrites the product account on the invoice.
  - `ourReference` string
  - `yourReference` string: Your reference for invoice, free string format
  - `orderReference` string: Reference if sending via EHF.
  - `customerId` integer, required: customerId = contactId where customer = true
  - `contactPersonId` integer: Id of the contact person. Must be associated with the provided customer.
  - `bankAccountCode` string, required: Bank account code associated with invoice, format 1920:XXXXX
  - `currency` string: ISO 4217 currency code. Defaults to "NOK" if unspecified.
  - `invoiceText` string: If not present, and standard text is registered, standard text is printed.
  - `cash` boolean, required: Payment taken in cash (True) or not (False).
  - `paymentAccount` string: For Cash Invoices only. For instance "1920:10001".
  - `projectId` integer: Optional - Associated project for the invoice to be created.
  - `roundingType` 'none' | 'round_half' | 'round_whole' | 'round_down_half' | 'round_down_whole': Type of øreavrunding (rounding) to apply to the total. 'none' means no rounding (default). 'round_half' rounds to nearest 50 øre, 'round_whole' rounds to nearest whole krone, 'round_down_half' rounds down to nearest 50 øre, 'round_down_whole' rounds down to nearest whole krone. Only applicable for NOK currency. Does not change the company's default rounding setting.

## Response `201`

Created

## Changes

- **2026-09-03** `2473dacdb89c`: 1 info
  - added the new optional request property `roundingType`
- **2021-12-08** `4813e5666340`: 1 info
  - the endpoint scheme security `fiken_api_oauth` was removed from the API

[Operation history](https://skmtc.dev/fiken/apis/fiken-api/changes/companies/:companySlug/invoices/post.md)

---

[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/29111da67f94?raw)
