#Moustache

1 messages ยท Page 1 of 1 (latest)

viral compassBOT
oblique lance
#

Hi, what is the issue?

rose grove
#

I am noticing this customer "cus_NuIj1hIl8bgcps" on account "acct_1EHNO1Ivds3mVXfh" has no record on pending invoice items being created. While this customer "cus_NxEauLTqC8zSgj" does.

#

That may sound a little obtuse. In other words I am seeing pending invoice items on cus_NuIj1hIl8bgcps but no related events

oblique lance
#

Looking on my end.

#

Did you create an invoice item for both customers? What did you expect would happen and why?

rose grove
#

invoice items were create for both customers using the same form in our application. One of them was charged immediately while the other customer's invoice items remain pending.

#

I was hoping to see the logs for when the invoice items were added but they do not exist.

oblique lance
rose grove
#

Yes... I just saw them as well. Sorry for the oversight. ANy idea why cus_NuIj1hIl8bgcps did not get charged?

oblique lance
#

For the other customer, I see an invoice item creation: https://dashboard.stripe.com/logs/req_wPOc44LvRi1F28 and https://admin.corp.stripe.com/request-log/req_6SJ49t6q0MAxt8#details. You can all of the events: https://dashboard.stripe.com/customers/cus_NxEauLTqC8zSgj and it looks like these pending items added to an invoice, https://dashboard.stripe.com/invoices/in_1NBK9eIvds3mVXfhkv8vzy73 and https://dashboard.stripe.com/invoices/in_1NBKGyIvds3mVXfh5zzZwCGp and finalized because they have a credit balance

rose grove
#

Yes that is correct. I used a credit balance to test. I submitted the second order to see if I can replicate the issue of the invoice items not getting charged for this client. My understanding is that by adding invoice items prior to creating a subscription, the items will be included in the sub's initial invoice.

oblique lance
rose grove
#

Yes, I understand. I am asking why the invoice items weren't included in the initial invoice for the other customer

viral compassBOT
rose grove
oblique lance
#

I'm further looking at this

rose grove
#

Thank you. I am probably missing something obvious but I cannot figure it out!

oblique lance
rose grove
#

I am not sure how... the form is one synchronous script with the invoice items created before the subscription is happening.

oblique lance
#

I tested this on my end, and if I create the invoice item before the subsciprtion, it does pull in my pending invoice items.

#

In test mode, I recommend that you create a pending invoice and then create a subscription to see it in action.

viral compassBOT
rose grove
#

yes, me too... but this time it didn't. This app is in production and has created 50,000 subscriptions with invoice items. I am trying to understand why in this case, it did not

spice oasis
#

๐Ÿ‘‹ hopping in here - give me a minute to catch up

rose grove
#

thanks, karbi

#

I can actually confirm that the invoice items were added before the subscription was created in this case:

#

cus_NuhjejyAt6zVXG is another example of this happening

spice oasis
#

Invoice items are only pulled into Subscription Invoices if the Subscription ID is specified when the Invoice Item is created

#

Actually let me double check that - one minute

rose grove
spice oasis
#

Yeah I'm looking now - I'm certain I'm just missing something obvious

#

I think this is related to the fact your have automatic tax enabled on that Subscription

rose grove
#

I had the same suspicion!

#

But I don't know how they are related

#

There are also coupons applied in both cases which is somewhat unique as well

spice oasis
#

Really quick - do you happen to have an example where the Invoice Items were added to your subscription automatically after creation?

rose grove
#

followed by

spice oasis
#

Aha, so you have code that's conditionally enabling/disabling automatic tax

#

That probably explains it - the subscriptions that are using tax_rates are the ones that are pulling in the invoice items correctly

rose grove
#

hmm

#

I can check some of my other clients for more examples.

#

besides, why would that change the behavior of the invoice items?

spice oasis
rose grove
#

I don't have access to those settings... this is a connect account

#

but they likely have!

#

what does it all mean?

#

I can see those settings!

#

and it looks like he hasn't completed the integration

spice oasis
#

One of my guesses was that if they changed those settings recently to now set a default tax behavior that would explain why initially those pending invoice items weren't being pulled in (because they have no default tax behavior to rely on at the time

rose grove
#

Is there a way to tell if the connected account has auto tax enabled automatically. It would be great if I could make it conditional based on whether or not my client has auto_tax configured properly

spice oasis
#

Yeah unfortunately I don't think there's any way to get that - your best bet would be to always set tax_behavior when you create an Invoice Items

#

(so that you're not relying on those defaults)

#

but let me also test this out really quick and make sure this is behaving like I expect

#

Yup just tested it out - and confirmed that when I don't have a default tax behavior set then Invoice Items that don't set tax_behavior don't get pulled in

#

And I've also checked some logs on our end and I can defintiely see that account changed those settings on May 18 to set a default

#

Which explains why it's working now and it wasn't working for the earlier ones like cus_NuhjejyAt6zVXG which had the subscirption created before they changed the settings

rose grove
#

awesome. Thank you for your help

spice oasis
#

๐Ÿ‘

#

Sorry that took a while to unravel