{"id":18716360,"url":"https://github.com/killbill/killbill-client-ruby","last_synced_at":"2025-08-22T05:30:56.870Z","repository":{"id":3629024,"uuid":"4695374","full_name":"killbill/killbill-client-ruby","owner":"killbill","description":"Ruby client library for Kill Bill","archived":false,"fork":false,"pushed_at":"2024-10-21T06:01:47.000Z","size":733,"stargazers_count":24,"open_issues_count":1,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-09T17:24:05.370Z","etag":null,"topics":["billing","killbill","payments","subscriptions"],"latest_commit_sha":null,"homepage":"https://killbill.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/killbill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"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},"funding":{"github":["killbill"]}},"created_at":"2012-06-17T22:32:23.000Z","updated_at":"2024-10-21T06:01:50.000Z","dependencies_parsed_at":"2023-12-14T03:42:53.515Z","dependency_job_id":"c9b3848e-91c2-4a00-b63c-8cfde39c4bf2","html_url":"https://github.com/killbill/killbill-client-ruby","commit_stats":null,"previous_names":[],"tags_count":109,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-client-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-client-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-client-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-client-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/killbill","download_url":"https://codeload.github.com/killbill/killbill-client-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230561013,"owners_count":18245324,"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","killbill","payments","subscriptions"],"created_at":"2024-11-07T13:12:26.310Z","updated_at":"2024-12-20T09:06:16.580Z","avatar_url":"https://github.com/killbill.png","language":"Ruby","readme":"killbill-client-ruby\n====================\n\nKill Bill Ruby client library.\n\nKill Bill compatibility\n-----------------------\n\n| Client version | Kill Bill version |\n| -------------: | ----------------: |\n| 0.x.y          | 0.16.z            |\n| 1.x.y          | 0.18.z            |\n| 2.x.y          | 0.20.z            |\n| 3.x.y          | 0.22.z            |\n| 4.x.y          | 0.24.z            |\n\nInstallation\n------------\n\nGet the [killbill-client](https://rubygems.org/gems/killbill-client) gem:\n\n```\ngem install killbill-client\n```\n\nAlternatively, add the dependency in your Gemfile:\n\n```\ngem 'killbill-client'\n```\n\nAuthentication\n--------------\n\nA username and password can be set directly in the `options` hash (accepted by each API method):\n```ruby\noptions = {\n  :username =\u003e 'admin',\n  :password =\u003e 'password'\n}\n```\nThese credentials are validated by Kill Bill either directly (users managed by Kill Bill) or via a third-party (LDAP, Okta, Auth0, etc.).\n\nAlternatively, a bearer token can be passed as such:\n```ruby\noptions = {\n  :bearer =\u003e 'token'\n}\n```\nThe security token would be validated by Kill bill via a third-party (e.g. Auth0).\n\nBy default, Kill Bill won't maintain sessions, except when calling the API `/1.0/kb/security/permissions` (`JSESSIONID`, present in the `Set-Cookie` response header).\nThis session id can be passed instead:\n```ruby\noptions = {\n  :session_id =\u003e 'JSESSIONID'\n}\n```\nUsing this session mechanism is recommend for user interfaces or to minimize the runtime dependency with a third-party provider.\n\nNote: if a timed out session is re-used (`last_access_time` older than 60 minutes by default), a `HTTP/1.1 401 Unauthorized` is returned with `Set-Cookie: JSESSIONID=deleteMe`, and the session is deleted from the database (and cache) on the server side.\n\nExamples\n--------\n\nHere is a snippet creating your first account and subscription:\n\n```ruby\nrequire 'killbill_client'\n\nKillBillClient.url = 'http://127.0.0.1:8080'\n\n# Multi-tenancy and RBAC credentials\noptions = {\n  :username =\u003e 'admin',\n  :password =\u003e 'password',\n  :api_key =\u003e 'bob',\n  :api_secret =\u003e 'lazar'\n}\n\n# Audit log data\nuser = 'me'\nreason = 'Going through my first tutorial'\ncomment = 'I like it!'\n\n# Create an account\naccount = KillBillClient::Model::Account.new\naccount.name = 'John Doe'\naccount.first_name_length = 4\naccount.external_key = 'john-doe'\naccount.currency = 'USD'\naccount = account.create(user, reason, comment, options)\n\n# Add a subscription\nsubscription = KillBillClient::Model::Subscription.new\nsubscription.account_id = account.account_id\nsubscription.product_name = 'Sports'\nsubscription.product_category = 'BASE'\nsubscription.billing_period = 'MONTHLY'\nsubscription.price_list = 'DEFAULT'\nsubscription = subscription.create(user, reason, comment, nil, true, options)\n\n# List invoices\naccount.invoices(true, options).each do |invoice|\n  puts invoice.inspect\nend\n```\n\nThe following script will tag a list of accounts with OVERDUE_ENFORCEMENT_OFF and AUTO_PAY_OFF:\n\n```ruby\nrequire 'killbill_client'\n\nKillBillClient.url = 'http://127.0.0.1:8080'\n\nAUDIT_USER = 'pierre (via ruby script)'\n\nFile.open(File.dirname(__FILE__) + '/accounts.txt').readlines.map(\u0026:chomp).each do |kb_account_id|\n  account = KillBillClient::Model::Account.find_by_id kb_account_id\n  puts \"Current tags for #{account.name} (#{account.account_id}): #{account.tags.map(\u0026:tag_definition_name).join(', ')}\"\n\n  account.add_tag 'OVERDUE_ENFORCEMENT_OFF', AUDIT_USER\n  account.add_tag 'AUTO_PAY_OFF', AUDIT_USER\n\n  puts \"New tags for #{account.name} (#{account.account_id}): #{account.tags.map(\u0026:tag_definition_name).join(', ')}\"\nend\n```\n\nWe have lots of examples in our [integration tests](https://github.com/killbill/killbill-integration-tests).\n\nTests\n-----\n\nTo run the integration tests:\n\n```bash\nrake test:remote:spec\n```\n\nYou need to set in spec/spec_helper.rb the url of your instance, e.g. `KillBillClient.url = 'http://127.0.0.1:8080'` and the username and password to authenticate the API, e.g. `KillBillClient.username = 'admin'` and `KillBillClient.password = 'password'`\n\n## License\n\nThe Kill Bill Ruby client is released under the [Apache license](http://www.apache.org/licenses/LICENSE-2.0).\n","funding_links":["https://github.com/sponsors/killbill"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillbill%2Fkillbill-client-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillbill%2Fkillbill-client-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillbill%2Fkillbill-client-ruby/lists"}