#benjam3960

1 messages ยท Page 1 of 1 (latest)

sage ridgeBOT
molten lynx
#

๐Ÿ‘‹ happy to help

#

the billing_cycle_anchor is when you want the start of every cycle to be, whereas the start date of a phase could be different and then for the first cycle prorations will be calculated

#

let's say the start of the phase is today and you want each cycle to start on the 1st of the month

#

you would specify start_date as now and billing_cycle_anchor as the 1st of Oct

willow kelp
#

ok got it !

#

I have created a subscription schedule this morning, but the next invoice will be on October 7th instead of October 1st. Should I use subscription schedule update to close [phase][0] and start a [phase][1], or could I direclty modify the billing cycle anchor of [phase][0] ? to Sept 1st or Oct 1st ?

molten lynx
#

there are 2 things to tackle here

#

do you wan the first billing_cycle to be today->Oct 1st? or Sept 1st->Oct 1st?

willow kelp
#

I would like the first bulling cycle to be Sept 1st -> Oct 1st

#

but It is not big deal if the first billing cycle is today -> Oct 1st

#

What is really important is that next payment is done on Oct 1st

molten lynx
#

bear in mind that you need to pass in all phases and all phase details since phases don't have IDs and can't be updated as we do Subscription Items for example

willow kelp
#

I only have one phase, so it's not a problem.

I just think it's a little bit strange to set the start date on Sept 7th, and the billing anchor in Oct 1st : From my point of view, I would interpret this as nothing will be charged to the customer from Sept 7th to Sept 30th, and billing will start from Oct 1st

molten lynx
#

billing_cycle_anchor is only related to the cycle start date

#

doesn't mean that it won't start billing before that time

willow kelp
#

ok

#

thank you for your help, have a great day

#

Sorry but I have the following error message

#

Invalid phases[0][billing_cycle_anchor]: must be one of phase_start or automatic

#

I set billing cycle to 1696402800

molten lynx
#

hmmm, yes I wasn't really aware that b_c_a works differently between Subscriptions and Subscription Schedules

#

please give me a minute to think about this

#

the first thing that comes to my head is to create 2 phases

#

but it's a bit of an ugly workaround

willow kelp
#

Yes, this was my idea too ("Should I use subscription schedule update to close [phase][0] and start a [phase][1], or could I direclty modify the billing cycle anchor of [phase][0] ?")

not ideal but it should work.

Let me know if you think there is another way

molten lynx
#

so apparently there's no workaround
whenever you create/update a Subscription Schedule
the first phase should be with a start_date of now and end_date of the 1st of next month, and then a second phase starting at the 1st of the next month

#

if you're not interested in keeping the phases, you can just specify the first phase with an end_date and this will release the subscription from the schedule and then you can handle it as a normal subscription

willow kelp
#

ok - I use the subscription schedule only to be able to plan future billing schedule - perhaps I am not using properly subscription schedule, and i should use a simple subscription with a future start date and a future billing cycle anchor

sterile blaze
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

sterile blaze
#

One workaround is to use a trial period until you want to start the Subscription, but treat status: trialing as not active

willow kelp
#

hum - i don't want the customer to see trial period

sterile blaze
#

Where will they see it?

willow kelp
#

In the invoice ?

sterile blaze
#

You mean in the first Invoice?

willow kelp
#

yes

sterile blaze
#

Are you sending them to your customers yourself?

willow kelp
#

My customer can download them from the customer portal

#

Anyway, I think the best is to handle it with 2 phases right inside a subscription schedule right ?

willow kelp
#

Yes, but in my case, I have created the schedule today, and I want the next billing to be on October 1st

#

So My first phase start today and end oct 1st, second phase start oct 1st

sterile blaze
#

So is you billing period 1 month?

willow kelp
#

No, it's a 24th month billing subscription

#

The susbcription started on 1st of september, and should be paid every month. But I can only create a subscription today

#

So to manage it properly, I thought the best way to do it is with subscription schedule, creating 2 phases (sept 7th - oct 1st, then oct 1st - xx 2025)

sterile blaze
#

I don't understand. Do you want to create your Subscription today, or in the future? Or do you only want to move the billing_cycle_anchor?

#

You can create a regular Subscription and set billing_cycle_anchor to 1st of October.

willow kelp
#

The subscription of my customer started on September 1st. But I can only create the subscription in Stripe today due to internal process of the company

willow kelp
sterile blaze
#

Please try and see if this works.

willow kelp
#

but the subscription schedule is already created, so I should close the phase[0] and start a phase[1] now right ?

willow kelp
#

ok

#

thank you for your support and clarification

sterile blaze
#

Happy to help!

willow kelp
#

sorry, but I have now the following error message

sterile blaze
#

It seems like the schedule completed

#

I would actually recommend you to start a new one, and not update it.

willow kelp
#

but it has the parameter iteration = 24

sterile blaze
#

It might be because it's in the final phase

willow kelp
#

If I don't pass the phases[0], and only the phases[1], I have the following error message

#

"error": {
"message": "If passing an array with explicit keys (e.g. foo[0]=a&foo[1]=b) instead of as an array (e.g. foo[]=a&foo[]=b), the keys must be numeric and sequential starting from 0. You passed the keys 1, we expected to have a key with the value 0.",
"param": "phases",
"request_log_url": "https://dashboard.stripe.com/logs/req_O4bnbuxHWNhRm4?t=1694088534",
"type": "invalid_request_error"
}

sterile blaze
#

What's the request you're sending?

willow kelp
#
sterile blaze
willow kelp
#

But if i put phases[0] it will overwrite previous created phase no?

sterile blaze
#

If you don't modify it it will stay the same

#

Why you don't want to create a new Subscription Schedule? They are complex on their own, even before you start updating them ๐Ÿ˜…

willow kelp
#

Because I understand that by creating a new subscription schedule, the customer will have 2 subscriptions with us

sterile blaze
#

Are you working in Live mode?

willow kelp
#

But he purchased only one

#

Yes i am in live mode

sterile blaze
#

I recommend trying this out in Test mode first. It's really easy to make a mistake that will result in charging your customers multiple times.

willow kelp
#

Ok I got it for next time

#

But I need to fix this for my customer for the time being

sterile blaze
#

I would cancel the existing Subscription and create a new one

willow kelp
#

But there is a payment request (sepa direct debit) that have been sent to the customer

sterile blaze
#

You can either refund it, or start a Subscription from the next month.

willow kelp
#

Ok - it s a little bit strange that I can t close the first phase of this subscription schedule on Oct 1st and create a new phase on oct 1st for this customer

sterile blaze
#

Can you add another phase to it?

#

After 1st of October

sage ridgeBOT
willow kelp
#

I would like to add another phase, but I have the following error message

full iris
#

๐Ÿ‘‹ stepping in as vanya needs to step away

#

So phase 0 should either mirror what is going on at the moment of the update or it should update the Subscription/Schedule immediately. You can't do something like set a future billing_cycle_anchor in phase 0. That would have to be done in phase 1.

willow kelp
#

so it should billing_cycle_anchor in phase 1 which should have a future date

full iris
#

Yes phase 0 basically has to mirror what is happening currently on the Subscription

willow kelp
#

I still have the same issue:

#

phases[1][start_date] and phases[1][billing_cycle_anchor] = 1696402800

full iris
#

Right so you want to use end_date from phase 0 combined with a billing_cycle_anchor: phase_start in phase 1 to reset the billing cycle anchor

willow kelp
#

correct

full iris
#

You don't put in a timestamp for billing_cycle_anchor in a Sub Schedule. It is basically just set to the beginning of the phase and you do the timing based on the lengths of the phases themselves

willow kelp
#

ok I remove the billing_cycle_anchor , but I now have this issue

full iris
#

Alright well that error seems pretty self explanatory, no?

#

You aren't testing on an active Subscription Schedule

willow kelp
#

I have an active subscription that I have created today

full iris
#

Sure but the Subscription Schedule is not active

#

So you need to create a new one for that Subscription

willow kelp
#

It's in active status in Stripe dashboard, so it's quite strange

full iris
#

That is the Subscription itself

#

Which is different from the Subscription Schedule

#

Subscription Schedules sit on top of Subscriptions

#

So you can have an active Subscription which used to have a Subscription Schedule

#

If a Subscription Schedule is "released" then that means that the Subscription Schedule was essentially completed but the underlying Subscription continues

willow kelp
#

but why it is in released status, if i created it with the parameter iteration = 24

full iris
willow kelp
#

And the property current_phase.end_date = 1756969200 (checked in a get subscription schedule)

full iris
#

Also, I'd highly recommend doing all of this in test mode right now

#

And making sure it all works as you expect in test mode before handling it in live mode

willow kelp
#

ok

#

so what is your recommendation now ? I should create a new phase with start date = Oct 1st ?

full iris
#

Well my recommendation is to first create a Subscription in test mode that looks similar to the Subscription you are working on

#

Then create a Subscription Schedule and attach it to that Subscription

#

Then work on testing how to update that Subscription Schedule in the manner you desire

#

Then do the same thing in live mode