Get Stripe subscription by User Id
I'm getting successfully subscription on server side using auth.api.listActiveSubscriptions, but i'd like to get user subscription by userId. The documentation doesn't specifies how can i do it. Exists any form to do that using the plugin or i need to implement the full subscription retrival by userId from scratch?
Solution
Hello João! You could query the DB directly, this is an example using Drizzle but it's mostly the same (the
referenceId can be either the user ID or the org ID):