For this to work out, you'll have to create a dummy entity in the USA, like a BBA or an LLC - and, just bill your invoices in bulk thro' the STPI to avail the benefit.
Otherwise, if you think this is too much of a hassle, you can just register for an IE Code [ Import Exports Code ] and show the government that your a 100% EOI and try to play around with taxes a bit.
Legally, there's not much of a problem - we do this stuff all the time
The best way i'd suggest to keep it transparent is registering with the STPI and getting the tax holiday - when the indian government is telling you that you don't have to pay taxes if your an IT company, why bother
I believe running a google search would help.
This YA post seems to be okay.