/marketplace_web_service

Simple wrapper gem for Amazon MWS(Marketplace Web Service) API.

Primary LanguageRubyMIT LicenseMIT

MarketplaceWebService

Gem Version Build Status Coverage Status

MarketplaceWebService is a wrapper gem for Amazon Marketplace Web Service(MWS) API.

Features

  • Build request path form arguments
    • Set default values(API Version, Signature Version, Signature Method, Timestapm, etc...)
    • Expand arrays
    • Escape unsafe characters
    • Make signature and add it to query string
    • Combine request path and query string
  • Provide default HTTP headers
    • Content-Type
    • Content-MD5
    • User-Agent

More detail is available in Amazon MWS Developer Guide

This gem does NOT provides features below.

  • Throttling
  • Build body XML

API Sections

  • ✅ Feeds (2009-01-01)
  • ✅ Reports (2009-01-01)
  • ☑️ Orders
  • ☑️ Products
  • ☑️ Recommendations
  • ☑️ Sellers
  • ☑️ Subscriptions

Installation

Add this line to your application's Gemfile:

gem 'marketplace_web_service'

And then execute:

$ bundle

Or install it yourself as:

$ gem install marketplace_web_service

Examples

Feeds

args = {
  key: "YOUR_SECRET_KEY",
  endpoint: "mws.amazonservices.jp",
  params: {
    "AWSAccessKeyId" => "YOUR_ACCESS_KEY_ID",
    "SellerId" => "YOUR_SELLER_ID",
    "FeedType" => "_POST_PRODUCT_PRICING_DATA_"
  },
  body: xml_string,
  headers:  { 'Contet-Type' => "text/xml; charset=iso8859-1" }
}

MWS::Feed.submit_feed(args) #=> Response XML String

Reports

args = {
  key: "YOUR_SECRET_KEY",
  endpoint: "mws.amazonservices.jp",
  params: {
    "AWSAccessKeyId" => "YOUR_ACCESS_KEY_ID",
    "SellerId" => "YOUR_SELLER_ID",
    "ReportTypeList" => ["_GET_FLAT_FILE_ORDERS_DATA_"],
    "Acknowledged" => false,
    "MaxCount" => 100
  }
}

MWS::Report.get_report_list(args) #=> Response XML String

Contributing

  1. Fork it ( https://github.com/[my-github-username]/marketplace_web_service/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request