Fulfillment_orders API returns empty array

Hi all,

I’m currently trying to fulfill an order in Shopify. Here’s the flow that I’m using:

  1. Order is successfully placed in shop
  2. Sending a GET request to “/admin/api/2022-07/orders/{ORDER_ID}/fulfillment_orders.json” to find the fulfillment_order_Id value that is needed for the next API call.
  3. Sending a POST request to “/admin/api/2022-07/fulfillments.json” passing the fulfillment_order_id retrieved from the fulfillment_orders.json endpoint.

Here’s the problem: the response from (2) “/admin/api/2022-07/orders/{ORDER_ID}/fulfillment_orders.json” is always an empty array and I can’t obtain a valid fulfillment_order_Id value. I’m working with orders that were not previously fulfilled.

Could someone please let me know how to solve this issue? Thanks!

Hi @alex331 ,

Thanks for your post.

I just tested the REST call for FulFillmentOrder and was able to get a successful result with the FulFillment_Order_Id following this development document.

You may want to double check that the order has fulfillable items and if you are still having issues, please provide me with an X-Request-Id from your request and I’ll be happy to dig in further for you.

Hope that helps!

Hi @kevnob

Thank you for your reply.

My REST API call for getting the FulfillmentOrder resource is following the documentation and looks correct.
Here’s the X-Request-Id: 05742051-1b7b-4ba5-bdf5-2782c301666f
Could you please try again to find out what’s wrong with the request?

Thanks,
Alex

Check permissions on your app.

I wasted 2 hours reading the internet and nobody had any clue.

I thought I had permissions ok - but no now set even more - not sure which one made a the difference; guessing - 3rd party merchant something

We haven’t received any suggested solution. Here’s how we solved the problem ourselves:

  1. Make sure that you have all the permissions added to your app.
    They can be found in the migrations guide: https://shopify.dev/apps/fulfillment/migrate
    We were getting empty fulfillment order resource because of that. In my opinion, we should have received an error that points to the missing permissions so we know what to do.

  2. Adjust your fulfillment request parameters based on the latest API version (currently 2022-07). There was a mismatch in the request parameters for the particular endpoint in the documentation. You should always follow the JSON resource and its fields.

Hello All,

Try following steps for unfulfilled order

  1. request scope for “write_assigned_fulfillment_orders,write_merchant_managed_fulfillment_orders,write_third_party_fulfillment_orders,read_assigned_fulfillment_orders,read_merchant_managed_fulfillment_orders,read_third_party_fulfillment_orders”

  2. Get “fulfillment_order_id” using “/admin/api/2022-07/orders/{order_id}/fulfillment_orders.json” API

  3. You should get ID as fulfillment_order_id from steps 2 Send POST request

$fulfillment_order_id = $fulfillment[0][‘id’];

$fulfillments[‘fulfillment’] = [
“line_items_by_fulfillment_order”=> [
0=>[
“fulfillment_order_id”=> $fulfillment_order_id,
]
]
];

Send POST request to: ‘/admin/api/2022-07/fulfillments.json’ API

  1. You should get responce data and your order is fulfilled.

Thanks,

Kurvi