#ya-yang_api
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/1318605309668884662
đ 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.
- ya-yang_api, 4 days ago, 26 messages
- ya-yang_api, 5 days ago, 3 messages
Hi there, the "day" on the invoice can sometimes appear as the day before or after your billing cycle anchor based on timezones. The API billing cycle anchor is a UTC timestamp, and when you use the day of month config like you used, the time of day uses the request time.
Your request was at 2024-12-17 07:33:51 UTC
So the billing cycle anchor was set to the same time, on Jan 16:
billing_cycle_anchor: 1737012831
This is 2025-01-16 07:33:51 UTC, which is 2025-01-15 23:33:51 PST (your timezone).
The opposite can also happen: if you made the request at, say, 23:30 UTC, and were based in Japan, you'd see the next day based on your local time
okay, I get the day of the month from another subscription that the customer has, I just want to be sure that their subscriptions' payment aligned.
Do you know if the invioice date on stripe is configured based on our account's timezone?
I believe it is?
I am wondering if this is what I should do. 1. get the current period end date in timestamp from the other subscription. 2. convert it from PST to UTC. 3. set the billing anchor for the new subscription to the specific timestamp in UTC?
Yes if you want more control over the time of day, you can use the full UTC billing_cycle_anchor timestamp, yes, but the config parameters also allow setting the hour:
https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_cycle_anchor_config-hour
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
hmmm, but it looks like the billing_cycle_anchor value i get from the subscription object will be in UTC format
does that mean I don't need to convert it? I can just set the new subscription's billing_cycle_anchor to be the same value?
If you want it to match, yes, you'd need to do that
YOu might also be able to just copy the current_period_end from the other subscription: https://docs.stripe.com/api/subscriptions/object#subscription_object-current_period_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this would be the timestamp of the next renewal invoice for the existing subscription, in UTC, and is based on the original anchor
if you set the new sub anchor to be that period end date, they'd invoice at the same time
sounds good! so no timezone conversion is needed
not with that technique, no