Marketplaces / Amazon SP API - Technical Scope / Amazon Smart Connect / Amazon Smart Connect - Accept Reject Shipments

Amazon Smart Connect - Accept/Reject Shipments

Version Created By Date Notes
1.0 Danail Deltchev 10.07.2024 First version
1.1 Hristiyan Georgiev 21.08.2024 Mapping changes for shipmentid
1.2 Milen Markov 26.09.2024 Updated operation parameter to showcase a usable keyword and added it to the description of parameters (operationId)
1.3 Danail Deltchev 08.10.2024 Reference ID should be STRING
1.4 Milen Markov 09.10.2024 Brought ‘reason’ out of the ‘lineItem’ node

The purpose of this page is to specify how Hemi will update Shipments to Amazon via the Smart Connect solution to Accepted or Rejected status

As previously described each Shipment can be only fully Accepted or fully Rejected

We are to use our abstraction for Acknowledgement

Order General Acknowledgement

We need to have additional validations that will check for full Acceptance or Rejection - IF an order will not be fully Accepted OR fully Rejected (no mixture allowed) within one Acknowledgement record in Hemi we should block it and mark it as “error” with the following message: “Partial Acknowledgement operations are not allowed for the Amazon Smart Connect integrations”

This operation is done via the POST processShipment

Example call:

<v1.2>

`https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}?operation={operationId}`

Usable Parameters:

Parameter Name Parameter Description Type Required Hemi Notes
shipmentId The id of the shipment which is to be confirmed for fulfillment String Yes <v1.1> To be mapped from Orders Amazon > Smart Connect Shipment ID </v1.1>
operationId string Yes CONFIRM for when we need to send Accept
REJECT for when we need to send Reject

</v1.2>

Example mapping:

Amazon Fields Hemi Mapping Hemi Notes
referenceId Order Acknowledgement > ID A unique reference to our rejection. If we are sending it successfully from Hemi we should be able to just pick the Hemi Acknowledgement ID
lineItems
lineItem
id Product in Order > Item Order Line ID This is the unique reference per SKU as received in the Shipment. We need to map to it from the Order Acknowledgement Rows to obtain it
quantity We should count the Order Acknowledgement Row Lines with Acknowledgement Action = Reject

Just as a note - this should’ve already passed the validation that it is full Rejection but just as a reminder - we are to send only full acceptance (quantity ordered = quantity accepted) or full rejection (quantity ordered = quantity rejected) on all products within the order | | | reason | | “OUT_OF_STOCK” | Hardcoded - <v1.4> Changed it’s location to be outside the ‘lineItem’ node but in ‘lineItems’ instead </v1.4> |

Please note in the above Example mapping everything mentioned is about rejection. This is because the fields in the body are mandatory ONLY when we are sending a rejection as operation. If we just make the call with ShipmentID and no body it is treated as accepted (exactly like we treat it where we ask only for the accepted quantity and we auto reject everything else)

Once we’ve successfully submitted the Accept/Reject flow and received a 200 response we want to follow it up with a confirmation check via the getShipment operation.

See how to use getShipment here: Amazon Smart Connect - Get Shipment

Once we successfully receive the information for the order and check that the “Status” field (please see the mapping for getShipments) is as “CONFIRMED” (accepted successfully) or “CANCELLED” (rejected successfully) we can proceed with updates to the order in Hemi.

All functions of communication and status updates should follow the abstraction rules. Once an order is Accepted successfully we treat it as RFS with everything that comes with it. Same goes about Rejected successfully.

If getShipment returns a different status we are to treat the whole operation as a fail and act accordingly with storing the following error in Order Error: “Accept/Reject operation was not a success based on the additional checks. Please check with Support and/or your Amazon account manager”

Note: There is the option that getShipment failed for whatever reason where the actual Confirmation was a success. In this case when we try to resubmit we should expect to receive an error from Amazon. IF we receive an error 409 we should treat this as a success for the operation we are sending and proceed to make the next getShipment which is to validate the status. From there on we should treat everything as per the above (if status matches our operation proceed to success scenario if not, error etc.)

<v1.3>

Please note field Reference ID should be type “string” no matter if we are sending int from our DB

</v1.3>

Is this article helpful?
0 0 0