No one here is a legal expert so we can’t give a definitive answer.
Using undocumented endpoints and first party tokens is likely a violation of the developer agreement, and because this is something involving payment processes it’s quite a serious thing so my advice would be not to attempt this and to gift any subs manually.
What you could do is submit a feature request on UserVoice and perhaps Twitch would consider it if there’s sufficient use case to outweigh the potential security issues. Developers: Top (553 ideas) – Twitch UserVoice