Marketpress function that runs after checkout


On this website, users will have the ability to sign up for fitness classes and so the way I did that is by adding an acf field to the products which equals the amount of classes they are allowed to join after purchasing that specific product. However at this point I need to run a function after checkout that checks what product they purchased and if the product has the acf field with a number in it to add that number to the users acf field of how many prepaid classes they have access to.

So all I need is for you guys to tell me what function I can run that will run after checkout with marketpress. Thanks!