Project

mono_ruby

0.0
No release in over 3 years
Low commit activity in last 3 years
Ruby gem wrapper for the Mono API. Read more here at https://docs.mono.co/docs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.2

Runtime

~> 0.18.1
 Project Readme

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

  • 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:

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.