Calling a CGI post-payment

This is sort of an over-arching question, and I haven't truly checked into it yet (I'm a noob), but…

I would like to call a .cgi script of my own after CS-Cart comes back from a payment that has been approved, with certain pieces of information. This mainly so I can assign serial numbers to certain pieces of software I sell and compose the download links for them. My system for that is all done and custom.

Where is the general direction I would look in to do this?