#evan_best-practices

1 messages ยท Page 1 of 1 (latest)

fiery jacinthBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1254787354212962316

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

tall dewBOT
#

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.

rare acorn
#

Summary of the above: I thought there was an error with the invoice because a usage+tier based product was not counting against the lower tier, but really it was correct because we have a billing threshold set and previous invoices were already sent with the free tier amount in the same month

tall dewBOT
spring prairie
#

Hi there ๐Ÿ‘‹ glad to hear you were able to get to the bottom of the previous concern. I'm not sure I'm grasping the new question raised. Previewing an upcoming Invoice is the best way to preview what the user will pay when a new Invoice is generated for them. I'm not sure I understand why you would look at past Invoices to know what the next Invoice would be. Is previewing the upcoming Invoice not showing you the information you're expecting it to?

rare acorn
#

I would like to show users the total usage for their billing period

#

Before we had billing thresholds, the upcoming invoice is where all of this information lived. Now it's spread across multiple invoices

#

I'm just wondering if there is a different way to query usage for a billing period, instead of needing to go through all the invoices in a month

#

I presume there's not a way, and maybe the new meter API has more capabilities?

spring prairie
#

Ah gotcha, I understand now!

#

Hm, I'm not sure if there is a great way to do that with thresholds in place. Do you hvae a test Subscription Item handy that you can test with? I'm curious if viewing a summary of the usage for the billing period shows what you're looking for, or if that also gets split due to the thresholds.
https://docs.stripe.com/api/usage_records/subscription_item_summary_list

rare acorn
#

Here's a test SI with thresholds! si_QCzjgP2dsYn7io

#

the two previous invoices with a $50 thresdhold : in_1PPxf2LTnsYBwL75zBEX4XpJ, in_1PSWRZLTnsYBwL75BuoO8S0I

#

and the upcoming invoice: test/customers/cus_QCzicozb3fHRor/upcoming_invoice/sub_1PMZjXLTnsYBwL75OgUFvP9c

spring prairie
#

And what do you see if you use the endpoint I shared a link to, to see the summary usage for the billing period for the Subscription Item?

rare acorn
#

three summaries, it looks like one for each invoice!

#

That's definitely helpful

#

I'm unblocked here, thanks for the help.

#

I'm going to stick with invoices though, because we also want to show the costs associated

#

for context, this is a page in our app

#

so I'll list invoices in the billing period, and then sum the usage on that SI, and the invoice amount for those two numbers