sales

PUT /companies/{companySlug}/sales/drafts/{draftId}

Changed on

Updates draft with provided id.

Request

  • Base URL
    https://api.fiken.no/api/v2
  • Auth
    OAuth 2
    Authorization codehttps://fiken.no/oauth/authorize
    Token URLhttps://fiken.no/oauth/token

Path parameters

companySlugstring required

Slug of company to retrieve

draftIdinteger required

The draftId (primary key of the returned object) is returned in the GET all drafts call.

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 paid became required

    • info

      the request optional property payments/items/amountInNok became not read-only

    • info

      the invoiceNumber request property format was generalized from int64 to no format