#birdy247_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1319310342936854579
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐
Why not creating a Subscription with a backdate 1st of January and set billing_cycle_anchor the 1st of next January?
https://docs.stripe.com/api/subscriptions/create#create_subscription-backdate_start_date
https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_cycle_anchor
Yes that's why I suggested using it with billing_cycle_anchor
I think that should work
I invite you to make a test
Would we have to set none for proration_behavior
Yes good point, I don't think it would be necessary because the result proration will be the full amount, if you passed exactly 1 year lap between the backdata and the billing cycle
But it's safer to specify it too.
If we had someone join on 1st Oct 2024 and we wanted to take payment today but next renewal is 1st Jan 2026, would this approach also work?
You mean 1st Jan 2025 ?
No 1st Jan 2026
We essentially give people who join within 3 months of the period ending, those months free
So they pay today, this then takes them through to end of next period (i.e. period + 2 months)
Ah no, this is different then.
We would ideally have one process that could cater for both scenarios
I see. What you can do actually is to use one-time Invoice for paying the first Subscription period. You create the Subscription with a free price for the first period and then you update the Subscription with the expected price for the period 2
What about the method I suggested
Where we create an invoice, finalise it and attach it to te customer, then create a subscription with a long number of trial days
Would that work?
You'll need 2 trial periods, one between 1st Oct 24 => 31st Dec 24 and a second from 1st Jan 24 to 31 Dec 24
Trial periods can't be longer than 1 year?
๐ stepping in
Thanks
Trials can be up to 2 billing periods based on the Price being used.
If I remember correctly...
Should be able to test quite easily
Ok, so if a period is 1 year, then we would be fine
Can you check my suggested flow for the 2 scenarios we are trying to solve
Is there a reason to create a separate Invoice instead of just updating the Subscription to be on trial until the next billing period ?
How would we charge them today without an invoice?
You would charge them via the initial Invoice for the Subscription
Instead of creating a separate Invoice and then a Subscription
Ok, we would grab the invoice and update it?
I wasnt sure if it was already finalsied
the latest_invoice ?
What do you mean by "update it"?
The initial Invoice for the Subscription is finalized on Subscription creation
So yes you would expand latest_invoice.payment_intent and then use that PaymentIntent to confirm the initial charge
Then if successful you can update the Subscription to set it on trial until the next time you want to bill for the Subscription
Ok, so just so we are on the same page
today = 1st Nov 2024
Member signs up today, we give them 2 months free and their next charge is 1st Jan 2026
The member would be charged today and then again on 1st Jan 2026
Yep so you create the Subscription with the normal yearly Price without a trial
Then after that initial charge you update the Subscription to a trial until Jan 1, 2026 so they are charged again.
Got it
If you prefer to go the other route and just use a separate Invoice then that works too
But this just keeps everything associated to the Subscription
So seems cleaner to me
And if we look at the other scenario where someone joins on 1st March and we want to collect payment today and then again on 1st Jan