Server Side Script to Submit a stock reconciliation

Upon an event trigger(in my case, if a job card is submitted with a specific custom field selected) I would like to submit a stock reconciliation transaction for a fixed set of items.

How would I go about doing this. I understand how to trigger the event, just not what function to call for said stock reconciliation transaction to be initiated.