fio-bank-transaction-history
Version:
Unofficial FIO BANK module to get FIO bank account transaction history
145 lines (99 loc) • 3.49 kB
Markdown

[](https://www.npmjs.com/package/fio-bank-transaction-history) [](https://www.npmjs.com/package/fio-bank-transaction-history)
> **Unofficial** FIO BANK module to get FIO bank account transaction history
:heavy_check_mark: **FROM - TO** date request
:heavy_check_mark: **LAST X days** request
```sh
npm install --save fio-bank-transaction-history
```
```js
const fio = require('fio-bank-transaction-history');
fio.setToken(" < YOUR FIO TOKEN >");
// Transactions in the last X days of the account history
fio.getHistoryForLastDays(6)
.then((jsonResult) => {
console.log(jsonResult);
})
.catch((error) => {
console.log(error);
});
// FROM - TO date function to access the account history
fio.getHistoryFromToDate("2021-02-13", "2021-03-13")
.then((jsonResult) => {
console.log(jsonResult);
})
.catch((error) => {
console.log(error);
});
```
```js
// For date format use moment.js
// To get today date in required format use
moment().format("YYYY-MM-DD");
// To find out if a transaction is "credit" or "debit"
// just check the value of column1 "objem" (X > 0)?
```
```js
// Set different FIO URL
// Default is : https://www.fio.cz/ib_api/rest/periods/
fio.setURL(url);
// For debugging to see the called URL (can be tested in browser)
// Default is: false
fio.showRequestURL(true);
```
```js
// Full call response
accountStatement: {
info: {
accountId: '2612345678',
bankId: '8330',
currency: 'EUR',
iban: 'SK4783300000002612345678',
bic: 'FIOZSKBAXXX',
openingBalance: 1000.00,
closingBalance: 2000.00,
dateStart: '2021-03-17+0100',
dateEnd: '2021-03-23+0100',
yearList: null,
idList: null,
idFrom: 11111111111,
idTo: 11111111111,
idLastDownload: null
},
transactionList: { transaction: [Array] }
```
```js
// Single transaction from transactionList
// Example: result.accountStatement.transactionList.transaction[0]
column0: { value: '2021-02-13+0100', name: 'Datum', id: 0 },
column1: { value: -8.88, name: 'Objem', id: 1 },
column5: { value: '1349', name: 'VS', id: 5 },
...
```
```code
So if you need to access the CURRENCY for example you call
result.accountStatement.transactionList.transaction[0].column14.value;
```

## :package: Sibling
For **posting payment requests** to FIO BANK please use package
```sh
require('fio-bank-payment-request');
```
For bug reports and feature requests, open issues. :bug:
Have an idea? Found a bug? Let me know :thumbsup:
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
- *BOLT Driver Management*
[] © Oliver Goossens