#phal0r

1 messages ยท Page 1 of 1 (latest)

bleak kindleBOT
last atlas
#

๐Ÿ‘‹ happy to help

primal oyster
#

If I specify "backdate_start_date" will this also set the billing cycle anchor to the first of the next month automatically?

And in general: The guide for using SubscriptionSchedules should achieve the same or am I on the wrong track?

last atlas
#

I'm looking into this, please give me a moment will get back to you shortly

#

I think the easiest way to achieve what you're looking for is doing what I suggested

  • Create a subscription with a back_start_date : (first of the month) and add proration_behavior: none
#
  • subscription can be created to start in the future and start at the first day of the selected month
    what do you really mean by that?
primal oyster
#

In our app, the user may choose when to start the subscription (it is a monthly ticket for public transport). If the ticket is for the current month, the subscription must be backdated to the first of the month.

If the user chooses a future month, i.e. from current point of view this would be march or april, the subscription must start 12am on the first of the month.

The reason is, that we want to listen to the invoice.paid webhook event and create the monthly ticket in this case.

#

So, if the user selects the current month, you suggest to create a subscription with the back_start_date parameter and if the subscription should start in a future month, we must use SubscriptionSchedules. Is this correct?

primal oyster
#

I will try with the back_start_date and will come back to this thread

last atlas
#

if you don't really care about the start_date of the current month you can use a combination of start_date: now and billing_cycle_anchor: 1st of next month and proration_behavior: none

primal oyster
#

I will check this aswell

primal oyster
#

It works for the current month, but the next period (generated invoice) is from 1st March until 29th of March, but March has 31 days.

#

I thought Stripe will take care automatically of that, no?

silver sable
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needed to step away, can you share more context or an ID of a related object?

primal oyster
#

invoice number is B8442AA8-0047

silver sable
#

Thank you, pulling that up

#

It looks like that is because the billing cycle anchor was pinned to Feb 28th (UTC) in the Subscription's creation request, so it is expected for the billing cycle anchor to remain on the 28th (UTC) of each month. What were you hoping to accomplish instead?

silver sable
#

Setting a billing cycle anchor to the concept of "the last day of the month" is tricky to do since we pin to the date of the month instead, and not all months have the same length. Once pinned to the 31st of a month, we will automatically adjust the anchor to correspond with the day in the month closest to that (28-30 depending).