Actually I am seeing the same problem without kits.
If I have an order that pulled for one single SKU from 2 different lots, the line_item will show the SKU and quantity for one lot, but then under line_item_lots show BOTH lots, not the actual lot the quantity refers to.
For a given order, the line_item in shipments shows the quantity for the SKU shipped from that lot, but then in the lots it will show both lots, not the one that’s being pulled from. Looks like there is an incorrect join here.
How does one tie back the correct lot to the correct quantity pulled from that lot? It’s strange that the same line_item_id has different quantities.
uery FetchOrderDetails($orderId: String!) {
order(id: $orderId) {
data {
id
order_number
shipments {
line_items {
edges {
node {
quantity
line_item_id
line_item {
id
sku
shipped_line_item_lots {
line_item_id
lot_expiration_date
lot_id
id
}
}
}
}
}
}
}
}
}
Result:
{
"node": {
"quantity": 79,
"line_item_id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"line_item": {
"id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"sku": "VEG2",
"shipped_line_item_lots": [
{
"line_item_id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"lot_expiration_date": "2026-09-22",
"lot_id": "TG90OjcyMzcyNA==",
"id": "U2hpcHBlZExpbmVJdGVtTG90OjEwNTA2MTcxMw=="
},
{
"line_item_id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"lot_expiration_date": "2026-06-11",
"lot_id": "TG90OjUxMTU1Mg==",
"id": "U2hpcHBlZExpbmVJdGVtTG90OjEwNTA2MTcxNg=="
}
]
}
}
},
{
"node": {
"quantity": 65,
"line_item_id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"line_item": {
"id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"sku": "VEG2",
"shipped_line_item_lots": [
{
"line_item_id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"lot_expiration_date": "2026-09-22",
"lot_id": "TG90OjcyMzcyNA==",
"id": "U2hpcHBlZExpbmVJdGVtTG90OjEwNTA2MTcxMw=="
},
{
"line_item_id": "TGluZUl0ZW06MTY4NjA0NDExNQ==",
"lot_expiration_date": "2026-06-11",
"lot_id": "TG90OjUxMTU1Mg==",
"id": "U2hpcHBlZExpbmVJdGVtTG90OjEwNTA2MTcxNg=="
}