Does anyone have GraphQL sample query that checks fulfillment status by line item?

aperkins
Shopify Partner
9 1 2

We are having trouble finding query parameters to match our fulfillment query to identify fulfillment status by line item. We need to be able to retrieve fulfillment status to identify partially fulfilled orders. The current query from the query from the fulfillment center is:

 

{

  orders(analyze: false, order_number: "#18081-M") {

    request_id

    complexity

    data(first: 1) {

      edges {

        node {

          id

          legacy_id

          partner_order_id

          order_number

          shop_name

          fulfillment_status

          order_date

          profile

          shipping_lines {

            carrier

            method

            price

            title

          }

          line_items(first:10) {

            edges {

              node {

                id

                sku

                quantity

                product_name

                fulfillment_status 

              }

            }

          }

          shipping_address {

            first_name

            last_name

            address1

            address2

            city

            state

            state_code

            zip

            country

            phone

            email

          }

      

        }

      }

      pageInfo {        

        hasNextPage

        startCursor

        endCursor

      }

    }

  }

}

Replies 4 (4)

HunkyBill
Shopify Expert
4851 60 554

Would not be better off working with the fulfillment orders assigned to an order? They are a record of all the items fulfilled and to be fulfilled and have a query parameter handy for your cause: status. With that, you should have no trouble identifying partial fulfillments. You do have to be careful of locations with this, too, but nonetheless, they are complete objects with helpful properties. I don't think your GraphQL is optimal for working with fulfillment status, even though line items do carry with them a status.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
aperkins
Shopify Partner
9 1 2

Currently, the orders pass through our IM system's API (they use GraphQL) into our shipping system. The developer with our shipping system getting that query - posted above - to update Shopify. Do you have any sample code for your suggestion that I might be able to pass along to him? Thanks for your help! 

HunkyBill
Shopify Expert
4851 60 554

Shopify published up to date documentation that completely describes how to use Shopify with GraphQL, including fulfillments. Your developer obviously has the skills to navigate to those in a web browser, read them and then implement/test them. Beats have a copy and paste competition here in the forums.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
aperkins
Shopify Partner
9 1 2

The problem is that we only have SKUs to work with through our fulfillment API and not the item IDs. Shopify support confirms that there is no documentation that match SKUs with global ID. At this point, we would welcome a developer who thinks they can tackle this job. Anyone interested can DM me.