This repository contains Simple REST APIs for Google Merchant Center. Official API documentation link
Install the client using gem install or by adding it to your Gemfile. Then, to use it.
gem 'gmc'And then execute:
$ bundle install
Or install it yourself as:
$ gem install gmc
After updating your bundle, run the installer
$ rails g install gmc
config = Gmc.config
config.merchant_id = "<Merchant ID>"
config.access_token = "<Access Token>"
config.api_key = "<API Key>"
# or Setup into config/gmc.rb fileProduct Create Endpoint
gmc = Gmc::Client.new
gmc.create(
id: '454',
title: 'Test',
description: 'Test Des',
link: 'https://examples.com/product',
image_link: 'https://examples.com/product.png',
content_language: 'en_US',
target_country: 'AU',
brand: 'Google',
feed_label: 'AU',
channel: 'online',
availability: 'in stock',
condition: 'new',
currency: 'INR',
price: '236.36'
)Product Update Endpoint
gmc = Gmc::Client.new
gmc.update(
id: '454',
title: 'Test',
description: 'Test Des',
link: 'https://examples.com/product',
image_link: 'https://examples.com/product.png',
brand: 'Google',
availability: 'in stock',
currency: 'INR',
price: '236.36'
)Product Delete Endpoint
gmc = Gmc::Client.new
gmc.destroy(id: '454')Product Detail Endpoint
gmc = Gmc::Client.new
gmc.product(id: '454')
gmc.productsThis library is supported on Ruby 2.5+.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gmc.
The gem is available as open source under the terms of the MIT License.