#jbodily - tax

1 messages · Page 1 of 1 (latest)

frosty marsh
#

Hi there. Let's chat in here

#

Give me a bit to catch up on things

#
# doesn't have information to process taxes
# https://stripe.com/docs/tax/customer-locations#handling-errors
stripe.Invoice.modify(
    invoice_id,
    automatic_tax={ "enabled": False },
)
stripe.Subscription.modify(
    subscription_id,
    automatic_tax={ "enabled": False },
)
stripe.Invoice.finalize_invoice(
    invoice_id,
    auto_advance=True
)```
#

Pasting for easy access in here

unborn elk
#

Thank you

frosty marsh
#

Can you share an example invoice id?

unborn elk
#

One point of order—in the code I pasted above, we are NOT currently setting auto_advance=True explicitly. It made it into the paste because I had staged those changes in response to the trouble. The documentation intimates that field is optional, so we thought not to set it.

#

Example invoice id : in_1Lb6u8K65xxom2F2cXUmfeMW

#

I'm wondering if I should set it, however.

frosty marsh
#

Oh yeah

#

That's the problem

#

I took a look at the invoice and auto advance is disabled

unborn elk
#

I'm assuming I can write a query to find these stalled invoices and advance them by re-executing the stripe.Invoice.finalize_invoice with auto_advance set to true? Does that sound right?

#

And let me make sure I'm understanding what happened. We have been automatically collecting all along. Last night we
• Turned on the tax according to the migration documentation.
• Changed the price reference to a price that was tax exclusive.
• Set automatic tax to enabled
• Caught any invoice_finalization errors and refinalized them.

At what point did the invoices change from auto_advance true to auto_advance false?

frosty marsh
#
    auto_advance: true,
    last_finalization_error: null,
    next_payment_attempt: 1661540716
  }
unborn elk
#

As noted above our line stripe.Invoice.modify only modifies the automatic_tax. The documentation says
If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices, pass auto_advance=false.
We do not pass that parameter at that point, so why would it be switching to false?

frosty marsh
#

It's because finalization fails

#

We turn off automatic collection when that happens

#

Because there's a problem

unborn elk
#

I see. So adding that auto_advance should help on the finalize_invoice method

#

🤔 It appears incomplete invoices are still coming after that change.

#

pi_3Lb87gK65xxom2F21Hvs8uj4

#

in_1Lb7B7K65xxom2F25D9TtmGe

#

Why does this one require confirmation?

frosty marsh
#

That says it succeeded

unborn elk
#

Great, great. Looks like I just needed to wait a minute

#

Success rates are looking much better

frosty marsh
#

Got it

unborn elk
frosty marsh
#

Yes

#

That would be an excellent callout

#

Thanks for flagging. I'll try to get that handled internally