purchases

GET /companies/{companySlug}/purchases

Changed on

Returns all purchases for given company

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

Query parameters

pageinteger

Returns the number of the page to return. Valid page values are integers from 0 to the total number of pages. Default value is 0.

pageSizeinteger

Defines the number of entries to return on each page. Maximum number of results that can be returned at one time are 100. Default value is 25.

datestring date

Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

dateLestring date

Filter based on date less than or equal to parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

dateLtstring date

Filter based on date strictly less than parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

dateGestring date

Filter based on date greater than or equal to parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

dateGtstring date

Filter based on date strictly greater than parameter value Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

lastModifiedstring date

Filter based on date of last modification. Returns results that were last modified on the date provided as a parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

lastModifiedLestring date

Returns results that have been last modified before or on the date provided as a parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

lastModifiedLtstring date

Returns results that have been last modified strictly before the date provided as a parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

lastModifiedGestring date

Returns results that have been last modified after or on the date provided as a parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

lastModifiedGtstring date

Returns results that have been last modified strictly after the date provided as a parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

sortBy'date asc' | 'date desc'

Sorts results in either ascending (asc) or descending (desc) order based on the parameter value.

paidboolean

When set to true, returns only purchases that have been paid. Otherwise false returns all purchases that have not been fully settled.

settledDatestring date

Filter based on settled date equal to parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

settledDateLestring date

Filter based on settled date less than or equal to parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

settledDateLtstring date

Filter based on settled date strictly less than parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

settledDateGestring date

Filter based on settled date greater than or equal to parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

settledDateGtstring date

Filter based on settled date strictly greater than parameter value. Dates are represented as strings formatted as YYYY-MM-DD. Example: January 1st, 1970: "1970-01-01"

contactIdinteger

Find all results for a given contact. Must be the contactId provided by a GET contacts call.

Response

OK

purchaseIdinteger

Id of given purchase.

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.

paidboolean required
currencystring required

ISO 4217 currency code

paymentAccountstring
paymentDatestring date

Payment date, format yyyy-mm-dd

kidstring

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

deletedboolean

Whether the purchase has been deleted or not

settledboolean

If the purchase as been marked as settled (True) or not (False).

settledDatestring date

Date the the purchase was marked as settled, format yyyy-mm-dd

Example response

[
  {
    "purchaseId": 2888156,
    "transactionId": 3458156,
    "date": "2018-04-03",
    "dueDate": "2018-04-03",
    "kind": "cash_purchase",
    "paid": true,
    "lines": [
      {
        "lineId": 2888156,
        "netPrice": 4500,
        "vat": 500,
        "account": "3000",
        "netPriceInCurrency": 4500,
        "vatInCurrency": 500,
        "projectId": 2815556
      }
    ],
    "supplier": {
      "contactId": 2747365,
      "createdDate": "2018-04-03",
      "lastModifiedDate": "2018-04-03",
      "name": "Fiken AS",
      "email": "kontakt@fiken.gmail",
      "organizationNumber": "913312465",
      "customerNumber": 51248,
      "customerAccountCode": "1500:20001",
      "phoneNumber": "62158537",
      "memberNumber": 5464,
      "memberNumberString": "5464",
      "supplierAccountCode": "2400:20001",
      "bankAccountNumber": "11112233334",
      "contactPerson": [
        {
          "contactPersonId": 2747365,
          "name": "Betty Boop",
          "email": "bb@gmail.com",
          "phoneNumber": "98573564",
          "address": {
            "streetAddress": "Karl Johan 34",
            "streetAddressLine2": "H0405",
            "city": "Oslo",
            "postCode": "0550",
            "country": "Norway"
          }
        }
      ],
      "notes": [
        {
          "author": "Betty Boop",
          "note": "Garage 45"
        }
      ],
      "currency": "NOK",
      "language": "Norwegian",
      "inactive": true,
      "daysUntilInvoicingDueDate": 15,
      "discount": 25,
      "address": {
        "streetAddress": "Karl Johan 34",
        "streetAddressLine2": "H0405",
        "city": "Oslo",
        "postCode": "0550",
        "country": "Norway"
      },
      "documents": [
        {
          "uuid": "745b2f15-1234-4408-8bf2-b1d2d7610cb2",
          "filename": "invoice_24760.pdf",
          "identifier": "24760",
          "type": "invoice"
        }
      ]
    },
    "currency": "NOK",
    "paymentAccount": "1920:10001",
    "paymentDate": "2018-04-03",
    "payments": [
      {
        "paymentId": 2888156,
        "date": "2018-04-03",
        "account": "1920:10001",
        "amount": 34000,
        "amountInNok": 500000,
        "currency": "NOK"
      }
    ],
    "purchaseAttachments": [
      {
        "uuid": "745b2f15-1234-4408-8bf2-b1d2d7610cb2",
        "filename": "invoice_24760.pdf",
        "identifier": "24760",
        "type": "invoice"
      }
    ],
    "kid": "5855454756",
    "project": [
      {
        "projectId": 73408306,
        "startDate": "2018-04-03",
        "endDate": "2018-04-03",
        "contact": {
          "contactId": 2747365,
          "createdDate": "2018-04-03",
          "lastModifiedDate": "2018-04-03",
          "name": "Fiken AS",
          "email": "kontakt@fiken.gmail",
          "organizationNumber": "913312465",
          "customerNumber": 51248,
          "customerAccountCode": "1500:20001",
          "phoneNumber": "62158537",
          "memberNumber": 5464,
          "memberNumberString": "5464",
          "supplierAccountCode": "2400:20001",
          "bankAccountNumber": "11112233334",
          "contactPerson": [
            {
              "contactPersonId": 2747365,
              "name": "Betty Boop",
              "email": "bb@gmail.com",
              "phoneNumber": "98573564",
              "address": {
                "streetAddress": "Karl Johan 34",
                "streetAddressLine2": "H0405",
                "city": "Oslo",
                "postCode": "0550",
                "country": "Norway"
              }
            }
          ],
          "notes": [
            {
              "author": "Betty Boop",
              "note": "Garage 45"
            }
          ],
          "currency": "NOK",
          "language": "Norwegian",
          "inactive": true,
          "daysUntilInvoicingDueDate": 15,
          "discount": 25,
          "address": {
            "streetAddress": "Karl Johan 34",
            "streetAddressLine2": "H0405",
            "city": "Oslo",
            "postCode": "0550",
            "country": "Norway"
          },
          "documents": [
            {
              "uuid": "745b2f15-1234-4408-8bf2-b1d2d7610cb2",
              "filename": "invoice_24760.pdf",
              "identifier": "24760",
              "type": "invoice"
            }
          ]
        }
      }
    ],
    "settled": true,
    "settledDate": "2024-04-03"
  }
]

Changes

    • info

      added the new optional query request parameter contactId

    • info

      added the new optional query request parameter lastModified

    • info

      added the new optional query request parameter lastModifiedGe

    • info

      added the new optional query request parameter lastModifiedGt

    • info

      added the new optional query request parameter lastModifiedLe

    • info

      added the new optional query request parameter lastModifiedLt

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      the response optional property /// became not write-only for the status

    • info

      added the new optional query request parameter date

    • info

      added the new optional query request parameter dateGe

    • info

      added the new optional query request parameter dateGt

    • info

      added the new optional query request parameter dateLe

    • info

      added the new optional query request parameter dateLt

    • info

      added the new optional query request parameter settledDate

    • info

      added the new optional query request parameter settledDateGe

    • info

      added the new optional query request parameter settledDateGt

    • info

      added the new optional query request parameter settledDateLe

    • info

      added the new optional query request parameter settledDateLt

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      the response optional property /// became not read-only for the status

    • info

      added the optional write-only property items/project/items/contact/memberNumberString to the response with the status

    • info

      added the optional write-only property items/supplier/memberNumberString to the response with the status

    • info

      the response property /// became required for the status

    • info

      response property items/project/items/contact/memberNumber deprecated

    • info

      response property items/supplier/memberNumber deprecated