ScaleLeap / selling-partner-api-sdk

A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API

Home Page:https://npm.im/@scaleleap/selling-partner-api-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shipping-API getRates has v2

optikalefx opened this issue · comments

I'm raising this issue as I try to get more data from Amazon. But for the shipping api, the getRates call, there is a required field channelDetails which is not present in the swagger, and therefore not here either.

However, I think if possible, we should get ahead of this. Here is the response from Amazon in our ticket.

The swagger you have provided is for the v1 getRates API. We have upgraded to v2 getRates API for which this channelDetails field is mandatory, but we are still supporting the older v1 APIs. For v1 APIs, channelDetails parameter is not available.

I don't see v2 anywhere, I don't see different swagger anyway. So trying to figure that out.

commented

Hi @optikalefx,

We use a codegen approach for generating this sdk.

Unfortunately we cannot amend the resulted code manually as it is not sustainable.

Hi @moltar, are you aware of different swagger to use? Amazon seems to be indicating there is updated swagger

commented

@optikalefx it seems like we have getRates support already.

getRates: async (body: GetRatesRequest, options: any = {}): Promise<RequestArgs> => {

Is this not what you are looking for?

commented

Oops, sorry, missed your point again 😅 You are looking for channelDetails.

But it does not exist in the official OpenAPI specification:

This is the search result for channelDetails string in the selling-partner-api-models repo, from which we generate this SDK:

https://github.com/amzn/selling-partner-api-models/search?q=channelDetails


screenshot-20210901T084447-v8qHdCKk

@moltar Got more word from Amazon on this.

As far as I know, v2 is still in UAT and has not been officially launched.

So we can close this for now. When v2 lands, I'll check-in then. I guess this API cannot be used with Prime orders for now. 🙃

commented

@optikalefx if you know the definitions yourself, you can fork the models repo, add your own specs, then fork this repo and replace the URL for the models repo and re-generate your own SDK.

@moltar I have the v2 swagger from Amazon. Is there a way this can be integrated into this library?

4. shippingV2.json.zip

commented

We cannot integrate it if it's not in the repo.

Best if you fork on your own for now.

@optikalefx if you know the definitions yourself, you can fork the models repo, add your own specs, then fork this repo and replace the URL for the models repo and re-generate your own SDK.