#benjam3960
1 messages ยท Page 1 of 1 (latest)
๐ 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
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 ?
there are 2 things to tackle here
do you wan the first billing_cycle to be today->Oct 1st? or Sept 1st->Oct 1st?
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
ok then you should update the subscription schedule, and pass the https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases-billing_cycle_anchor to be the 1st of October
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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
billing_cycle_anchor is only related to the cycle start date
doesn't mean that it won't start billing before that time
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
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
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
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
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
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
The problem is that you can't set a future start date on the regular Subscriptions.
One workaround is to use a trial period until you want to start the Subscription, but treat status: trialing as not active
hum - i don't want the customer to see trial period
Where will they see it?
In the invoice ?
You mean in the first Invoice?
yes
Are you sending them to your customers yourself?
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 ?
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
So is you billing period 1 month?
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)
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.
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
This is probably the best way to manage this case indeed
Please try and see if this works.
You can use test clocks to simplify testing: https://stripe.com/docs/billing/testing/test-clocks
but the subscription schedule is already created, so I should close the phase[0] and start a phase[1] now right ?
thanks for the tip
Yes
Happy to help!
sorry, but I have now the following error message
"error": {
"message": "You cannot update a subscription schedule that is currently in the released status. It must be in not_started, active status to be updated.",
"request_log_url": "https://dashboard.stripe.com/logs/req_MtHTDkhnZLs9Re?t=1694088121",
"type": "invalid_request_error"
}
It seems like the schedule completed
I would actually recommend you to start a new one, and not update it.
but it has the parameter iteration = 24
It might be because it's in the final phase
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"
}
What's the request you're sending?
https://api.stripe.com/v1/subscription_schedules/sub_sched_1Nnez8HIIiQEaaQS7FrIAhlz?proration_behavior=none&phases[1][start_date]=1696402800&phases[1][items][0][price]=price_1NnexvHIIiQEaaQSVlWJspBB&phases[1][description]=Votre abonnement airnest&phases[1][proration_behavior]=none&phases[1][iterations]=23&phases[1][metadata][duration phase]=24&phases[1][metadata][order]=%232807&phases[1][collection_method]=charge_automatically&phases[1][metadata][order_url]=https://admin.shopify.com/store/getairnest/orders/5725045850453&phases[1][metadata][order_graphql_api_id]=gid://shopify/Order/5725045850453
The indexes must start from 0. You must provide all phases starting from the current one
But if i put phases[0] it will overwrite previous created phase no?
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 ๐
Because I understand that by creating a new subscription schedule, the customer will have 2 subscriptions with us
Are you working in Live mode?
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.
I would cancel the existing Subscription and create a new one
But there is a payment request (sepa direct debit) that have been sent to the customer
You can either refund it, or start a Subscription from the next month.
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
Can you add another phase to it?
After 1st of October
You can also try to release the Schedule to make it a normal Subscription: https://stripe.com/docs/api/subscription_schedules/release
I would like to add another phase, but I have the following error message
"error": {
"message": "Invalid phases[0][billing_cycle_anchor]: must be one of phase_start or automatic",
"param": "phases[0][billing_cycle_anchor]",
"request_log_url": "https://dashboard.stripe.com/logs/req_gdT5X7baIko6JD?t=1694090727",
"type": "invalid_request_error"
๐ 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.
so it should billing_cycle_anchor in phase 1 which should have a future date
Yes phase 0 basically has to mirror what is happening currently on the Subscription
I still have the same issue:
{
"error": {
"message": "Invalid phases[1][billing_cycle_anchor]: must be one of phase_start or automatic",
"param": "phases[1][billing_cycle_anchor]",
"request_log_url": "https://dashboard.stripe.com/logs/req_IMdN9huatv4sJq?t=1694091252",
"type": "invalid_request_error"
}
}
phases[1][start_date] and phases[1][billing_cycle_anchor] = 1696402800
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
correct
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
ok I remove the billing_cycle_anchor , but I now have this issue
"error": {
"message": "You cannot update a subscription schedule that is currently in the released status. It must be in not_started, active status to be updated.",
"request_log_url": "https://dashboard.stripe.com/logs/req_O1lSGmPFQE3H6m?t=1694091611",
"type": "invalid_request_error"
}
Alright well that error seems pretty self explanatory, no?
You aren't testing on an active Subscription Schedule
I have an active subscription that I have created today
Sure but the Subscription Schedule is not active
So you need to create a new one for that Subscription
It's in active status in Stripe dashboard, so it's quite strange
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
but why it is in released status, if i created it with the parameter iteration = 24
Looks like you specifically released it yourself via the Dashboard: https://dashboard.stripe.com/logs/req_MM7tqwbcEt9zeo
And the property current_phase.end_date = 1756969200 (checked in a get subscription schedule)
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
ok
so what is your recommendation now ? I should create a new phase with start date = Oct 1st ?
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