#jeff_unexpected
1 messages ยท Page 1 of 1 (latest)
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.
- jeff_unexpected, 29 minutes ago, 6 messages
๐ 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/1260899535698268223
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
๐
if subscription ends at 12:30, metered usage between 12:00 ~ 12:30 is not being included in invoice.
But these will be included in the next invoice no ?
should I make next invoice manually? since it was final invoice of subscription?
I should have write it is just before subscription end into "What did you expect to happen?" too.
I see yes, between you are using the legacy record usage or the new billing meters ?
Also could you please share the Subscription Id ?
i'm using new meter api.
sub_1PQkSVFNf8dK0vHxtfbJuV1z
sub_1Paz93FNf8dK0vHxbcPlg1aR
these are subscriptions that i tried to insert the last usage.
Thanks for sharing, checking...
Actually, this is expected yes.
You have two options. Finalize the invoice immediatly once Stripe creates the draft in voice and disable the services from your end customer. Or keep reproting usages and issue one extra invoice for the remaining period.
Aha, thank you for the check.
One more thing, is it also expected that reporting before invoice created also not inserted?
e.g)
reporting at = 12:01:00
reporting timestamp = 12:00:00
subscription ends and invoice creation = 12:30:00
above not inserted but timestamp 11:59:00 works.
if so, I will disable the service at the top of the hour before the subscription end time.
Yes, we only collate meter events reported when the subscription/invoice is actually created and exists. And events reported for that customer/price prior to that won't be collected
Oh no, I mean that 12:00:00 is in subscription period but will be end soon.
let me put it simple, a subscription started at 00:30 and ended at 12:30.
i was able to insert usage at 11:59
but not able to put at 12:00 even it was before subscription ends.
Depends, are these aggregated events you're reporting? Is there an example?
yes it is hourly aggregated events.
these are what i tried
Can you share some requests where you send meter events?
hmm ok.
sub_1Paz93FNf8dK0vHxbcPlg1aR
was ended Jul 10, 11:57 AM
curl https://api.stripe.com/v1/billing/meter_events \
-X POST \
-u ":" \
-d event_name=mesa \
-d timestamp=1723287599 \
-d "payload[stripe_customer_id]"="cus_QRp0kktv8R6Bw0" \
-d "payload[value]"=9
curl https://api.stripe.com/v1/billing/meter_events \
-X POST \
-u ":" \
-d event_name=mesa \
-d timestamp=1723287600 \
-d "payload[stripe_customer_id]"="cus_QRp0kktv8R6Bw0" \
-d "payload[value]"=1
curl https://api.stripe.com/v1/billing/meter_events \
-X POST \
-u ":" \
-d event_name=mesa \
-d timestamp=1723287601 \
-d "payload[stripe_customer_id]"="cus_QRp0kktv8R6Bw0" \
-d "payload[value]"=3
curl https://api.stripe.com/v1/billing/meter_events \
-X POST \
-u ":" \
-d event_name=mesa \
-d timestamp=1723291199 \
-d "payload[stripe_customer_id]"="cus_QRp0kktv8R6Bw0" \
-d "payload[value]"=5
tried above 4 curl command
first one was successful but others were not.
i mean, request were succeed but not included in invoice ๐
hey @normal geyser
I think I've already answered you in this thread #1260883803371475008 message
think of the hourly aggregation as small subscription period times
if the period has not ended then it won't be part of the current invoice
does that make sense to you?
hi @mossy heath. yes I could not comment on the thread since it was closed.
no worries, we close the threads after they get idle for some time
ah, so you mean, the whole one hour should be inside the subscription period, right?
inside the invoice period right
aside from the subscription period, each invoice has a period as well
isn't invoice has a grace period also?
the reason why it works this way is because the hour hasn't finished yet and other events within this hour can occur, so the aggregation is still not yet "finalized" to become part of an invoice
the grace period is regarding the payment due date
for subscription period wise, I think i understood.
not the period of the invoice
yep!
before the subscription end
you don't really care about the subscription end
because there will be an invoice that will be generated after that
for the period that wasn't covered
oh
that's why you see the usage record in the upcoming invoice
then, if I stop the automatic finalize
of the invoice
and wait for the aggregation hour
then it will be included?
if you take for example in_1Paz93FNf8dK0vHxnTVWBYM4
that is exact
you can see the period.start and period.end on the object
on the line items
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
"period": {
"end": 1723287600,
"start": 1720612633
},
I see it
actually you might be right on the finalization part
could you try to do the same but instead of finalizing directly wait until it gets finalized after 1h?
you can use test clocks so you don't have to wait the 1h
sure, let me try.
ok I just did some extra tests and confirmed my initial claim
regardless of when the invoice is finalized
the important thing is whether the hour is fully part of the period of the invoice or not
basically if the invoice is created during the hour, the usage records of that hour won't be part of the invoice