Hi Amit,
Could you confirm if my understanding is correct that your concern is adding keywords to a negative keyword list which is added to a shopping campaign? If yes, it is possible by using addNegativeKeyword() or addNegativeKeywords() method. Otherwise, could you further elaborate what you meant by this "I would like to do the same for Google Shopping campaigns."?
With regard to Search Terms, it is currently only possible to get through Search Query Performance Report, and not possible to add Search Terms.
Please let me know if you have further concerns.
Regards,
Hiroyuki
Google Ads Scripts Team