# Shipment Returning Duplicate Line Items

**URL:** <https://community.shiphero.com/t/shipment-returning-duplicate-line-items/1957>\
**Category:** GraphQL API\
**Created:** [April 19, 2022, 6:00pm UTC](https://community.shiphero.com/t/shipment-returning-duplicate-line-items/1957 "2022-04-19T18:00:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fairweather](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fairweather](https://community.shiphero.com/u/fairweather)\
**Post date:** [April 19, 2022, 6:00pm UTC](https://community.shiphero.com/t/shipment-returning-duplicate-line-items/1957/1 "2022-04-19T18:00:07Z")

</div>

When I request a shipment’s line items from an order that has multiple shipments, I am seeing duplicate lines items being returned. The order below has 3 line items but 5 shipments. When I request the shipments, I am expecting to only get the three line items back under the line\_items edges but I am getting 3 copies of the first item, 2 of the second, and 2 of the third.

I’d like to know if this is the intended structure of the data being returned and if so, how do I only return the distinct items from the order?

Ideally, when I request the line\_items, I would filter on first:3 since there are only 3 line items but that would only return the first item repeated 3 times. This seems like a bug to me.

query { shipments(order\_id: “T3JkZXI6MjYyNTMwMjQ0” ) { request\_id complexity data(first: 5) { edges { node {  
id  
legacy\_id  
order\_id  
user\_id  
warehouse\_id  
pending\_shipment\_id  
address  
{  
name  
address1  
address2  
city  
state  
zip  
country  
phone  
}  
created\_date  
line\_items(first:15)  
{  
edges  
{  
node  
{  
line\_item  
{  
id  
legacy\_id  
sku  
partner\_line\_item\_id  
price  
product\_name  
quantity  
option\_title  
fulfillment\_status  
quantity\_pending\_fulfillment  
quantity\_shipped  
quantity\_allocated  
backorder\_quantity  
custom\_options  
custom\_barcode  
eligible\_for\_return  
customs\_value  
warehouse\_id  
locked\_to\_warehouse\_id  
subtotal  
barcode  
created\_at  
updated\_at  
order\_id  
}  
}  
}  
}  
shipping\_labels  
{  
id  
legacy\_id  
account\_id  
shipment\_id  
order\_id  
box\_id  
status  
tracking\_number  
order\_number  
carrier  
shipping\_name  
shipping\_method  
cost  
box\_code  
dimensions  
{  
weight  
height  
width  
length  
}  
label  
{  
paper\_pdf\_location  
thermal\_pdf\_location  
pdf\_location  
image\_location  
}  
address  
{  
name  
address1  
address2  
city  
state  
zip  
country  
phone  
}  
device\_id  
profile  
partner\_fulfillment\_id  
full\_size\_to\_print  
packing\_slip  
insurance\_amount  
carrier\_account\_id  
source  
created\_date  
}  
}  
} } } }

Here is the return data (some data redacted for privacy):

{  
“data”:{  
“shipments”:{  
“request\_id”:“625eef2320f18fbf04480d8c”,  
“complexity”:76,  
“data”:{  
“edges”:[  
{  
“node”:{  
“id”:“U2hpcG1lbnQ6MjUzODQ1OTY5”,  
“legacy\_id”:253845969,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”,  
“user\_id”:null,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“pending\_shipment\_id”:null,  
“created\_date”:“2022-04-18T15:07:05”,  
“line\_items”:{  
“edges”:[  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTgz”,  
“legacy\_id”:685344183,  
“partner\_line\_item\_id”:“52750740”,  
“price”:“19.2000”,  
“product\_name”:“Tees-Mil-Spec Tri-Blend Crew --Tan-Tan-LG”,  
“quantity”:145,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:145,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“2784.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:06”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
},  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTgz”,  
“legacy\_id”:685344183,  
“partner\_line\_item\_id”:“52750740”,  
“price”:“19.2000”,  
“quantity”:145,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:145,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“2784.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:06”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
},  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTgz”,  
“legacy\_id”:685344183,  
“partner\_line\_item\_id”:“52750740”,  
“price”:“19.2000”,  
“quantity”:145,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:145,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“2784.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:06”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
},  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTg0”,  
“legacy\_id”:685344184,  
“partner\_line\_item\_id”:“52750741”,  
“price”:“19.2000”,  
“quantity”:140,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:140,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“2688.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:07”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
},  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTg0”,  
“legacy\_id”:685344184,  
“partner\_line\_item\_id”:“52750741”,  
“price”:“19.2000”,  
“quantity”:140,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:140,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“2688.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:07”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
},  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTg1”,  
“legacy\_id”:685344185,  
“partner\_line\_item\_id”:“52750742”,  
“price”:“19.2000”,  
“quantity”:90,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:90,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“1728.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:07”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
},  
{  
“node”:{  
“line\_item”:{  
“id”:“TGluZUl0ZW06Njg1MzQ0MTg1”,  
“legacy\_id”:685344185,  
“partner\_line\_item\_id”:“52750742”,  
“price”:“19.2000”,  
“quantity”:90,  
“option\_title”:"",  
“fulfillment\_status”:“fulfilled”,  
“quantity\_pending\_fulfillment”:0,  
“quantity\_shipped”:90,  
“quantity\_allocated”:0,  
“backorder\_quantity”:0,  
“custom\_options”:null,  
“custom\_barcode”:null,  
“eligible\_for\_return”:true,  
“customs\_value”:“0.00”,  
“warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“locked\_to\_warehouse\_id”:“V2FyZWhvdXNlOjczNTE=”,  
“subtotal”:“1728.00”,  
“created\_at”:“2022-04-13T22:57:46”,  
“updated\_at”:“2022-04-18T15:07:07”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”  
}  
}  
}  
]  
},  
“shipping\_labels”:[  
{  
“id”:“U2hpcHBpbmdMYWJlbDoxNjc1NDQ4NjM=”,  
“legacy\_id”:167544863,  
“account\_id”:“QWNjb3VudDo0MTg2”,  
“shipment\_id”:“U2hpcG1lbnQ6MjUzODQ1OTY5”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”,  
“box\_id”:“4538”,  
“status”:“valid”,  
“order\_number”:“262530244”,  
“carrier”:“fedex”,  
“shipping\_name”:“Manual Order Shipping Method”,  
“shipping\_method”:“FEDEX\_GROUND”,  
“cost”:“31.40”,  
“box\_code”:“02”,  
“dimensions”:{  
“weight”:“34.0000 lb”,  
“height”:“15.7500 inch”,  
“width”:“15.63 inch”,  
“length”:“21.38 inch”  
},  
“device\_id”:“shipping web”,  
“profile”:“default”,  
“partner\_fulfillment\_id”:null,  
“full\_size\_to\_print”:"",  
“packing\_slip”:"",  
“insurance\_amount”:“0.00”,  
“carrier\_account\_id”:“79667”,  
“source”:“shipping web”,  
“created\_date”:“2022-04-18T15:07:05”  
},  
{  
“id”:“U2hpcHBpbmdMYWJlbDoxNjc1NDQ4NjY=”,  
“legacy\_id”:167544866,  
“account\_id”:“QWNjb3VudDo0MTg2”,  
“shipment\_id”:“U2hpcG1lbnQ6MjUzODQ1OTY5”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”,  
“box\_id”:“7944”,  
“status”:“valid”,  
“order\_number”:“262530244”,  
“carrier”:“fedex”,  
“shipping\_name”:“Manual Order Shipping Method”,  
“shipping\_method”:“FEDEX\_GROUND”,  
“cost”:“24.85”,  
“box\_code”:“02”,  
“dimensions”:{  
“weight”:“25.0000 lb”,  
“height”:“9.5000 inch”,  
“width”:“15.63 inch”,  
“length”:“21.38 inch”  
},  
“device\_id”:“shipping web”,  
“profile”:“default”,  
“partner\_fulfillment\_id”:null,  
“full\_size\_to\_print”:"",  
“packing\_slip”:"",  
“insurance\_amount”:“0.00”,  
“carrier\_account\_id”:“79667”,  
“source”:“shipping web”,  
“created\_date”:“2022-04-18T15:07:05”  
},  
{  
“id”:“U2hpcHBpbmdMYWJlbDoxNjc1NDQ4Njc=”,  
“legacy\_id”:167544867,  
“account\_id”:“QWNjb3VudDo0MTg2”,  
“shipment\_id”:“U2hpcG1lbnQ6MjUzODQ1OTY5”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”,  
“box\_id”:“7944”,  
“status”:“valid”,  
“order\_number”:“262530244”,  
“carrier”:“fedex”,  
“shipping\_name”:“Manual Order Shipping Method”,  
“shipping\_method”:“FEDEX\_GROUND”,  
“cost”:“24.85”,  
“box\_code”:“02”,  
“dimensions”:{  
“weight”:“25.0000 lb”,  
“height”:“9.5000 inch”,  
“width”:“15.63 inch”,  
“length”:“21.38 inch”  
},  
“device\_id”:“shipping web”,  
“profile”:“default”,  
“partner\_fulfillment\_id”:null,  
“full\_size\_to\_print”:"",  
“packing\_slip”:"",  
“insurance\_amount”:“0.00”,  
“carrier\_account\_id”:“79667”,  
“source”:“shipping web”,  
“created\_date”:“2022-04-18T15:07:06”  
},  
{  
“id”:“U2hpcHBpbmdMYWJlbDoxNjc1NDQ4Njk=”,  
“legacy\_id”:167544869,  
“account\_id”:“QWNjb3VudDo0MTg2”,  
“shipment\_id”:“U2hpcG1lbnQ6MjUzODQ1OTY5”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”,  
“box\_id”:“7944”,  
“status”:“valid”,  
“order\_number”:“262530244”,  
“carrier”:“fedex”,  
“shipping\_name”:“Manual Order Shipping Method”,  
“shipping\_method”:“FEDEX\_GROUND”,  
“cost”:“22.44”,  
“box\_code”:“02”,  
“dimensions”:{  
“weight”:“22.0000 lb”,  
“height”:“9.5000 inch”,  
“width”:“15.63 inch”,  
“length”:“21.38 inch”  
},  
“device\_id”:“shipping web”,  
“profile”:“default”,  
“partner\_fulfillment\_id”:null,  
“full\_size\_to\_print”:"",  
“packing\_slip”:"",  
“insurance\_amount”:“0.00”,  
“carrier\_account\_id”:“79667”,  
“source”:“shipping web”,  
“created\_date”:“2022-04-18T15:07:06”  
},  
{  
“id”:“U2hpcHBpbmdMYWJlbDoxNjc1NDQ4NzA=”,  
“legacy\_id”:167544870,  
“account\_id”:“QWNjb3VudDo0MTg2”,  
“shipment\_id”:“U2hpcG1lbnQ6MjUzODQ1OTY5”,  
“order\_id”:“T3JkZXI6MjYyNTMwMjQ0”,  
“box\_id”:“7944”,  
“status”:“valid”,  
“order\_number”:“262530244”,  
“carrier”:“fedex”,  
“shipping\_name”:“Manual Order Shipping Method”,  
“shipping\_method”:“FEDEX\_GROUND”,  
“cost”:“22.44”,  
“box\_code”:“02”,  
“dimensions”:{  
“weight”:“22.0000 lb”,  
“height”:“9.5000 inch”,  
“width”:“15.63 inch”,  
“length”:“21.38 inch”  
},  
“device\_id”:“shipping web”,  
“profile”:“default”,  
“partner\_fulfillment\_id”:null,  
“full\_size\_to\_print”:"",  
“packing\_slip”:"",  
“insurance\_amount”:“0.00”,  
“carrier\_account\_id”:“79667”,  
“source”:“shipping web”,  
“created\_date”:“2022-04-18T15:07:06”  
}  
]  
}  
}  
]  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![iescobar](https://avatars.discourse-cdn.com/v4/letter/i/4491bb/32.png) [@iescobar](https://community.shiphero.com/u/iescobar)\
**Post date:** [April 21, 2022, 10:46am UTC](https://community.shiphero.com/t/shipment-returning-duplicate-line-items/1957/2 "2022-04-21T10:46:41Z")

</div>

Hello @fairweather !

I am now looking into this issue.  
I will let you know as soon as I have an update.  
Kind regards,

Ignacio

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [May 18, 2022, 3:01pm UTC](https://community.shiphero.com/t/shipment-returning-duplicate-line-items/1957/4 "2022-05-18T15:01:55Z")

</div>

Hello @fairweather!

Apologies for the late answer.

What you are experiencing is caused by splitting line items into different packages. I’m going to bring this matter to our engineering team as each line item is showing the total quantity and not the amount that was split.

Kind regards,  
TomasFD
