Using the API to retry a failed fulfillment (and change shipping method - using Amazon MCF)

Highlighted
New Member
8 0 0

Hi - I'm running into an issue that I can't seem to find specific documentation for.

 

I use Amazon Marketplace Web to fulfill my shopify orders. It works great, however recently I introduced a new shipping method and the name does not match the default Amazon ones which makes it fail - I was aware that this happens and did it intentionally. Specifically I call it Ground Shipping instead of Standard Shipping which Amazon expects.

 

I want to use the API to resubmit it for fulfillment but to override and make it send to Amazon as Standard Shipping so that it goes through. This can be done easily within the Shopify backend manually (I'm attaching screenshots of where it shows it failed automatic attempt and where I can retry manually and choose the right shipping method from a pulldown).

 

I was trying to use the fulfillments.json endpoint for an order and sending a json string that looks like this for example:

 

{
"fulfillment": {
"location_id": 123456,
"tracking_number": null,
"notify_customer": false,
"shipping_method": "Expedited Shipping",
"shipping_carrier": "None"
}

 

123456 would be my actual location id.

 

I thought this would work but perhaps it doesn't let you send shipping_method. 

 

This is the URL I would post to, 1234 would be the order id :

 

/admin/api/2019-10/orders/1234/fulfillments.json

 

I know that the location_id I'm using is right because if I put in a wrong one I get a specific error that it's invalid, however when I submit with all the correct info I get this error:

 

{"errors":{"base":["Failed to submit fulfill request."]}}

 

Which is not descriptive, I can't tell what's causing it.

 

Does anyone know if I can achieve what I'm trying to do with the API instead of having to do it manually in the Shopify backend?

 

Thanks!

 

fulfillment failure with wrong shipping method name.pngpage in backend that lets me change shipping method and resubmit.png

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @Alaya ,

 

Anything that can be accomplished from the Shopify Admin for your shop can usually be also accomplished through the Shopify Admin API.

 

For the error you are retrieving, can you provide the value of the "X-Request-ID" header from the Shopify error response? With this value we could go through our platform logs to better investigate why this error is occurring.  

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
8 0 0

Hi Hassain,

 

Thanks for the response. Here is the request ID: c84300b0-20af-4db0-bc73-19ab11a0563b

 

Please let me know what I can do differently. Once again, I just want to resubmit this fulfillment to Amazon Marketplace Web with expedited shipping as the method so that it will go through.

 

Thanks!

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hey @Alaya ,

 

Thank you for providing the X-Request-ID. Through this I have been able to investigate through our platform logs for both the failing POST request to the fulfillments.json Admin API endpoint as well as the successful job creating the fulfillment through the Shopify Admin/back-end

 

One thing I noticed is that in your failing POST request to the fulfillments.json endpoint, you are passing the parameter of "shipping_method": "Expedited Shipping". However for the successful fulfillment creations that are done through the Shopify Admin/back-end, I can see that the parameter of "shipping_method" is set to just "Expedited" only. 

 

So with this in mind, could you try sending your POST request to the fulfillments.json endpoint of the Shopify Admin API again, but this time use the parameter of "shipping_method": "Expedited" in the body of your request? This might potentially work and no longer throw the error of "Invalid shipping method provided for this fulfillment service. Retry fulfillment with a valid shipping method."

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
8 0 0

Hi, thanks for the response. I tried it now for order id 1945433538620 with just "Expedited" but I get the error:

 

{"errors":{"base":["Failed to submit fulfill request."]}}

 

Here is the x-request-id: 5b1d9e64-8ba3-4251-8bde-9c60f80cbeb0

 

Let me know if you have any other ideas. Thanks!

 

 

0 Likes