Skip to content

withmono/mono-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Register on the Mono website and get your public and secret keys.
  2. 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

Implementation

Methods

Once an instance of the client has been created you use the following methods:

Get Wallet Balance

This resource allows you to check the available balance in your Mono wallet

walletBalance = monoClient.getWalletBalance

Get Account Id from token

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"})

Unlink Account

This resource provides your customers with the option to unlink their financial account(s)

unlink = monoClient.unlinkAccount({"accountId" => "6094b18f7f87041b24cb8bc1"})

Get Account Information

This resource returns the account details with the financial institution.

accountInfo = monoClient.getAccountInformation({"accountId" => accountId})

Get Account Statement in JSON

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"
})

Poll Account Statement in 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"
})

Get Account Transactions

This resource returns the known transactions on the account.

accountTransactions = monoClient.getAccountTransactions({
    "accountId" => "6094b18f7f87041b24cb8bc1",
    "paginate" => true,
    "limit" => 10
})

Get Customer's Credits

This resource returns the historical credits on the account

customerCredits = monoClient.getCredits({"accountId" => "6094b18f7f87041b24cb8bc1"})

Get Customer's Debits

This resource returns the historical debits on the account

customerDebits = monoClient.getDebits({"accountId" => "6094b18f7f87041b24cb8bc1"})

Get Income Information

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.

Get Account Identity

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

Synchronise Data

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

Get Re-auth Code.

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"})

Get Financial Institutions

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.

About

Ruby library for Mono's API

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published