jlevers / selling-partner-api

A PHP client library for Amazon's Selling Partner API
BSD 3-Clause "New" or "Revised" License
404 stars 197 forks source link

There are also some enumerated values that are not defined in “\SellingPartnerApi\Model\FbaInboundV0\PrepInstruction” #443

Closed lai3221 closed 1 year ago

lai3221 commented 1 year ago

It throw "Invalid value for enum '\SellingPartnerApi\Model\FbaInboundV0\PrepInstruction', must be one of: 'Polybagging', 'BubbleWrapping', 'Taping', 'BlackShrinkWrapping', 'Labeling', 'HangGarment', 'SetCreation', 'Boxing', 'SuffocationStickering', 'SetStickering', 'RemoveFromHanger'.

see https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v0-reference#prepinstruction.

torro-uk commented 1 year ago

We are seeing this too.... is there a fix as the documentation doesn't mention anything other than ShipmentId and Marketplace ID. Is this a code or API issue?

zoltansuto commented 1 year ago

hello guys it is a coding issue, the list of available PrepInstructions have been extended by Amazon, and it is missing from the code. Full list here https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v0-reference#prepinstruction image

zoltansuto commented 1 year ago

@jlevers hi Jessy, what's the process to become a contributor - sorry couldn't find any docs? Because this is an easy fix and I could help ;-)

zoltansuto commented 1 year ago

suggested fix https://github.com/jlevers/selling-partner-api/pull/446

steverobison commented 1 year ago

I don't have an answer offhand as this project, i think, is partially done through an api generator. Rebuilding the way these enum values work would be nice as amazon seems likes to change them without warning. I don't think having them as an actual enum helps anything. Would be better for the api to be agnostic about it and let amazon pass back an error if we didn't pass a valid one.

jlevers commented 1 year ago

@zoltansuto your PR is merged in v5.5.1, so this issue should be resolved. I've also updated the JSON model that's used to generate the PrepInstruction.

@steverobison at this point this particular enum has caused so many problems that i agree, but changing from an enum to a string would be a breaking change, so I can't make that change until the next major version.

zoltansuto commented 1 year ago

@steverobison @jlevers agree with you both, unfortunately I'm not surprised amazon is doing changes without warning :(

zoltansuto commented 1 year ago

@jlevers may I ask where I can find the project that is genating the code? just curious :)

steverobison commented 1 year ago

@steverobison @jlevers agree with you both, unfortunately I'm not surprised amazon is doing changes without warning :(

Yeah. SP-api is such an improvement over MWS but... amazon still does what amazon does.

steverobison commented 1 year ago

@jlevers may I ask where I can find the project that is genating the code? just curious :)

I believe its https://openapi-generator.tech. I had noticed it in comments of the various api classes.

jlevers commented 1 year ago

@zoltansuto it's a private repo, there are a few things getting generated/controlled out of a single repo so i can't really make it public unfortunately...but yes, it uses OpenAPI's generator under the hood

zoltansuto commented 1 year ago

Sure, no problem. I understand

spire-mike commented 8 months ago

@jlevers It seems like Amazon recently added a new value ShipsInProductPackaging value. I think this PR handles it. If so, please merge.

https://github.com/jlevers/selling-partner-api/pull/659