#joshglazebrook
1 messages · Page 1 of 1 (latest)
You can create Invoices that are separate from Subscriptions, yes. You can also create one-off Invoice Items that only apply to one invoice and do not affect the rest of the Subscription's line items. Not sure if that answers your question though.
Yea so I want to offer monthly and year billing for my subscriptions. But I also need to charge for "orders" placed during each month. For monthly billing this is easy as you can just add pending invoice items that get automatically included in the next monthly invoice. For yearly, these would be included in the yearly renewal which isn't what I want. So my thinking is to still do this, but create an invoice once a month which includes all of those pending items and then finalize it.
I'm also assuming the 250 invoice item limit is per invoice item and not quantity, correct? If so I think this would be easier than trying to use a usage based subscription and handle both monthly and yearly subscriptions in the way I need to
I'm also assuming the 250 invoice item limit is per invoice item and not quantity, correct?
Correct
If you're doing monthly and yearly at the same time, generally you'd just want to create separate subscriptions. That would be the "Stripe only" solution. Otherwise you may want to look into creating a webhook endpoint that listens for invoice.created and invoice.upcoming to update the Invoice with a line item each month. A cron job could work, but I think it would be much harder to implement and likely more prone to breaking
I was thinking I would just add invoice items after a customer performs an action I want to charge for (on a monthly basis). So if they are on a monthly subscription (base fixed cost), these would just be added to the next upcoming invoice that stripe automatically creates & finalizes for the monthly subscirption. But for yearly I would still create the invoice items (as the actions I charge for are performed by the customer), but since stripe only creates and finalizes the invoice once a year, instead I would just manually (with the api) create an invoice once a month which should pull those invoice items off the upcoming subscription invoice without affecting the next yearly invoice for the base subscription.
I was thinking I would just add invoice items after a customer performs an action I want to charge for (on a monthly basis). So if they are on a monthly subscription (base fixed cost), these would just be added to the next upcoming invoice that stripe automatically creates & finalizes for the monthly subscirption.
This part makes sense, but you would have to cache the extra charges, since Stripe doesn't create a new Invoice until shortly before the next billing cycle. There is a 1 hour window after Stripe creates an invoice, where you can update it with one-of invoice items, so you would want to listen for theinvoice.createdevent if this is the route you decided to go.
Is that just for essentially timekeeping purposes? ie: if I don't care if additional items get included into that invoice (during that 1 hour period) prior to it being finalized, they won't be lost right?
For the yearly subscriptions, if i'm reading this correctly, I can just create an invoice and pass in the subscription id and it will include all of the pending invoice items, without affecting the subscriptions billing cycle (https://stripe.com/docs/api/invoices/create#create_invoice-subscription)
That's correct. You could explicitely create it as well