{"id":19312108,"url":"https://github.com/bigcommerce/bigcommerce-api-ruby","last_synced_at":"2025-05-16T19:07:22.058Z","repository":{"id":1643304,"uuid":"2368617","full_name":"bigcommerce/bigcommerce-api-ruby","owner":"bigcommerce","description":"Connect Ruby applications with the Bigcommerce Platform","archived":false,"fork":false,"pushed_at":"2024-07-01T18:45:28.000Z","size":341,"stargazers_count":79,"open_issues_count":18,"forks_count":127,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-12T17:50:09.916Z","etag":null,"topics":["api-client","bigcommerce","oauth","ruby"],"latest_commit_sha":null,"homepage":"https://developer.bigcommerce.com","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/bigcommerce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2011-09-12T01:48:42.000Z","updated_at":"2024-09-21T05:52:32.000Z","dependencies_parsed_at":"2024-06-19T04:08:13.882Z","dependency_job_id":"9356ccdb-59fd-4acc-be8d-3703013f753e","html_url":"https://github.com/bigcommerce/bigcommerce-api-ruby","commit_stats":{"total_commits":170,"total_committers":35,"mean_commits":4.857142857142857,"dds":0.8588235294117648,"last_synced_commit":"eec22ad56d9e89ac3c531de524cf7a918423257f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigcommerce-api-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigcommerce","download_url":"https://codeload.github.com/bigcommerce/bigcommerce-api-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249177,"owners_count":22039027,"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":["api-client","bigcommerce","oauth","ruby"],"created_at":"2024-11-10T00:32:53.956Z","updated_at":"2025-05-16T19:07:22.036Z","avatar_url":"https://github.com/bigcommerce.png","language":"Ruby","readme":"# BigCommerce API Ruby\n\n[![Gem Version](https://badge.fury.io/rb/bigcommerce.svg)](https://rubygems.org/gems/bigcommerce)\n[![CircleCI](https://circleci.com/gh/bigcommerce/bigcommerce-api-ruby/tree/master.svg?style=svg)](https://circleci.com/gh/bigcommerce/bigcommerce-api-ruby/tree/master)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/d1ba1b74a2a74a26e8b4/test_coverage)](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d1ba1b74a2a74a26e8b4/maintainability)](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/maintainability)\n\nThis is the official BigCommerce API client to support our Stores API. You can find more information about becoming a \nBigCommerce developer here: [developer.bigcommerce.com](http://developer.bigcommerce.com).\n\n\n## Installation\nBigCommerce is available on [RubyGems](https://rubygems.org/gems/bigcommerce).\n\n```sh\ngem install bigcommerce\n```\n\nYou can also add it to your Gemfile.\n\n```rb\ngem 'bigcommerce', '~\u003e 1.0'\n```\n\n## Requirements\n\n- Ruby 2.7.5 or newer (Ruby 3.0+ is preferred)\n\n## Getting Started\nTo make requests to our API, you must register as a developer and have your credentials ready.\n\nAlso very important: For the OAuth authentication mechanism, the resources to which you have acccess depend on the\nscopes that the merchant has granted to your application. For more information about Store API scopes, \nsee: [OAuth Scopes](https://developer.bigcommerce.com/api/scopes).\n\n## Authentication\nWe currently have two different authentication schemes that you can select, depending on your use case.\n\n### OAuth\nOAuth apps can be submitted to [BigCommerce App Store](https://www.bigcommerce.com/apps), allowing other merchants to install these apps in their \nBigCommerce stores.\n\n__[More Information](https://developer.bigcommerce.com/api/using-oauth-intro)__\n\n### Basic Authentication (Legacy)\nTo develop a custom integration for one store, your app needs to use Basic Authentication.\n\n__[More Information](https://developer.bigcommerce.com/api/legacy/basic-auth)__\n\n## Configuration\nTo authenticate your API client, you will need to configure the client like the following examples.\n\n### OAuth App\n\n- ```client_id```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) \"My Apps\" section.\n- ```access_token```: Obtained after a token exchange in the auth callback.\n- ```store_hash```: Also obtained after the token exchange.\n\n```rb\nBigcommerce.configure do |config|\n  config.store_hash = ENV['BC_STORE_HASH']\n  config.client_id = ENV['BC_CLIENT_ID']\n  config.access_token = ENV['BC_ACCESS_TOKEN']\nend\n```\n\n### Basic Authentication (Legacy)\n\nTo get all the basic auth credentials, simply visit your store admin page, and navigate to the \n`Advanced Settings` \u003e `Legacy API Settings`. Once there, you can create a new legacy API account on which to authenticate.\n\n\n```rb\nBigcommerce.configure do |config|\n  config.auth = 'legacy'\n  config.url = ENV['BC_API_ENDPOINT_LEGACY']\n  config.username = ENV['BC_USERNAME']\n  config.api_key = ENV['BC_API_KEY']\nend\n```\n\n__SSL Configuration__\n\nIf you are using your own, self-signed, certificate, you can pass SSL options to Faraday. This is not required, but \nmight be useful in special edge cases.\n\n```rb\nBigcommerce.configure do |config|\n  config.auth = 'legacy'\n  config.url = 'https://api_path.com'\n  config.username = 'username'\n  config.api_key = 'api_key'\n  config.ssl = {\n    # Faraday options here\n  }\nend\n```\n\nFor more information about configuring SSL with Faraday, please see the following:\n\n- [Faraday SSL example](https://gist.github.com/mislav/938183)\n- [Faraday: Setting up SSL certificates](https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates)\n\n### Customer Login API\nIf you want to generate tokens for storefront login using the Customer Login API, you need to configure your app's \nclient secret.\n\n- ```store_hash```: The store hash of the store you are operating against.\n- ```client_id```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) \"My Apps\" section.\n- ```client_secret```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) \"My Apps\" section.\n\n```rb\nBigcommerce.configure do |config|\n  config.store_hash = ENV['BC_STORE_HASH']\n  config.client_id = ENV['BC_CLIENT_ID']\n  config.client_secret = ENV['BC_CLIENT_SECRET']\nend\n```\n\n## Usage\nFor full examples of using the API client, please see the [examples folder](examples) and refer to \nBigCommerce's [developer documentation](https://developer.bigcommerce.com/api).\n\nExample:\n\n```rb\n# Configure the client to talk to a given store\nBigcommerce.configure do |config|\n  config.store_hash = ENV['BC_STORE_HASH']\n  config.client_id = ENV['BC_CLIENT_ID']\n  config.access_token = ENV['BC_ACCESS_TOKEN']\nend\n\n# Make an API request for a given resource\nBigcommerce::System.time\n=\u003e #\u003cBigcommerce::System time=1466801314\u003e\n```\n\n### Thread Safety\n\nThe `Bigcommerce.configure` method is NOT thread-safe. This mechanism is designed for applications or \nCLIs (command-line interfaces) where thread safety is not a concern. If you need to guarantee thread safety, we support\nthis alternative mechanism to make thread-safe API requests:\n\nRather then setting up a single `connection` for all API requests, construct a new connection for each thread.\nIf you can ensure that each of these connections is stored in a thread-safe manner, you can pass the `connection` as \nyou query the resource.\n\nThis connection is nothing more than a `Faraday::Connection` – so if you want to write your own, or to use your own \nadapters, you can feel free. Please refer to this gem's [connection class](https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/lib/bigcommerce/connection.rb) for more details.\n\n##### OAuth\n\n```rb\nconnection = Bigcommerce::Connection.build(\n  Bigcommerce::Config.new(\n    store_hash: ENV['BC_STORE_HASH'],\n    client_id: ENV['BC_CLIENT_ID'],\n    access_token: ENV['BC_ACCESS_TOKEN']\n  )\n)\n=\u003e #\u003cFaraday::Connection:0x007fbf95068978 ... \u003e\u003e\n\nBigcommerce::System.time(connection: connection)\n=\u003e #\u003cBigcommerce::System time=1466546702\u003e\n\nBigcommerce::System.raw_request(:get, 'time', connection: connection)\n=\u003e #\u003cFaraday::Response:0x007fd4a4063170 ... \u003e\u003e\n```\n\n##### Basic Auth\n\n```rb\nconnection_legacy = Bigcommerce::Connection.build(\n  Bigcommerce::Config.new(\n    auth: 'legacy',\n    url: ENV['BC_API_ENDPOINT_LEGACY'],\n    username: ENV['BC_USERNAME'],\n    api_key: ENV['BC_API_KEY']\n  )\n)\n=\u003e #\u003cFaraday::Connection:0x007fbf95068978 ... \u003e\u003e\n\nBigcommerce::System.time(connection: connection_legacy)\n=\u003e #\u003cBigcommerce::System time=1466546702\u003e\n\nBigcommerce::System.raw_request(:get, 'time', connection: connection_legacy)\n=\u003e #\u003cFaraday::Response:0x007fd4a4063170 ... \u003e\u003e\n```\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## License\nSee [LICENSE.md](LICENSE.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigcommerce-api-ruby/lists"}