How do I retrieve the final discounted price of the Cart Line in the Cart transform function

I have this as part of my cart-transform input

query RunInput {
cart {
lines {
id
quantity
merchandise {
… on ProductVariant {
product {
id
}
id
}
}
cost {
amountPerQuantity {
amount
}
totalAmount {
amount
}
}
}
}
}

However, I am trying to retrieve the line item post product level discount. I am referring to this part of the docs and don’t see any option to detect if a line item has a discount applied.

My goal is to only group products that have the same final price (post-discount).

Please do advise how can I achieve this.

Hello @ExcelFixer_MY,

Cart transform runs before discount function so this is not possible.
As the discount function has still not run. You can apply discounts on cart transform.

If for any reason you want some data for discount function then in cart transform create line item propertiers which will be useful for discount functions for further discounts.

Refer :
Function execution order in checkout