# Line Item Quantity not fulfilled using "shipment\_create"

**URL:** <https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869>\
**Category:** GraphQL API\
**Created:** [October 2, 2020, 12:22pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869 "2020-10-02T12:22:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![khungersumit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/khungersumit/32/215_2.png) [@khungersumit](https://community.shiphero.com/u/khungersumit)\
**Post date:** [October 2, 2020, 12:22pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/1 "2020-10-02T12:22:21Z")

</div>

Hi  
I create shipment of an order using shipment mutation API call but the line item still showing “pending” state.

**here is my request**

mutation {

shipment\_create(  
data: {  
order\_id: “XXX…6MTQ2MzQ3OTQy”  
warehouse\_id: “XXX…XNlOjY0OTAx”  
customer\_account\_id: “XXX…udDo1NjkxMA==”  
address: {  
name: “John”  
address1: “2543 Johnson St.”  
address2: “Apt. 2”  
city: “Oklahoma”  
state: “Oklahoma”  
zip: “73008”  
country: “US”  
phone: “5555555555”  
}  
line\_items: { line\_item\_id: “xxx…06NDE2NzM4NTQ0”, quantity: 12 }  
labels: {  
address: {  
name: “John”  
address1: “2543 Johnson St.”  
address2: “Apt. 2”  
city: “Oklahoma”  
state: “Oklahoma”  
zip: “73008”  
country: “US”  
phone: “5555555555”  
}  
carrier: “UPS”  
shipping\_name: “UPS - Ground”  
shipping\_method: “Ground”  
cost: “0.00”  
dimensions: { weight: “12”, height: “12”, width: “12”, length: “12” }  
label: {  
paper\_pdf\_location: “[exampleurl.com](http://exampleurl.com)”  
thermal\_pdf\_location: “[exampleurl.com](http://exampleurl.com)”  
pdf\_location: “[exampleurl.com](http://exampleurl.com)”  
}  
line\_item\_ids: “xxx…6NDE2NzM4NTQ0”  
tracking\_number: “1234434242444444434”  
}  
}  
) {  
request\_id  
complexity  
shipment {  
id  
legacy\_id  
order\_id  
user\_id  
warehouse\_id  
pending\_shipment\_id  
address {  
name  
address1  
address2  
city  
state  
country  
zip  
phone  
}  
picked\_up  
needs\_refund  
refunded  
delivered  
shipped\_off\_shiphero  
dropshipment  
created\_date  
line\_items(first: 2) {  
edges {  
node {  
id  
line\_item\_id  
quantity  
}  
}  
}  
}  
}  
}

**here is my response**  
{  
“data”: {  
“shipment\_create”: {  
“request\_id”: “xxx…0968d73259300d”,  
“complexity”: 10,  
“shipment”: {  
“id”: “xxx…Q6MTAzMTEyMzc0”,  
“legacy\_id”: 103112374,  
“order\_id”: “xxx…TQ2MzQ3OTQy”,  
“user\_id”: null,  
“warehouse\_id”: “xxx…XNlOjY0OTAx”,  
“pending\_shipment\_id”: null,  
“address”: null,  
“picked\_up”: false,  
“needs\_refund”: false,  
“refunded”: false,  
“delivered”: false,  
“shipped\_off\_shiphero”: true,  
“dropshipment”: false,  
“created\_date”: “2020-10-02T12:12:23+00:00”,  
“line\_items”: {  
“edges”: [  
{  
“node”: {  
“id”: “Uxxxxxx2hxxxxBlZExpbmVJdGVtOjE4Mzc3MjQwNw==”,  
“line\_item\_id”: “TGluZUl0ZW06NDE2NzM4NTQ0”,  
“quantity”: 12  
}  
}  
]  
}  
}  
}  
}  
}

**Why it is still showing “pending” to fulfill since I have fufilled all 12 quantities**

Please clear these things 🙂  
Thanks in advance

 ![image](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/9fb28052c31221b6e22ac938e30cfac83d1aa4fd.png)

---

<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:** [October 2, 2020, 12:35pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/2 "2020-10-02T12:35:53Z")

</div>

Hi @khungersumit!  
That is because to mimic a shipment on the app you will need to make three Mutations:

1. Shipment Create mutation
2. Inventory Remove mutation
3. Order Update Fulfillment Status mutation

1 creates the shipment+label, 2 removes the inventory and 3 sets the fulfillment status of the order and the line items

We have an example here --\> [https://developer.shiphero.com/order-fulfillment/](https://developer.shiphero.com/order-fulfillment/)

Let me know if that doesn’t help or I could help clarify anything.  
Thanks in advance!  
Tom

---

<div class="post-metadata">

**Author:** ![khungersumit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/khungersumit/32/215_2.png) [@khungersumit](https://community.shiphero.com/u/khungersumit)\
**Post date:** [October 5, 2020, 11:23am UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/3 "2020-10-05T11:23:23Z")

</div>

@tomasw  
I did all the steps but still why Quantity shipped showing 0 here as show in the screenshot. because of this, I am not able to figure our using API LineItem **quantity\_shipped** is showing returning 0.

```
                                        "quantity": 1,
                                        "price": "1000.00",
                                        "product_name": "SProd",
                                        "option_title": null,
                                        "fulfillment_status": "fulfilled",
                                        "quantity_pending_fulfillment": 0,
                                        " **quantity_shipped**": 0,
                                        "customs_value": "0.00",
                                        "subtotal": "1000.00"

```

 ![1](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/d6f96a99a8314a81b8db3daff5144e59ae0b4297.png)

---

<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:** [October 5, 2020, 5:27pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/4 "2020-10-05T17:27:22Z")

</div>

Hi @khungersumit  
The `quantity_shipped` refers to the quantity shipped using the ShipHero App, as for the shipments made outside of ShipHero (Stores, Public API) they won’t affect this field.  
For this purpose (shipping outside of ShipHero App) you will need to see the `quantity_pending_fulfillment`, `quantity`, and the shipments made if necessary.  
Thanks!  
Tom

---

<div class="post-metadata">

**Author:** ![khungersumit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/khungersumit/32/215_2.png) [@khungersumit](https://community.shiphero.com/u/khungersumit)\
**Post date:** [October 6, 2020, 7:50am UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/5 "2020-10-06T07:50:38Z")

</div>

Hi @tomasw

I am facing some weird scenario PARTIAL\_UPDATE CASE

1). I had an order with 2 lineitems (each item is of Quantity 2)  
2). I created shipment of 1st line item with 2 quantity. (shipment\_create mutation)  
3). I removed the inventory (inventory\_remove mutation)  
4). Since I did a partial update of this order, so I used **order\_update\_line\_items** for the above line item which I fulfilled in 1-3 steps.

Now when I checked the Order at dasbhoard it shows like following as shown in screenshot for that shipped line item and in API it is showing line this  
“node”: {  
“id”: “TGluZUl0ZW06NDI3Nzc2NTQ0”,  
“sku”: “100-2”,  
“product”: {  
“id”: “UHJvZHVjdEluZm86Mjc1MDI3MTAw”,  
“sku”: “100-2”,  
“dimensions”: {  
“weight”: “0.0051 lb”  
}  
},  
“ **quantity** ”: 2,  
“price”: “100.00”,  
“product\_name”: “AirPods”,  
“ **fulfillment\_status** ”: “fulfilled”,  
“ **quantity\_pending\_fulfillment** ”: 2,  
“ **quantity\_shipped** ”: 0  
}

**Problem** : Nowhere if you check the above API response it is still showing **quantity\_pending\_fulfillment:2** , what is the reason of this.  
I was expecting it to be 0 since I have fulfilled **both Quantity** of this line item??

Please check this case

 ![image](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/54eca24e1ecf59ab1fc93ab607eaf46817e0a0d6.png)

---

<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:** [October 6, 2020, 12:16pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/6 "2020-10-06T12:16:20Z")

</div>

Hi @khungersumit!  
That is correct, if you want to partially fulfill the order (only one line item) you will also need to update the **quantity\_pending\_fulfillment** when sending the **order\_update\_line\_items**  
Let me know if that doesn’t help.  
Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![khungersumit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/khungersumit/32/215_2.png) [@khungersumit](https://community.shiphero.com/u/khungersumit)\
**Post date:** [October 6, 2020, 1:15pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/7 "2020-10-06T13:15:37Z")

</div>

Ok @tomasw

What my requirement is **I just only want to know how many items have been shipped** using the data which I get from Order Line items  
will it be the correct way If if do like the following

QuantityShipped = Quantity - quantityPendingFulfillmet;

---

<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:** [October 6, 2020, 1:53pm UTC](https://community.shiphero.com/t/line-item-quantity-not-fulfilled-using-shipment-create/869/8 "2020-10-06T13:53:47Z")

</div>

I believe so @khungersumit  
And also check the status in case it has been canceled instead.  
You could also do the calculation of shipped quantities based on the shipments, but the approach mentioned above would be faster
