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”
}
]
}
}
]
}
}
}
}