#Osiris
1 messages · Page 1 of 1 (latest)
Hi there, yes you can create an one-off invoice with Invoicing https://stripe.com/docs/invoicing
If I create invoice on subscription, the amount is zero. Docs say 'pending' items would be included. Its not including the outstanding usage
What doc are you reading?
sorry this one (same page different section )https://stripe.com/docs/billing/invoices/subscription#generating-invoices
I tried to create invoice on this subscription and amount is 0.
The quantity is 48, and I saw the amount is 2,205, I believe you are using volume tiers_mode
If you expect to see amount for the first 3, you should use graduated pricing. https://stripe.com/docs/products-prices/pricing-models#graduated-pricing
no no, above is screenshot of upcoming invoice from subscriptions dashboard. The invoice I created just 1 minute back is this.
Did you report any usage yet?
I wanted to show even though it shows 2205 outstanding, when I create invoice using
stripe.invoices.create({
customer: 'cus_xxx',
subscription: 'sub_yyy'
})
amount is 0.
Did you report any usage yet?
First screenshot is recorded usage.
Basically , stripe isn't considering that 2205 as pending because its due date is 28th April. And hence its not being included in off-cycle invoice I am creating
Did you create any pending invoice items? or you just report usage without creating any pending invoice items?
No I didn't create any 'pending' items. The series of events were:
- 28th Mar Morning: subscription bought (1 month interval)
- 28th Mar evening: usage recorded as 48 (on subscription)
- 29th Mar (NOW): I am creating an off-cycle invoice
OK, the Stripe will create a pending invoice item based on the usage at the end of the billing cycle (i.e., 28th April), since it's is 29th Mar, that pending invoice item is not yet created and therefore not included in the invoice that you explicitly create.
Yes then it doesn't help with my usecase ? The off-cycle invoice I create will never include the outstanding usage ?
Not directly, you'll need to calculate the amount create your own pending invoice item
You mean a new flat one-time price for every such case ?
you can retrieve the usage summary through this API https://stripe.com/docs/api/usage_records/subscription_item_summary_list#usage_record_summary_all
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It depends on your business requirement. You said "I want to charge the customer if usage increases certain threshold. ", what's the amount that you wish to charge?
Right I was too fixated on 'price varies' thing of volume based pricing. Didn't realise I can charge the threshold itself. Like after usage amount increases 2k charge equivalent money.
So i need to create a invoice, then add a new invoice_item with calculated price. Correct ? Also is it even possible to create invoice item with volume pricing (priceId = that of user-seats) and then set usage ?
Will figure that out from docs. Thanks for help !
I think that's possible, here's my suggestion.
- You can create a invoice item with the amount of the current usage (you can get the usage summary thought the API that posted earlier and multiple it with your unit amount)
- Once your customer has paid, remember to set the usage quantity (use
action=setinstead ofincrement) (https://stripe.com/docs/api/usage_records/create?lang=node#usage_record_create-action) so your customer is not charged twice for the same usage.
cool, got it. supplying priceId didn't work but explicitly setting amount and quantity is working. I will consider this best possible supported solution. Thanks again for help
You might also want combine flat rate + metered usage (https://stripe.com/docs/products-prices/pricing-models#flat-rate-metered-usage) so that you collect a upfront funds from you customer to cover your cost.