amz-tools / amazon-sp-api

Amazon Selling Partner API Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shipping.getShipment and merchantFulfillment.getShipment

littleGauze opened this issue · comments

how do I invoke shipping.getShipment and merchantFulfillment.getShipment api with operation?
Do i have to use the api_path to invoke it individually.

Hi @littleGauze,

yes, I'm afraid that's the only way of calling it right now, as the operation "getShipment" will always call the "shipping.getShipment" endpoint.

To be honest, we totally missed the possibility of operations existing more than once with the exact same name! We chose the operation centric design because it seemed like the shortest and easiest way of calling the API and under the impression that Amazon is never using the same operation name twice.

Not quite sure how to come up with a fix yet that will not include breaking changes and doesn't end up in patching around here and there. We might force the use of an endpoint parameter for all "duplicate" operations or we might have to think about a new major version in the future that can include some breaking changes but without forcing people to restructure too much.

The same problem also exists for the "createShipment" and "cancelShipment" operations.

Hi @littleGauze,

yes, I'm afraid that's the only way of calling it right now, as the operation "getShipment" will always call the "shipping.getShipment" endpoint.

To be honest, we totally missed the possibility of operations existing more than once with the exact same name! We chose the operation centric design because it seemed like the shortest and easiest way of calling the API and under the impression that Amazon is never using the same operation name twice.

Not quite sure how to come up with a fix yet that will not include breaking changes and doesn't end up in patching around here and there. We might force the use of an endpoint parameter for all "duplicate" operations or we might have to think about a new major version in the future that can include some breaking changes but without forcing people to restructure too much.

The same problem also exists for the "createShipment" and "cancelShipment" operations.

got it.

Just added a new client version (0.5.0) that includes the possibility of specifying an endpoint to use, so. i.e. "shipping" or "merchantFulfillment", either as a separate parameter endpoint:'shipping' or shorthand as operation:'shipping.getShipment'.

Using .callAPI() without specifying an endpoint is still possible and working, but is considered deprecated and is discouraged.