#aayush

1 messages · Page 1 of 1 (latest)

marble crowBOT
worn tinsel
tame fable
#

yes
req_9auywV2m85bZxB

#

this is the id

worn tinsel
#

That timestamp is 2023-05-02 00:00:00UTC and you are creating the request today

tame fable
#

26/05/2023, 16:56:03 this is the timestamp.

#

yes i just created the req.

worn tinsel
tame fable
#

what is an ideal timestamp to set the billing_anchor?

#

is there anything u can recommend.

tame fable
#

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.

forest crown
#

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.

tame fable
#

yes sure!

tame fable
forest crown
#

You can find what month it is now, increase it by 1 and set date to 1st 00:00.

tame fable
#

you mean the billing cycle anchor

forest crown
#

Yes

#

What programming language are you using?

tame fable
#

nodejs

#

so i set up the billing_cycle_anchor 1685557800
which is 1st of next month.

forest crown
#
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); 
tame fable
#

what if like a users subscribes on like say 2nd of june what happens in that case?

forest crown
#

It's set to 1st of July

tame fable
#

okkk sure!
thanks

forest crown
#

Happy to help. Please, let me know if you have any other questions.