{"id":16380950,"url":"https://github.com/vergilet/monobank","last_synced_at":"2025-03-16T16:30:30.741Z","repository":{"id":56884455,"uuid":"231343312","full_name":"vergilet/monobank","owner":"vergilet","description":"Monobank API Ruby","archived":false,"fork":false,"pushed_at":"2024-05-20T12:40:09.000Z","size":133,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T03:52:56.696Z","etag":null,"topics":["hacktoberfest","mono","mono-api","monobank","monobank-api","ruby"],"latest_commit_sha":null,"homepage":"https://vergilet.github.io/monobank/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vergilet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-02T08:55:10.000Z","updated_at":"2024-06-27T22:14:59.000Z","dependencies_parsed_at":"2023-12-03T11:23:44.485Z","dependency_job_id":"49149233-da58-4cc4-aced-2f5e66739a45","html_url":"https://github.com/vergilet/monobank","commit_stats":{"total_commits":90,"total_committers":2,"mean_commits":45.0,"dds":0.2777777777777778,"last_synced_commit":"f5929526b8e8b3eb88e4ad78ee74f117436428e4"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fmonobank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fmonobank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fmonobank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vergilet%2Fmonobank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vergilet","download_url":"https://codeload.github.com/vergilet/monobank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221665758,"owners_count":16860308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","mono","mono-api","monobank","monobank-api","ruby"],"created_at":"2024-10-11T03:52:58.803Z","updated_at":"2024-10-27T10:53:35.315Z","avatar_url":"https://github.com/vergilet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"right\"\u003e\n    \u003ca href=\"https://github.com/vergilet/monobank\"\u003e\u003cimg align=\"\" src=\"https://user-images.githubusercontent.com/2478436/51829223-cb05d600-22f5-11e9-9245-bc6e82dcf028.png\" width=\"56\" height=\"56\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://rubygems.org/gems/monobank\"\u003e\u003cimg align=\"right\" src=\"https://user-images.githubusercontent.com/2478436/51829691-c55cc000-22f6-11e9-99a5-42f88a8f2a55.png\" width=\"56\" height=\"56\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://rubygems.org/gems/monobank\"\u003e\u003cimg width=\"460\" src=\"https://user-images.githubusercontent.com/2478436/71856112-95639280-30eb-11ea-932e-dd8cbe851858.png\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[![Build Status](https://api.travis-ci.com/vergilet/repost.svg?branch=master)](https://app.travis-ci.com/github/vergilet/monobank)\n\n# Monobank\n\nUnofficial Ruby Gem for [Monobank API](https://api.monobank.ua/docs/).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'monobank'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install monobank\n\n## Endpoints\n\nUse available methods to gather needed data from Monobank API:\n\n```ruby\n# Bank currency\nMonobank.bank_currency\n\n# Client Info\nMonobank.client_info(token: YOUR_MONO_TOKEN)\n\n# Statement\nMonobank.statement(token: YOUR_MONO_TOKEN, account_id: ACCOUNT_ID, from: 1546304461, to: 1546306461) # 30 days ago: (Date.today - 30).to_time.to_i\n\n# Set webhook\nMonobank.set_webhook(token: YOUR_MONO_TOKEN,  url: WEBHOOK_URL)\n```\n\n### Public data\n\nGeneral information provided without authorization.\n\n#### Bank Currency\n\n##### API Method: [bank-currency](https://api.monobank.ua/docs/#tag/Publichni-dani/paths/~1bank~1currency/get)\n\n`GET /bank/currency`\n\n*Get a basic list of monobank exchange rates. The information is cached and updated at least once every 5 minutes.*\n\n\n```ruby\nbank_currency = Monobank.bank_currency\nbank_currency                   # Array\n```\n\n```ruby\nsome_currency = bank_currency.first\nsome_currency.class             # Monobank::Resources::Bank::Currency\n```\n\n```ruby\nsome_currency.currency_code_a   # Integer, ISO 4217\nsome_currency.currency_code_b   # Integer, ISO 4217\nsome_currency.date              # Integer, Unix time in sec (use Time.at)\nsome_currency.rate_sell         # Float\nsome_currency.rate_buy          # Float\nsome_currency.rate_cross        # Float\n\nsome_currency.attributes        # Hash with all fields above\n```\n\n*(!) About [ISO 4217](https://uk.wikipedia.org/wiki/%D0%9A%D0%BB%D0%B0%D1%81%D0%B8%D1%84%D1%96%D0%BA%D0%B0%D1%86%D1%96%D1%8F_%D0%B2%D0%B0%D0%BB%D1%8E%D1%82_(ISO_4217)?section=2#%D0%9F%D0%B5%D1%80%D0%B5%D0%BB%D1%96%D0%BA_%D0%B4%D1%96%D1%8E%D1%87%D0%B8%D1%85_%D0%BA%D0%BE%D0%B4%D1%96%D0%B2).* \n\n\n### Personal data\n\nInformation provided only with the access token that the client can obtain in his personal account [Monobank API](https://api.monobank.ua/)\n\n#### Client Info\n\n##### API Method: [personal-client-info](https://api.monobank.ua/docs/#tag/Kliyentski-personalni-dani/paths/~1personal~1client-info/get)\n\n`GET /personal/client-info`\n\n*Receiving information about the client and a list of his accounts. Restrictions on the use of the function no more than once every 60 seconds.*\n\n```ruby\nclient_info = Monobank.client_info(token: YOUR_MONO_TOKEN)\nclient_info.class               # Monobank::Resources::Personal::ClientInfo\n```\n```ruby\nclient_info.name                # String, client name\nclient_info.web_hook_url        # String, webhook url \nclient_info.accounts            # array of accounts (type Monobank::Resources::Personal::Account)\n\nclient_info.attributes          # Hash with all fields above\n```\n##### Client Info \u003e Account\n\n```ruby\naccount = client_info.accounts.first\naccount.class                   # Monobank::Resources::Personal::Account\n```\n```ruby\naccount.id                      # String, Account identifier\naccount.balance                 # Integer, Balance in cents\naccount.credit_limit            # Integer, Credit limit\naccount.currency_code           # Integer, ISO 4217\naccount.cashback_type           # String, None, UAH, Miles \n\naccount.attributes              # Hash with all fields above\n```\n\n#### Statement\n\n##### API Method: [personal-statement](https://api.monobank.ua/docs/#tag/Kliyentski-personalni-dani/paths/~1personal~1statement~1{account}~1{from}~1{to}/get)\n\n`GET /personal/statement/{account}/{from}/{to}`\n\n*Receiving a statement {from} - {to} time in seconds in Unix time format. \nThe maximum time for which it is possible to receive a statement is 31 days + 1 hour (2682000 seconds).\nLimit on using the function no more than 1 time in 60 seconds.*\n\n```ruby\naccount_id = 'QWERTY-1SdSD' # String, ClientInfo -\u003e Account ID\nfrom       = 1546304461     # Integer, Unix time in sec (use Time.at)\nto         = 1546306461     # Integer, Optional, uses current time if blank\n```\n\n```ruby\nstatements = Monobank.statement(token: YOUR_MONO_TOKEN, account_id: ACCOUNT_ID, from: 1546304461, to: 1546306461)\nstatements                  # array of statements (type Monobank::Resources::Personal::Statement)\n```\n\n```ruby\nstatement = statements.first\nstatement.class             # Monobank::Resources::Personal::Statement\n```\n```ruby\nstatement.id                # String, transaction ID\nstatement.time              # Integer, Unix time in sec (use Time.at)\nstatement.description       # String, transaction description\nstatement.mcc               # Integer, Merchant Category Code, (ISO 18245)\nstatement.hold              # Boolean, Lock status\nstatement.amount            # Integer, Amount in cents\nstatement.operation_amount  # Integer, Amount in cents\nstatement.currency_code     # Integer, ISO 4217\nstatement.commission_rate   # Integer, commission amount in cents\nstatement.cashback_amount   # Integer, cashback amount in cents\nstatement.balance           # Integer, balance in cents\n\nstatement.attributes        # Hash with all fields above\n```\n\n#### Set WebHook\n\n##### API Method: [personal-webhook](https://api.monobank.ua/docs/#tag/Kliyentski-personalni-dani/paths/~1personal~1webhook/post)\n\n`POST /personal/webhook`\n\n*Sends json ~ `{type:\"StatementItem\", data:{account:\"...\", statementItem:{#StatementItem}}}` to WEBHOOK_URL*\n\n```ruby\nwebhook = Monobank.set_webhook(token: YOUR_MONO_TOKEN,  url: WEBHOOK_URL)\nwebhook.class               # Monobank::Resources::Personal::Webhhok\n```\n```ruby\nwebhook.status              # String, \"ok\" if ok :)\n\nwebhook.attributes          # Hash with all fields above\n```\n\n\n#### Errors\n\nError object with code and description.\n\n```ruby\nerror.class                 # Monobank::Resources::Error\n\nerror.code                  # Integer, (e.g. 429 for Too many requests)\nerror.error_description     # String, Error description\n\nerror.attributes            # Hash with all fields above\n```\n\n### Corporate API\n\nFor now please use specs as a documentation - [MonobankCorporate Spec](https://github.com/vergilet/monobank/blob/master/spec/monobank_corporate_spec.rb)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/vergilet/monobank](https://github.com/vergilet/monobank)\n    \nFeel free to contribute:\n1. Fork it ([https://github.com/vergilet/monobank/fork](https://github.com/vergilet/monobank/fork))\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n\n\n## License\nThe gem is available as open source under the terms of the MIT License.\n\nCopyright © 2020 Yaro \u0026 Tolik.\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen)](https://raw.githubusercontent.com/vergilet/monobank/master/LICENSE.txt)\n\n**That's all folks.**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvergilet%2Fmonobank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvergilet%2Fmonobank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvergilet%2Fmonobank/lists"}