I'm a bit ashamed to say, but I'm having trouble with checking if the customer has a valid subscription. I'm currently only storing the customer_id in the database and retrieving the information from Stripe to have it as a single source of truth and avoiding putting the Stripe info in our database and having to make sure it's synced.
On the other hand, I can't make a request to Stripe with every request, so I'm thinking of memoization or something.
I could find guides on how to accept payments and create subscriptions which are trivial, but no examples on what happens after that.
Suppose I have an API with a single endpoint and set up a subscription for a customer, how do I not hit the Stripe API with every request to check if the subscription is still alive without storing customer info in my database and having to sync it (i.e: keep everything in Stripe)?