#jtm-metered-usage
1 messages · Page 1 of 1 (latest)
hello, thinking one sec
try this
can you create an Invoice for that Subscription in the mid cycle? (you'll have to test it) can you give that a shot?
I anticipate it will create an Invoice for the current usage, after which you can update the Price to a diff one
I'll try this and let you know, thanks!
@spring obsidian So (using the test clock) I've created a subscription, and reported usage, I can see charges in the upcoming invoice. When I make a call to create an invoice for the subscription I get an error that says "Nothing to invoice for subscription"
ah you're using Billing Clocks
do you have a request ID for that failing request? just wanna see
req_0JkZjCkd4y0SvZ
my test completed which deletes the test user. I can try again and pause the test so the subscription stays active if that helps
Ok it's paused just before create invoice would be called
sub_1K20RoHGIs3OKt3kKXHgiDYG
There should be an Upcoming Invoice for $15
@spring obsidian with the upcoming invoice showing, in theory creating the invoice should work here?
yes
Ok, if I run that I still get the error
Hello! I'm catching up... can you give me the request ID showing the latest error?
If I continue the test it'll end up deleting the customer and subscription. But I can modify it so it doesn't, then get you a failed request, one minute.
@small solstice req_F0rUj3PbLc3g57 is one that failed saying nothing to invoice.
Looking, hang on...
I think your best option is to cancel the existing Subscription with invoice_now set to true and then create a new Subscription for the upgrade. https://stripe.com/docs/api/subscriptions/cancel#cancel_subscription-invoice_now
When I tried that the subscription just sat in some state and didn't advance. I'll try again, though and let you know what it does.
The canceled Subscription or the new Subscription?
Canceled. So I just canceled and it's saying "Scheduled" with $0 due.
No usage attached to it
Can you give me the request ID showing your cancelation request for it?
Yep req_s1zRpuSk6NjhjA
Hm, I wonder if this is an issue with Billing Clocks. If you try this without Billing Clocks does it work as expected?
Let me see, I'll have to build a new quick test to try it.
Oh, hang on, the timestamp you provided for the usage record is over two weeks in the future. If you supply a timestamp of right now does it work?
I have to set the usage timestamp in the future to account for the billing clock advancements.
The usage record ts is == test_clock_value + 1, otherwise the API call fails
Ah. Could be an edge case that Billing Clocks don't account for.
It seems so. I just tried this flow without Billing Clocks:
- Create customer and subscribe
- Report usage
- Delete with
invoice_now=True
I see a draft invoice for the right amount now.
Alright, so seems like a bug with Billing Clocks. Please report the details to the person who gave you access to the Billing Clocks beta so the Billing Clocks team can investigate and fix. 🙂
Just reply to the email I received?
I'm not sure what the email says; does it include information about reporting bugs or giving feedback on the beta?
If there are no explicit instructions I would reply to the email, yeah.
Yep just says to reach out, I will do that. Thank you!