This post was published 3 years ago. Some details may have changed since then.
You can now programmatically gift (or ungift) paid subscriptions through the API.