GET

Description

Retrieves a list of contract accruals or a single contract accrual.

URL structure

https://api.fortnox.se/3/contractaccruals/{DocumentNumber}

Method

GET

Version

3

Response

The contract accruals register can return a list of records or a single record. By specifying a DocumentNumber in the URL, a single record will be returned. Not specifying a DocumentNumber will return a list of records.

<?xml version="1.0" encoding="UTF-8"?>
<ContractAccruals TotalResources="3" TotalPages="1" CurrentPage="1">
  <ContractAccrualSubset url="https://api.fortnox.se/3/invoiceaccruals/8">
    <Description>Periodisering av avtalsfaktura 8</Description>
    <DocumentNumber>8</DocumentNumber>
    <Period>MONTHLY</Period>
  </ContractAccrualSubset>

  [...]

  <ContractAccrualSubset url="https://api.fortnox.se/3/invoiceaccruals/10">
    <Description>Periodisering av avtalsfaktura 10</Description>
    <DocumentNumber>10</DocumentNumber>
    <Period>MONTHLY</Period>
  </ContractAccrualSubset>
</ContractAccruals>
<?xml version="1.0" encoding="UTF-8"?>
<ContractAccrual url="https://api.fortnox.se/3/contractaccruals/10">
  <AccrualAccount>2990</AccrualAccount>
  <CostAccount>3990</CostAccount>
  <Description>Periodisering av avtalsfaktura 10</Description>
  <AccrualRows>
    <InvoiceAccrualRow>
      <Account>2990</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>17997</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </InvoiceAccrualRow>
    <InvoiceAccrualRow>
      <Account>3990</Account>
      <CostCenter></CostCenter>
      <Credit>17997</Credit>
      <Debit>0</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </InvoiceAccrualRow>
  </AccrualRows>
  <DocumentNumber>10</DocumentNumber>
  <Period>MONTHLY</Period>
  <Times>1</Times>
  <Total>17997</Total>
  <VATIncluded>false</VATIncluded>
</ContractAccrual>
{
  "MetaInformation": {
    "@TotalResources": 3,
    "@TotalPages": 1,
    "@CurrentPage": 1
  },
  "ContractAccruals": [
    {
      "@url": "https://api.fortnox.se/3/invoiceaccruals/8",
      "Description": "Periodisering av avtalsfaktura 8",
      "DocumentNumber": 8,
      "Period": "MONTHLY"
    },

    [...]

    {
      "@url": "https://api.fortnox.se/3/invoiceaccruals/10",
      "Description": "Periodisering av avtalsfaktura 10",
      "DocumentNumber": 10,
      "Period": "MONTHLY"
    }
  ]
}
{
  "ContractAccrual": {
    "@url": "https://api.fortnox.se/3/contractaccruals/10",
    "AccrualAccount": 2990,
    "CostAccount": 3990,
    "Description": "Periodisering av avtalsfaktura 10",
    "AccrualRows": [
      {
        "Account": 2990,
        "CostCenter": "",
        "Credit": 0,
        "Debit": 17997,
        "Project": "",
        "TransactionInformation": ""
      },
      {
        "Account": 3990,
        "CostCenter": "",
        "Credit": 17997,
        "Debit": 0,
        "Project": "",
        "TransactionInformation": ""
      }
    ],
    "DocumentNumber": 10,
    "Period": "MONTHLY",
    "Times": 1,
    "Total": 17997,
    "VATIncluded": false
  }
}

POST

Description

Creates a contract accrual.

URL structure

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

Method

POST

Version

3

Request

The request body should contain a structure of a contract accrual, either in JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<ContractAccrual>
  <AccrualAccount>2990</AccrualAccount>
  <CostAccount>3990</CostAccount>
  <AccrualRows>
    <InvoiceAccrualRow>
      <Account>2990</Account>
      <Credit>0</Credit>
      <Debit>2999</Debit>
    </InvoiceAccrualRow>
    <InvoiceAccrualRow>
      <Account>3990</Account>
      <Credit>2999</Credit>
      <Debit>0</Debit>
    </InvoiceAccrualRow>
  </AccrualRows>
  <DocumentNumber>2</DocumentNumber>
  <Total>2999</Total>
</ContractAccrual>
{
  "ContractAccrual": {
    "AccrualAccount": 2990,
    "CostAccount": 3990,
    "AccrualRows": [
      {
        "Account": 2990,
        "Credit": 0,
        "Debit": 2999
      },
      {
        "Account": 3990,
        "Credit": 2999,
        "Debit": 0
      }
    ],
    "DocumentNumber": 2,
    "Total": 2999
  }
}

Response

The response should contain the created contract accrual in either JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<ContractAccrual url="https://api.fortnox.se/3/contractaccruals/2">
  <AccrualAccount>2990</AccrualAccount>
  <CostAccount>3990</CostAccount>
  <Description></Description>
  <AccrualRows>
    <InvoiceAccrualRow>
      <Account>2990</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>2999</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </InvoiceAccrualRow>
    <InvoiceAccrualRow>
      <Account>3990</Account>
      <CostCenter></CostCenter>
      <Credit>2999</Credit>
      <Debit>0</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </InvoiceAccrualRow>
  </AccrualRows>
  <DocumentNumber>2</DocumentNumber>
  <Period>MONTHLY</Period>
  <Times>1</Times>
  <Total>2999</Total>
  <VATIncluded>false</VATIncluded>
</ContractAccrual>
{
  "ContractAccrual": {
    "@url": "https://api.fortnox.se/3/contractaccruals/2",
    "AccrualAccount": 2990,
    "CostAccount": 3990,
    "Description": null,
    "AccrualRows": [
      {
        "Account": 2990,
        "CostCenter": "",
        "Credit": 0,
        "Debit": 2999,
        "Project": "",
        "TransactionInformation": ""
      },
      {
        "Account": 3990,
        "CostCenter": "",
        "Credit": 2999,
        "Debit": 0,
        "Project": "",
        "TransactionInformation": ""
      }
    ],
    "DocumentNumber": 2,
    "Period": "MONTHLY",
    "Times": 1,
    "Total": 2999,
    "VATIncluded": false
  }
}

PUT

Description

Updates a contract accrual.

URL structure

https://api.fortnox.se/3/contractaccruals/{DocumentNumber}

Method

PUT

Version

3

Request

The request body should contain a structure of a contract accrual, either in JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<ContractAccrual>
  <AccrualAccount>2990</AccrualAccount>
  <CostAccount>3311</CostAccount>
  <AccrualRows>
    <InvoiceAccrualRow>
      <Account>2990</Account>
      <Credit>0</Credit>
      <Debit>2999</Debit>
    </InvoiceAccrualRow>
    <InvoiceAccrualRow>
      <Account>3311</Account>
      <Credit>2999</Credit>
      <Debit>0</Debit>
    </InvoiceAccrualRow>
  </AccrualRows>
</ContractAccrual>
{
  "ContractAccrual": {
    "AccrualAccount": 2990,
    "CostAccount": 3311,
    "AccrualRows": [
      {
        "Account": 2990,
        "Credit": 0,
        "Debit": 2999
      },
      {
        "Account": 3311,
        "Credit": 2999,
        "Debit": 0
      }
    ]
  }
}

Response

The response should contain the updated contract accrual in either JSON or XML.

<?xml version="1.0" encoding="UTF-8"?>
<ContractAccrual url="https://api.fortnox.se/3/contractaccruals/2">
  <AccrualAccount>2990</AccrualAccount>
  <CostAccount>3311</CostAccount>
  <Description></Description>
  <AccrualRows>
    <InvoiceAccrualRow>
      <Account>2990</Account>
      <CostCenter></CostCenter>
      <Credit>0</Credit>
      <Debit>2999</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </InvoiceAccrualRow>
    <InvoiceAccrualRow>
      <Account>3311</Account>
      <CostCenter></CostCenter>
      <Credit>2999</Credit>
      <Debit>0</Debit>
      <Project>0</Project>
      <TransactionInformation></TransactionInformation>
    </InvoiceAccrualRow>
  </AccrualRows>
  <DocumentNumber>2</DocumentNumber>
  <Period>MONTHLY</Period>
  <Times>1</Times>
  <Total>2999</Total>
  <VATIncluded>false</VATIncluded>
</ContractAccrual>
{
  "ContractAccrual": {
    "@url": "https://api.fortnox.se/3/contractaccruals/2",
    "AccrualAccount": 2990,
    "CostAccount": 3311,
    "Description": null,
    "AccrualRows": [
      {
        "Account": 2990,
        "CostCenter": "",
        "Credit": 0,
        "Debit": 2999,
        "Project": "",
        "TransactionInformation": ""
      },
      {
        "Account": 3311,
        "CostCenter": "",
        "Credit": 2999,
        "Debit": 0,
        "Project": "",
        "TransactionInformation": ""
      }
    ],
    "DocumentNumber": 2,
    "Period": "MONTHLY",
    "Times": 1,
    "Total": 2999,
    "VATIncluded": false
  }
}

DELETE

Description

Removes a contract accrual.

URL structure

https://api.fortnox.se/3/contractaccruals/{DocumentNumber}

Method

DELETE

Version

3

Request

The request body should be empty.

Response

The response body should be empty.

Fields

Contract Accrual

Field Description Limits Type Searchable Sortable Required R/W
Url Direct URL to the record String R
AccrualAccount Account for the accrual 4 digits Integer Yes R/W
CostAccount Account for the cost 4 digits Integer Yes R/W
Description Description String R/W
AccrualRows Yes
DocumentNumber Document number Integer Yes R/W
Period Type of period MONTHLY / BIMONTHLY / QUARTERLY / SEMIANNUALLY / ANNUALLY String R
Times Total times of accruals Integer R
Total Total of the accrual Float Yes R/W
VATIncluded Is VAT included Boolean R/W

Contract Accrual Row

Field Description Limits Type Searchable Sortable Required R/W
Account Account number 4 digits Integer R/W
CostCenter Code of the cost center String R/W
Credit Credit Float R/W
Debit Debit Float R/W
Project Project number String R/W
TransactionInformation Transaction information String R/W