Coder Social home page Coder Social logo

amazon_seller_central's Introduction

amazon_seller_central

This gem wraps Amazon's SellerCentral pages with a Ruby API. Currently this gem supports accessing buyer feedback, accessing current inventory listings, and simple updates to those listings.

Setup

You need to require the gem and then provide the email address and password you use to login to Amazon SellerCentral via the AmazonSellerCentral.configure method:

require 'amazon_seller_central'

AmazonSellerCentral.configure do |config|
  config.login_email    "[email protected]"
  config.login_password "secret"
end

Feedback Access

After configuration, the easiest way to access your feedback is using the block form:

AmazonSellerCentral::FeedbackPage.each_page do |page|
  feedbacks = page.feedbacks
  feedback = feedbacks.first

  feedback.arrived_on_time   # true, false, or nil
  feedback.comments          # The feedback left ("Excellent transaction!")
  feedback.customer_service  # true, false, or nil
  feedback.date              # A Time object
  feedback.item_as_described # true, false, or nil
  feedback.order_id          # An Amazon Order ID, like 123-1234567-1234567
  feedback.rater_email       # [email protected]
  feedback.rater_role        # typically "Buyer"
  feedback.rating            # an integer, 1 - 5
end

Inventory Access

You can access current inventory in much the same way as feedback:

AmazonSellerCentral::Inventory.each_page do |page|
  listings = page.listings
  listing = listings.first

  listing.sku          # <Your sku for this listing>
  listing.asin         # An ASIN, e.g. B003962DXE
  listing.product_name # The name of the product
  listing.created_at   # a Time object representing when you created this listing
  listing.quantity     # an integer
  listing.condition    # "New" or "Used - Very Good" or whichever
  listing.price_cents  # an integer of cents. listing.price is also available to get dollars
  listing.status       # "Open", "Closed (Out of Stock)", or "Incomplete"
end

Updating Inventory

Currently this gem supports updating a listing you've already created via the web interface or some other API. Future versions may include creating listing entries from scratch.

To update a listing, you use ListingPage#apply_listings, like so:

# alternately get a page inside the 'each_page' method above
page = AmazonSellerCentral::Inventory.load_first_page
# Updating a listing for my sku, "PR6902-2":
listing = page.listings.find("PR6902-2")
listing.quantity = 10
listing.price_cents = 1599
# Note the array syntax here allows you to update multiple listings
# on this page at the same time.
page.apply_listings([listing])

TODO

  • Access to more sections of Amazon SellerCentral.
  • Rework Mechanize access to allow parallel / thread-safe usage
  • Note: This library is likely not thread-safe. (It's untested)

Contributing to amazon_seller_central

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2011 Optoro, Inc. See LICENSE.txt for further details.

amazon_seller_central's People

Contributors

awwaiid avatar bsmith-optoro avatar cokara avatar cpartin avatar emckenna avatar jedprentice avatar jshakespear avatar jszmajda avatar openmailbox avatar psujohn avatar yportnoy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.