{"id":13695196,"url":"https://github.com/adamneilson/mondo-clj","last_synced_at":"2026-02-19T07:03:17.453Z","repository":{"id":62433678,"uuid":"47202344","full_name":"adamneilson/mondo-clj","owner":"adamneilson","description":"Provides a clojure wrapper to the Mondo bank API.","archived":false,"fork":false,"pushed_at":"2016-02-03T11:32:46.000Z","size":113,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-12T12:17:11.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamneilson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-01T16:30:24.000Z","updated_at":"2020-01-09T02:42:09.000Z","dependencies_parsed_at":"2022-11-01T21:15:44.663Z","dependency_job_id":null,"html_url":"https://github.com/adamneilson/mondo-clj","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamneilson%2Fmondo-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamneilson%2Fmondo-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamneilson%2Fmondo-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamneilson%2Fmondo-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamneilson","download_url":"https://codeload.github.com/adamneilson/mondo-clj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252168995,"owners_count":21705361,"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":[],"created_at":"2024-08-02T18:00:19.301Z","updated_at":"2025-10-21T22:01:55.457Z","avatar_url":"https://github.com/adamneilson.png","language":"Clojure","funding_links":[],"categories":["Code \u0026 Client Libraries"],"sub_categories":[],"readme":"# mondo-clj\n\n\u003cimg src=\"https://cdn.rawgit.com/adamneilson/mondo-clj/master/resources/mondo-logo.svg\" style=\"width:60%;display:block;margin:auto;\"\u003e\n\nThis **unofficial** clojure lib gives simple hooks for the [Mondo API](https://getmondo.co.uk/docs/). It's pre-alpha and not all functions are finalized.\n\n[![Build Status](https://travis-ci.org/adamneilson/mondo-clj.svg?branch=master)](https://travis-ci.org/adamneilson/mondo-clj)\n\n## Installing \nCurrent [semantic](http://semver.org/) version:\n\n[![Clojars Project](http://clojars.org/mondo-clj/latest-version.svg)](http://clojars.org/mondo-clj)\n\nTo use with Leiningen, add\n\n```clojure\n:dependencies [[mondo-clj \"0.1.11\"]]\n```\nto your project.clj.\n\nYou can use it in a source file like this:\n\n```clojure\n(:require [mondo-clj.core :as mondo])\n```\nor by REPL:\n\n```clojure\n(require '[mondo-clj.core :as mondo])\n```\n\n\n## Usage\n\n### Authentication\nThe Mondo API implements OAuth 2.0 so the first step is to get a token:\n\n```clojure\n(mondo/get-access-token {:client-id \"client-id\"\n                         :client-secret \"client-secret\"\n                         :username \"username\"\n                         :password \"password\"})\n```\n\nThis should return a map similar to this:\n\n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :access-token \"access_token\"\n :client-id \"client_id\"\n :expires-in 21600\n :refresh-token \"refresh_token\"\n :token-type \"Bearer\"\n :user-id \"user_id\"}\n```\nAs you can see I'm adding the `:status` to the returned map to give a bit of context to any errors.\n\nAt any time you can get information about an access token, using:\n\n```clojure\n(mondo/whoami \"access-token\")\n```\n\nreturns:\n\n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :authenticated true,\n :client-id \"client_id\",\n :user-id \"user_id\"}\n```\n\n### Accounts\n\nTo get a list of accounts:\n\n```clojure\n(mondo/list-accounts \"access-token\")\n```\nReturns something like:\n\n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :accounts [{:id \"acc_00009237aqC8c5umZmrRdh\"\n             :description \"Peter Pan's Account\"\n             :created #inst \"2015-12-01T00:00:00.000-00:00\"}]}\n\n```\n\n### Balance\nGet the balance of a specific account\n\n```clojure\n(mondo/read-balance \"access-token\" \"account-id\")\n```\nReturns:\n\n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :balance 50.0\n :currency \"GBP\"\n :spend-today 0.0}\n```\nNB: The [Mondo docs](https://getmondo.co.uk/docs/#balance) currently say that the `balance` and `spend-today` return types are 64bit integers in minor units of the currency. Eg. GBP `5000` is £50.00. This seems counter-intuitive to me so I'll be coercing the `balance` and `spend-today` to *double* type so `50.0` is £50.00.\n\n### Transactions\nGet details of a single transaction. NB: full merchant details are returned:\n\n```clojure\n(mondo/get-transaction \"access-token\" \"transaction-id\")\n```\n\nReturns \n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :transaction {:account-balance 130.13\n               :amount -5.10\n               :created #inst \"2015-12-01T00:00:00.000-00:00\"\n               :currency \"GBP\"\n               :description \"THE DE BEAUVOIR DELI C LONDON GBR\"\n               :id \"tx_00008zIcpb1TB4yeIFXMzx\"\n               :merchant {:address {:address \"98 Southgate Road\"\n                                    :city \"London\"\n                                    :country \"GB\",\n                                    :latitude 51.54151\n                                    :longitude -0.08482400000002599\n                                    :postcode \"N1 3JD\"\n                                    :region \"Greater London\"}\n                          :created #inst \"2015-12-01T00:00:00.000-00:00\"\n                          :group_id \"grp_00008zIcpbBOaAr7TTP3sv\"\n                          :id \"merch_00008zIcpbAKe8shBxXUtl\"\n                          :logo \"https://pbs.twimg.com/profile_images/527043602623389696/68_SgUWJ.jpeg\"\n                          :emoji \"🍞\"\n                          :name \"The De Beauvoir Deli Co.\"\n                          :category \"eating_out\"}\n               :metadata {}\n               :notes \"Salmon sandwich 🍞\"\n               :is_load false\n               :settled true}}\n```\n\nOr list transactions\n\n```clojure\n(mondo/list-transactions {:access-token \"access-token\" \n                          :account-id \"account-id\"})\n\n;or \n\n(mondo/list-transactions {:access-token \"access-token\" \n                          :account-id \"account-id\" \n                          :since #inst \"2015-12-01T00:00:00.000-00:00\"})\n\n;or \n\n(mondo/list-transactions {:access-token \"access-token\" \n                          :account-id \"account-id\"\n                          :before #inst \"2015-12-01T00:00:00.000-00:00\"})\n\n;or \n\n(mondo/list-transactions {:access-token \"access-token\" \n                          :account-id \"account-id\"\n                          :since #inst \"2015-12-01T00:00:00.000-00:00\" :limit 48})\n```\n\nYou can also add meta-data to a transaction\n\n```clojure\n(mondo/annotate-transaction \"access-token\" \"transaction-id\" {:foo \"bar\" :baz \"quux\"})\n```\n\n\n### Feed\n\nYou can inject items into an accounts feed\n\n```clojure\n(mondo/create-feed-item {:access-token \"access-token\"\n                         :account-id \"account_id\"\n                         :type \"basic\"\n                         :params {:title \"My custom item\"\n                                  :image-url \"www.example.com/image.png\"\n                                  :background-color \"#FCF1EE\"\n                                  :body-color \"#FCF1EE\"\n                                  :title-color \"#333\"\n                                  :body \"Some body text to display\"}\n                         :url \"http://aan.io\"}\n```\n\n### Webhooks\nWeb hooks allow your application to receive real-time, push notification of events in an account. \n\nYou can register a webhook:\n\n```clojure\n(mondo/register-webhook \"access-token\" \"account-id\" \"webhook-url\")\n```\n\nList the web hooks registered on an account:\n\n```clojure\n(mondo/list-webhooks \"access-token\" \"account-id\")\n```\n\nOr delete a webhook to stop receiving transaction events:\n\n```clojure\n(mondo/delete-webhook \"access-token\" \"webhook-id\")\n```\n\n### Attachments\n\nThe first step when uploading an attachment is to obtain a temporary URL to which the file can be uploaded. The response will include a `:file-url` which will be the URL of the resulting file, and an `:upload-url` to which the file should be uploaded to.\n```clojure\n(mondo/upload-attachment \"access-token\" \"file-name\" \"file-type\")\n```\nReturns:\n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :file-url \"https://s3-eu-west-1.amazonaws.com/mondo-image-uploads/user_00009237hliZellUicKuG1/LcCu4ogv1xW28OCcvOTL-foo.png\"\n :upload-url \"https://mondo-image-uploads.s3.amazonaws.com/user_00009237hliZellUicKuG1/LcCu4ogv1xW28OCcvOTL-foo.png?AWSAccessKeyId=AKIAIR3IFH6UCTCXB5PQ\\u0026Expires=1447353431\\u0026Signature=k2QeDCCQQHaZeynzYKckejqXRGU%!D(MISSING)\"}\n```\n\nOnce you have obtained a URL for an attachment, either by uploading to the `:upload-url` obtained from the `upload-attachment` endpoint above or by hosting a remote image, this URL can then be registered against a transaction. Once an attachment is registered against a transaction this will be displayed on the detail page of a transaction within the Mondo app.\n ```clojure\n(mondo/register-attachment \"access-token\" \"external-id\" \"file-url\" \"file-type\")\n```\nReturns:\n```clojure\n{:status {:success? true \n          :error-code 200 \n          :error-name \"OK\" \n          :error-body \"All is well.\"}\n :attachment {:id \"attach_00009238aOAIvVqfb9LrZh\"\n              :user_id \"user_00009238aMBIIrS5Rdncq9\"\n              :external-id \"tx_00008zIcpb1TB4yeIFXMzx\"\n              :file-url \"https://s3-eu-west-1.amazonaws.com/mondo-image-uploads/user_00009237hliZellUicKuG1/LcCu4ogv1xW28OCcvOTL-foo.png\"\n              :file-type \"image/png\"\n              :created #inst \"2015-12-01T00:00:00.000-00:00\"}}\n\n```\n\nTo remove an attachment, simply deregister this using its `id`\n ```clojure\n(mondo/deregister-attachment \"access-token\" \"id\")\n```\n\n\n## Questions \u0026 Shortcomings?\n1. Would be really good to have an API version made available. Adding the request header `X-Api-Version` to make sure of  compatibility going forward.\n2. It's unclear at this time whether Pagination allows for `before` to be either an instant or a transaction-id.\n\n\n\n![](https://raw.githubusercontent.com/adamneilson/mondo-clj/master/resources/mondo-alpha-card.png)\n\n## License\n\nCopyright © 2015 [Adam Neilson](http://aan.io)\n\nDistributed under the [Eclipse Public License](http://www.eclipse.org/legal/epl-v10.html) either version 1.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamneilson%2Fmondo-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamneilson%2Fmondo-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamneilson%2Fmondo-clj/lists"}