#joey_api

1 messages · Page 1 of 1 (latest)

shrewd pagodaBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1332325318630838385

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

tidal field
#

Our tax settings have "automatic tax" enabled by default, but this doesn't seem to be applied to our subscriptions.
The Dashboard setting? That only applies to Dashboard created objects. You need to specify automatic_tax[enabled] via API each time otherwise

#

If we try to create or update a subscription with "automatic tax" enabled, it'll throw an error unless our shipping info is correct. Which isn't always the case in our current system.
Yes, but you can bypass that if you wish: https://docs.stripe.com/api/customers/create#create_customer-tax-validate_location

plain karma
#

oh great! So if the customer shipping info is invalid, then it'll just not add tax?

tidal field
plain karma
#

then if we update the customer shipping info correctly, it'll start adding tax and we won't have to do anything extra with the subscription?

tidal field
#

You may just need to re-enable automatic_tax if it was disabled during a failure:

If we don’t have a recognised customer location, invoices for a subscription continue to finalise automatically but without calculating taxes. This has the following effects:

The automatic_tax[enabled] parameter changes to false on the subscription and invoice.

plain karma
#

oh okay. So I will still need to enable automatic tax after the customer shipping is updated correctly

tidal field
#

Yep!

plain karma
#

or would it enable the automatic tax, after I change the shipping info?

tidal field
#

I don't believe so, but this kind of alludes to this being supported so not sure:

To review subscriptions without automatic tax calculations in your Stripe Dashboard, visit your Subscriptions page and filter the view by the Automatic tax not enabled option. To reactivate automatic tax for these subscriptions in the future, make sure you have at least one valid customer location, and activate automatic tax through the Stripe Tax Dashboard.

#

I'd recommend just testing that scenario

plain karma
#

I'm just thinking.. I'd rather not have to do an extra API call to enable automatic tax, after every time I update a customer's shipping info

plain karma
tidal field
#

Then you'd just need to use the API to guarantee success

plain karma
# tidal field Then you'd just need to use the API to guarantee success

I'm not sure what you mean by that. I'm thinking in this scenario:

  1. A customer + subscription is created without a shipping address. "automatic tax" is enabled
  2. An invoice is generated, which disables "automatic tax". Correct?
  3. A customer updates his address. We make an API call to update the customer's shipping info
    3b. We make another API call just to re-enable "automatic tax"
  4. A customer updates his address again. We make an API call to update the customer's shipping info
    4b. Even though the customer tax is currently enabled, we make another API call because we have to do this on every shipping info update

Preferably, I would like to be able cut out 3b and 4b. Is there a way that I wouldn't have to make these extra API calls, whenever a user updates their shipping info

tidal field
# tidal field I don't believe so, but this kind of alludes to this being supported so not sure...

An invoice is generated, which disables "automatic tax". Correct?
Yes, assuming you haven't set tax[validate_location]: 'immediately' on the Customer

Is there a way that I wouldn't have to make these extra API calls, whenever a user updates their shipping info
This is what I said in the above paragraph – it makes it seem like the Dashboard setting handles it but I cannot confirm so I'd test it

#

To reactivate automatic tax for these subscriptions in the future, make sure you have at least one valid customer location, and activate automatic tax through the Stripe Tax Dashboard.

plain karma
#

thank you for getting back to me so quickly with all of this!

So in this scenario:

  1. A customer + subscription is created without a shipping address. "automatic tax" is enabled
  2. An invoice is generated, which disables "automatic tax"
  3. A customer updates his address. We make an API call to update the customer's shipping info, with tax[validate_location]: 'immediately' enabled

After step 3, will the subscription's "automatic tax" be re-enabled? Or would we still have to do an API call to enable it?
I'll do a test regardless. Thank you!

tidal field
#

Yeah again, not sure. Let me ask a colleague

plain karma
#

got it. Thanks!

shrewd pagodaBOT
tidal field
#

Seems like the API call to re-enable is required

plain karma
#

got it. I'll just do the extra API call every time that we update customer shipping info then. As for the migration tool, yeah I know about it but I think we'd prefer not to have to do this periodically.

Either way, I'm super thankful for your help today!

tidal field
#

Then you know it won't fail validation on the next billing cycle, where you end up in a loop of re-collecting a valid address each time

plain karma
tidal field
#

that validating tax immediately would suffice just as well
There's no way to do that other than trying to calculate an invoice

plain karma
#

yeah, so it looks like we'll just have to do an extra API call even if the tax is currently enabled