#yuichi-hamamoto_best-practices

1 messages ¡ Page 1 of 1 (latest)

hazy owlBOT
#

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

📝 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.

shadow gust
vital sparrow
#

Yes I understand that I need to recreate as I mentioned in the intial post

#

The problem here is how do I search the price?

#

Let's say I have a product with two prices,
lookup_key: "monthly"
lookup_key: "yearly"

#

When I recreate the prices I can't use same lookup_key

#

Should I not use lookup_key to look for price>

#

?

shadow gust
#

Got it.

#

If you're using lookup_key you'll want for it to be more descriptive for each price.

  • Original Price: lookup_key: "monthly"
  • Updated Price lookup_key: "monthly20250619"
#

Or something along those lines.

vital sparrow
#

But the list api is exact match right?

shadow gust
#

List API will returns a list of your active prices.

#

I guess I'm not clear on your ask here

vital sparrow
#

but I can list price with specific lookup_key

shadow gust
#

No you cannot.

vital sparrow
#

yes you can

shadow gust
#

Sorry, you're right. I'm looking at the doc now.

#

When you create the price, you'll need to provide the lookup_key

vital sparrow
#

I was gonna use lookup_key to switch the price for the product, which some documents suggest but not sure if it's good idea

shadow gust
#

Or update the existing prices to include them

vital sparrow
#

The problem is I can only update its metadata and the status which indicate the price is active or not

shadow gust
#

The prupose of the lookup_key is to aid in price retrieval

vital sparrow
#

Right

shadow gust
#

Let me quickly test on my end.

vital sparrow
#

You are right, I can update lookup_key with api, but I can't from the dashboard?

shadow gust
#

You should be able to do it via the Dashboard as well. I just tested it

#

Head to the price you're looking to updated, click on edit and scroll to the bottom of the page. You should see "Lookup key"

vital sparrow
#

Oh true

#

But do you think using a lookup key to switch the price for the product, whether monthly or yearly, is a good idea?

#

When I change the price for monthly, let's call them monthly_old and monthly_new

#

For those who newly subscribe the product is fine

#

but then I need to update all subscription to monthly_new too

#

That means at some point monthly_old and monthly_new need to exist right

#

Then I feel updating lookup_key is not smart idea

shadow gust
#

Both do not need to exist because we recommend you archive old prices before you create new ones.

#

That way if you're using List, for example, you can list all of the active prices at the time and not have to worry about archived ones.

vital sparrow
#

What happens if renewing the subscription happens after archiving the price and before creating a new price?

#

They can still make invoice with archived price?

shadow gust
#

Oh, no they will not. However, you should be creating the new price prior to archiving the existing price.

vital sparrow
#

Right

#

So update old lookup key=> create new one=> update all the subscriptions with old price to new one=> archive?

shadow gust
#

If you're going to archive the old price then you may not need to add the look up.

#

If you're keeping both prices active that's when look up key is beneficial

vital sparrow
#

But I was gonna use lookup key to find price for monthly and yearly

#

not to differenciate old and new one

#

But I think I understood how I should update the price

#

Thank you

shadow gust
#

Understood. Apologies, if I didn't really understand what you're looking to achieve.,

vital sparrow
#

nonono

#

You helped me a lot to think

#

Thank you