#ironbeard-multiple-invoice
1 messages ยท Page 1 of 1 (latest)
Hi there! No, invoices are isolated to Subscriptions (or aren't tied to a Sub at all), so you can't have one invoice for multiple Subs.
Gotcha. I was hoping for some type of "cancel_at_period_end" behavior for a SubscriptionItem, but don't think that's possible.
I want my customers to get a single invoice/charge per year, but be able to add/remove access to the SaaS accordingly. Not sure if there's a way to remove/cancel a SubscriptionItem from a subscription but not do it until the following Invoice/billing period.
๐ thanks!
๐
Are these created automatically when I create a subscription? e.g., would it just be a matter of modifying an existing schedule for a SubscriptionItem?
You can attach a Sub Schedule to an already-created Sub or you can create a new Sub with a Sub Schedule
gotcha, that helps. Will read the docs further, thanks!
Come back with any questions that we can help with!
If I
- create a Subscription with a single item,
- later add a second item (that got prorated and paid immediately),
- then even later I created a SubscriptionSchedule to cancel the second item at the end of the billing period,
Would the end of the billing period send a customer.subscription.updated webhook that only had the single (initial) item listed? That's the event I'm listening for to provision access.
No it should contain both... the item that was canceled should be in the previous_attributes hash in the webhook
One of the best things to do when you are building an integration involving Sub Schedules is to use Test Clocks (https://stripe.com/docs/billing/testing/test-clocks) to be able to test end-to-end.
That would be an easy way to ensure your webhook is picking up the necessary info
Yeah, I learned about Clocks the other day but haven't dug into them yet
gotcha tho
I'm confused, when customer.subscription.updated is sent after the new invoice, since the invoice doesn't have the second item (due to the schedule), why would it be listed in the webhook under items?
Sorry I think I misunderstood. I thought you were talking about the update when the item is removed.
Which specific instance of the event are you referring to?
Ah, yeah sure
So
1, 2, and 3 as above. And then when they're payment is processed, 1 year from the date of (1), Stripe would send a customer.subscription.updated event, right? or I am misunderstanding that
Yep the customer.subscription.updated event will fire every time the Sub cycles.
So yes, I do think the item that was present before but now isn't after the annual renewal should be included.
Gotcha, so 1 year from the initial subscription, the invoice would finalize/get paid, and that event/webhook would be sent and only include the SubscriptionItem from the initial subscription, not the one that was on a Schedule to be cancelled on that date
The one that was cancelled on that date will be included as a previous_attributes item.
So it will be mentioned on the event
But in a way that indicates it is no longer present on the Sub
But was present in the past
Oh, gotcha. It wouldn't be in the items.data list tho?
I guess I just need to mess around with clocks lol
It should no longer be in the items.data list since the item is no longer a part of the Sub (it was removed)
But yes, highly recommend using test clocks to make sure (I also haven't tested this specific scenario)
Right, that's what I was anticipating. Gotcha. I use the items.data list to provision service, so if I create a Schedule that cancels one item on the billing day, then I can still rely on that webhook to provision service (only allow them access to pages corresponding to the items.data object in the webhook payload).
Cool cool, thanks so much ๐
Yeah as far as I know that should still work fine with a schedule!
Damn, this Clocks Dashboard API is nuts (in a good way).
I've never seen a company as dev friendly as you guys, thanks for all you do
โค๏ธ
So I created a clock, created a subscription, fast fowarded 6 months, and I want to update that subscription and add a second SubscriptionItem. I see the toggle for "Prorate changes" but it puts the prorated amount into the next invoice. Is it possible to simulate "invoice_immediately" just for the prorated amount?
I guess it doesn't really matter for what I'm trying to test, but just figured I'd ask
Yep you want always_invoice when you update the Sub: https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
You can also set this on a Sub schedule phase: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-proration_behavior
Sorry for being unclear: I'm familiar with always_invoice, but I meant is there a way to emulate it when updating a subscription in the Test Clocks dashboard?
Ah I see, thanks for clarifying. I think you are right โ you can't set always_invoice in the Dashboard. You can only toggle proration on/off. I'll double check though
Gotcha, I wasn't sure if could be done with the Usage Treshold options, but eh, I don't think it's a huge deal for my situation at the moment
I've got to step away but my colleague is going to step in and is happy to help with any further questions! Have a good one!
No worries, thanks!
I was hoping to get some clarification on SubscriptionSchedules.
If I want to specify iterations in my phase rather than end_date, and if all my Prices are annual, would iterations=1 mean it ends at the end of the next upcoming billing cycle, or would that be done by iterations=0?
If you want 1 year, then iterations should be 1
I would want less than a year, actually; just until the next billing date. Would it still be one *iteration?
If the price is annual, then the next billing date would be 1 year later right?
Or am I missing something
In my scenario, there's an annual subscription set up. Then some months later the subscription is updated and another SubscriptionItem is added, with always_invoice and the prorated amount billed immediately.
I want to approximate something like 'cancel_at_period_end' with that new SubscriptionItem, which I believe means I need to create a SubscriptionSchedule, and I guess I was trying to see if I could do that with iterations instead of end_date
The billing date is one year from the initial subscription creation date
For this it sounds like you'll need to use end_date
Since 1 iteration of a yearly price is 1 year
gotcha, thanks!
Is it your understanding that I need to be using a SubscriptionSchedule to mimic cancel_at_period_end for a SubscriptionItem?
Yeah
But what is the subscription item exactly? Just a one time charge?
Or some recurring charge?
Hmm, well, it would be adding a recurring charge to the plan, but since it's invoice_always with an immediate prorated payment, I'd want the user to be able to cancel the added part at some point but still provision access to them until the next billing cycle.
I guess my thought is:
- someone signs up for annual SaaS access
- 6 months later, they say "I want this subscription add-on", which adds on an annual access price/subscription item. But I want them to be able to "cancel_at_period_end" and go back to just the initial annual price when their billing date comes around.
Got it yeah end_date would be the move then
Gotcha, thanks!