I don't know if it's a good idea to automate the goods receipt in background.
Normally the goods receipt should be done, if the goods were delivered (and of course if they're ok, nothing damaged). This can't be done in background as you need someone to check this and post then the goods receipt if everything is fine.
What is the business process behind this requirement?