jlevers / selling-partner-api

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

FBA Inbound API migration #823

Open NoxArt opened 4 days ago

NoxArt commented 4 days ago

Hi, I know this is mainly for reporting issues and we're not entitled to ask for this, but does anyone have any guide / sample / advice about converting from old jlevers library & FBA Inbound v0 to new jlevers library & FBA Inbound v2024-03-20? I kinda understand the new library and already migrated other APIs, but the FBA Inbound changes I can't wrap my head around and time is running short

Thank you for any help!

dartheditous commented 3 days ago

I'm working on this as well, although I'm not using jlevers' library. If you have a specific question I'll let you know if I've got that far.

It really does seem to be unnecessarily complicated. For example, there are skus which Amazon already knows need no prep. For these, you can specify prepOwner as "NONE". But then there are skus which Amazon doesn't know the prep details for (even though they never needed any under the v0 API). You can update these yourself with setPrepDetails, by setting prepCategory to "NONE", but you also have to add a prepType of "ITEM_NO_PREP", and when you create the shipment, you have to specify the prepOwner as "SELLER", even though no prep is required! 🤦‍♂️

jlevers commented 3 days ago

I just finished implementing a full small parcel inbounding flow, so if you have any particular questions I'm happy to answer them -- I don't have any guide written or anything like that, unfortunately!

NoxArt commented 3 days ago

That's great ... would it be possible to post an (anonymized) example? The readme.md already has examples for Uploading a feed document and Downloading a feed result document, so maybe add it among these? I think it would be helpful to many people

jlevers commented 3 days ago

There's no good way to write a compact example, as there's a lot of mandatory error handling, and 10+ steps depending on the flow, which is why I've asked if you have any specific questions I can answer.

The full flow implementation falls into the category of things that I typically don't share publicly, since I put a lot of work into figuring out how it works and this is how I make my living :) I'm happy to implement a full version of the flow for you as a small consulting project, if that's something you'd be interested in. My email is jesse [at] highsidelabs [dot] co.

That said, still happy to answer specific questions here if you have em!

NoxArt commented 3 days ago

that's understandable, thank you, we will consider it

NoxArt commented 7 hours ago

Around 50% of the time generatePackingOptions fails with "ERROR: Operation GeneratePackingOptions cannot be processed on an empty inbound plan. Please check again later if the inbound plan", are you experiencing that too?

A thing I can't figure out atm is if they already implemented setting Prep/owner label via API so that it no longer says that I can't use Seller Prep option "does not require labelOwner but SELLER was assigned. Accepted values: [NONE]"

They have this https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#setprepdetails

But it doesn't seem to help (though I set both category and type to None, not sure if it's correct)

Also I'm getting empty result for listPackingOptions and calling setprepdetails didnt help ... or is that expected?

dartheditous commented 7 hours ago

A thing I can't figure out atm is if they already implemented setting Prep/owner label via API so that it no longer says that I can't use Seller Prep option "does not require labelOwner but SELLER was assigned. Accepted values: [NONE]"

Can't quite work out what you're saying here... but you can call listPrepDetails to work out whether you need to set labelOwner and prepOwner to NONE or SELLER/AMAZON (it's really illogical and complicated though. It will give you a list of prepTypes, and if one of them is ITEM_LABELING then you need to set labelOwner to SELLER/AMAZON. If any other prepTypes are present, then you have to set prepOwner to SELLER/AMAZON - even if the only other prepType is ITEM_NO_PREP. And that's without considering any of the constraints, which don't seem to be explained in the docs anywhere).

But it doesn't seem to help (though I set both category and type to None, not sure if it's correct)

NONE isn't valid for prepType. Did you get the OperationId from your call to setPrepDetails and confirm that the operation succeeded (using getInboundOperationStatus)?

NoxArt commented 7 hours ago

Thank you for quick reply

Sorry, yes, I mean NONE for Category and [ ITEM_NO_PREP ] for Type

It now passes with labelOwner = NONE, prepOwner = SELLER ... not sure this is what is correct for us, I would have assumed there should be some labelOwner and it would probably be us (seller)

I added checking for operation status + waiting and now it's working, thank you so much