purchases

POST /companies/{companySlug}/purchases/drafts

Changed on

Creates a purchase draft.

Request

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

Request body

invoiceIssueDatestring date

Issue date of the draft, format yyyy-mm-dd

dueDatestring date

Due date of draft, format yyyy-mm-dd

invoiceNumberstring

If invoice associated with draft, this is the invoice number (not to be confused with the invoiceId of an invoice issued from Fiken)

contactIdinteger

Contact Id

projectIdinteger

Project ID if only 1 project associated with entire draft. It is also possible to specify the project on individual draft lines

cashboolean required

If a cash sale/purchase (true) or otherwise (false)

currencystring

ISO 4217 currency code

kidstring

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

paidboolean required

Whether the sale/purchase has been paid (true) or not (false)

Example request

{
  "invoiceIssueDate": "2018-04-03",
  "dueDate": "2018-04-03",
  "invoiceNumber": "NOEE2888156",
  "contactId": 2888156,
  "projectId": 2888156,
  "currency": "NOK",
  "kid": "5855454756",
  "payments": [
    {
      "paymentId": 2888156,
      "date": "2018-04-03",
      "account": "1920:10001",
      "amount": 34000,
      "amountInNok": 500000,
      "currency": "NOK"
    }
  ],
  "lines": [
    {
      "incomeAccount": "3000",
      "net": 25000,
      "gross": 30000,
      "projectId": 2888156
    }
  ]
}

Response

Created

Changes

    • breaking

      the request property became required

    • info

      the request optional property // became not read-only

    • info

      the request property format was generalized from int64 to no format

    • info

      the endpoint scheme security fiken_api_oauth was removed from the API