How to apply discount to basket using stripe

Is there a way to apply a discount automatically to the basket at checkout if say 4 items purchased I am using stripe