How can I create a credit-based digital product system on a web app?

Show More

I am trying to build a store where a customer buys for example 1,000 credits for $10.

The user can use the web app. Each time they use it, a endpoint is called, and 1 credit should be consumed / subtracted from the customers credits.

How is a system like this, possible to create on Shopify? (Maybe Shopify is not the best for this?)

Thanks