Goal: fulfill Shopify orders via API and clarify how to obtain required IDs. Early confusion stemmed from using a PUT endpoint that updates existing fulfillments (requires fulfillment_id) instead of creating new ones.
Key clarification: creating a fulfillment does not start with fulfillment_id. You must first retrieve fulfillment orders for the order and then create a fulfillment referencing those.
Working process (resolved):
Step 1: GET /admin/api/{version}/orders/{order_id}/fulfillment_orders.json to obtain the fulfillment_order_id (api.id) and the assigned_location_id. Use fulfillment_orders, not fulfillments.
Step 2: POST /admin/api/{version}/fulfillments.json with payload including line_items_by_fulfillment_order: [{ fulfillment_order_id: api.id, line_items: […] }], tracking_info (company/number/url), notify_customer, and location_id set to assigned_location_id.
Common pitfalls: using /orders/{order_id}/fulfillments.json led to “Not Found” until location_id matched assigned_location_id. Using wrong fields (e.g., fulfilling the whole order) can occur; ensure you pass only the intended line items.
Permissions: ensure the app has write_merchant_managed_fulfillment_orders scope.
Status: resolved with a confirmed working flow on API versions like 2021-10 and 2022-10. Code/JSON examples are central to the solution.
The fulfillment_id is the unique identifier for a Fulfillment in Shopify. The request url you posted makes it seem like you’re trying to use this PUT endpoint which updates an existing fulfillment, and that is probably why the fulfillment_id is required.
If you’re trying to create a fulfillment for an Order or a FulfillmentOrder you might try one of these POST endpoints instead:
Hello JuanGrasso - Thank you for replying to my inquiry. I did check into the links, which you provided, and I am still not quite sure how to accomplish what needs to be accomplished.
Currently we are posting the below data to a specific Order_ID in order to change the fulfillment status of the order to fulfilled:
When looking at the different Endpoint options for Posting to the FulfillmentOrder API, I don’t see any Endpoint which appears to contain this functionality. I only see “POST” Endpoints for this API with the following functionality:
Cancel a fulfillment order
Mark a fulfillment order as incomplete
Apply a fulfillment hold
move a fulfillment to a new location
mark the fulfillment as open
release a fulfillment hold on a fulfillment order
reschedule the fulfill_at time of a scheduled fulfillment order
I am probably missing something, so if you could point me in the right direction, that would be much appreciated.
Hi @SCHLUE1 I am losing my mind trying to accomplish the same as you. Everything I can find assumes I have access to the fulfillment id or the fulfillment order id, but if I have not yet fulfilled the order, the ids do not exist.
It would be helpful if @Shopify_77 detailed how to create those ids.
Please let me know if you figure this out. I have posted up where I am at if you would like to look at the path I am following, it’s here: https://community.shopify.com/user/888415
I have not tested the following due to having to work at a different project, but you could try the below:
Use a URI with the following structure: https://XYZ-Prodbox.myshopify.com/admin/orders//fulfillment_orders.json
(please note the use of “fulfillment_orders.json” - instead of “fulfillments.json”)
The , which is passed within the above URI, would contain the shoporder - not the fulfillment order
Thanks for the quick response! Unfortunately, this doesn’t work. I have tried all the versions of GET that I can find with both fulfillment & fulfillment_order and none of them seems to work. I will keep plugging away because I have to solve this. I will update you with any findings as you are going down the same path that I am.
I have managed to pull in the fulfillment order id via the GET call that you recommended above.
I have the JSON to send the data back to the store “working” too, however, it isn’t adding the tracking data to the store and it isn’t fulfilling the orders. I can’t figure out where I have gone wrong unless there is another step that I have missed in all of this.
Note: Make sure you use fulfillment_orders and not fulfillments.
This will send you: api.id, api.shop_id, api.order_id, etc., which you need for the next step. Use the api.id for the next step as it is the fulfillment_order_id, do not use api.order_id as it is the order_id.
Step two: POST to API (or use your method of choice)