Ask A Question

Notifications

You’re not receiving notifications from this thread.

Do you store lots of Stripe customer/billing data in your database or do you call it dynamically from Stripe?

Daniel Weaver asked in Gems / Libraries
Just wondering if it's best to store locally, in my own database, all of the customer's Stripe data or is it better to call for this every time I want to display it?

There's a lot of data and it feels funky to store it all locally and try to keep it all in sync. But on the other hand, calling the Stripe API all the time feels wrong too.

I'm thinking about card brand, card last 4 digits, trial end date, coupon applied, coupon end date, next billing date, etc.
Reply
I personally store a local copy of all the information I care about. You can pretty easily sync this information and it's going to make your app a lot quicker not having to hit the API for every page view that needs that information. Stripe doesn't change their data structures very often so you should be fine syncing it. You can also use webhooks to keep it up-to-date.
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.