Covers all questions related to inventory management, order fulfillment, and shipping.
I want to get all the orders(fulfilled and unfulfilled) from the api url, but I only get the unfulfilled orders by /admin/orders.json?fulfillment_status=any.
And I also get the unfulfilled orders by /admin/orders.json?fulfillment_status=shipped.
WHY?
Solved! Go to the solution
This is an accepted solution.
I stumbled upon something in terms of filtering a GraphQL orders query by fulfillment status. The query terms don't necessarily match up with the field values that are displayed when the data is returned back in the response.
So for example, if I were to query an orders that had a fulfillment status of unfulfilled, I'd need to do something like this:
{
orders(first: 5, reverse:true, query: "fulfillment_status:unshipped") {
edges {
node {
name
id
displayFulfillmentStatus
displayFinancialStatus
}
}
}
}
And if I were to query for any orders with a fulfillment status of fulfilled, I'd need to do this:
{
orders(first: 5, reverse:true, query: "fulfillment_status:shipped") {
edges {
node {
name
id
displayFulfillmentStatus
displayFinancialStatus
}
}
}
}
And finally, for those partially fulfilled orders:
{
orders(first: 5, reverse:true, query: "fulfillment_status:partial") {
edges {
node {
name
id
displayFulfillmentStatus
displayFinancialStatus
}
}
}
}
It wouldn't be the worst idea if someone at Shopify expanded on the GraphQL API documentation so that the exact query terms would be spelled out!
As far as I can see, the fulfillment_status "any" is the default (https://help.shopify.com/api/reference/order#index).
Doesn't it work without adding the filter?
I faced the "issue", that the default filter for "status" is not "any" but "open".
Hope this helps.
I mean the fulfillment_status, not the order status.
It doesn't work without the fulfillment_status filter, it only returns the unfulfilled orders but no fulfilled orders.
After some testing, it appears that the "fullfilment_status" filter is designed to act as a secondary filter, you mainly use after the status filter. I currently have 3 open orders, 1 cancelled and 85 closed. Here are the results of my testing using this filter.
admin/orders.json?fulfillment_status=shipped (no results, because without a filter on the default orders API, it is trying to check the open orders to see if they have been shipped)
admin/orders.json?status=any&fulfillment_status=shipped (85 results, because I have told it to bring back all orders using status=any and out of all of them, 85 are one\shipped)
admin/orders.json?fulfillment_status=unshipped (3 results, because without a filter on the default orders API, it is checking the open orders for to see if they are unshipped, which they are).
admin/orders.json?status=any&fulfillment_status=unshipped (4 results, because I have asked for all orders using status=any which includes my 3 open orders and the 1 cancelled order which has not been fulfilled\shipped)
admin/orders.json?status=any&fulfillment_status=partial (no results because I don't do partial fulfilment orders)
admin/orders.json?fulfillment_status=any (returns 3, because the default API call returns only open orders)
admin/orders.json?status=any&fulfillment_status=any (returns 89, because it is now saying, give me all orders with any fulfilment status)
Hopefully, this is useful to you and anyone else.
Like mentioned previously by someone else, it appears to achieve what you think you want to achieve if you stick with status=any to bring back every order (fulfilled an unfulfilled). At the moment apart from wanting to return partially fulfilled orders, I can see no reason to have to use the fulfillment_status filter.
If using order status (status=any) definitely isn't what you want to do, and you believe fulfilment status is what you want, then maybe explain the scenario and outcome you are trying to achieve. Maybe we can come up with a solution for you.
Regards
Gareth
Hey guys is there any way to get the total value of the fullfilled or unfullfilled orders?
@Gareth_Doherty1 wrote:After some testing, it appears that the "fullfilment_status" filter is designed to act as a secondary filter, you mainly use after the status filter. I currently have 3 open orders, 1 cancelled and 85 closed. Here are the results of my testing using this filter.
admin/orders.json?fulfillment_status=shipped (no results, because without a filter on the default orders API, it is trying to check the open orders to see if they have been shipped)
admin/orders.json?status=any&fulfillment_status=shipped (85 results, because I have told it to bring back all orders using status=any and out of all of them, 85 are one\shipped)
admin/orders.json?fulfillment_status=unshipped (3 results, because without a filter on the default orders API, it is checking the open orders for to see if they are unshipped, which they are).
admin/orders.json?status=any&fulfillment_status=unshipped (4 results, because I have asked for all orders using status=any which includes my 3 open orders and the 1 cancelled order which has not been fulfilled\shipped)
admin/orders.json?status=any&fulfillment_status=partial (no results because I don't do partial fulfilment orders)
admin/orders.json?fulfillment_status=any (returns 3, because the default API call returns only open orders)
admin/orders.json?status=any&fulfillment_status=any (returns 89, because it is now saying, give me all orders with any fulfilment status)
Hopefully, this is useful to you and anyone else.
Like mentioned previously by someone else, it appears to achieve what you think you want to achieve if you stick with status=any to bring back every order (fulfilled an unfulfilled). At the moment apart from wanting to return partially fulfilled orders, I can see no reason to have to use the fulfillment_status filter.
If using order status (status=any) definitely isn't what you want to do, and you believe fulfilment status is what you want, then maybe explain the scenario and outcome you are trying to achieve. Maybe we can come up with a solution for you.
Regards
Gareth
Hi , i cannot get the order which is fulfilled using this status 😞
Is there any limit for the orders on api, and i am getting same data for every query why is that 😞 , i tried all combinations of query params but i get the same response again and again, and i can't even find the order which i want but it's status is fulfilled
Please help!
Thanks
I have found some quirks using the GraphQL API in this regard as well. Below is a screen shot, where I am trying to pull the 5 most recent orders that have been fulfilled. Perhaps I'm mistaken in my query syntax since perhaps this is interpreted as a loose search. Where the characters fulfilled are contained in unfulfilled as well as partially_fulfilled?
This is an accepted solution.
I stumbled upon something in terms of filtering a GraphQL orders query by fulfillment status. The query terms don't necessarily match up with the field values that are displayed when the data is returned back in the response.
So for example, if I were to query an orders that had a fulfillment status of unfulfilled, I'd need to do something like this:
{
orders(first: 5, reverse:true, query: "fulfillment_status:unshipped") {
edges {
node {
name
id
displayFulfillmentStatus
displayFinancialStatus
}
}
}
}
And if I were to query for any orders with a fulfillment status of fulfilled, I'd need to do this:
{
orders(first: 5, reverse:true, query: "fulfillment_status:shipped") {
edges {
node {
name
id
displayFulfillmentStatus
displayFinancialStatus
}
}
}
}
And finally, for those partially fulfilled orders:
{
orders(first: 5, reverse:true, query: "fulfillment_status:partial") {
edges {
node {
name
id
displayFulfillmentStatus
displayFinancialStatus
}
}
}
}
It wouldn't be the worst idea if someone at Shopify expanded on the GraphQL API documentation so that the exact query terms would be spelled out!
Wow, @Gregarican how did you find this? I've spent weeks on this issue. This is nowhere in the documentation.
If someone using the shopifyAPI python library for making paginated requests for orders and want both fulfilled, open and more, this is how to fetch the first page. You can then use the column fulfillment_status to differenciate fulfilled vs open.
shopify.Order.find(limit=250, created_at_min=created_at_min, status='any')
I really really hate their GraphQL docs. It is a nightmare.
If you want to filter unfulfilled order, you need the query and reverse:true
{
orders(first: 10, reverse:true, query:"fulfillment_status:unshipped") {
pageInfo {
hasNextPage
}
edges {
node {
id
processedAt
displayFulfillmentStatus
displayFinancialStatus
totalPrice
}
cursor
}
}
}
Hello @Gareth_Doherty1
I am working on to delete product from admin automatically when particular order fulfilled, for that I am using order rest api and get all orders but when I want to get only fulfilled orders I can not get that.
Can you please check my code and help me in this ?
$getOrders = shopify_call($access_token, $shop, "/admin/api/2023-04/orders.json", array("fulfillment_status" => 'fulfilled'), 'GET');
This might be from 2018 but thank you, absolute life saver! This is the documentation! 😅
Thank you very much! Gareth.