Query Orders with Backordered Items

I need help writing a query for all orders (from a specific shop) that contain backordered line items. I am new to GraphQL and the ShipHero API, any help is much appreciated.

Hi @marvinpackrabbitusa!
We don’t have a option to filtered by orders that contain Backordered items, but you could gather that information by making, something like this:

query{
  orders(shop_name: "mycustomshop.com"){
    request_id
    complexity
    data(first: 100) {
      edges {
        node {
          id
          legacy_id
          order_number
          fulfillment_status
          line_items(first:10) {
            edges {
              node {
                quantity_pending_fulfillment
                backorder_quantity
              }
            }
          }
        }
      }
    }
  }
}

The filter for Unfulfilled orders (all ordered not fulfilled) will be available soon as well for this query.
What is it that you are trying to accomplish with this? maybe we could think about another approach

Thanks in advance!
Tom

Thanks for the response I’ll try this approach. We shipped several orders this year that were missing an out of stock shirt. I was trying to pull these orders and the associated backordered line items (shirt type with quantity still unfulfilled).

The end goal is a daily report of orders with backordered items.

Thanks for confirming that @marvinpackrabbitusa
I will let you know as soon as we have the “Unfulfilled” filter available because that might also help to optimize this query

thank you @tomasw for the help.

1 Like

Hi @marvinpackrabbitusa!
We apologize for the delay about this!
The feature should be live now, and you should be able to filter like:

query {
  orders(fulfillment_status: "unfulfilled") {
    request_id
    complexity
    data(first: 100) {
      edges {
        node {
          id
          legacy_id
          order_number
          partner_order_id
          shop_name
          fulfillment_status
        }
      }
    }
  }
}

Thanks again for the patience while we implemented this!
Tom