How to automate Stock movement in background

What I want to achieve is that when the user Submits a Job Card or Work Order the relevant Stock Movement Entry should run automatically in background.

For this what API should I call?

Please help.

Regards,