Fetch a list of opening balances for a given period.
POST /accounting_api/add
Create a new accounting statement using FORM DATA.
Statement rows are given as an array, for example row[x][debit] is the debit value of the row x.
Request parameters
Name
Description
Data type
Req’d
Example
purchase_invoice_id
purchace_invoice_id
int
YES*
1
entry_date
Entry date. Leave empty for current date.
string (date)
2018-01-01
statement_series_id
Old way. Do not make new implementations after 8.8.2022. Fennoa internal identifier of the statement series. Leave empty to create statement into GL series, or look under Statement series
int
16
statement_series_code
Statement series code. Alternative to statement series id. Starting from 8.8.22
CA (see Statement series list)
description
Description of statement
string
Cash sales
*Mandatory if statement_series_code is PU. Also statement_series_code MUST be PU if purchase_invoice_id is given.
If statement_series_code parameter NOT posted at all, statement_series_code is GL.
Header fields (above) appears only once in the POST payload and they are all optional. At least two statement rows (below) must be sent along with the header data. Number of rows is not limited, but the sum of all debit fields must be equal to the sum of all credit fields. A single row must not have both debit and credit values present.
Name
Description
Data type
Req’d
Example
row[1][debit]
Debit sum for first statement row, max 2 decimals
number
YES
100.00
row[1][account]
Account for the first statement row
int
YES
4000
row[1][description]
Description for the first statement row
string
Row description
row[1][vatcode]
VAT handling (identifier) for the row. Use GET /account_api/get/vatcodes for full list of VAT handling identifiers and their functions
int
row[1][dim_{dimension_type_id}]
Dimensions for statement row. {dimension_type_id} is the id of the dimension type and it’s value is the code of the dimension.
int
row[1][dim_1] = 100 (dimension for the type ”1” would be 100)
row[1][accrual_start]
Acrual start date YYYY-MM-DD
date
2022-12-31
row[1][accrual_count]
Count of acruals
int
12
row[2][credit]
Credit sum for the second statement row, max 2 decimals
number
YES
100.00
row[2][account]
Account for the second statement row
int
YES
199999
row[2][description]
Description for the second statement row
string
row[2][vatcode]
VAT handling (identifier) for the row. Use GET /account_api/get/vatcodes for full list of VAT handling identifiers and their functions
int
row[2][dim_{dimension_type_id}]
Dimensions for statement row. {dimension_type_id} is the id of the dimension type and it’s value is the code of the dimension.
int
row[2][accrual_start]
Acrual start date YYYY-MM-DD
date
2022-12-31
row[2][accrual_count]
Count of acruals
int
12
Response
Response code
Description
200
Ok, adding a statement was successfull
400
Unable to add a statement. Further information can be found from the errors array in response JSON
401
API key / company code is invalid or the user does not have permission to add statements
405
Invalid method, double check you are sending ”POST” and not ”GET” etc
503
Service Unavailable
Name
Description
Data type
Possible values / Examples
status
Status of the operation
string
OK / ERROR
id
If adding a statement was successfull, id contains unique identifier for the newly created statement
int
1234
statement_number
Statement number
int
5
statement_series_code
Statement series code Starting from 8.8.22
string
GL (see Statement series list)
statement_series_id
Old way. Only if POST statement_series_id or no statement_series_id or_statement_series_code. Do not make new implementations after 8.8.2022. Fennoa internal identifier of the statement series.
int
16
Statement series
Following statement serias are available to POST (add).
Statement series name
Series code
statement_series_id
Payroll
PJ
5
Depreciation
DE
13
Cash
CA
16
Imported
OLD
18
Financial statement
FS
21
Tax account
TA
22
General ledger 1
GL
1
General ledger 2
GL2
29
General ledger 3
GL3
30
General ledger 4
GL4
31
General ledger 5
GL5
32
General ledger 6
GL6
33
Purchace invoice*
PU
3
*Only for adding statement to purchace invoice already saved to Fennoa.
POST /accounting_api/do/upload_attachment
Add an attachment to a statement. PDF-format is recommended, but JPEG or PNG are also supported.
Request parameters
Request parameters are given as part of the URL as follows:
/accounting_api/do/upload_attachment/<id>
Name
Description
Data type
Req’d
Example
id
Unique identifier of a statement
int
100
Form data
Content type must be multipart/form-data which is used to send binary data to the server. Form-data contains one field ”file” that is the actual file upload.
Name
Description
Data type
Req’d
Example
file
File to upload
file
YES
Response
Response code
Description
200
Ok, file uploaded successfully and attached to the statement
400
Error receiving the file
401
API key / company code is invalid or the user does not have permission
405
Invalid method, double check you are sending ”POST” and not ”GET” etc
503
Service Unavailable
Name
Description
Data type
Possible values / Examples
status
Status of the operation
string
OK / ERROR
data
Description of the status (if stataus = OK)
string
File stored.
GET /accounting_api/get/account_balance
Fetch the balance of a given account and date.
Request parameters are given as part of the URL as follows: