#aayush
1 messages · Page 1 of 1 (latest)
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
That timestamp is 2023-05-02 00:00:00UTC and you are creating the request today
no, the timestamp is 2023-05-02 00:00:00UTC
check https://www.unixtimestamp.com/
Epoch and unix timestamp converter for developers. Date and time function syntax reference for various programming languages.
what is an ideal timestamp to set the billing_anchor?
is there anything u can recommend.
billing_anchor must be a future timestamp:
https://stripe.com/docs/api/subscriptions/create#create_subscription-billing_cycle_anchor
ok but like i have a doubt how to set-it up accordingly in such a way that if i want my customers billing to happend on 1st of each month
Like for today i can set a billing_anchor for 5 days then next billing date is of 5 days.
but if a customer subscribes on 20th of month an i want its billing cycle for 1st of month.
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
You can set it to be the 1st of next month.
yes sure!
uhmm can u elaborate since users can subscribe to any day of the month how can i set it up for 1st of next month exactly.
You can find what month it is now, increase it by 1 and set date to 1st 00:00.
you mean the billing cycle anchor
const nextMonth = new Date();
nextMonth.setMonth(nextMonth.getMonth()+1);
nextMonth.setDate(1);
nextMonth.setHours(0, 0, 0, 0);
const unixTimestamp = nextMonth.getTime() / 1000;
console.log(unixTimestamp);
what if like a users subscribes on like say 2nd of june what happens in that case?
It's set to 1st of July
okkk sure!
thanks
Happy to help. Please, let me know if you have any other questions.