amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
612 stars 736 forks source link

Rate Limits + questions #673

Closed A-Lawrence closed 4 years ago

A-Lawrence commented 4 years ago

Hi there!

I'm really pleased to see that Amazon is embracing the world of having a REST-based API, although I was a little taken back that the documentation remains some of the least developer-friendly I have to engage with (take a look at Stripe, Shopify, or OnBuy for examples of truly wonderful documentation to use).

A few questions:

(1) is the documentation going to be formally published somewhere, to avoid us needing to build it ourselves using Swagger, or attempting to navigate via the GitHub UI?

(2) the rate-limiting documentation is just as unclear as before, except this time there's no easy way of finding out how many tokens we start within our buckets. Also, are different request groups banded together as with the old API, i.e. are all order endpoints bundled into the same rate-limiting group?

(3) following on from the above, the way the documentation is written suggests that 1 getOrder request can be submitted per second (say, downloading 100 orders). The getOrderItems endpoint is then limited to 1 per second also, which means we'll have to fire off 100 requests over the course of 2 minutes. Why can we not expand the getOrder response to include this data? Likewise with the getOrderBuyerInfo.

I'm sure there's a lot of work gone into this, but I'm a little concerned that instead of reimaging the API, it's just been replicated, including the bizarreness of having an ORDER_ACKNOWLEDGEMENT_FEED which actually cancels orders rather than acknowledges them. On the topic of feeds, I see that feeds are still being submitted as XML, despite switching to a JSON based API - why can't we submit the content as such instead of having to endure the 90's concept of an XSD.

seanevan commented 4 years ago

@A-Lawrence, my apologies for the delay in responding to you on this issue. Answering your questions:

  1. Yes, we will formally publish the documentation in the future. Right now we are focused on getting use case guides published to GitHub, which should address the need to build docs using Swagger.
  2. Thanks for the feedback, I'll relay it to the author of the usage plans guide. Different request groups are banded together right now.
  3. Have you considered using order reports for this scenario? Might help if I understand your use case a bit more to give a better answer.

To your last point, we've focused on first attaining parity with MWS APIs, but we're not stopping there. While I can't share specific plans, I can say that the two pain points you've noted are ones that we've definitely considered as part of the SP-API future state.

Best regards, Sean Evans Manager, Support Engineering

doctaphred commented 3 years ago

Hi @seanevan, thanks for the reply: I had the same question as A-Lawrence regarding the rate limiting, and it's good to hear confirmed that order reports should present a viable alternative.

I personally am a big fan of XML and XSDs, but the core XSDs at https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/XML_Documentation_Intl.pdf and https://sellercentral.amazon.com/gp/help/help.html?itemID=1611 contradict the format returned by the orders report API (e.g., the orders report response claims it uses the xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" schema, but its MessageType has the valueAllOrdersReport, which is not one of the values enumerated at https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/amzn-envelope.xsd). I can't find any documentation at all for the AllOrdersReport response in either the MWS or the SPAPI docs, and the responses I'm receiving have significant differences from the schema described in the OrderReport XSD. (The XSDs linked to in the above documentation appear to be between 9 and 14 years old, so I'd imagine they've developed significantly since they were published.)

I've attempted to infer a partial schema for the AllOrdersReport myself, which should hopefully mostly work, but it would be great to be able to know for sure what kinds of data I should and should not expect these responses to include. (The flat-file/TSV orders reports unfortunately are not sufficient, as they appear to be missing certain vital data, including the AmazonOrderItemCode.)

Are you able to provide links to the up-to-date core and AllOrdersReport XSDs, or at least to some sort of documentation of the structure and contents of the XML-format orders report responses?

saras-daton commented 2 years ago

Hi,

Our report jobs are getting cancelled regularly, especially the various inventory reports. The response we get from Amazon doesn't tell us why the report request is getting cancelled. We are left wondering if it is because of any breach of rate limits on our end. Can someone please point us to any documentation that helps us better understand this situation and what we can do about it? @seanevan @rugved1991