Re: Fulfillment Order Endpoint Returns 404 Not Found

Solved

Fulfillment Order Endpoint Returns 404 Not Found

MohamedHamza_
Shopify Partner
2 0 0

Hi, I'm following this instruction to fulfill the order, and based on the given endpoint (/admin/api/2023-01/fulfillments.json) here is my request body:

{
"fulfillment":{
    "tracking_info":{
          "number":1111,
          "URL":"<URL>
     "},
   "line_items_by_fulfillment_order":[{"fulfillment_order_id": 4912420782258}]}
}

but I'm getting 404 Not Found
{
    "errors": "Not Found"
}
I'm sure 100% that the provided order id(fulfillment_order_id) exists in my shop, as I've tried to retrieve it from this endpoint and it works fine, so did I miss something? as the documentation is very straightforward!

PS: From my understanding fulfillment_order_id is supposed to be the order id that I need to fulfill. 
 
Accepted Solution (1)

garyrgilbert
Shopify Partner
427 41 178

This is an accepted solution.

Hi Mohamed,

 

I think you are using the order_id as the fulfillment_order_id right?

 

If so then that is your problem.  The fulfillment_order_id is not the shopify order_id.  The fulfillment_order_id is what you get when you go to fulfillment_orders

 

/admin/api/2023-01/orders/[order_id]/fulfillment_orders.json

 

This will return an array of all fulfillmentorders for a particular order (there can be more than one) You will probably need to get the fulfillment_order that has the status "open" and is assigned to the location that you are concerned about.

 

Once you have the right fulfillment_order_id and plug that number into your fulfillment request then it should fulfill the order as you expect.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 6 (6)

garyrgilbert
Shopify Partner
427 41 178

This is an accepted solution.

Hi Mohamed,

 

I think you are using the order_id as the fulfillment_order_id right?

 

If so then that is your problem.  The fulfillment_order_id is not the shopify order_id.  The fulfillment_order_id is what you get when you go to fulfillment_orders

 

/admin/api/2023-01/orders/[order_id]/fulfillment_orders.json

 

This will return an array of all fulfillmentorders for a particular order (there can be more than one) You will probably need to get the fulfillment_order that has the status "open" and is assigned to the location that you are concerned about.

 

Once you have the right fulfillment_order_id and plug that number into your fulfillment request then it should fulfill the order as you expect.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
MohamedHamza_
Shopify Partner
2 0 0

Hi @garyrgilbert, I don't know why it's hard to find this kind of direct info in docs!

 

thanks for solving my issue, much appreciated.

anniebaile
Shopify Partner
7 0 3

Sorry to reply to your older answer, but I'm really struggling here.

I'm experiencing the same error as described above, and when trying your fix, the GET request to that order ID responds with an empty fulfillment array of {"fulfillments":[]}. 

I'm trying to use  the newer /fulfillments.json endpoint as stated in the documentation but getting response Not Found. 

So how do I use this Fulfillment ID approach when my order has no fulfillments created yet? That's what I'm trying to do. 

 

garyrgilbert
Shopify Partner
427 41 178

Hi Annie,

 

Fulfillments are in the past tense, meaning there wont be any if no fulfillments have taken place. You first need to get the fulfillmentorders from the orders/{orderid}/fulfillment_orders.json endpoint, with the information returned from that (fulfillment_order.id and fulfillment_order line_item.id's you can plug them into the post above and create a fulfillment.

 

Cheers,

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
anniebaile
Shopify Partner
7 0 3

This worked. You're awesome.

mungalim
Shopify Partner
1 0 0

Turns out this worked, thank you @garyrgilbert , I like you