#itsqwerty

1 messages ยท Page 1 of 1 (latest)

worthy cradleBOT
rain spire
hidden spear
#

so I just directly be using the priceId or what is the alternaative?

rain spire
#

Price API is a complete replacement for Plan API. Any reason you are uing Plan API?

hidden spear
#

oh i think i got it wrong

#

sorry I realised I did not mean plans but meant products

rain spire
hidden spear
#

is there any benefit to aving 1 product and multiple differnt prices under it (like monthly, yearly) then just creating 2 differnt products for each plan (one yearly and one monthly)

rain spire
#

It's totally up to you to organize your product data

#

ie. you can have one Tshirt product, and multiple prices for different color vairants

hidden spear
#

but there is no benfit to doing it? lets I had 3 subscriptions to offer. and each one of them an monthly or a yearly plan. Is there benefit I will receive from making 1 product for each plan and giving them 2 differnt prices because otherwise I assume it will just be better if i store the productid seperatly and and 6 differnt products instead of prices so I do not need to make addational requests to stripe to grab the priceIds based on the product?

rain spire
#

It's only about how to represent your Product data. Up to you if you want separated Product for each Price. Not sure why you need to send the request to grab to Price Id from the Product tho

hidden spear
#

maybe im being a bit dumb with this but I was going to store what users receive per month based on the product they are subscribed to

#

and I was going to have a plans table

#

that stores the productId and then when the FE sends hey I want this product and i want it to be yearly

#

I thought I would need to grab the productId from the db, make a request to stripe to get the yearly priceId so I can create a subscription for ithat

#

on the plan I was also going to have the planName, so the FE would pass something like
{ plan: 'ELITE', isAnnual: true }

#

along with the customers email, etc, etc

rain spire
#

qq how about just storing stripePriceId on the Plan table instead?

hidden spear
#

so something like priceIds: [{type: 'yearly', id: '123',}, { type: 'monthly', id: '456'}]

rain spire
#

Sorry if I misunderstood but why a hash? PriceId should be a string in the form or price_xxx.

worthy cradleBOT
winged sail
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

hidden spear
winged sail
hidden spear
#

yeah but that will just require an addtional api request everytime thats why I asked the original questions, would it just be better having 6 differnt products (2 for each plan (yearly and monthly) instead of 3 that contain two prices