#shimmmaz_api

1 messages ¡ Page 1 of 1 (latest)

fresh raptorBOT
#

👋 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/1308490535782322196

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

peak valve
#

Hello! There's a one month + one hour difference between the backdate_start_date and billing_cycle_anchor timestamps you're setting. Is that additional hour intentional? That might be causing the issue.

strong oyster
#

that one hour is probably due to day light savings, and probably has nothing to do with my setup

peak valve
#

Yeah, the timestamp you're providing is the issue. The period you end up billing for represents 1.0013440860215055 of a full period, which is where those extra cents are coming from. If you want it to be exactly one period's worth of charges you need to specify timestamps that represent exactly 1 period.

strong oyster
#

Got it, interestingly, I just retried with 1 hour extra and it worked

#

Thank you for the help!

peak valve
#

I think it probably does have something to do with daylight saving and how a specific period is being calculated.

#

Internally, for the Subscription associated with the Event you shared above, we're calculating it based on 2024-11-30 22:00:00 - 2024-10-31 21:00:00 which has an extra hour in there.

#

That's 1.0013440860215055 of a period, so we multiply that by the amount for a period, which comes out to the amount for a period plus some cents.

strong oyster
#

yep, that all makes sense.

A related but different question: When a subscription starts on the 1st of the month, when does it actually start? 12 am UTC? Some other time?

peak valve
strong oyster
#

I can see that in my setup every subscription that gets charged on the 1st of the month is charged on a slightly different time. I was wondering if there was a stripe time that subscription are charged for.

peak valve
#

The actual payments happen at slightly different times from the exact period specified in the Subscription because they're queued and processed alongside other recurring transactions Stripe-wide.

#

The calculations for how much to charge are based on the Subscription period values, but the actual payments happen typically a bit later than that due to the queue.