Mono Ruby Library
The Mono Ruby library provides convenient access to the Mono API from applications written in Ruby.
For connecting customer accounts in the browser or an app, use the Mono Connect Widget.
Documentation
For complete information about the API, head to the docs.
Getting Started
- Register on the Mono website and get your public and secret keys.
- Setup your Mono Connect Widget with your Mono public key.
Installation
Add this line to your application's Gemfile:
gem 'mono_ruby'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install mono_ruby
Usage
The package needs to be configured with your account's secretKey
, which is
available in the Mono Dashboard.
monoClient = MonoRuby::Mono.new({
"secretKey" => "live_sk_..."
})
Features
- Wallet Balance
- Get Account ID from Auth Code
- Unlink Account
- Account Information
- Account Statement
- Poll Account Statement PDF
- Transactions
- Credits
- Debits
- Income Information
- Identity
- Sync Data
- Re-auth Code
- Institutions
Implementation
Methods
Once an instance of the client has been created you use the following methods:
This resource allows you to check the available balance in your Mono wallet
walletBalance = monoClient.getWalletBalance
This resource returns the account id (that identifies the authenticated account) after successful enrolment on the Mono Connect Widget.
accountIdGet = monoClient.getAccountId({"code" => "code_ir9FIYb5HvNcb1tVe9Dp"})
This resource provides your customers with the option to unlink their financial account(s)
unlink = monoClient.unlinkAccount({"accountId" => "6094b18f7f87041b24cb8bc1"})
This resource returns the account details with the financial institution.
accountInfo = monoClient.getAccountInformation({"accountId" => accountId})
This resource returns the bank statement of the connected financial account in JSON.
You can query 1-12 months bank statement in one single call.
accountStatement = monoClient.getAccountStatement({
"accountId" => "6094b18f7f87041b24cb8bc1",
"period" => "last2months",
"output" => "json"
})
Get Account Statement in PDF
This resource returns the bank statement of the connected financial account in PDF.
You can query 1-12 months bank statement in one single call.
accountStatement = monoClient.getAccountStatement({
"accountId" => "6094b18f7f87041b24cb8bc1",
"period" => "last2months",
"output" => "pdf"
})
With this resource, you set the output as PDF, and you can use this endpoint to poll the status
pollAccountStatement = monoClient.pollPdfAccountStatementStatus({
"accountId" => "6094b18f7f87041b24cb8bc1",
"jobId" => "EqCjlqWoxWu2AgRsMSxX"
})
This resource returns the known transactions on the account.
accountTransactions = monoClient.getAccountTransactions({
"accountId" => "6094b18f7f87041b24cb8bc1",
"paginate" => true,
"limit" => 10
})
This resource returns the historical credits on the account
customerCredits = monoClient.getCredits({"accountId" => "6094b18f7f87041b24cb8bc1"})
This resource returns the historical debits on the account
customerDebits = monoClient.getDebits({"accountId" => "6094b18f7f87041b24cb8bc1"})
This resource will return income information on the account.
accountIncome = monoClient.getIncome({"accountId" => "6094b18f7f87041b24cb8bc1"})
Note: This is a number estimated by Mono. It is not nesecarrily 100% correct, however, a confidence interval is provided to show the estimations accuracy.
This resource returns a high level overview of an account identity data.
identity = monoClient.getIdentity({"accountId" => "6094b18f7f87041b24cb8bc1"})
Note: Not all banks return identity information. See Coverage
This resource attempts to Sync data manually.
dataSync = monoClient.syncDataManually({"accountId" => "6094b18f7f87041b24cb8bc1"})
Note: This may require some users to re-authorize their bank account with Mono. See Re-authorization
This resource returns a Re-auth code which is a mono generated code for the account you want to re-authenticate,
reCode = monoClient.reauthCode({"accountId" => "6094b18f7f87041b24cb8bc1"})
This resource returns the available institutions on Mono
institutions = monoClient.getInstitutions
Support
If you're having general trouble with Mono Ruby or your Mono integration, please reach out to us at hi@mono.co or come chat with us on Slack. We're proud of our level of service, and we're more than happy to help you out with your integration to Mono.
Contributing
If you would like to contribute to the Mono Ruby Library, please make sure to read our contributor guidelines.
License
MIT for more information.