#trina_api

1 messages ยท Page 1 of 1 (latest)

gaunt muskBOT
#

๐Ÿ‘‹ 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/1376954849916092469

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

cursive epoch
#

Hi hi! Let me take a peek. ๐Ÿ™‚

candid temple
cursive epoch
#

Let's take a step back. Without using any Stripe-specific concepts, what are you trying to accomplish here?

candid temple
#

Sure, I am trying to migrate Customers to a new Product Billing Meter.
I have around 400 active Subscriptions, each Subscription has a Product. For this Product, there are multiple Prices, each connected to the same Billing Meter. I would like to make a new Meter and update this for all the Prices linked to the Product. Is this possible without creating new Prices?

#

Sorry it's a bit hard to not use Stripe-specific concepts: I want to introduce a new version of this measurement system and have all existing pricing options for the offering use the new version. Ideally I want to do this without having to redefine the pricing options or create new ones.

cursive epoch
#

:chef-kiss:

#

Ok awesome, thank you. Give me a moment. ๐Ÿ™‚

#

Does this mean that sum isn't behaving the way you expected it to, so you're going to do your own aggregation and then just report the total?

#

Or rather, you're going to just continuously report the "current period total," I guess.

candid temple
#

sum is behaving as expected, but I would like to use the last aggregation method instead.

#

When I created the meter, only count and sum were available.

cursive epoch
#

Totally fair.

#

Well, we saved the best for last, clearly.

#

Thank you for the setup on that one. That's ... possibly one of my best. ๐Ÿ˜‚

#

Ok, now that I've been sufficiently silly, let me figure out how to get you moving forward.

candid temple
#

Thank you for bringing humour to the situation ๐Ÿฅฒ

#

Ideally I would love to just deactivate the old meter and create a new meter with the same event name, but it's not clear to me whether the Price is linked by meter ID or by meter name

cursive epoch
#

Oo

#

Ok, so right now the collective wisdom sayeth that the likely solution is "new Prices and Meters, and then a migration", but let me confirm and flesh that out for you.

Can you share the Price ID with me so I can just doublecheck something? And then I think I can write up a li'l narrative of the approach to this - which should actually be a lot less scary than it smells right now.

candid temple
#

price_1REw6zCFE1KEriEVVD92xC54

cursive epoch
#

Do you access it using its lookup_key?

candid temple
#

yes

#

but we also have the priceid saved for each customer in our database

cursive epoch
#

An aside: Do you have a test to ensure that you correctly bill in ZAR, and that its unrenderable-in-two-decimals unit price is being correctly applied?

candid temple
#

No we don't currently have customers using ZAR, but good point

cursive epoch
#

I'm not just a pretty bird, friend.

#

Ok, so here's how I'd prolly (want a cracker) approach it:

gaunt muskBOT
cursive epoch
celest trench
#

hi! fyi i'm taking over for timebox here - it looks like this question may be resolved but feel free to let me know if there are any more questions!

candid temple
#

thank you both ๐Ÿ™‚ @cursive epoch @celest trench I was hoping for a less lengthy way to do this but appreciate the confirmation

cursive epoch
#

You're very welcome! You should be able to script all of this, and you can definitely set everything up in a Sandbox and use Test Clocks to confirm your script works exactly as you expect before you do the scary thing. ๐Ÿ™‚