Skip to main content

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

Gems / Libraries • Asked by Daniel Weaver
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.

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.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.