You have just found the Ruby-flavored client of Fintoc. It mainly consists of a port (more of a carbon copy, really) of fintoc-python.
You can think of Fintoc API as a piscola.
And the key ingredient to a properly made piscola are the ice cubes.
Sure, you can still have a piscola without ice cubes.
But hey… that’s not enjoyable -- why would you do that?
Do yourself a favor: go grab some ice cubes by installing this refreshing library.
Add this line to your application's Gemfile:
gem 'fintoc'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install fintoc
- Get your API key and link your bank account using the Fintoc dashboard.
- Open your command-line interface.
- Write a few lines of Ruby code to see your bank movements.
require 'fintoc'
client = Fintoc::Client.new('api_key')
link = client.link('link_token')
account = link.find(type: 'checking_account')
#Get the las 30 movements
movements = account.get_movements
#Or get the all the movements since
movements = account.get_movements(since: '2020-08-15')
And that’s it!
require 'fintoc'
client = Fintoc::Client.new('api_key')
link = client.get_link('link_token')
accounts = link.get_accounts
puts accounts
# Or... you can pretty print all the accounts in a Link
link = client.get_link('link_token')
link.show_accounts
If you want to find a specific account in a link, you can use find. You can search by any account field:
require 'fintoc'
client = Fintoc::Client.new('api_key')
link = client.get_link('link_token')
account = link.find(type: 'checking_account')
# or
account = link.find(number: '1111111')
# or
account = link.find(id: 'sdfsdf234')
You can also search for multiple accounts matching a specific criteria with find_all:
require 'fintoc'
client = Fintoc::Client.new('api_key')
link = client.get_link('link_token')
accounts = link.find_all(currency: 'CLP')
To update the account balance you can use update_balance:
require 'fintoc'
client = Fintoc::Client.new('api_key')
link = client.get_link('link_token')
account = link.find(number: '1111111')
account.update_balance
require 'fintoc'
require 'time'
client = Fintoc::Client.new('api_key')
link = client.get_link('link_token')
account = link.find(type: 'checking_account')
# You can get the account movements since a specific Date
yesterday = DateTime.now - 1
account.get_movements(since: yesterday)
# Or... you can use an ISO 8601 formatted string representation of the Date
account.get_movements(since: '2020-01-01')
Calling get_movements without arguments gets the last 30 movements of the account
This project relies on the following packages:
You can run all the tests just by running:
rspec
Bug reports and pull requests are welcome on GitHub at https://github.com/fintoc-com/fintoc.