Peddler: List my FBM Inventory with

461 views Asked by At

I've installed Peddler to connect to Marketplace Web service. I cannot find which is the method to list my inventory (Merchant)

require "peddler"

client = MWS.orders(
  primary_marketplace_id: "XXXX",
  merchant_id: "XXX",
  aws_access_key_id: "XXX",
  aws_secret_access_key: "XXXXX",
)

p client.list_inventory_supply

Error

app.rb:30:in `<main>': undefined method `list_inventory_supply' for #<MWS::Orders::Client:0x007fd6ab9d0f60> (NoMethodError)
2

There are 2 answers

0
mpowmap On

First - Have you tried playing with this using Scratchpad? If not head over to https://mws.amazonservices.com/scratchpad/index.html

You should have this bookmarked if you are working with the MWS API.

In Scratchpad you can test API calls.

Check out the following link and READ IT: http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html

You will see the Report that contains the SKU, ASIN, Price, and Quantity fields. You cant miss it.

The Enumeration value of the Report is what you use as ReportType when Requesting the Report.

The process works like this. You request a Report by ReportType

You check to see if that Report is DONE (ReportProcessingStatus).

Once it is (DONE) you GetReport using the ReportID that is listed when you check on the Status.

You parse the Report.

0
Charles On

Check out this part of the error: for # (NoMethodError)

What that error is saying is list_inventory_supply is not a method of MWS::Orders. (It's a method of MWS::FulfillmentInventory)

What you're looking for is this (see client.list_inventory_supply):

require "peddler"

client = MWS.fulfillment_inventory( primary_marketplace_id: "XXXX", merchant_id: "XXX", aws_access_key_id: "XXX",
aws_secret_access_key: "XXXXX", )

p client.list_inventory_supply seller_skus: ['PF-5VZN-04XR', 'V4-03EY-LAL1', 'OC-TUKC-031P']