#nukesforbreakfast_best-practices
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/1336412534072152136
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I also have some weird requirements in certain cases from our clients. For example, a recent one was that a permit issued during the year is only good until the end of that calendar year, so it would need to be renewed on the first of the following year with that lower renewal fee.
hi! just want to ack your question, things are a little busy but i will get back to you asap ๐
at a glance subscription schedules sound like the perfect solution for you. have you tried them out yet?
you'd essentially set up two phases, one referencing the higher price and then a second referening a lower price
that's what I figured. What happens at the end of the second phase? I would basically want it to remain renewing at the lower price until cancelled.
end_behavior: "release" should do that for ya
https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-end_behavior
ok, what about this weird requirement? How would I model that in a subscription? I haven't confirmed it should be a prorated amount, but I assume it would be since having to pay full price for a permit you get on December 15th that expires on January 1st would be extremely irritating. But, I wouldn't put it past a municipality to have that kind of rule either, so I might need to support the case without proration as well.
good question! let me circle back to that in juuuust a bit, still juggling multiple threads. appreciate your patience ๐
no worries
Hello
Taking over here
I'm not sure I fully grasp what you mean by
A permit issued during the year is only good until the end of that calendar year, so it would need to be renewed on the first of the following year with that lower renewal fee.
What's a permit here in Stripe context?
Is that a subscription or something else?
that would be the subscription price I'm trying to model
for example:
Initial fee $50 for the first year
renewal fee every year after $15
However, if they do it by calendar year, the permit would be billed that initial $50 for the period of Jan 1 to Dec 31.
If somone signs up for a permit and it gets issued on December 15th, how do I prorate that initial $50 fee for the remaining days in the current calendar year while renewing it on January 1st of the new year for the lower $15 amount?
So basically charging $35 for renewal on Jan 1st for the next period?
Sorry I think i'm confused about when you're issuing the permit. Is it for the year before the first year or before the second year?
Sorry
The permit is issued for the current calendar year. So if it's issued on a date in 2025 it's for the year of 2025 renewing on Jan 1, 2026 at the lower $15 renewal fee.
Just to make sure I'm on the same page,
I'm a customer and I sign up for your subscription on January 1st, 2025.
- 1st year cost is $50 which I pay upfront
- 2nd year and so on will cost $15 (starting Jan 1st, 2026)
However, instead of renewing on Jan 1st, 2026 - I renew it on December 15th, 2025 instead.
What happens next depends on how you handle updates:
- Renewing on December 15th, 2025 means you're changing your billing cycle anchor meaning your billing cycle anchor will change from Jan 1 - Jan 1 to Dec 15 - Dec 15
- You can configure proration when you update the product/price by setting
proration_behaviorparameter
https://docs.stripe.com/billing/subscriptions/upgrade-downgrade
not quite
You can't do proration but also keep the billing cycle the same iirc.
I'm a customer and I sign up for your subscription on December 15th, 2025.
- 1st year cost is $50 which I pay upfront, but needs to be prorated for the remaining days in 2025 as the billing cycle runs from Jan 1st, 2025 to December 31, 2025.
- 2nd year and so on will cost $15 (starting Jan 1st, 2026)
Ah I see. You can backdate the subscription and set the billing cycle anchor to prorate the price for the 15 days - https://docs.stripe.com/billing/subscriptions/backdating?dashboard-or-api=api#backdating-billing-cycle
If you don't backdate, you'd need to calculate the prorated amount yourself since Stripe won't know when exactly the subscription started
but how do I make that happen when using a billing schedule?
do I set this start_date value to a date in the past? https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-start_date
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes - https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#backdating-subscription
And make sure to set proration_behavior to none otherwise Stripe will attempt to charge the customer for backdated time
Hmm actually, I don't know if Subscription Schedules can handle this usecase ๐ค
oh, so proration when backdating charges for the amounts from the backdated date to now?
I actually want it to do something like this:
- The billing cycle is a fixed calendar year, Jan 1 to Dec 31
- If a permit is issued any day other than Jan 1, prorate the $50 fee amount based on the remaining days in the year. I.E. if it's halfway through the year (July 1), then only charge them $25.
One option would be to backdate and create a subscription first as per - #1336412534072152136 message
Then you create a subscription schedule for that existing subscription and Update the schedule to configure the next phase to $15 price
I don't know if Subscription Schedule can handle this usecase on its own
so I'm confused, sorry: Does backdating a subscription mean stripe tries to charge and collect on the entire subscription amount? Or is the proration in the other direction where it only charges for the remaining amount due in the billing period? I think this only applies in the fixed calendar year period case.
Normally, an annual subscription would just charge the full amount on the day you subscribe, and renew a year from that date.
so I'm just trying to understand if stripe can model this weird, fixed calendar year case.
Hi, I'm taking over as my teammate needs to step away. Let me catch up
yeah, what you're asking is not possible I'm afraid
a normal annual subscription is, though, right?
but not this weird fixed calendar period case.
Yeap!
Ok, and I can achieve the first year price 1, 2nd year and everything after price 2 with schedules?
I think discord just went down
Yeap so my message was not sent.
so, just confirming:
I can set up a schedule with the first phase as price 1 for the first year, and then the second phase as price 2 for the second year and set the end behavior to "release" to continue on price 2 forever until cancellation.
That is right. I highly recommend that you test this using your Test API key. You can leverage our Test Clocks, https://docs.stripe.com/billing/testing/test-clocks to advance time
perfect
finally, do subscriptions support mid cycle cancellations with and without prorated refunds?
I.E they cancel halfway through the year, so we refund half of the subscription price.
Yes, you can set that on the update call.
ok, I think that answers my question. I'll have to do a lot of testing.
should I be using the new sandboxes or test mode to do that?
that is up to you