Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

fulfillmentOrders query not returning pending fulfillmentOrders for a given order

fulfillmentOrders query not returning pending fulfillmentOrders for a given order

cs-sf
Shopify Partner
4 0 0

Hello,

 

I'm having an issue with my graphQL query:

query {
  order(id: "gid://shopify/Order/{order_id}") {
    fulfillmentOrders(first:10){
      edges{
        node{
          id
          assignedLocation{
            name
          }
          lineItems(first:50){
            edges{
              node{
                id
                sku
                totalQuantity
              }
            }
          }
        }
      }
    }
    fulfillments(first: 10) {
          id
      location{
        name
      }
      fulfillmentLineItems(first: 100){
        edges{
          node{
            lineItem{
              sku
              quantity
            }
          }
        }
      }
    }
  }
}


where {order_id} is replaced with the string of numbers for the given order.

 

 but for an order with a pending fulfillment, I am not getting any data from this query for the fulfillmentOrders part, I am only getting the fulfilled portion returned through fulfillments.

 

Can anyone help understand why?

Here is the response from the given order:

{
  "data": {
    "order": {
      "fulfillmentOrders": {
        "edges": []
      },
      "fulfillments": [
        {
          "id": "gid://shopify/Fulfillment/{fulfillment_id}",
          "location": {
            "name": "{location_name}"
          },
          "fulfillmentLineItems": {
            "edges": [
              {
                "node": {
                  "lineItem": {
                    "sku": "{sku}",
                    "quantity": 1
                  }
                }
              }
            ]
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 747,
      "actualQueryCost": 9,
      "throttleStatus": {
        "maximumAvailable": 10000,
        "currentlyAvailable": 9932,
        "restoreRate": 500
      }
    }
  }
}

cssf_0-1685033615621.png

 

Replies 4 (4)

cs-sf
Shopify Partner
4 0 0

This appears to also be the case with fulfillmentOrders query by itself, just requesting first:10.

 

This looks to be a bug with the fulfillmentOrders query

cs-sf
Shopify Partner
4 0 0

Still looking for help with this issue. There appears to be an issue with our specific shopify store where the fulfillmentOrders query by itself (and when nested inside orders, for example) returns no data on our actual store, but my dev environment gets the list of fulfillmentOrders without issue in both circumstances.

ShopifyDevSup
Shopify Staff
1453 238 524

Hey @cs-sf, thank you for waiting on an answer here. I was able to do some testing in my own environment here and can confirm that query should return fulfillment orders even if the order's fulfillment status is pending. One thing I can recommend is to double check if your integration on the "live" shop has the relevant scopes for the type of fulfillment order. 

There are three different types of fulfillment orders on a shop when it comes to an app. There are "assigned" fulfillment orders, which relate to fulfillment orders that are managed by the app itself, there are "third party" fulfillment orders that are managed by other apps and there are "merchant managed" fulfillment orders which are ones that are managed by the merchant themselves.

I'd confirm that the relevant scopes are enabled (for example read_third_party_fulfillment_orders) is enabled if the fulfillment order info you're querying isn't managed by your app. 

If this doesn't resolve the issue, could you please reach out to our Partner Support Team through your Partner Dashboard? Since we may have to handle some sensitive shop-level information this would be the best next step. I'd share this thread as a link in your correspondence with our Partner Support team and if need be, they can get in touch with our more technical teams to facilitate troubleshooting with you. 

Hope this helps - let me know if I can clarify anything on our end and hope to hear from you soon through Partner Support. 

Al | Shopify Developer Support

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

cs-sf
Shopify Partner
4 0 0

I was able to confirm that I have the permissions enabled as expected and have re-ran the queries with additional fulfillment related permissions enabled. I am still getting a blank response in fulfillmentOrders. I'd also expect the permission denied response if I didn't have access to do so with the installed app/credentials.

I have a pending ticket with support on this issue as well, that we've had open since last Friday.