#seventhirteen_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1331785481159049296
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, catching up here and gimme a few mins
Hi, this is expected since meter data persist across products. The Meter is tightly-coupled to the Prices, but you have 2 different Subscriptions per Prices here and their Invoices are separated
Hi - thanks for responding ๐
so I have only one subscription, which persists - just the products/prices within the subscription are changing (from A to B).
If the meter is tightly coupled to prices, what happens to Product A's charges/invoice after it's replaced with Product B? I don't see those charges in the new invoice.
Is the best solution then to reset the meter to 0 by sending a negative value when products are changed?
Ah I see
Sorry was overlooking that you have only one Subscription
I wonder why don't you have 2 separated Meter for 2 Prices? The nature of Prices sharing Meters is for them to continuing having the same usage data
^ yes thats exactly what I'd like to happen, but when I switch to product B the invoice does not reflect the charges posted while Product A was in use
Prices A and B are linked to Meter M. I create Subscription X with Product A and log 50 units of usage. The meter summary API returns 50, and the upcoming invoice reflects this. I then replace Product/Price A with Product/Price B in Subscription X.
The upcoming invoice resets usage to 0, but the API still shows 50. I then log 27 units for Product B, and the invoice updates to 27, but the API shows 77.
You mean the Upcoming Invoice here should have remained to 50 and change to 77?
I see. If you advance the time (using Billing Test Clock) and see the actual Invoice being created, does it have 77 or still 27?
You mean the Upcoming Invoice here should have remained to 50 and change to 77? - correct, once i swapped to product B I expected the usage to initially be 50, then increase to 77 once i post 27 usage units. I've attached some screenshots
checking that now
advancing the clock past the billing period results in this invoice - it is incorrect too
This is the request where you changed price, correct? https://dashboard.stripe.com/test/logs/req_ns0LSLpbrV3oz9
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This Subsription has Subscription Schedule too, so it, kinda hard to follow. Could you test again with a pure Subscirption, and share its Id?
yep that request looks right
Ok, working on that step by step:
- created sub
sub_1QkFuMQUG2aWaqxyofaiLGcK, no schedules. Posted 50 units on priceprice_1QiOU2QUG2aWaqxyy2GxeBfE
upcoming invoice and api requests are correct at 50
- swap products/prices. req
req_ns0LSLpbrV3oz9
- invoice is wrong (shows 0 usage), api call is correct (shows 50 usage)
Wait, why set the unit price to $0? If you set it to ie. 10$, you would see it multipled by the 50 in Upcoming Invoice, correct?
we're using the flat price only
so we determine the tier based on meter volume, but where you fall specifically in the tier (ie unit cost) isn't charged
- Charge 17 units now that product B is set. invoice shows 17. api call shows 67
Can you share the request id when you change price?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Looks like you are deleting the first Subscription Item and creating another Subscription Item
Can you use the same Subscirption Item Id, but only change its Price?
You would want to find the existing Subscription Item Id (from the Subscription) to specify
ok, trying
https://dashboard.stripe.com/test/workbench/logs/req_7g3u7HOboob6EL
no luck, same thing so far
after second post. same issue
Weird because it works on my side
Can you try to advance a little bit of time before making the Subscirption Update?
Give the API some times (Test Clock) after reporting usage, and before making Subscription Update
Ummm could you provide the Sub Is and request id for each step? I just tested and it works correctly here, having the old usage reflected on the new Price
Sub: sub_1QkGkOQUG2aWaqxyetcOgDaV
That's really weird. Gimme some time to look at this
Thank you for the detailed requests
thank you for the help! Look forward to hearing from you ๐
Ah I see, the Price is successfully changed to the new Price, but the usage wasn't updated
This sounds like a bug on our end. Let me confirm with my colleague and be back. If this takes too long, feel free to write in Support and mention this Discord thread. We will continue from there
My team will take the Supprot case
Curious if you test w a normal Price (no tiers, just plain unit amount and quantity), do you see the issue?
Hey @fallow plinth I think I figured it out. Reporting a Meter event takes some time for it to reflect in all Subscriptions. When you reported the first 50 usage to the Meter, please give it some times (actual time, not just advancing Test clock) until you see it's display on Dashboard to the new Price
Then you can report the next 39 usage, and wait a while again to see it is applied (50+39) to the new Price