Villager trade detection

Can I somehow detect, wich od my custom villager trades Has been chosen from a player? My plan is to check wich trade the player has done to remove the item from the chest the villager is connected to. Is this posible or something simular?

Continue to help post