GET
Description
Retrieves a list of financial years or a single financial year.
URL structure
https://api.fortnox.se/3/financialyears/{Id}
Method
GET
Version
3
Response
The financial year register can return a list of records or a single record. By specifying an Id in the URL, a single record will be returned. Not specifying an Id will return a list of records.
<?xml version="1.0" encoding="UTF-8"?> <FinancialYears TotalResources="5" TotalPages="1" CurrentPage="1"> <FinancialYearSubset url="https://api.fortnox.se/3/financialyears/5"> <Id>5</Id> <FromDate>2013-01-01</FromDate> <ToDate>2013-12-31</ToDate> <accountCharts>från föregående år</accountCharts> <AccountingMethod>ACCRUAL</AccountingMethod> </FinancialYearSubset> [...] <FinancialYearSubset url="https://api.fortnox.se/3/financialyears/1"> <Id>1</Id> <FromDate>2009-01-01</FromDate> <ToDate>2009-12-31</ToDate> <accountCharts>från föregående år</accountCharts> <AccountingMethod>ACCRUAL</AccountingMethod> </FinancialYearSubset> </FinancialYears>
<?xml version="1.0" encoding="UTF-8"?> <FinancialYear url="https://api.fortnox.se/3/financialyears/1"> <Id>1</Id> <FromDate>2009-01-01</FromDate> <ToDate>2009-12-31</ToDate> <AccountChartType></AccountChartType> <AccountingMethod>ACCRUAL</AccountingMethod> </FinancialYear>
{ "MetaInformation": { "@TotalResources": 5, "@TotalPages": 1, "@CurrentPage": 1 }, "FinancialYears": [ { "@url": "https://api.fortnox.se/3/financialyears/5", "Id": 5, "FromDate": "2013-01-01", "ToDate": "2013-12-31", "accountCharts": "från föregående år.", "AccountingMethod": "ACCRUAL" }, [...] { "@url": "https://api.fortnox.se/3/financialyears/1", "Id": 1, "FromDate": "2009-01-01", "ToDate": "2009-12-31", "accountCharts": "från föregående år.", "AccountingMethod": "ACCRUAL" } ] }
{ "FinancialYear": { "@url": "https://api.fortnox.se/3/financialyears/1", "Id": 1, "FromDate": "2009-01-01", "ToDate": "2009-12-31", "AccountChartType": null, "AccountingMethod": "ACCRUAL" } }
POST
Description
Creates a financial year
URL structure
https://api.fortnox.se/3/financialyears
Method
POST
Version
3
Request
The request body should contain a structure of a financial year, either in JSON or XML.
Response
The response should contain the created financial year in either JSON or XML.
<?xml version="1.0" encoding="UTF-8"?> <FinancialYear url="https://api.fortnox.se/3/financialyears/6"> <Id>6</Id> <FromDate>2014-01-01</FromDate> <ToDate>2014-12-31</ToDate> <AccountChartType></AccountChartType> </FinancialYear>
{ "FinancialYear": { "@url": "https://api.fortnox.se/3/financialyears/6", "Id": 6, "FromDate": "2014-01-01", "ToDate": "2014-12-31", "AccountChartType": "" } }
Search
It is possible to find a financial year based on a date, this is done by a search with the parameter “date”.
For example:
https://api.fortnox.se/3/financialyears/?date=2014-06-30
Fields
Field | Description | Limits | Type | Searchable | Sortable | Required | R/W |
Url | Direct URL to the record | – | String | – | – | – | R |
Id | The ID of the financial year | – | Integer | – | Yes | – | R |
FromDate | Start date of the financial year | – | Date | Yes | Yes | Yes | R/W |
ToDate | End date of the financial year | – | Date | Yes | Yes | Yes | R/W |
AccountChartType/ accountCharts |
Type of the account chart | Valid account chart type, see “Account Charts”. If empty, the type from the previous year will be used. | String | – | – | – | R/W |
AccountingMethod | Accounting Method | ACCRUAL, CASH | String | No | No | Yes | R/W |