#reyansh-sharma_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1245993909289484291
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Am I missing to provide any other parameters While requesting to create the subscription?
your plan is daily, you sent the request at 2024-05-31 06:09:21 UTC and you are setting 2024-06-01 07:00:00 as the billing cycle anchor. The error message seems quite self explanatory
message: "billing_cycle_anchor cannot be later than next natural billing date (1717222161) for plan",
unix timestamp 1717222161 is 2024-06-01 06:09:21 UTC
Thanks, Alex Is it possible to set up the next natural billing date manually as well?
I'm not doing anything to set up the natural building date at all.
no, that natural billing date is automatically calculated
req_gXgYRflqkQHtVx This specific request to create a subscription was a success
that's because the time you submitted that request was 2024-05-31 07:01:06 UTC. So the next natural billing date is 2024-06-01 07:01:06 UTC
Ah yes that I totally understand
if you want to test and always maintain the same request creation time, i suggest you look into using test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
Thanks Though it seems I have to change the logic a bit
Currently what I'm doing: If the local time is before 6 am use today's UTC 7:00 AM as the Billings cycle anchor if it is after 6:00 AM then use tomorrow at 7 AM UTC.
This issue is happening while testing in the IST time zone As the time difference between IST and UTC is a bit high.
I'm not sure i understand the problem. You are passing in the unix timestamp which is in seconds, there's no time difference when you're using unix timestamp