purchases

POST /companies/{companySlug}/purchases

Changed on

Creates a new purchase.

Request

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

Request body

transactionIdinteger
identifierstring

Invoice/sale number or similar.

datestring date required

Payment date, format yyyy-mm-dd

dueDatestring date

Due date of the invoice, format yyyy-mm-dd

kind'cash_purchase' | 'supplier' required

Purchased with cash or through a supplier.

supplierIdinteger

Id of supplier if not a cash purchase.

currencystring required

ISO 4217 currency code

paymentAccountstring
paymentDatestring date

Payment date, format yyyy-mm-dd

paymentAmountInNokinteger

Required when creating a purchase with payment in a foreign currency. This is the actual NOK amount paid from the bank account. Formatted in cents (115000 = 1150.00 NOK)

kidstring

Norwegian KID number. Number from 2 to 25 digits long.

projectIdinteger

Id of given project.

Example request

{
  "transactionId": 3458156,
  "date": "2018-04-03",
  "dueDate": "2018-04-03",
  "kind": "cash_purchase",
  "lines": [
    {
      "lineId": 2888156,
      "netPrice": 4500,
      "vat": 500,
      "account": "3000",
      "netPriceInCurrency": 4500,
      "vatInCurrency": 500,
      "projectId": 2815556
    }
  ],
  "supplierId": 2888156,
  "currency": "NOK",
  "paymentAccount": "1920:10001",
  "paymentDate": "2018-04-03",
  "paymentAmountInNok": 115000,
  "kid": "5855454756",
  "projectId": 2888156
}

Response

Created

Changes

    • info

      the request optional property // became not write-only

    • breaking

      the request property // became required

    • info

      added the new optional request property