#chloe_api

1 messages ¡ Page 1 of 1 (latest)

kind berryBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1261240611495874673

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

lusty shard
#

Hi, let me help you with this.

#

Why do you need Products in your database exactly?

fierce orbit
#

I will need to present my products through my api and display frontend on website. Do you suggest just fetch the stripe products directly from stripe api in the route handler and then display the product list?

lusty shard
#

Yes, it's better to keep just one source of truth.

fierce orbit
#

Yeh it definetly adds complexity to have 2 data trying to always be in sync

#

I will first need to create a price and then create a product with this price attached to the product?

lusty shard
#

First you create the Product and then create Prices for it.

fierce orbit
#

Can i present the whole product object to the frontend? I suppose i will need to atleast have the id rendered frontend so I know which product to choose on checkout when i send request to backend. I will need id, name and descriotion field atleast i suppose

lusty shard
#

Why not?

fierce orbit
#

Idk if there are any sensitive data but i suppose its not

lusty shard
#

Not in the Products/Prices, no.