A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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}]} }
{ "errors": "Not Found" }
Solved! Go to the solution
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
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
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.