#madmark00178_api

1 messages ¡ Page 1 of 1 (latest)

coral glacierBOT
#

👋 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/1313567366919098438

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

worthy lance
#

Hello! How many Prices did you see in Workbench when you tried to list them?

inner mural
#

10 prices

worthy lance
#

That makes sense, list calls have a limit of 10 by default. It's likely the Price you're looking for just didn't fit inside that limit.

inner mural
#

oh even when using 'stripe prices list'?

worthy lance
#

Yes, that's a list call like any other.

#

If you want to see more than 10 results you need to specify a higher limit in the command.

inner mural
#

Got it. Could you provide me some guidance then? Prices can't be modified really it seems, so it sounds like what I do is have products, then when i need a price change, i have to add a new price and archive the old price, and move the lookup key over to the new one. That's fine, but what is best practice with old prices and managing subscriptions that use the old prices? The reason i hit a roadblock here is because i'm testing a subscirption information page on my app, and my API was only grabbing a limit of 10 prices (as you pointed out). Should my API be keeping a list of all prices (active and inactive) so it can display information in the subscription page for matching prices, but then also be gradually moving old subscriptions over the new price ids?

worthy lance
#

I'm not sure I completely follow. Can you tell me more about the subscription information page you're building? Is the intent to display the info for a specific subscription, or is it showing info for many different ones?

inner mural
#

Sorry ya ill clarify. So, first i should say, any time there's a product or price change on the webhook (and on API startup) my API grabs all prices. That list of prices is then retrieved via an endpoint on my API, which my next.js frontend grabs. In this specific case, the frontend grabs the prices to show a user their current subscription information - price, plan name, etc. But what i'm running into is that since a user may have an archived price id associated with their user data, should my frontend be looking at active AND archived prices? Also, should i be migrating users to the new price id as soon as I archive one and switch the lookup key?

worthy lance
#

Why are you retrieving all Prices instead of just the specific ones associated with the given Subscription?

inner mural
#

I guess because when i built out my API and frontend originally, i didn't realize prices can't be modified. So I thought the simple thing to do would be to always store the active prices, and have the frontend grab those to display both A) current pricing for the subscription tiers page, and B) current user plan pricing. Should i change this so that for grabbing current user pricing, it makes a direct call to Stripe for that specific price id (instead of using the stored prices)?

worthy lance
#

Yeah, it sounds like you want to look at the Subscription and fetch the specific Price(s) it uses, and then also fetch the specific Price(s) which represent the current Price(s) if you also need those/if they're different.

coral glacierBOT