# Shipments line items quantity and quantity\_shipped

**URL:** <https://community.shiphero.com/t/shipments-line-items-quantity-and-quantity-shipped/1139>\
**Category:** GraphQL API\
**Created:** [February 24, 2021, 2:26pm UTC](https://community.shiphero.com/t/shipments-line-items-quantity-and-quantity-shipped/1139 "2021-02-24T14:26:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![heyjess](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@heyjess](https://community.shiphero.com/u/heyjess)\
**Post date:** [February 24, 2021, 2:26pm UTC](https://community.shiphero.com/t/shipments-line-items-quantity-and-quantity-shipped/1139/1 "2021-02-24T14:26:42Z")

</div>

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”: “”  
> }  
> }  
> }  
> ]  
> },

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [February 25, 2021, 11:27am UTC](https://community.shiphero.com/t/shipments-line-items-quantity-and-quantity-shipped/1139/2 "2021-02-25T11:27:15Z")

</div>

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:

 ![Screen Shot 2021-02-25 at 08.21.47](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/db722885dd19f18b7e51d2cf3d17204a6541c2c3.png)

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

---

<div class="post-metadata">

**Author:** ![heyjess](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@heyjess](https://community.shiphero.com/u/heyjess)\
**Post date:** [February 25, 2021, 1:32pm UTC](https://community.shiphero.com/t/shipments-line-items-quantity-and-quantity-shipped/1139/3 "2021-02-25T13:32:33Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [February 26, 2021, 11:49am UTC](https://community.shiphero.com/t/shipments-line-items-quantity-and-quantity-shipped/1139/4 "2021-02-26T11:49:28Z")

</div>

Hi @heyjess !

> [@heyjess](#):
>
> 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.

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
