#arvindkgs-testclocks

1 messages · Page 1 of 1 (latest)

willow stream
#

Hello! GIev me a minute and I can take a look

brave oracle
#

Hi @willow stream did you check if invoice.upcoming event is simulated for testclocks?

willow stream
#

Sorry - juggling a few too many threads right now, so still digging

#

Do you have an example customer ID that you were testing this out with?

brave oracle
#

cus_LV9vLCqC5c4XFw

willow stream
#

We're wondering if the fact that it's a $0 invoice has anythign to do with it - can you try adding usage and see if that helps?

brave oracle
#

Usage will be added once invoice.upcoming event is received

#

Are you telling me I cannot rely on invoice.upcoming event to send usage?

willow stream
#

Sorry, let me clarify - in general, you should be able to rely on the invoice.upcoming event to be triggered, but we're trying to narrow down whether this is some weird behavior with test clocks

brave oracle
#

Okay, I tested it by adding usage, but I don't see invoice.upcoming event generated, I advanced the testclock to 30th, and the billing cycle ends on 1st of next month. So it should have generated the event, as it is after 3 days prior to end of current billing cycle

willow stream
#

Digging into this a bit more, it looks like you're using send_invoice for this subscription? That's the issue right there - invoice.upcoming events are only sent for Subscriptions with charge_automatically. If using send_invoice is a hard requirement for your integration, then you won't be able to rely on invoice.upcoming

brave oracle
#

ohh! why should it matter?

#

which event can I rely on then to send usage report? Usage is fixed for my use case. It is not dynamic.

#

I can send usage report any time in the current billing cycle, as the usage is always fixed

willow stream
#

If usage is fixed, why are you using metered billing? Metered biling is more relevant when you want to report variable usage through a billing period.

brave oracle
#

I want invoice to be generated post usage at the end of the billing cycle

#

Not upfront

willow stream
#

Gotcha - can you just report usage as soon as the invoice from the previous cycle has been generated? So instead of waiting for invoice.upcoming you'll wait for invoice.created so you'll know that the next cycle for the subscription has started

brave oracle
#

that should work, thank you

#

Can I add a feature request to Stripe? Generate invoice.upcoming for subscriptions with send_invoice

willow stream
#

yup! i can't definitely surface that feedback to the team