#ya-yang_api

1 messages ¡ Page 1 of 1 (latest)

finite groveBOT
#

👋 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.

crystal cape
#

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

livid axle
#

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?

crystal cape
livid axle
#

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?

crystal cape
livid axle
#

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?

crystal cape
#

If you want it to match, yes, you'd need to do that

#

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

livid axle
#

sounds good! so no timezone conversion is needed

crystal cape
#

not with that technique, no