#kinfabs
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
hi ๐
the easiest way is to first create the subcription then create the schedule from that subscription https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but then I'd need to cancel the subscription again for only using the scheduled one?
which will be transfered to a subscription again when the start_date is reached
I'm not sure I follow
when you create a schedule from a subscription, you don't have to cancel the underlying subscription
the Subscription Schedule would be the main thing you need to worry about
there won't be 2 subscriptions
you just transform the Subscription to a Subscription Schedule
ah ok. Get it!
thank you - I will try to do that!
so I can also change the start date from now to one in the future then?
oh I forgot about the future start date ๐คฆ
my bad
actually in that case you just need to use https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-default_settings-billing_cycle_anchor to change the billing_cycle_anchor
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What I want to do is create a scheduled subscription (with one month) that starts in the future but with a fixed billing circle (let's say the 1st of a month and it should start tomorrow)
The first invoice then should only contain the days from tomorrow until the 30th. And the next invoice at the 1st the full amount for a month
yes I did that as descriped in the docs but then the first invoice has the full amount and the second one (at the 1st) has the discounted amount (minus the 20 days )
ok let's try this
create a schedule with 2 phases
the 1st one has an end_date (the next 1st of the month - 1day) and another phase that starts on the 1st of the month
if you're just doing the Schedule to start in the future
you can also create 1 phase and set the https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior to release
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I've done exactly what you've descriped. And that leads to the behaviour with first invoice full and second one discounted
can you try with https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-proration_behavior always_invoice?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I've also tried that - no change ๐
I'm not sure then that the behavior you're trying to accomplish is achievable
Hm, it is possible via dashboard
I'm asking for some confirmation from my teammates
thank you!
as said in the dashboard you're using the initial_billing_cycle_anchor property for that in scheduled subscriptions. It does exactly what we want to do via api - so maybe there is somehow a possibility to archive this ๐
doesn't seem possible from what I've tried
initial_billing_cycle_anchor is something the new the product team for Subscriptions added in the last month or so, presumably they intend to bring this functionality to the API eventually(generally we release things in the Dashboard first since we can control things, there's more of a process for releasing things to the public API as it can't be changed once released). I'd write to https://support.stripe.com/?contact=true to express interest so hopfully the feedback is raised to help priortise that work.
you could use e.g. a cron job and create the subscription later(since passing billing_cycle_anchor set to the 1st, if doing the PAPI call on the 20th, will do what you want, it's just that you can't use a Schedule to create the subscription automatically)
yeah that's whate we will try to implement now! Thank you!