Solved

FulfillmentOrderLineItem Connection and LineItem object

garyrgilbert
Shopify Partner
397 40 166

Hello @Shopify 

 

I just finished a merchant managed fulfillment private app for one of our customers following the directions supplied by the supplied guide manage fulfillments. I too get the line Items associated with the fulfillment order.

 

lineItems(first: 1) {
            edges {
              node {
                id
                totalQuantity
                remainingQuantity
                lineItem {
                  variant {
                    inventoryItem {
                      id
                    }
                  }
                }
              }
            }
          }

 

now however I see that the lineItem object from within the lineItems connection is being deprecated. How do I then get at the information for the inventory item being fulfilled if all I have is the FulfillmentOrderLineItem id, total and remaining quantity?

 

The deprecation warning states:

As of API version 2023-01, this field has been deprecated. The order line item associated with a `FulfillmentOrderLineItem` shouldn't be used to determine what to fulfill. Use the `FulfillmentOrderLineItem` and `FulfillmentOrder` objects instead. An order `LineItem` represents a single line item on an order, but it doesn't represent what should be fulfilled

Unfortunately the message doesn't help me in determining how to associate the information from the fulfillmentOrderLineItem object to a specific product/variant.  I get the SKU and fufilled quantity back from the fulfillment agency, which with the current setup works since I can associate the fulfillmentorderlineitem.lineitem.sku.

 

Could someone please tell me how I should go about it once the line item is no longer available?

 

Cheers,

 

Gary

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Accepted Solution (1)

ronald_g
Explorer
67 2 7
Replies 2 (2)

ronald_g
Explorer
67 2 7

This is an accepted solution.

garyrgilbert
Shopify Partner
397 40 166

Hey Ronald,

 

Thanks for pinging this. I took a look at he 2023-01 API and noticed that it was added without having to refrence the lineItem.

 

My Query now looks like this:

 

query getOrderByID($id: ID!, $lineItemsAfter: String, $lineItemsBefore: String, $first: Int, $last:Int) {
                order(id: $id) {
                  fulfillmentOrders(first: 1, query: "status:OPEN OR status:IN_PROGRESS") {
                    edges {
                      node {
                        id
                        requestStatus
                        supportedActions {
                          action
                        }
                        lineItems(first:$first, last:$last, after:$lineItemsAfter, before:$lineItemsBefore) {
                          pageInfo{
                            hasNextPage
                            endCursor
                          }
                          edges {
                            node {
                              id
                              totalQuantity
                              remainingQuantity
                              sku
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution