amzn / selling-partner-api-samples

Sample code for Amazon Selling Partner API use cases
MIT No Attribution
51 stars 29 forks source link

Create a sample workflow for editing a listing #56

Open johnkw opened 1 week ago

johnkw commented 1 week ago

Can you create a sample workflow for editing a listing using the new non-deprecated options, now that the feed file update is deprecated?

Previously, the workflow was extremely simple:

  1. Go to https://sellercentral.amazon.com/listing/cards/add-product?style=standalone and type in your product type.
  2. Download the template spreadsheet, fill it out, save it as a CSV.
  3. Upload via /feeds/2021-06-30/feeds.

Now however with /feeds/2021-06-30/feeds being deprecated, what is step 1? There's no "JSON" or whatever thing to download anywhere that I can find on SellerCentral.

See https://github.com/amzn/selling-partner-api-models/issues/547 on the prior bug report regarding no documented workflow on this. Unfortunately it was marked closed without actually being addressed. Not sure why really.

jawheral commented 6 days ago

Hi @johnkw,

We do provide guidance on the new listings workflow. Please check the following resources:

Best, Jawher Selling Parnter API

johnkw commented 6 days ago

I see https://developer-docs.amazon.com/sp-api/docs/building-listings-management-workflows-guide#creating-and-updating-listings-items-in-bulk yes.

But where is the new step 1? It skips over step 1 entirely now and starts talking about other details.

The old step 1 is "Go to https://sellercentral.amazon.com/listing/cards/add-product?style=standalone and type in your product type." and from there everything else is super easy.

What is the new URL to go to on SellerCentral in order to download a JSON_LISTINGS_FEED compatible file?

jawheral commented 5 days ago

Hi @johnkw,

You don't need to go to Seller Central. The JSON_LISTINGS_FEED as the name implies is json based. Basically, the feed payload is in JSON format and the structure/data validation is governed by a json schema.

The schema for the JSON_LISTINGS_FEED can be found here with examples of how it looks like.

The schemas for listings attributes (each message in the feed), depend on the product type and can be fetched from the Product Type Definitions API using the getDefinitionsProductType operation.

You can find some JSON_LISTINGS_FEED body example [here](https://developer-docs.amazon.com/sp-api/docs/listing-workflow-migration-tutorial. By inspecting the body, you find a productType attribute ("productType": "LUGGAGE" in the example). As mentioned in the guide, JSON_LISTINGS_FEED and the Listings Items API are contractually compatible. Given you use the same productType and operation the attributes will be governed by the same schema.

I hope this helps!

Best, Jawher Selling Partner API

johnkw commented 5 days ago

Well thank you, however that doesn't solve the problem.

We need a new step 1/2 for the new workflow. So we need to be able to download a file somewhere that has the list of the relevant columns for a given product category, along with documentation for each of the columns, and what the valid values are, and the meaning of those values. Currently, all of that is in the XLSX file from steps 1/2 in the current workflow.

So we need an equivalent file to download for JSON_LISTINGS_FEED, or some way to have JSON_LISTINGS_FEED accept the same column names that the currently-available XLSX file uses, or some documentation embedded in the XLSX to translate each of the normal column names into a JSON_LISTINGS_FEED hierarchical path.

leonardonakagawa commented 5 days ago

Hi @johnkw,

For the API layer, what you mention can be done by using the Product Type Definitions API.

It gives you all the Attributes and valid values needed in a localized form (en_US or pt_BR) for example.

The columns from the Flat-File in the Seller Central are the attributes which you will retrieve using the getDefinitionsProductType operation. You will be able to parse the JSON schema and read relevant attributes and valid values.

This workflow is covered by the sample solution as @jawheral pointed out. But if you are interested in the API itself I encourage you to check the Product Type Definitions API v2020-09-01 Use Case Guide for further information.

Keep us posted if this is what you are looking for.

All the best, Leonardo Nakagawa Solutions Architect, Selling Partner API Developer Support

johnkw commented 4 days ago

Well, I can investigate all of that, but that looks like a gigantic time suck.

Is there currently a way to just download a JSON template, like you're currently able to for the simple CSV? Or a way to map the current CSV columns over to the JSON hierarchical paths?