Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: fetchapp

This branch is 9 commits ahead and 74 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

BigCommerce API V2 - Ruby Client

This library provides a wrapper around the BigCommerce REST API for use within Ruby apps or via the console.


The Ruby Client is still in alpha and core features of the API may be unsupported and undocumented.


  • Ruby 1.8.7+
  • Rubygems
  • JSON

To connect to the API, you need the following credentials:

  • Secure URL pointing to a BigCommerce store
  • Username of an authorized admin user of the store
  • API key for the user

A valid API key is required to authenticate requests. To grant API access for user, go to Control Panel > Users > Edit User and make sure that the 'Enable the XML API?' checkbox is ticked.


Download the lib folder and copy it to a path accessible within your app, or install the package directly from Rubygems:

gem install bigcommerce


To use the API client in your Ruby code, provide the required credentials as follows:

require 'bigcommerce'

api ={
    :store_url => "",
    :username  => "admin",
    :api_key   => "d81aada4c19c34d913e18f07fd7f36ca"

Connecting to the store

Ping the get_time method to check that your configuration is working and you can connect successfully to the store:

ping = api.get_time


The API object acts as a gateway to all top level resources in the V2 API.

$ irb
> api =
> api.get_products.each { |product| puts }
> api.get_customers.each { |customer| puts }
> puts api.get_orders_count
> category = api.get_category(11)
> = "Laptops"
> category.update
> brand =
> = "Samsung"
> brand.create
> option = api.get_option(22)
> option.delete
Something went wrong with that request. Please try again.