List all salary transactions

URL

https://api.fortnox.se/3/salarytransactions

Method

GET

Description

Lists all salary transactions for all employees. Supports query-string parameters employeeid and date for filtering the result.

Response

{
  "MetaInformation": {
    "@TotalResources": 2,
    "@TotalPages": 1,
    "@CurrentPage": 1
  },
  "SalaryTransactions": [
    {
      "@url": "https://api.fortnox.se/3/salarytransactions/1964",
      "EmployeeId": "9978",
      "SalaryCode": "133",
      "SalaryRow": 1964,
      "Date": "2016-12-13",
      "Number": "0",
      "Amount": "0",
      "Total": "500",
      "Expense": "",
      "VAT": "0",
      "TextRow": ""
    },
    {
      "@url": "https://api.fortnox.se/3/salarytransactions/1965",
      "EmployeeId": "9978",
      "SalaryCode": "892",
      "SalaryRow": 1965,
      "Date": "2016-12-14",
      "Number": "0",
      "Amount": "0",
      "Total": "750",
      "Expense": "1",
      "VAT": "150",
      "TextRow": ""
    }
  ]
}
<?xml version="1.0" encoding="UTF-8"?>
<SalaryTransactions TotalResources="2" TotalPages="1" CurrentPage="1">
    <SalaryTransactionSubset url="https://api-fn3-sl.utv.fortnox.local/3/salarytransactions/1964">
        <EmployeeId>9978</EmployeeId>
        <SalaryCode>133</SalaryCode>
        <SalaryRow>1964</SalaryRow>
        <Date>2016-12-13</Date>
        <Number>0</Number>
        <Amount>0</Amount>
        <Total>500</Total>
        <Expense/>
        <VAT>0</VAT>
        <TextRow/>
    </SalaryTransactionSubset>
    <SalaryTransactionSubset url="https://api-fn3-sl.utv.fortnox.local/3/salarytransactions/1965">
        <EmployeeId>9978</EmployeeId>
        <SalaryCode>892</SalaryCode>
        <SalaryRow>1965</SalaryRow>
        <Date>2016-12-14</Date>
        <Number>0</Number>
        <Amount>0</Amount>
        <Total>750</Total>
        <Expense>1</Expense>
        <VAT>150</VAT>
        <TextRow/>
    </SalaryTransactionSubset>
</SalaryTransactions>

Retrieve a salary transaction

URL

https://api.fortnox.se/3/salarytransactions/{SalaryRow}

Method

GET

Description

Retrieves a single salary transaction

Response

{
  "SalaryTransaction": {
    "EmployeeId": "9978",
    "SalaryCode": "133",
    "SalaryRow": 1964,
    "Date": "2016-12-13",
    "Number": "0",
    "Amount": "0",
    "Total": "500",
    "Expense": "",
    "VAT": "0",
    "TextRow": ""
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<SalaryTransaction>
    <EmployeeId>9978</EmployeeId>
    <SalaryCode>133</SalaryCode>
    <SalaryRow>1964</SalaryRow>
    <Date>2016-12-13</Date>
    <Number>0</Number>
    <Amount>0</Amount>
    <Total>500</Total>
    <Expense/>
    <VAT>0</VAT>
    <TextRow/>
</SalaryTransaction>

Create a salary transaction

URL

https://api.fortnox.se/3/salarytransactions

Method

POST

Description

Creates a new salary transaction for an employee.

Usable “SalaryCode”s:

You can get a list of usable salary codes from Register, Lönearter och koder, Lönearter by choosing one of two tables and printing (Utskrift in the toolbar).
Depending on which salary code table (löneartstabell) that is set in the settings (Inställningar, Lön, Avtal för arbetare/tjänsteman – Allmänt) you can choose the salary code to use from either salary code table. Make sure to use the correct table that is used for the employee (Register, Personal, Anställning, Personaltyp) you want to sent the salary transaction for. Some salary codes do not exist in every table.

Request

{
  "SalaryTransaction": {
    "EmployeeId": "9978",
    "SalaryCode": "1321",
    "Date": "2017-01-13",
    "Number": "10",
    "Amount": "200"
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<SalaryTransaction>
    <EmployeeId>9978</EmployeeId>
    <SalaryCode>1321</SalaryCode>
    <Date>2017-01-13</Date>
    <Number>10</Number>
    <Amount>200</Amount>
</SalaryTransaction>

Response

{
  "SalaryTransaction": {
    "EmployeeId": "9978",
    "SalaryCode": "1321",
    "SalaryRow": 1966,
    "Date": "2017-01-13",
    "Number": "10",
    "Amount": "200",
    "Total": "2000",
    "Expense": "",
    "VAT": "0",
    "TextRow": ""
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<SalaryTransaction>
    <EmployeeId>9978</EmployeeId>
    <SalaryCode>1321</SalaryCode>
    <SalaryRow>1966</SalaryRow>
    <Date>2017-01-13</Date>
    <Number>10</Number>
    <Amount>200</Amount>
    <Total>2000</Total>
    <Expense/>
    <VAT>0</VAT>
    <TextRow/>
</SalaryTransaction>

Update a salary transaction

URL

https://api.fortnox.se/3/salarytransactions/{SalaryRow}

Method

PUT

Description

Updates a salary transaction.

Usable “SalaryCode”s:

You can get a list of usable salary codes from Register, Lönearter och koder, Lönearter by choosing one of two tables and printing (Utskrift in the toolbar).
Depending on which salary code table (löneartstabell) that is set in the settings (Inställningar, Lön, Avtal för arbetare/tjänsteman – Allmänt) you can choose the salary code to use from either salary code table. Make sure to use the correct table that is used for the employee (Register, Personal, Anställning, Personaltyp) you want to sent the salary transaction for. Some salary codes do not exist in every table.

Request

{
  "SalaryTransaction": {
    "Number": "20"
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<SalaryTransaction>
    <Number>20</Number>
</SalaryTransaction>

Response

{
  "SalaryTransaction": {
    "EmployeeId": "9978",
    "SalaryCode": "1321",
    "SalaryRow": 1966,
    "Date": "2017-01-13",
    "Number": "20",
    "Amount": "200",
    "Total": "4000",
    "Expense": "",
    "VAT": "0",
    "TextRow": ""
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<SalaryTransaction>
    <EmployeeId>9978</EmployeeId>
    <SalaryCode>1321</SalaryCode>
    <SalaryRow>1966</SalaryRow>
    <Date>2017-01-13</Date>
    <Number>20</Number>
    <Amount>200</Amount>
    <Total>4000</Total>
    <Expense/>
    <VAT>0</VAT>
    <TextRow/>
</SalaryTransaction>

 

Delete a salary transaction

URL

https://api.fortnox.se/3/salarytransactions/{SalaryRow}

Method

DELETE

Description

Removes a single salary transaction

 

Properties

Field Type Access Description
EmployeeId  String (15) RW Unique employee-id
SalaryCode String (6) RW Salary code
SalaryRow Integer R Unique row ID
Date Date RW Date
Number Float RW Number of #
Amount Float RW Cost per # in SEK
Total Float RW Sum in SEK
Expense String (6) RW Expense code from the expense registry
VAT Float RW Sum VAT
TextRow String (40) RW Optional additional text relating to the salary transaction

The settings of the salary code determines which fields are allowed to be set, updated, and registered. For instance you cannot create a ‘BONUS’ salary transaction using Number and Amount. For many salary codes the settings may automatically set the value of Total to Number * Amount. The API does not throw validation errors around this, but the incoming data is processed through these rules nonetheless.