{"id":18656617,"url":"https://github.com/zendesk/iron_bank","last_synced_at":"2025-04-06T22:08:41.589Z","repository":{"id":37788248,"uuid":"150337308","full_name":"zendesk/iron_bank","owner":"zendesk","description":"An opinionated Ruby interface to the Zuora REST API","archived":false,"fork":false,"pushed_at":"2025-03-26T16:33:43.000Z","size":311,"stargazers_count":17,"open_issues_count":15,"forks_count":7,"subscribers_count":283,"default_branch":"main","last_synced_at":"2025-03-30T20:13:00.592Z","etag":null,"topics":["billing","rest-client","zuora"],"latest_commit_sha":null,"homepage":"https://www.zuora.com/developer/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zendesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-25T22:35:38.000Z","updated_at":"2025-03-07T19:48:08.000Z","dependencies_parsed_at":"2024-02-29T13:28:35.528Z","dependency_job_id":"fa1e9500-c6e2-4dd3-a4d8-87e7fd7d0d2f","html_url":"https://github.com/zendesk/iron_bank","commit_stats":{"total_commits":118,"total_committers":24,"mean_commits":4.916666666666667,"dds":0.576271186440678,"last_synced_commit":"18d09f17e6f13d3607de74024f974670bf4df121"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Firon_bank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Firon_bank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Firon_bank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Firon_bank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zendesk","download_url":"https://codeload.github.com/zendesk/iron_bank/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["billing","rest-client","zuora"],"created_at":"2024-11-07T07:24:21.257Z","updated_at":"2025-04-06T22:08:41.556Z","avatar_url":"https://github.com/zendesk.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iron Bank\n\n![CI](https://github.com/zendesk/iron_bank/workflows/CI/badge.svg?branch=main)\n\nAn opinionated Ruby interface to the [Zuora REST API][zuora-dev].\n\n\u003e We who serve the Iron Bank face death full as often as you who serve the Iron\n\u003e Throne.\n\n_(A Dance with Dragons, Chapter 44, Jon IX)_\n\nThis gem provides opinionated resources to interact with the Zuora API through\ntheir REST interface. It defines **associations** between them, as well as a\nsimple **declaration API** (`with_one`, `with_many`) to extend them.\n\nThis gem is tested against Ruby `\u003e= 3.1`.\n\nPlease use [GitHub Issues][issues] to report bugs.\n\n## Getting Started\n\nYou will need:\n\n- a **Zuora tenant** (apisandbox, services, performances or production)\n- an **administrator access** to this tenant (to gain API access)\n- and an **OAuth client** for this user ([Zuora documentation][zuora-doc-oauth])\n\nIronBank is a pure Ruby client, but we do provide a generator (for the\nconfiguration) when using it within [Rails][rails-website].\n\nAdd the gem to your `Gemfile` with:\n\n```rb\ngem 'iron_bank'\n```\n\nAnd run the `bundle` command to install it. You then need to run the generator:\n\n```\n$ rails generate iron_bank:install\n```\n\nUse the `client_id` and `client_secret` from your Zuora OAuth client and add\nthem to the generated `config/initializers/iron_bank.rb` file.\n\n## Configuration\n\n```rb\n# Configure Ironbank\nIronBank.configure do |config|\n  config.client_id         = 'client_id'\n  config.client_secret     = 'client_secret'\n  config.auth_type         = 'auth_type'\n  config.domain            = 'zuora-domain'   # zuora doamin\n  config.export_directory  = 'directory-path' # export directory path\n  config.schema_directory  = 'directory-path' # schema drirectory path\n\n  # Ironbank uses Faraday to send request to Zuora. Middlewares can be specified\n  # by adding the class name and class options to the `middlewares`\n  # configuration.\n  # Faraday middlewares, we can send in an array with cutomer middleware class\n  # and options\n  config.middlewares \u003c\u003c [DummyMiddlewareClass, {}]\nend\n\n```\n\n## Usage\n\n```rb\n# make a query to Zuora using ZOQL\nIronBank::Query.call \"select Name from Account where Id='zuora-account-id'\"\n\n# retrieve an account\naccount = IronBank::Account.find 'zuora-account-id'\n# =\u003e #\u003cIronBank::Resources::Account\u003e\n\n# access this resource attributes\naccount.name # =\u003e 'My Company Inc.'\n\n# or associated objects\naccount.bill_to\n# =\u003e #\u003cIronBank::Resources::Contact\u003e\n\naccount.active_subscriptions\n# =\u003e [#\u003cIronBank::Resources::Subscription\u003e]\n```\n\n## Local records\n\nIf your product catalog does not change often, you may want to export it locally\nso that product catalog and related object queries look for **local records**\nfirst, then **fallback** to the API if no records are found.\n\nYou can export your product catalog locally using the `LocalRecords` class:\n\n```rb\n# Save CSV files in the directory specified by `config.export_directory`\nIronBank::LocalRecords.export\n```\n\nThen, making a query/looking for a record will first search through the local\nrecords, then default to the API if no records are found.\n\n```rb\nproduct = IronBank::Product.find 'zuora-product-id'\n# =\u003e #\u003cIronBank::Resources::Product\u003e\n\nproduct.plans[0].charges[0].tiers[0]\n# =\u003e #\u003cIronBank::Resources::ProductRatePlanChargeTier\u003e\n```\n\nWithout local records, the previous scenario will make **4 requests** to Zuora\nto access the charge tiers. By exporting local records, you can significantly\nreduce your execution time, e.g., when building a `SubscriptionRequest`.\n\n## Development\n\n1. After checking out the repo, run `bin/setup` to install dependencies\n2. Edit the copied `.env` file with your Zuora credentials\n3. Execute `bundle exec rake` to run the linters and tests\n4. You can also run `bin/console` for an interactive prompt that will allow you\n   to experiment with the Zuora APIs\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/zendesk/iron_bank.\n\n## Known issues\n\n- `AutoPay` field on the `Invoice` object is not queryable using ZOQL despite\n  the metadata showing `\u003cselectable\u003etrue\u003c/selectable\u003e`, hence it has been added\n  to the `excluded_fields` method.\n- Exporting the local records through `IronBank::LocalRecords.export` can take a\n  long time (especially the `ProductRatePlanChargeTier` records). In case the\n  task fails because the export is still processing, you can manually download\n  the export from Zuora by going to **Reporting** -\u003e **Data Sources** and\n  looking for the `ProductRatePlanChargeTier.csv` export.\n\n## Copyright and license\n\nCopyright 2018 Zendesk, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License.\n\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\n[issues]: https://github.com/zendesk/iron_bank/issues\n[zuora-describe]: https://www.zuora.com/developer/api-reference/#tag/Describe\n[zuora-dev]: https://developer.zuora.com\n[zuora-doc-oauth]:\n  https://knowledgecenter.zuora.com/CF_Users_and_Administrators/A_Administrator_Settings/Manage_Users#Create_an_OAuth_Client_for_a_User\n[zuora-website]: https://www.zuora.com\n[rails-website]: https://rubyonrails.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Firon_bank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzendesk%2Firon_bank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Firon_bank/lists"}