👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Integrating Stripe and Sanity for an ecommerce site with variable ticket prices.

3 replies
Last updated: May 25, 2022
Has anyone worked together with Stripe and Sanity? I am building a very simple ecommerce site (a merch store for a small metal band) and I would like to have the band manage their products in Sanity with other content. But I would like to utilize Stripe to the fullest with tax rates, shipping rates etc. Do you think that I would need to sync the products between Stripe and Sanity or manage with just getting the tax and shipping rates from Stripe and manage all other data in Sanity?
This guide is otherwise awesome but left me wondering about a few things I mentioned
🙂 https://www.sanity.io/guides/building-ecommerce-sites-with-the-stripe-api
May 24, 2022, 5:56 AM
Some . This is with 11ty. The frontend designer runs the stripe account. I helped them craft queries and API interactions and created their studio. Our challenge was variable “pay what you want” ticket prices and creating a system of relating a single “ticket” product back to specific show+performance purchases. Stripe makes it rough to set up “name your own price” products without providing this initial interaction. She handled most of the stripe config, so I don’t know if I’m best to speak on it.
The general workflow here:
• show dates are mapped into the available form values
• the insecure form data like date, preferred name, and accessibility notes are passed into the purchase
• the secure purchase info is done directly with stripe and the data passed into it
• details like number purchased and the insecure form data are passed back into sanity http api on successful purchase to track details on purchased tickets - these can then be checked off and referenced at the door
I am very uncertain if this can be exploited or is generally advised. But this was low risk here as providing the insecure data is voluntary and real-name and financial transactions are relying on stripe directly and only stored there.

They’re halfway through their premier show with this new method now and it seems to be working well so far.
😄
May 25, 2022, 12:06 AM
Thanks User! Appreciate the details 🙂
I’ll try to remember and come back to tell what kind of approach I end up going with
🙂
May 25, 2022, 7:06 AM
one more little thought on this - Sanity makes a really nice transaction tracker for something like our use case. This may depend on your traffic volume, but sending the sales receipts effectively back into the dataset after a purchase success takes much of the dev load off of the stripe account and back into our control. We can then directly relate basic sales/inventory info directly to products without juggling multiple interactions and only transmit the insecure data we want to keep for this without concerns of filtering private emails and finance info. Everything is in a nice silo and can be referenced exactly how we want.
May 25, 2022, 9:59 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?