#carter_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/1377865589795848195
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! gimme a few minutes to take a look!
I understand the first option, but am still a little confused over the second option where you mention create a second subscription per customer for tracking each month start/end - can you explain this option in a little more detail?
i'm a little confused over how creating a second subscription per customer will allow you to track each month start/end if it's an annual subscription
Hey Alex, So what we're trying to avoid is having to manage the start and end dates of a month when they're on an annual subscription. We were thinking we might be able to create a 2nd subscription that just has a free product in it, and use the start and end date from the subscription, instead of hand-rolling the start and end dates in the app ourselves. We're mostly just wanting to know if there's other approaches that we haven't considered to handle the case where a subscription has monthly "usage" but is billed annually. Hope that makes sense.
yep, that was very clear!
I actually really like the second option that you thought of, i don't think there's a better way right now off the top of my head. Do you intend to prorate if the customer cancels the subscription midway or upgrades / downgrades?
At the moment we're planning on disabling proration behavior for the initial build, downgrades would be scheduled for the next phase, and upgrades would only really occur once they have exhausted their usage, at which point the subscription ends and we start a new sub and move the billing anchor forward
hmmhmm, you may not need two subscriptions if you don't intend to use prorations
if you don't intend to allow for prorations, you can consider :
- when you create the monthly subscription with a $0 price, you can charge the customer for the annual fee by adding it to https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items
- so every "year" when it's time to charge the customer again, you would then create a invoice item to add to the draft invoice : https://docs.stripe.com/api/invoiceitems/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah interesting, I'm guessing with this approach it's just adding an extra item to the invoice so we would have to take on tracking when year ends?
yeah....there's pros/cons to each approach
after thinking about it, i still feel your idea is easier to manage in the sense that you really only need to store both subscription ids in your DB, then rest of it is mostly handled by Stripe
In case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
Alright, that's really helpful though! I'll have to play around with the one off items and see which one will work for us.
I think that's all from me today. Thanks for the insight Alex, much appreciated.
sure! feel free to reach out again if you still have any other questions.
Just an additional point that if you go with the two subscriptions approach, you may need to manually set the billing_cycle_anchor when creating the second subscription, ensuring that it follows that of the first subscription. Otherwise they may be a few seconds apart