Fulfillment Order Endpoint Returns 404 Not Found

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.

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

1 Like

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.

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.

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

This worked. You’re awesome.

1 Like

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