#thomasst

1 messages · Page 1 of 1 (latest)

graceful pulsarBOT
cobalt parrot
#

Hi đź‘‹

It looks like the Invoice Item was created for the Customer. but, since this subscription was canceled in the middle of the billing period and you didn't specify the invoice_now option, an invoice was not generated to apply this invoice item. It will be included on the next invoice for this customer or at the end of the billing period.

steep osprey
#

Under "Pending invoice items"

cobalt parrot
#

I'm not sure what the Dashboard will show, we don't spend much time working with the dashboard here. You are using test clocks and that might not behave the way you expect either. But I do see the Invoice Item created 40 minutes ago. But it also shows a deleted (39 minutes ago).

steep osprey
#

What event deleted it?

#

Do you have any idea how it got deleted?

#

The dashboard should normally show those items, but it appears it somehow got deleted. Why?

cobalt parrot
#

It looks like that was related to the canceling of the Subscription. I would recommend you test this process out again with invoice_now: true.

steep osprey
#

But I don't necessarily want it invoiced, I'd like to keep the upcoming invoice item.

#

Is it a bug? Shouldn't it stay?

placid cove
#

đź‘‹ Hello! I 'm hopping in to take a look as well since snufkin has to head out soon

steep osprey
#

Thanks!

placid cove
#

I'm still chasing this down, but it may take me a bit longer

steep osprey
#

No worries, thank you for looking into it

placid cove
#

Just a quick update from me - I'm still looking, but I actually haven't been able to reproduce the behavior you're seeing at all

#

I see my invoice items being retained whe the subscription is canceled

steep osprey
#

ok, please keep me posted

placid cove
#

I'm still not able to reproduce, but wanted to ask really quick

#

Is this something you're able to reproduce repeatedly whenever you cancel a subscription?

#

Or is it just happening for this one subscription test?

graceful pulsarBOT
steep osprey
#

It happened in this subscription test. I'll go with the suggestion of using invoice_now but I'm suggesting that this may be a bug on your side that possibly should be investigated.

placid cove
#

Yeah what I was trying to narrow down is whether this is somethign you seen in ALL your subscription cancellation requests, or just this specific one

steep osprey
#

I've had some where it worked. I don't remember the exact conditions.

#

so I was surprised it disappearing here

#

Are you able to reproduce it? Maybe it's only if the clock is exactly on the cycle renewal timestamp.

placid cove
#

I haven't been able to reproduce it at all - which is why I asked if it was somethign you were able to reproduce repeatedly as well 🙂

steep osprey
#

Would you like me to rerun the test just to see if it happens again?

#

on a new test clock & customer ID

placid cove
#

Yeah that would help

steep osprey
#

I have another quick question meanwhile.

placid cove
#

go ahead

steep osprey
#

The amount_due vs amount_remaining fields are both 200 on in_0Nqfqo4rOYBvHyzsaxrO2YFg. But the customer has a credit balance of $290. The docs for amount_due say: "Final amount due at this time for this invoice. If the invoice’s total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If"

#

In this case, since there is a balance, wouldn't the amount_due have to be 0 "at this time"?

#

Use case is: I want to calculate the total amount of money that the customer owes us (or we owe them).

#

That would be the balance plus any outstanding amount of invoices that aren't paid.

#

To make this calculation, should I sum up the balance + amount_due or amount_remaining of each invoice?

#

Actually this customer would have due invoices for $292, and a balance of $290, so owes $2 in total.

placid cove
#

From what I can see, that customer had a credit balance that was added on 2023-09-15 17:34:20 but the Invoice was finalized before that on 2023-09-15 17:30:44 - that's why the invoice doesn't reflect that customer balance

steep osprey
#

Yep, in that scenario is there a difference ever between amount_due and amount_remaining?

placid cove
#

It would change once the invoice is actually paid, but at that point in time for the invoice it'd be the same

steep osprey
#

For my use case, which field should I use?

placid cove
#

I'd use amount_remaining - once an invoice is paid, amount_due won't change. amount_remaining will

steep osprey
#

Thanks

#

Take a look at sub_0Nqhdj4rOYBvHyzsOCIH17H3 now

placid cove
#

The invoice item wasn't deleted for that example, right?

steep osprey
#

no

placid cove
#

👍

#

I'm still not entirely sure why that earlier example you gave deleted the invoice items, but I'll be sure to flag with the product team to see if we can get to the bottom of it

#

If you see it happening again definitely let us know!