#ziwengames_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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/1221901095090131198
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
To add to above, if a user buys the subscription with address X, but then buys an additional product with address Y, I would need to set the address from X to Y back to X. I'm trying to understand if there's a better way to manage addresses for tax purposes.
As in the user buys from you twice and puts in two different full addresses? Or are you talking about if a user switches between two credit cards with different ZIP codes?
Either case would fit
I guess the 2nd question might not even be necessary if I better understand a proper process to use automatic tax
Yeah, the credit card switch shouldn't change your tax location as far as I am aware, so you shouldn't need to change anything there
I think the tax location is based on the address provided by the credit card info?
Btw I'm using stripe elements
I don't think that is correct. It should be based entirely on customer.address which you can update with an update call https://docs.stripe.com/api/customers/update#update_customer-address
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
https://docs.stripe.com/tax/customer-locations
So I'm looking at this doc and it tells me the order of priority of addresses that it uses to calculate tax
If I don't set the customers address, it ends up using the address associated with the card
If the transaction is tied to a payment method with full billing details we use that billing address.
Ah, my apologies for being wrong there.
No worries
Yep so you can update that here. https://docs.stripe.com/api/payment_methods/object#payment_method_object-billing_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yea my point was if I finalize an invoice before they even submit a payment method, how would stripe calculate the correct tax
I've tried that (without setting a customer address) and I had an API error
So it seems like it's necessary to set the customers address if using automatic tax
This point leads to my 2nd question, which I describe was annoying to constantly set the customers address every time they paid using a different address
Yep, unfortunately that is a tricky situation with elements. One solution I have heard of is to use our upcoming invoice endpoint to preview the price as the customer puts in different addresses at checkout https://docs.stripe.com/api/invoices/upcoming
Ah that is exactly what our docs recommend https://docs.stripe.com/billing/taxes/collect-taxes?tax-calculation=stripe-tax#preview-price
And I can put in a feature request but unfortunately we don't have a way to automatically update the customer address here. I definitely get how that is annoying
Just taking a look give me a sec
A related question to clarify my understanding: Once a customer's billing/shipping address is set, does the billing/shipping addresses collected from all future credit cards used not affect the tax?
It seems like it only takes the address associated with the customer object.
Yes, we use the first item in that list that exists fr the customer. So if the shipping or billing address is set, we would always use that over the address set on the payment methods
How do tax codes per product affect this process
Does it just choose the tax rate based on the customer address AND tax code id
I guess to clarify, is it the developers job for automatic tax to charge the right tax percentage (which might be wrong if it takes the wrong type of address)
I think certain products are supposed to be taxed the shipping vs billing address
Unfortunately I'm not that familiar with the compliance side of things here. This doc makes it sound like it mostly depends on where the customer is receiving the product but I'm not fully clear from reading this doc.
https://stripe.com/resources/more/should-you-charge-sales-tax-based-on-the-billing-or-shipping-address
If you reach out to our support team they should be able to provide guidance on this:
https://support.stripe.com/?contact=true
Ok thanks for the link. Back to the first question (I viewed the links you sent and it didnt answer this question):
Suppose I create a subscription charged to location A with card A. Then they purchase a product to location B with card B. Then the subscription renewal will automatically charge card A. Does this mean I will have to change the customers address to location B right before they charge card B, then change the address back to location A for tax purposes?
Unfortunately that is also more of a compliance question so I don't know enough to speak to how that would work. This server is more for the coding side of things so I know how to update these fields with code but don't know the complexities of what is expected to charge the proper amount of tax here. I have not heard of other users having to switch this this frequently but I don't know enough to say for sure one way or the other
Ok thank you