#jtm-metered-usage

1 messages · Page 1 of 1 (latest)

spring obsidian
spring obsidian
#

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

rose perch
#

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"

spring obsidian
#

ah you're using Billing Clocks

#

do you have a request ID for that failing request? just wanna see

rose perch
#

req_0JkZjCkd4y0SvZ

spring obsidian
#

ah

#

cause that Subscription is canceled

#

try with one that is active

rose perch
#

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?

spring obsidian
#

yes

rose perch
#

Ok, if I run that I still get the error

small solstice
#

Hello! I'm catching up... can you give me the request ID showing the latest error?

rose perch
#

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.

small solstice
#

Looking, hang on...

rose perch
#

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.

small solstice
#

The canceled Subscription or the new Subscription?

rose perch
#

Canceled. So I just canceled and it's saying "Scheduled" with $0 due.

#

No usage attached to it

small solstice
#

Can you give me the request ID showing your cancelation request for it?

rose perch
#

Yep req_s1zRpuSk6NjhjA

small solstice
#

Hm, I wonder if this is an issue with Billing Clocks. If you try this without Billing Clocks does it work as expected?

rose perch
#

Let me see, I'll have to build a new quick test to try it.

small solstice
#

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?

rose perch
#

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

small solstice
#

Ah. Could be an edge case that Billing Clocks don't account for.

rose perch
#

It seems so. I just tried this flow without Billing Clocks:

  1. Create customer and subscribe
  2. Report usage
  3. Delete with invoice_now=True

I see a draft invoice for the right amount now.

small solstice
#

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. 🙂

rose perch
#

Just reply to the email I received?

small solstice
#

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.

rose perch
#

Yep just says to reach out, I will do that. Thank you!