#misty_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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
if you don't want to though, you can create adhoc Prices and Products :
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
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
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?
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.
hm, alright