Covers all questions related to inventory management, order fulfillment, and shipping.
Hi, Working on a custom app and I am trying to pull in the order fulfillment list from the Shopify API. Currently following the documentation it says to use https://shopify.dev/api/admin-rest/2022-01/resources/fulfillmentorder#[get]/admin/api/2022-01/orders... but no matter what order I pass to the endpoint it returns an empty array
Hey @mikewa33,
I did some testing with the example fulfillment order API request you shared, on several open and unfulfilled orders in my test enviroment. In all cases was returned the expected data and found no issues. Below I have included the testing process, but would suggest reading through our fulfillment example docs that offers insights on scopes, explanation of fulfillment orders as well as process for order management vs fulfillment service applications - this one following covers migration but is a good place to start.
1. Create an order with multiple line_items and leave the order unfulfilled, you can do this however works best for your stores configuration.
2. Using the Orders endpoint, locate that order_id
:GET https://{SHOP}.myshopify.com/admin/api/2022-01/orders.json?fulfillment_status=unfulfilled
3. Populate at into the fulfillment_orders request:GET https://{SHOP}.myshopify.com/admin/api/2022-01/orders/{ORDER_ID}/fulfillment_orders.json
If you have the correct scopes and feel something isn't working after testing, please log the x-request-id header value we returned for the request and share it back here. With that I can take a look at our requests logs and share any insights from there!
Cheers!
awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
I have a similar case, where an empty array is returned. x-request-id is: cfb118b2-9416-4074-8da3-99cc220be3df
Thanks!
I'll answer the question, since Shopify api support (if there is such a thing) clearly does not give a damn. (A bitterness in this post - sorry, but disappointed about not getting any help from this community, shopify support, shopify partner support, shopify launch team, shopify bug team).
To the solution:
If you struggle with empty response/empty array on GET ..../fulfillment_orders.json, try updating permissions or creating a new private app. That helped me out.
HAhaha. Yesss
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
I had the same issue. The reason is because the `read_merchant_managed_fulfillment_orders` or `write_merchant_managed_fulfillment_orders` access scopes have not been requested.
I did try requesting `write_assigned_fulfillment_orders` in my fulfilment app but this still just returned an empty array.
Other endpoints will throw an error if access scopes have not been granted but this endpoint confusingly just returns an empty array.
The API was limited but stable for years. There seems to be a lot of bad decision API design and bugs being introduced just lately.
Glad to help 🙂
hi Jc25 !
Have you resolved this problem? if yes then kindly share what's the possible solution to this problem
@SaadMayo
Like @Appifiny said (thanks for that), just add `read_merchant_managed_fulfillment_orders` and/or `write_merchant_managed_fulfillment_orders` access scopes worked for me (with read_assigned_fulfillment_orders and write_assigned_fulfillment_orders scopes).
I first go a 401 and checked write_assigned_fulfillment_orders and read_assigned_fulfillment_orders in the permissions. Then I received the empty list. After also checking write_merchant_managed_fulfillment_orders and read_merchant_managed_fulfillment_orders it worked. So I didn't have the necessary permissions but still go a valid but empty response? Wtf shopify... No information in the docs afaik.
Did you ever figure out a solution? I checked over my API response object about a hundred times, confirmed I have all of the permissions, but I can't figure out why I keep receiving an empty list. Order is marked as paid, unfulfilled, and the inventory is in stock. 😞
Yes I got it working by creating a new api permisssion app. But as the post from @Appifiny states you can just add `read_merchant_managed_fulfillment_orders` and/or `write_merchant_managed_fulfillment_orders` access scopes worked for me (with read_assigned_fulfillment_orders and write_assigned_fulfillment_orders scopes).
I still cannot get it to work.
When I access the following endpoint
https://{{api_key}}:{{api_password}}@{{store_name}}.myshopify.com/admin/api/{{api_version}}/orders/{{0rder_id}}/fulfillments.json I get an empty array. I do have the following access scopes
"write_merchant_managed_fulfillment_orders",
"read_merchant_managed_fulfillment_orders",
"read_assigned_fulfillment_orders"
"write_assigned_fulfillment_orders"
"write_third_party_fulfillment_orders"
"read_third_party_fulfillment_orders"
So I cannot get the fulfillment order id associated with the order. have I missed something?
Did you ever resolve this?
Hi, please notice that I was having the same issue when making the call without realising that I was using an old no longer valid scope:
GET https://{SHOP}.myshopify.com/admin/api/2022-01/orders/{ORDER_ID}/fulfillments.json as per previous documentation, and I was getting empty array...
BUT (this make the trick for me) if we read above in @awwdam comment, the correct endpoint is .../fulfillment_orders.json, by using the suggested endpoint I got it working also.
Hope this help