#melona_code
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/1217691681458094120
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Stripe API expects UTC time, so if you pass in correct value in UTC it should works. The question is whether you calculated and passed in a valid UTC value? I can take a look if you have thr concrete error message and the request id req_xxx
one of them is this
{
"status": "500 Internal Server Error",
"exception": "stripe.error.InvalidRequestError: Request req_lEfiHyV4dzWTZT: billing_cycle_anchor cannot be later than next natural billing date (1713044342) for plan",
"version": "18.8.0"
}
req_lEfiHyV4dzWTZT
Okie what is your current billing cycle and what’s the interval?
erh the error was actually for subscription creation, so it has not even been created. As for the occurence time, it just happened several hours ago. The interval is supposed to be monthly, and the creation date of the subscription should be the start date.
I do not set the subscription start date explicitly though
Okie so this is a monthly Price, and you call it on Mar 13 21:39:02 UTC
you can only specify a billing_cycle_anchor to no later than April 13 21:39:02, which is 1713044342 in the reponse
Here you set it to 1713052800 which is April 14 00:00:00
The algorithm is the current time where you are sending request + maximum 1 month for monthly price, in exact seconds
I see
How do you exactly calculate + 1 month? Like if it is 29 Feb, is it going to be 29 March next interval?
Yes should be
Okay, thanks a lot man