{"id":28254931,"url":"https://github.com/chargebee/chargebee-ruby","last_synced_at":"2025-06-16T06:31:36.502Z","repository":{"id":2936242,"uuid":"3948129","full_name":"chargebee/chargebee-ruby","owner":"chargebee","description":"Ruby library for the Chargebee API.","archived":false,"fork":false,"pushed_at":"2025-06-03T05:56:12.000Z","size":1237,"stargazers_count":32,"open_issues_count":10,"forks_count":66,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-06-03T16:18:59.671Z","etag":null,"topics":["chargebee","ruby"],"latest_commit_sha":null,"homepage":"https://apidocs.chargebee.com/docs/api?lang=ruby","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/chargebee.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-04-06T08:42:37.000Z","updated_at":"2025-06-03T05:56:13.000Z","dependencies_parsed_at":"2023-07-05T20:46:45.559Z","dependency_job_id":"96188ded-3c61-418b-80aa-7d1a1412d4e7","html_url":"https://github.com/chargebee/chargebee-ruby","commit_stats":null,"previous_names":[],"tags_count":231,"template":false,"template_full_name":null,"purl":"pkg:github/chargebee/chargebee-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chargebee","download_url":"https://codeload.github.com/chargebee/chargebee-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260114353,"owners_count":22960887,"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":["chargebee","ruby"],"created_at":"2025-05-19T20:16:30.574Z","updated_at":"2025-06-16T06:31:36.454Z","avatar_url":"https://github.com/chargebee.png","language":"Ruby","readme":"# Chargebee Ruby Client Library - API V2\n\n[![gem](https://img.shields.io/gem/v/chargebee.svg?maxAge=2)](https://rubygems.org/gems/chargebee)\n[![gem](https://img.shields.io/gem/dtv/chargebee.svg?maxAge=2)](https://rubygems.org/gems/chargebee)\n\nThis is the official Ruby library for integrating with Chargebee.\n\n- 📘 For a complete reference of available APIs, check out our [API Documentation](https://apidocs.chargebee.com/docs/api/?lang=ruby).  \n- 🧪 To explore and test API capabilities interactively, head over to our [API Explorer](https://api-explorer.chargebee.com).\n\n\u003e Note: Chargebee now supports two API versions - [V1](https://apidocs.chargebee.com/docs/api/v1) and [V2](https://apidocs.chargebee.com/docs/api), of which V2 is the latest release and all future developments will happen in V2. This library is for \u003cb\u003eAPI version V2\u003c/b\u003e. If you’re looking for V1, head to [chargebee-v1 branch](https://github.com/chargebee/chargebee-ruby/tree/chargebee-v1).\n\n## Installation\n\nInstall the latest version of the gem with the following command...\n\n    $ sudo gem install chargebee -v '~\u003e2'\n\n\n## Requirements\n\n* Ruby 1.9.3 or above.\n\n## Documentation\n\nSee our [Ruby API Reference](https://apidocs.chargebee.com/docs/api?lang=ruby \"API Reference\").\n\n## Usage\n\n### To create a new subscription:\n\n```ruby\nChargeBee.configure({:api_key =\u003e \"your_api_key\" , :site =\u003e \"your_site\"})\nresult = ChargeBee::Subscription.create({\n\t:id =\u003e \"sub_KyVqDh__dev__NTn4VZZ1\", \n\t:plan_id =\u003e \"basic\", \n})\nsubscription = result.subscription\nputs \"created subscription is #{subscription}\"\n```\n\n### Create an Idempotent Request\n\n[Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests. \n\n```ruby\nrequire 'chargebee'\nChargeBee.configure({:api_key =\u003e \"your_api_key\" , :site =\u003e \"your_site\"})\nresult = ChargeBee::Customer.create({\n  :first_name =\u003e \"John\",\n  :last_name =\u003e \"Doe\",\n  :email =\u003e \"john@test.com\",\n  :locale =\u003e \"fr-CA\",\n  :billing_address =\u003e {\n    :first_name =\u003e \"John\",\n    :last_name =\u003e \"Doe\",\n    :line1 =\u003e \"PO Box 9999\",\n    :city =\u003e \"Walnut\",\n    :state =\u003e \"California\",\n    :zip =\u003e \"91789\",\n    :country =\u003e \"US\"\n    }\n  },\n  nil,\n  {\"chargebee-idempotency-key\" =\u003e \"\u003c\u003cUUID\u003e\u003e\"} # Replace \u003c\u003cUUID\u003e\u003e with a unique string\n)\ncustomer = result.customer\ncard = result.card\nresponseHeader = result.get_response_headers # Retrieves response headers\nputs(responseHeader)\nidempotencyReplayedValue = result.is_idempotency_replayed # Retrieves Idempotency replayed header value\nputs(idempotencyReplayedValue)\n```\n`is_idempotency_replayed` method can be accessed to differentiate between original and replayed requests.\n\n## License\n\nSee the LICENSE file.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchargebee%2Fchargebee-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchargebee%2Fchargebee-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchargebee%2Fchargebee-ruby/lists"}