#Moustache
1 messages ยท Page 1 of 1 (latest)
Hi, what is the issue?
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
Looking on my end.
Did you create an invoice item for both customers? What did you expect would happen and why?
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.
It see these invoice item creations https://dashboard.stripe.com/logs/req_wSHOIVCPaGTw3V and https://dashboard.stripe.com/logs/req_n8gwoLYBYbxtjd for customer cus_NuIj1hIl8bgcps.
Yes... I just saw them as well. Sorry for the oversight. ANy idea why cus_NuIj1hIl8bgcps did not get charged?
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
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.
Because there is a Credit Balance, the invoice finalized automatically as there was $0 amount to charge: https://dashboard.stripe.com/invoices/in_1NBK9eIvds3mVXfhkv8vzy73. You can see this in the Dashboard.
Yes, I understand. I am asking why the invoice items weren't included in the initial invoice for the other customer
this is from the Invoice Item creation api docs:
https://stripe.com/docs/api/invoiceitems/create
I'm further looking at this
Thank you. I am probably missing something obvious but I cannot figure it out!
It looks like the timing is very close. The subscription, https://dashboard.stripe.com/logs/req_EC1t897amrjSlx was created at 2023-05-16 20:08:45 UTC and the invoice item was created, https://dashboard.stripe.com/logs/req_wSHOIVCPaGTw3V at 2023-05-16 20:08:45 UTC for instance. So at the time the subsciprtion was created, there was no invoice item.
I am not sure how... the form is one synchronous script with the invoice items created before the subscription is happening.
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.
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
๐ hopping in here - give me a minute to catch up
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
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
That can't be right.
this is from the Invoice Item creation api docs:
https://stripe.com/docs/api/invoiceitems/create
I
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
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
Really quick - do you happen to have an example where the Invoice Items were added to your subscription automatically after creation?
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
hmm
I think that may not be it. this customer was able to signup with auto-tax enabled: https://dashboard.stripe.com/acct_1EHNO1Ivds3mVXfh/events/evt_1NBKH0Ivds3mVXfhzDeJc7WK
I can check some of my other clients for more examples.
besides, why would that change the behavior of the invoice items?
You know... maybe there is an issue with the tax setup for that client? when i visit this page: https://dashboard.stripe.com/acct_1EHNO1Ivds3mVXfh/invoices/in_1NBKGyIvds3mVXfh5zzZwCGp I cannot load the auto-tax information
Hm.... You haven't happened to change the tax settings at https://dashboard.stripe.com/settings/tax recently, have you?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
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
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
https://stripe.com/docs/api/accounts/retrieve not seeing it here
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
awesome. Thank you for your help