Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vik007/gmc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple REST APIs for Google Merchant Center

This repository contains Simple REST APIs for Google Merchant Center. Official API documentation link

Usage

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

Usage

    config = Gmc.config
    config.merchant_id = "<Merchant ID>"
    config.access_token = "<Access Token>"
    config.api_key = "<API Key>"

    # or Setup into config/gmc.rb file

Product 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.products

Supported Ruby versions

This library is supported on Ruby 2.5+.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gmc.

License

The gem is available as open source under the terms of the MIT License.

About

Google Merchant Center

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages