#misty_best-practices

1 messages ¡ Page 1 of 1 (latest)

neat tundraBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1232516573626105937

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

strange flareBOT
remote geyser
#

hello! In most cases, you would link the Product in Stripe to your own internal system's product using an id. I'm not too sure what you mean by you now have to store duplicate data just to not spam Stripe with requests for this data to display? You can run into scale issues with rate limits (https://stripe.com/docs/rate-limits) if you are constantly needing to retrieve big lists, so we typically recommend using your own DB

Learn about API rate limits and how to work with them.

hidden spindle
#

Right, so what I currently do already is store the product_id, seller_id and inventory numbers. This is not enough data to display to the end user though as I need the product name, description, images, etc. All of which are on stripe, which I am forced to use the Product api's to even use checkout so I am now in the dilemma of having to both send this data to stripe to use checkout, and store this data myself to display to the end user, as if I request a huge list of products from stripe api constantly I will run into rate limits.

remote geyser
#

you only send the data to Stripe once when you create the Product though. Subsequent creation of the Checkout Session would use a Product id

hidden spindle
#

So what you recommend is to collect data to send to stripe to create the product, then to also store said data in my database for easy displaying?

remote geyser
#

You can read more about Products and Prices here : https://docs.stripe.com/products-prices/overview

Ideally, y ou would create the Product once, also create the corresponding Prices. So when you create the Checkout Session, you would only pass in a Price id : https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price

Yes, you would also store those data in your DB for easy display on your own site. You would also make any subsequent changes in Stripe if the prices/products in your DB changes.

Model your business on Stripe with products and prices.

hidden spindle
#

hm, alright