All Projects → hakanensari → Peddler

hakanensari / Peddler

Licence: mit
Amazon MWS API client

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Peddler

mws-orders
A Ruby interface to the Amazon MWS Orders API
Stars: ✭ 14 (-95.3%)
Mutual labels:  ecommerce, amazon
Awesome Amazon Seller
A curated list of tools and resources for Amazon sellers.
Stars: ✭ 117 (-60.74%)
Mutual labels:  ecommerce, amazon
Gogrocery
Its an eCommerce app inspired from Amazon , big Basket , grofers ,grocery app , Etc
Stars: ✭ 62 (-79.19%)
Mutual labels:  ecommerce, amazon
awesome-ecommerce
Collect and develop Open Source or Free Projects for building ecommerce platform easy and fast and free
Stars: ✭ 39 (-86.91%)
Mutual labels:  ecommerce, amazon
Magento2 Gmail Smtp App
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Stars: ✭ 281 (-5.7%)
Mutual labels:  amazon
S Cart
This project has been replaced by https://github.com/s-cart/s-cart
Stars: ✭ 258 (-13.42%)
Mutual labels:  ecommerce
not-one-link
A simple Node.js library that allows you to re-map Amazon links from one country to another (Like Amazon OneLink™️ but simpler to use)
Stars: ✭ 19 (-93.62%)
Mutual labels:  amazon
AquilaCMS
AquilaCMS is an Open Source and "all in one" ecommerce solution, self hosted, built using nodejs (MERN stack)
Stars: ✭ 69 (-76.85%)
Mutual labels:  ecommerce
React Storefront
React Storefront - PWA for eCommerce. 100% offline, platform agnostic, headless, Magento 2 supported. Always Open Source, Apache-2.0 license. Join us as contributor ([email protected]).
Stars: ✭ 292 (-2.01%)
Mutual labels:  ecommerce
Amazon Alert
Track prices on Amazon and receive email alerts for price drops
Stars: ✭ 290 (-2.68%)
Mutual labels:  amazon
Awesome Woocommerce
Plugins and code snippets to improve your WooCommerce store.
Stars: ✭ 279 (-6.38%)
Mutual labels:  ecommerce
Php Aws Ses
PHP classes that interfaces Amazon Simple Email Service
Stars: ✭ 263 (-11.74%)
Mutual labels:  amazon
Firebase Cms
A CMS + E-commerce platform built with Angular and Firebase
Stars: ✭ 286 (-4.03%)
Mutual labels:  ecommerce
craft-commerce-widgets
Insightful widgets for Craft CMS Commerce stores
Stars: ✭ 33 (-88.93%)
Mutual labels:  ecommerce
Workarea
Workarea is an enterprise-grade Ruby on Rails commerce platform
Stars: ✭ 290 (-2.68%)
Mutual labels:  ecommerce
Nearby-Shops-Android-app-Deprecated
Open Source Food Delivery and local shopping Platform
Stars: ✭ 12 (-95.97%)
Mutual labels:  ecommerce
Alexa Skill Kit
Library for effortless Alexa Skill development with AWS Lambda
Stars: ✭ 278 (-6.71%)
Mutual labels:  amazon
Sapper Ecommerce
Svelte ecommerce - Headless, Authentication, Cart & Checkout, TailwindCSS, Server Rendered, Proxy + API Integrated, Animations, Stores, Lazy Loading, Loading Indicators, Carousel, Instant Search, Faceted Filters, 1 command deploy to production, Open Source, MIT license. Join us as contributor ([email protected])
Stars: ✭ 289 (-3.02%)
Mutual labels:  ecommerce
React Storefront
Build and deploy e-commerce progressive web apps (PWAs) in record time.
Stars: ✭ 275 (-7.72%)
Mutual labels:  ecommerce
Buildapks
Really quickly build APKs on handheld device (smartphone and tablet) in Amazon, Android, Chromebook, PRoot and Windows📲 See https://buildapks.github.io/docsBuildAPKs/setup to start building APKs.
Stars: ✭ 272 (-8.72%)
Mutual labels:  amazon

Peddler

Build Maintainability Test Coverage

💥 Amazon is migrating to the newly-launched Selling Partner API (SP-API) and is no longer granting new users access to the MWS APIs. I hope to add support in Peddler in due course.

Peddler is a Ruby interface to the Amazon MWS API, a collection of web services that help Amazon sellers programmatically exchange data on their listings, orders, payments, reports, and more.

To use Amazon MWS, you must have an eligible seller account and register as a developer. You can then access your own selling account using its merchant ID—note that Amazon also refers to this as seller ID or merchant token in different places.

Amazon has multiple regions. Each region requires application developers to register individually. Some MWS API sections may require additional authorisation from Amazon.

Peddler

Usage

Require the library.

require "peddler"

A client requires the AWS credentials of the application developer. If you are working in a single MWS region, you can set them globally.

export AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY

Now, create a client with the Amazon marketplace you signed up on and a merchant ID. Peddler provides a class for each API section under an eponymous namespace.

client = MWS.orders(marketplace: "ATVPDKIKX0DER",
                    merchant_id: "123")

# or a shorthand
client = MWS.orders(marketplace: "US",
                    merchant_id: "123")

If you are creating a client for another seller, pass an MWS Auth Token as well.

client = MWS.orders(marketplace: "ATVPDKIKX0DER",
                    merchant_id: "123",
                    auth_token: "123")

You won't be able to create a client for another seller if you are in different regions.

If you are working with sellers across multiple regions, a single set of credentials will not be enough. In that case, do not use global environment variables and pass your AWS credentials when creating the client.

client = MWS.orders(marketplace: "ATVPDKIKX0DER",
                    merchant_id: "123",
                    aws_access_key_id: "123",
                    aws_secret_access_key: "123")

Once you have a client with valid credentials, you should be able to make requests to the API. Clients map operation names in a flat structure. Methods have positional arguments for required input and keyword arguments for optional parameters. Both method and argument names are underscored but otherwise identical to the names of the corresponding operations and parameters documented in the API.

For instance, using the above MWS Orders client:

response = client.list_orders('ATVPDKIKX0DER')

Parser

Peddler wraps successful responses in a generic parser that handles both XML documents and flat files:

response = client.get_service_status
response.parse # will return a Hash object
response.dig('Status') # delegates to Hash#dig

You can swap this with a purpose-built parser.

MWS::Orders::Client.parser = MyParser

For a sample implementation, see my MWS Orders library.

Throttling

Amazon limits the number of requests you can submit to some operations in a given amount of time. When you hit a limit, your request throws a Peddler::Errors::RequestThrottled error.

You will want to exit or back off exponentially and retry if you hit this error.

begin
  client.throttled_method
rescue Peddler::Errors::RequestThrottled
  back_off_exponentially
  retry
end

Some API sections also have an hourly request quota in addition to the numerical request quota. When you hit this quota, your request throws a Peddler::Errors::QuotaExceeded error.

You can introspect your quota usage on the parsed response:

response = client.method_with_quota
puts response.mws_quota_remaining
# 150

begin
  client.method_with_quota
rescue Peddler::Errors::QuotaExceeded => error
  puts error.response.mws_quota_remaining
  # 0
end

Read tips on how to avoid throttling.

Debugging

If you are having trouble with a request, read the Amazon documentation. Peddler's source also links individual operations to their corresponding entries in the Amazon docs.

Note that some optional keywords have default values.

To introspect requests, set the EXCON_DEBUG environment variable to 1 or similar truthy value. Peddler will then log request and response internals to stdout.

If you contact Amazon MWS support, they will ask you for the RequestId and Timestamp of affected requests.

response = client.problem_method
puts response.mws_request_id
puts response.mws_timestamp

You can access the same attributes on error.response. See above example.

The APIs

Easy Ship

With the Easy Ship API, you can build applications that help sellers in India manage and ship their Amazon Easy Ship orders. Your Amazon Easy Ship applications can get available pickup slots; schedule, reschedule, and cancel pickups; and print labels, invoices, and warranties.

Feeds

The MWS Feeds API lets you upload inventory and order data to Amazon. You can also use this API to get information about the processing of feeds.

Finances

The MWS Finances API enables you to obtain financial information relevant to your business with Amazon. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range.

Fulfillment Inbound Shipment

With the MWS Fulfillment Inbound Shipment API, you can create and update inbound shipments of inventory in the Amazon Fulfillment Network. You can also also request lists of inbound shipments or inbound shipment items based on criteria that you specify.

Fulfillment Inventory

The MWS Fulfillment Inventory API can help you stay up-to-date on the availability of your inventory in the Amazon Fulfillment Network. The Fulfillment Inventory API reports real-time availability information for your Amazon Fulfillment Network inventory regardless of whether you are selling your inventory on Amazon's retail web site or through other retail channels.

Fulfillment Outbound Shipment

The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed through channels other than Amazon's retail web site, using your inventory in the Amazon Fulfillment Network. You can request previews of potential fulfillment orders that return estimated shipping fees and shipping dates based on shipping speed. You can get detailed item-level, shipment-level, and order-level information for any existing fulfillment order that you specify. You can also request lists of existing fulfillment orders based on when they were fulfilled and by the fulfillment method associated with them.

Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.

Merchant Fulfillment

The Merchant Fulfillment API provides programmatic access to Amazon’s fulfillment shipping services for sellers, including competitive rates with Amazon-partnered carriers. Sellers can find out what shipping services are available by submitting information about a proposed fulfillment shipment, such as package size and weight; shipment origin and destination; and delivery date requirements. Sellers can choose from the shipping service options returned by Amazon, and then receive shipping labels for fulfilling their orders.

Orders

With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.

Products

The MWS Products API helps you get information to match your products to existing product listings on Amazon Marketplace websites and to make sourcing and pricing decisions for listing those products on Amazon Marketplace websites.

Recommendations

The Recommendations API enables you to programmatically retrieve Amazon Selling Coach recommendations by recommendation category. A recommendation is an actionable, timely, and personalized opportunity to increase your sales and performance.

Reports

The Reports API lets you request reports about your inventory and orders.

Sellers

The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.

Shipment Invoicing

With the Shipment Invoicing API section (in conjunction with the FBAOutboundShipmentStatus notification), you can integrate invoicing into Amazon’s shipping process for a seller’s Fulfillment by Amazon (FBA) orders.

This functionality is available only in the Brazil marketplace.

Subscriptions

The Amazon MWS Subscriptions API section enables you to subscribe to receive notifications that are relevant to your business with Amazon. With the operations in the Subscriptions API section, you can register to receive important information from Amazon without having to poll the Amazon MWS service. Instead, the information is sent directly to you when an event occurs to which you are subscribed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].