Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scharrier/qonto-ruby
Unofficial Qonto Api Ruby client
https://github.com/scharrier/qonto-ruby
banking client rest-api
Last synced: about 2 months ago
JSON representation
Unofficial Qonto Api Ruby client
- Host: GitHub
- URL: https://github.com/scharrier/qonto-ruby
- Owner: scharrier
- License: mit
- Created: 2017-09-17T22:07:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-06T11:36:44.000Z (about 1 year ago)
- Last Synced: 2024-02-23T06:22:54.120Z (11 months ago)
- Topics: banking, client, rest-api
- Language: Ruby
- Homepage: http://qonto.eu
- Size: 27.3 KB
- Stars: 9
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Qonto API Ruby Client
The Qonto API Ruby client provides convenient access to the Qonto API from applications written in Ruby language.
It is currently up to date with the `v2` version. Qonto API documentation is avaible at https://api-doc.qonto.eu.This project is not affiliated with the Qonto company in any way.
## Installation
Add this line to your application's Gemfile:
gem 'qonto'
And then execute:
$ bundle
Or install it yourself as:
$ gem install qonto
## Requirements
* Ruby 2.1+.
## Usage
The library needs to be configured with your account's secret key and organization
slug which are available in your organization dashboard on http://qonto.eu.require 'qonto'
# Initialize your client
client = Qonto::Client.new(slug: 'your-organization-slug', secret_key: 'your-secret-key')You can retrieve your organization bank accounts by calling `get_organization`:
# Retrieve your organization object
organization = client.get_organization
bank_account = organization.bank_accounts.first# Balance is available for each bank account
puts "Balance: #{bank_account.balance} €"You can list transactions for a given bank account by calling `list_transactions`:
# Paginate through the pending transactions
transactions = client.list_transactions(
bank_account: bank_account,
per_page: 10,
current_page: 2,
status: ['pending']
)transactions.each do |transaction|
puts " #{transaction.side} (#{transaction.status}): #{transaction.amount} #{transaction.currency} - #{transaction.label}"
endIf a request returns an error, the client raises a `Qonto::Error`. This can be simply
handled by a `begin/rescue` block:begin
organization = client.get_organization
puts "Balance: #{organization.bank_accounts.first.balance} €"
rescue Qonto::Error => e
puts "Oops: #{e.to_s}"
end## Development
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests.
To install this gem onto your local machine, run `bundle exec rake install`.