#evan_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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.
- evan_unexpected, 2 days ago, 8 messages
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
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?
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?
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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?
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