#sukatoa-subscription

1 messages Β· Page 1 of 1 (latest)

patent oxide
#

πŸ‘‹ Can you share the subscription ID (sub_xxx) with situation you faced?

pearl silo
#

sure, Thanks River. Hold on

#

sub_1LI2CkHxUYbY7mq5UUea6z4o

#

here

patent oxide
#

Stripe follows monthly billing cycle instead of 30 days:

For example, a customer with a monthly subscription set to cycle on the 2nd of the month will always be billed on the 2nd.

If a month doesn’t have the anchor day, the subscription will be billed on the last day of the month. For example, a subscription starting on January 31 bills on February 28 (or February 29 in a leap year), then March 31, April 30, and so on.

Reference: https://stripe.com/docs/billing/subscriptions/billing-cycle

#

In the sample subscription, the backdate is set to 30 June (which is one month + one day in total for first invoice), so it's prorated to 330 (month of Jul) + 330/30*1 (30 Jun) = 341

pearl silo
#

oh, hhmmmmm

#

which is

#

does this mean Stripe uses GMT to compute?

patent oxide
#

Let me double confirm the timezone that is used

#

The epoch timestamp are in UTC format

#

1656604800 here = 2022-06-30 16:00:00 UTC

pearl silo
#

And so Stripe will look for the UTC one, to compute its Monthly concept - and it detects the July 31st is an extra day because the startdate in UTC is set on June 30, 4PM UTC

patent oxide
#

To correct it, you'll need to set the backstart date to epoch timestamp of 1 Jul in UTC

pearl silo
#

Ahhh, so In order for this to be resolved and follow the logic we wanted. The first attempt of backdateStartDate is we must set its value that is inline with UTC/GMT at least July 1, 2022 00:00:00 for the Stripe to compute its monthly concept and land its next billing cycle to Aug1,

but then its fine to override its via setting its nextBillingCycleAnchor in GMT+9 to get it to normalize on our timezone

#

Will try this one and test, will get back to this to give feedback. Thanks much River

restive siren
#

@pearl silo I'm taking over this thread, let me know if you have a follow-up question

pearl silo
#

Thanks Jack Tan πŸ™‡β€β™‚οΈ

#

will provide feedback here soonest

restive siren
#

I need to step away so I’m going to archive this thread. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact

near lily
#

@pearl silo πŸ‘‹

pearl silo
#

Thanks Jonny πŸ˜„

near lily
#

Hey! Can you summarise the issue?

pearl silo
#

So I'm back to give feedback - it was advised to set the backdateStartDate into July 1, 12:00:00AM UTC so that Stripe will do the correct computation to end up charging 330 instead of 341

#

To summarize, we are charging the user of whole month even if the user started the monthly subscription in the middle of the month

#

We use backdateStartDate to point it to July 1 and start the billing cycle anchor to next Month Aug1 so we charge them 330 upfront

#

unfortunately it charges 341

#

only to find out that the backdatestartdate we used is referencing on localtime of july 1, 12:00:00am, but the UTC/GMT is June 30, 4PM

near lily
pearl silo
#

And now we try to adjust the backdate startdate to have the local time equivalent to July 1, 2022 12:00:00AM UTC/GMT

#

but it charges 326, not 330

near lily
#

Can you share the ID of a recent API request to attempt this? req_xxx

pearl silo
#

subscription ID: sub_1LI9X0HxUYbY7mq5NA0XkWKA

#

hold on

#

hhhmmmm I'm confused where to find it on the Stripe dashboard, unfortunately, we're not logging that id on the app. May I know where specifically we can get that id

near lily
#

Let me check that sub_xxx

#

billing_cycle_anchor: "1659283200" (Sun Jul 31 2022 16:00:00 GMT+0000)
backdate_start_date: "1656633600" (Fri Jul 01 2022 00:00:00 GMT+0000)

#

Looks like your billing_cycle_anchor timestamp isn't the correct UTC value

#

you're 8 hours short

#

Thus the invoice is prorated to 326

pearl silo
#

ohh, that part. So the backdateStartdate now is correct. It such that the billingCycleAnchor is incorrect this time that's why it got short

near lily
#

Seems that way if the intention is to use August 1st!

pearl silo
#

alrights, I'll get back to this thread for further feedback on the experiments

#

thanks so much Jonny!

near lily
#

np!

pearl silo
#

Hey Jonny, it works! you guys River, Jack Tan and Jonny are awesome!

#

10/5 stars for you guys

near lily
#

πŸŽ‰