This study investigated the psychological mechanism underlying the relationship between green consumption values and green purchasing behaviour amongst undergraduates. Using a two-wave prospective research design, this study surveyed 1198 students from a large university in China. The results showed that students' green consumption values positively related to their green purchasing behaviour, with gratitude serving as a partial mediator. Green product availability moderated both the relationship between gratitude and green purchasing behaviour and the indirect effect of green consumption values on green purchasing behaviour. Notably, when green products were easily accessible, the positive impact of gratitude on purchasing behaviour became weak. Similarly, the indirect effect of gratitude connecting consumption values and purchasing behaviour weakened with increased green product availability. These results offer insights into how and when green consumption values promote undergraduates' green purchasing behaviour, providing important implications for promoting sustainable consumption amongst young people.