Kugel
Kugel

Reputation: 838

Stripe charge changes monthly for yearly subscription

I'm trying to implement something similar to Immediately charge for subscription changes, but instead of charging immediately, I would like to charge once a month. Customers can choose between a yearly and a monthly plan. If they pay annually, I would like to charge quantity changes to the subscription once a month, instead of waiting for the next billing cycle.

This is what I do so far:

  1. create the subscription (through the checkout)
  2. set the pending_invoice_item_interval to "month" with an interval count of 1
  3. update the quantity for the subscription if the customer adds/removes users

When I go to the dashboard, I can see that the customer has a subscription and pending invoice items. But the next invoice is set to next year. I thought pending_invoice_item_interval will grab all open invoice items and puts them in a new invoice once a month. Or is the dashboard just wrong and it does what it promises to do? From the docs:

Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval.

Quick example: start with one user -> 60$/year, add one -> prorate 60$ for the existing user, 120$/year. In this case, the next bill will be 180$ instead of charging 60$ next month and 120$ next year.

I could create an invoice manually each month, which will be charged immediately for the correct amount, but I would prefer it if Stripe could handle this case for me. Any ideas on how I could make this work?

Upvotes: 0

Views: 1678

Answers (1)

Nolan H
Nolan H

Reputation: 7459

What you're describing is in fact the expected behaviour, but the Upcoming Invoice date is just not aware of these extra invoices -- it is only aware of the invoices related to subscription periods rolling over.

Despite this, the additional invoices should be created as you are trying to achieve.

For my own satisfaction I've configured a test for the same situation except using the day interval to see if the pending items are invoiced tomorrow. Happy to report back on the results of that to confirm.

Upvotes: 2

Related Questions