#bondsmith_unexpected
1 messages ¡ Page 1 of 1 (latest)
đ 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/1296468603981398098
đ Have more to share? Add more 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.
- julian_best-practices, 21 hours ago, 24 messages
Can you share the prorated invoice ID?
It's likely that this is a limitation of date precision via Dashboard on the anchor, rather than the start time
In which case I would recommend setting up your tests using the API/SDK so that you can specify an exact anchor timestamp
But I can only confirm that with the ID
You can check the actual unix timestmap of the billing_cycle_anchor that got set though, I suspect you'd find that is midnight of the date you picked
so 1 minute short, hence 12.999 days
I'm reproducing the Clock to get the value for you!
This is the code that is shown when creating the Subscription:
curl https://api.stripe.com/v1/subscriptions \
-u "<REDACTED>" \
-d billing_cycle_anchor=1730444400 \
-d currency=usd \
-d customer=cus_R305DsFzTvlrNS \
-d "items[0][price]"=price_1QAHy8L2wtzMQawZBNgGxIds \
-d "items[0][quantity]"=1 \
-d off_session=true \
-d payment_behavior=error_if_incomplete
This is the id in_1QAu7tL2wtzMQawZkv9uG6ff
Yes the 12.999 case is just outlining the correct functionality when the subscription is started at midnight vs the second case where the calculation was 13.498 days and I was expecting 14 or a way to set the time to midnight on the day to get as close to 14 as possible
I checked the anchor timestamp from the request I just sent and it does match midnight on the configured timezone
Still looking at this proration calculation for you
Cheers @open briar !
In the meantime I tested sending the backdate_start_date property via curl to midnight and the proration was calculated correctly 43.55/(90/31) = 15.0005 days
You create the subscription with test clock time 1729278060 (2024-10-18 12:01:00 your time, PDT)
You sent (via Dashboard) the billing_cycle_anchor as 1730444400 (2024-11-01 00:00:00)
The monthly price would have renewed at 1731956460 (2024-11-18 11:01:00 PST, note daylight time change)
Period would have been (1731956460 - 1729278060) seconds = 31 days
With your BCA it is (1730444400 - 1729278060) seconds = 13.499 days
13.499/31 = 0.4355
0.4355 * 90$ = $39.19
So that all seems to have happened as expected
If you expect a different proration you need to change either the start time (via test clock time) or the billing cycle anchor you use.
The half day offset is the 00:00 vs 12:00 of your anchor vs start time