Missing Shipment Data

We are receiving inconsistent data from the GraphQL API when requesting Order details with shipment nodes. With some orders, this returns shipment information and other orders it does not. We need to get the shipment information for the tracking number. See Query and different responses below.

Query

 {
order (id: "<order id>") {
    request_id
    complexity
    data{
        id
        order_number
        shop_name
        fulfillment_status
        shipments{
            shipping_labels{
                tracking_number
                carrier
            }
            line_items(first: 1, after: ""){
                pageInfo{
                    hasNextPage
                    startCursor
                    endCursor
                }
                edges{
                    node{
                        line_item{
                            id
                            partner_line_item_id
                            sku
                            quantity
                        }
                    }
                }
            }
        }
    }
}

}

API response with Shipment Info

{
  "order": {
    "request_id": "5eb9605a20b143f250209951",
    "complexity": 2,
    "data": {
      "id": "<order id>",
      "order_number": "<order number>",
      "shop_name": "",
      "fulfillment_status": "fulfilled",
      "shipments": [
        {
          "shipping_labels": [
            {
              "tracking_number": "<tracking_number>",
              "carrier": "endicia"
            }
          ],
          "line_items": {
            "pageInfo": {
              "hasNextPage": false,
              "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
              "endCursor": "YXJyYXljb25uZWN0aW9uOjA="
            },
            "edges": [
              {
                "node": {
                  "line_item": {
                    "id": "<line id>",
                    "partner_line_item_id": "68-125990166-1",
                    "sku": "ZLP-1",
                    "quantity": 1
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}

API response with missing Shipment Info using the same query

{
  "order": {
    "request_id": "5ecc701dcd21d1d65bb51cb4",
    "complexity": 2,
    "data": {
      "id": "<order id>",
      "order_number": "101054",
      "shop_name": "<site name>",
      "fulfillment_status": "fulfilled",
      "shipments": [
        
      ]
    }
  }
}

Can you please help us understand what is happening here and why we are not receiving shipment info for all orders?

Hi @alex29next!
I seems like that order with “order_number”: “101054” is canceled (and there are no shipments for that order).
Let me know if you were not referring to that order.
Thanks in advance!
Tom