#ironbeard-multiple-invoice

1 messages ยท Page 1 of 1 (latest)

jolly mantle
#

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.

lilac nebula
#

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.

jolly mantle
#

You would use a Subscription Schedule for this

lilac nebula
#

๐Ÿ‘€ thanks!

jolly mantle
#

๐Ÿ‘

lilac nebula
#

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?

jolly mantle
#

You can attach a Sub Schedule to an already-created Sub or you can create a new Sub with a Sub Schedule

lilac nebula
#

gotcha, that helps. Will read the docs further, thanks!

jolly mantle
#

Come back with any questions that we can help with!

lilac nebula
#

If I

  1. create a Subscription with a single item,
  2. later add a second item (that got prorated and paid immediately),
  3. 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.

jolly mantle
#

No it should contain both... the item that was canceled should be in the previous_attributes hash in the webhook

#

That would be an easy way to ensure your webhook is picking up the necessary info

lilac nebula
#

Yeah, I learned about Clocks the other day but haven't dug into them yet

#

gotcha tho

jolly mantle
#

Gotcha

#

๐Ÿ™‚

lilac nebula
#

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?

jolly mantle
#

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?

lilac nebula
#

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

jolly mantle
#

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.

lilac nebula
#

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

jolly mantle
#

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

lilac nebula
#

Oh, gotcha. It wouldn't be in the items.data list tho?

#

I guess I just need to mess around with clocks lol

jolly mantle
#

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)

lilac nebula
#

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 ๐Ÿ™‚

jolly mantle
#

Yeah as far as I know that should still work fine with a schedule!

lilac nebula
#

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

jolly mantle
#

โค๏ธ

lilac nebula
#

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

jolly mantle
lilac nebula
#

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?

jolly mantle
#

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

lilac nebula
#

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

jolly mantle
#

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!

lilac nebula
#

No worries, thanks!

lilac nebula
#

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?

pastel sentinel
#

If you want 1 year, then iterations should be 1

lilac nebula
#

I would want less than a year, actually; just until the next billing date. Would it still be one *iteration?

pastel sentinel
#

If the price is annual, then the next billing date would be 1 year later right?

#

Or am I missing something

lilac nebula
#

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

pastel sentinel
#

For this it sounds like you'll need to use end_date

#

Since 1 iteration of a yearly price is 1 year

lilac nebula
#

gotcha, thanks!

#

Is it your understanding that I need to be using a SubscriptionSchedule to mimic cancel_at_period_end for a SubscriptionItem?

pastel sentinel
#

Yeah

#

But what is the subscription item exactly? Just a one time charge?

#

Or some recurring charge?

lilac nebula
#

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:

  1. someone signs up for annual SaaS access
  2. 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.
pastel sentinel
#

Got it yeah end_date would be the move then

lilac nebula
#

Gotcha, thanks!