Shipments line items quantity and quantity_shipped

Hi @tomasw

“request_id”: “6036605dded34c72c0f5624c”
For Shipments, the most of them have same number for quantity and quantity_shipped in line_items. But few of them has different number.
Could you let me know what the difference is?

" line_items": {
“edges”: [
{
“node”: {
“id”: “”,
“legacy_id”: ,
“line_item_id”: “”,
“shipment_id”: “”,
“shipping_label_id”: “”,
“quantity”: 1,
“line_item”: {
“id”: “”,
“legacy_id”: ,
“sku”: “146104…”,
“quantity_shipped”: 1,
“product_name”: “”
}
}
}
]
},

“line_items”: {
“edges”: [
{
“node”: {
“id”: “==”,
“legacy_id”: ,
“line_item_id”: “”,
“shipment_id”: “”,
“shipping_label_id”: “==”,
“quantity”: 4,
“line_item”: {
“id”: “”,
“legacy_id”: ,
“sku”: “70026…”,
“quantity_shipped”: 6,
“product_name”: “”
}
}
}
]
},

Hi @heyjess!

That would be because the quantity_shipped is accumulative, and the order was reshipped.
For example for that Query with “request_id”: “6036605dded34c72c0f5624c” I now get back:

“order_id”: “T3JkZXI6MTY5ODM4MjM0”
“line_item_id”: “TGluZUl0ZW06NDcyMDU5NzY4”,
“quantity”: 2,
“quantity_shipped”: 6,

But that is because:

Order Qty was changed from 2 to 4 and then reshipped, making it:

2 (Initially shipped) + 4 (from the reshipment) = 6

Let me know if this sounds confusing
Thanks again!
Tom

Thanks for the response!

It is a little confusing to me.
That means ShipHero shipped total 6 items which were shipped separately: first time shipped 2 items and second time shipped 4 items with the exact same tracking info such tracking number, line item id, order_id etc.

OR

it means that ShipHero shipped total 4 items with one time shipping. In this case, if quatitiy_shipped and quantity are different number, the correct number of actual quantity should be quatitiy_shipped - quantity. ( 6 - 2 = 4)

Hi @heyjess !

Something like this, but not exactly, each shipment has its shipment ID and separate label.
I believe that the field quantity_shipped might be causing you some confusion here.
So when you Query for the line_item inside of the shipments line_item:

shipment {data {line_item{line_item

You are “getting back” to the order level and not the shipment, so if you ask for Quantity Shipped it will display the Quantity Shipped at a Order lever and not for that specific Shipment.

Try for example:

query {
  shipments(order_id: "thisOrderId") {
    complexity
    request_id
    data(first: 10, sort: "created_date") {
      edges {
        node {
          line_items(first: 10) {
            edges {
              node {
                quantity
                line_item {
                  quantity_shipped
                }
              }
            }
          }
          shipping_labels {
            shipment_line_items (first:10) {
              edges {
                node {
                  quantity
                }
              }
            }
          }
        }
      }
    }
  }
}

Quantities will display the ones on the Shipment/Label, but Quantity Shipped will be the Qty shipped based on ALL shipments.

Let me know if this sounded confusing or I could explain better!
Thanks again!
Tom

2 Likes