Hi Rahul,
There's no such API, as far as I know.
From what I can see, you could arrange automatically to create a Pre-Declaration from a Goods Receipt - there's a check-box for that in the Activity Sequence. But I don't think it will help you for creating the document before GR.
Regards,
Dave