#pterodavtyl

1 messages · Page 1 of 1 (latest)

stiff cobaltBOT
mortal narwhal
#

Yeah afaik that error is accurate. It's because once the invoice is created, the next billing period has already started

lean umbra
#

Thank you for your help duchess!

#

I want to know why I don't see this event anywhere on my test data or my real actual customers

#

I'm concerned about it because I don't know what will happen when it triggers

#

Is there a way to test it?

mortal narwhal
#

What is the billing period of your subscription? Monthly?

lean umbra
#

I have monthly for my real users and for some test users, but I also created a few weekly ones to test.

My setting is for 3 days (I changed it Tuesday), 3 days ago.

mortal narwhal
#

Ah that's probably the issue

#

The invoice.upcoming event is only generated for billing periods over a week

#

See the little info icon at the above link

lean umbra
#

My info icon says Event will only be created if billing period is longer than 3 days. Settings changes apply immediately unless an event has already been sent for the next billing period.

mortal narwhal
#

Ah ok

lean umbra
#

So, if I change the invoice.created case for invoice.upcoming, it should work?

mortal narwhal
#

Yeah but if no invoice.upcoming events are being generated it won't

#

Can you share the subscription id where you expected that event to be generated?

lean umbra
#

Sure

#

"sub_1Nq7JbI2zXV3qlvkAXQNLGCs"

mortal narwhal
#

They're being generated

#

This was sent 7 days before invoice creation because you didn't update the dashboard setting until after

lean umbra
#

Ah! I see!

#

I was looking for the 3 day range

mortal narwhal
#

That'll only apply to future

lean umbra
#

but I can find it on the Oct 19 logs

mortal narwhal
#

What do you mean?

#

Click the above link

#

That directly links to the invoice.upcoming event

lean umbra
#

Yes, but I was confused as to why I was not findind it on my logs, but I was only looking for 3 days before

mortal narwhal
#

Yep that's why

lean umbra
#

Ok... so this is basically the last time I have to report usage

#

Unless I use a cron job or something like that

#

I'm not an expert and I don't really have experience with cron jobs

mortal narwhal
#

But up to you on how you want to handle

lean umbra
#

Batches meaning cron jobs?

mortal narwhal
#

Yep

lean umbra
#

Ok, I will look into it... last question

#

If I changed my setting on Tuesday, and the real customers are set to be billed on Nov 1

#

Should I have seen invoice.created events or not?

mortal narwhal
#

You mean invoice.upcoming?

lean umbra
#

Yes, sorry

mortal narwhal
#

No worries

lean umbra
#

invoice.upcoming

mortal narwhal
#

Can you share a subscription id?

lean umbra
#

sure

#

sub_1NrhTAI2zXV3qlvkqxT3tUpk

stiff cobaltBOT
mortal narwhal
#

Gotcha. Yeah you should get invoice.upcoming 3 days out

#

Looking at the billing period, invoice.upcoming was sent on 9/24 prior to the 10/01 renewal

#

I think you changed your setting in time

lean umbra
#

Yes, I did a change in the subscription

#

To a different product

#

Is this going to cause issues?

mortal narwhal
#

Shouldn't

#

But generally I recommend you test out all these major changes in test mode before making decisions for live mode

lean umbra
#

Yeah, I want to test this, but time is running out

mortal narwhal
#

Let me check one thing

lean umbra
#

thanks

mortal narwhal
#

Yeah you should get invoice.upcoming 3 days out

#

You made the update to your setting on 2023-10-24 20:02:32 +0000

#

That's 8 days prior to renewal

#

So it's expected you didn't get the event 7 days out. You'll get it 3 days out

lean umbra
#

Great. So 3 days out is the 29th? or the 28th?

mortal narwhal
#

29th

lean umbra
#

Perfect. I will look into possibly doing a vercel cron job, or use invoice.upcoming

#

Does the Stripe API complain if I do daily setting for reports?

mortal narwhal
#

What do you mean?

lean umbra
#

Like... running a report for all my users

#

...every day?

mortal narwhal
#

You can do that

lean umbra
#

I'm not exactly sure how it works yet

#

I just don't want to be flagged as "too many API calls"

mortal narwhal
lean umbra
#

So 20 per second

mortal narwhal
#

Nope

#

That's just for files and search api

#

It's 25 for most operations in test mode

#

But 100 in live

#

Please just read that doc though

lean umbra
#

Will do! Thank you so much for your help

mortal narwhal
#

No problem

lean umbra
#

Is there anyone that I can email to send a praise for your assistance? You deserve an award!

mortal narwhal
#

Haha thanks!

#

No unfortunately not. I appreciate it though

lean umbra
#

I wish I could

#

Will this thread be locked at some point?

mortal narwhal
#

Yep we lock them after some inactivity

#

If you have follow-up questions, you can message in the main channel

#

Someone will open a new thread

lean umbra
#

But you are just too awesome

mortal narwhal
#

Lol

#

My colleagues are awesome as well