#ecila_vip

1 messages · Page 1 of 1 (latest)

unreal chasmBOT
abstract garnet
#

How can I help?

elfin moss
#

Hi! It's been a while!

sub_1OCHINJrgt3ZD9jfqrs4TynP to take a look.

This is a Subscription made on 3/1 01:00 JST, but the next payment is due on 3/29 01:00 JST.
The next payment for this should be 4/1 01:00 JST.

What should I do?

abstract garnet
#

Yup it's because of the timezone. Stripe timestamps are in unix time, so when you create a subscription that started on 3/1 01:00 JST, that time is converted to unix, and the renewal is one month after that unix time,

elfin moss
#

Can this be avoided?

A user enrolls and wants to create a Subscription immediately, but cannot process it between midnight and 9am daily?

#

Or should our product also be UTC?

abstract garnet
elfin moss
#

I thought about that too, but that would not settle the payment immediately.

Is that the only way?

#

req_9KBrJ5Pd02RNMP

I tried.

abstract garnet
elfin moss
#

The billing_cycle_anchor cannot be specified later than one month. In the previous example, I would not be able to specify billing_cycle_anchor as 4/1 01:00 JST when I create on 3/1 01:00 JST.

#

We are using from Japan, so we are on a positive time difference, but what about people in areas with negative time differences? Do they have any trouble with this?

abstract garnet
#

No, you should set billing_cycle_anchor within a month. For example, if you customer is trying to subscribe at 1/1 0:00 GMT, you can set billing_cycle_anchor to the equivalent of 1/1 0:00 JST, so the billing date will start from 1/1 0:00 JSP , remember to disable proration (https://stripe.com/docs/api/subscriptions/create?lang=node#create_subscription-proration_behavior)

elfin moss
#

Okay, I'll give it a try. I would like you to see if it fits.

#

req_tppFr58RIG352d
sub_1OCI3rJrgt3ZD9jfKzWVgc6F

I created Subscription
start_at: 2023-03-01 01:00 JST
billing_cycle_anchor: 2023-03-01 01:00 JST

But it doesn't work.

abstract garnet
#

What doesn't work?

elfin moss
#

sub_1OCI3rJrgt3ZD9jfKzWVgc6F next payment date is still 3/29

abstract garnet
#

That's because 1677600000 is 28 February 2023 16:00:00 GMT

#

one month later is 28 March 2023 16:00:00 GMT, which is 29 Mar JST

elfin moss
#

So what should be set for billing_cycle_anchor?

abstract garnet
#

Anytime after 1 Mar 2023 00:00:00 GMT

elfin moss
#

ok, I'm trying

#

Set billing_cycle_anchor to 3/1 00:00 GMT = 3/1 09:00 JST. The time is now 3/1 01:00 JST.

sub_1OCILyJrgt3ZD9jfx5MWNrNB

The cycle is indeed correct, but I am having trouble with the payment not occurring until 3/1 09:00 JST. Can this be avoided?

abstract garnet
#

Another way is to set the billing_cycle_anchor to the next month's renewal date

elfin moss
#

Oops, I see. In this case.
I should set the billing_cycle_anchor as 4/1 00:00 GMT = 4/1 09:00 JST. I'll give it a try.

#

invalid_request_error - billing_cycle_anchor
billing_cycle_anchor cannot be later than next natural billing date (1680019200) for plan

I couldn't.

unreal chasmBOT
covert path
#

yes, it can only be set to a time before the next billing date . So use a trial_end instead I think, if I understand what you're asking.

elfin moss
#

Hello.

If I modify the payment cycle using trial_end/billing_cycle_anchor, I end up having to wait 8 hours for the first payment, which is not friendly.

e.g.)
The time is now 3/1 01:00 JST.
Set billing_cycle_anchor to 3/1 00:00 GMT = 3/1 09:00 JST.
The first payment is 3/1 09:00 JST, which is 8 hours later. The subscription will not be available immediately.

Setting trial_end to 3/1 00:00 GMT = 3/1 09:00 JST does the same thing

covert path
#

I don't really understand. You completely control everything here and you can set the time to any unix timestamp you want. There's no reason you have to wait 8 hours I think.

elfin moss
#

Back to the story.

What I want to do: get users to subscribe immediately.
What I'm having trouble with: subscribing at a specific time (0-9am JST) disrupts the cycle anchor due to the discrepancy with GMT. Depending on the timing, e.g. 3/1, it is noticeable

#

You completely control everything here

No, none of this is working as we speak.

covert path
#

I really don't understand. The billing_cycle_anchor is set to the current time that you call the /v1/subscriptions API to create the Subscription. It will bill again at that day and time of day at the start of the next billing period.
You can change the next billing date by setting trial_end to any time in the future(which will be the time the next Invoice gets created), if you wish.

elfin moss
#

Sorry, not English main.

To rephrase.

clock_1OCI1MJrgt3ZD9jfvU5oZgGm

This is a test clock set for 2023-03-01 01:00 JST. In this context, how can I create a Subscription that has an immediate subscription on 2023-03-01 01:00 and the next payment coming on 2023-04-01 01:00?

#

In this case, what time and minute should I specify for trial_end to make it work?

by setting trial_end to any time in the future

covert path
#

the unix timestamp for '2024-03-01 01:00' , I think, you can test it out

elfin moss
#

2024?

covert path
#

I think, not sure, I can't look at your clock object sorry

elfin moss
#

cus_P0J6OUMWZD3bVR