Amazon-SP-API-CSharp icon indicating copy to clipboard operation
Amazon-SP-API-CSharp copied to clipboard

Can you also include the Shipping API V2 support in this project?

Open IamGanesh19 opened this issue 3 years ago • 8 comments

Amazon Logistics has shipping api v2 created outside of SP-API. SP-API has V1 support for shipping API. Can you also include support for Shipping API V2 in this project? Below URL contains the model for v2.

https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-model

IamGanesh19 avatar Aug 06 '22 13:08 IamGanesh19

I second this! @IamGanesh19 , how do you determine which model to pull/use in your code? We are generating C# code using swagger codegen and we're trying to figure out how to determine which version to use, and how to tell if there have been updates.

smargoli2 avatar Aug 24 '22 09:08 smargoli2

I second this! @IamGanesh19 , how do you determine which model to pull/use in your code? We are generating C# code using swagger codegen and we're trying to figure out how to determine which version to use, and how to tell if there have been updates.

Yep, that is a challenge. Not sure how to handle it. For now I have created a pull request to support this by adding V2 models & Services.

IamGanesh19 avatar Aug 25 '22 14:08 IamGanesh19

More work still needed here

abuzuhri avatar Sep 02 '22 13:09 abuzuhri

Will be needing this in the new year, happy to help once have got our products live.

TechyChap avatar Oct 03 '22 17:10 TechyChap

I ended up generating an API for each version, and I reference the version that I want to use in my code. I used OpenAPI Generator to generate the C# code with package names that include the version.

smargoli2 avatar Oct 06 '22 07:10 smargoli2

@IamGanesh19 almost finish this and its should be ready for test now i will do some change to make not need to take parameter from amazon connection

@TechyChap take look to the work and see how we can improve it

abuzuhri avatar Oct 06 '22 18:10 abuzuhri

In Model for the ShippingV2 need some improvements. In "RequestedDocumentSpecification" class, datatype of the attribute Format, NeedFileJoining, RequestedDocumentTypes should change.

Please change this so we can create valid request.

ebgtestdotnet avatar Oct 07 '22 12:10 ebgtestdotnet

@IamGanesh19 please check here

abuzuhri avatar Oct 07 '22 12:10 abuzuhri

Shipping V2 doesn't work when trying to purchase shipment. Dpi so optional but if you don't provide it in the RequestedDocumentSpecification then you get the reply: Amazon_ Shipping doesn't support requested DPI null. Currently, supported dpi : [300, 203] However you are unable to enter the DPI, I believe this should be an integer value but the DPI has been put in as a class with no properties and no constructor to actually set the DPI. Due to this the purchaseShipment call is unusable.

StuartGarnham avatar Nov 03 '22 10:11 StuartGarnham

@StuartGarnham thanks for finding this, I have modified the model can you please pull the latest code and check if it works?

RenzoF avatar Nov 04 '22 15:11 RenzoF

It is not working for me. It just returns "Invalid Input" when I make a call to ShippingV2.PurchaseShipmentAsnyc.

`var request = new PurchaseShipmentRequest() { RequestToken = requestToken, RateId = rateId, RequestedDocumentSpecification = new RequestedDocumentSpecification { Format = DocumentFormat.PNG, Dpi = 300, PageLayout = "LEFT", Size = new DocumentSize { Length = 6, Width = 4, Unit = "INCH" }, NeedFileJoining = "false", RequestedDocumentTypes = new List<DocumentType> { DocumentType.LABEL } } };

return await _sellingPartnerAPI.PurchaseShipment(request, brand);`

I get this response: An invalid documentation specification was provided. Please provide a documentation specification based on the GetRates response.

marketlabdev avatar Dec 22 '22 16:12 marketlabdev

Do you still facing same issue ?

abuzuhri avatar Mar 17 '23 19:03 abuzuhri

I've updated to the latest nuget package and I'm no longer having problems.

marketlabdev avatar Mar 19 '23 17:03 marketlabdev