#jbodily - tax
1 messages · Page 1 of 1 (latest)
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
Thank you
Can you share an example invoice id?
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.
Oh yeah
That's the problem
I took a look at the invoice and auto advance is disabled
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?
Looks like this event: https://dashboard.stripe.com/events/evt_1Lb7rxK65xxom2F2SMoV74Yi
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
auto_advance: true,
last_finalization_error: null,
next_payment_attempt: 1661540716
}
You can always filter invoices with this api request: https://stripe.com/docs/api/invoices/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
It's because finalization fails
We turn off automatic collection when that happens
Because there's a problem
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 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?
That says it succeeded
Great, great. Looks like I just needed to wait a minute
Success rates are looking much better
Got it
Perhaps for others sake, the bit about finalizing invoices after failure with the auto_advance set to True being required in this bit of documentation would be helpful: https://stripe.com/docs/tax/customer-locations#handling-errors