Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • seanrock 262 posts 483 karma points
    Dec 03, 2020 @ 09:12
    seanrock
    0

    Calculating tax for US states

    Hi Matt

    Our client will expand their shipping to include the US and want to make sure they are charging correct tax. The tax will need to be calculated after the shipping destination is defined and we'll likely use a 3rd party api to make sure we get the correct tax rate for the state. Is there an example of calculating the tax manually (if that is how it would work) during checkout and ensuring the rate and tax values are persisted with the order? Or am I over-thinking this?

    Thanks Sean

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Dec 03, 2020 @ 09:32
    Matt Brailsford
    1

    Hi Sean,

    I think you might need to look into implementing some custom calculators https://vendr.net/docs/core/1-3-0/key-concepts/calculators/

    You'll probably need to check the order and see if it has a shipping address defined and if not, return 0 for their tax rates, but once you have the shipping location, you could then return an actual tax rate for the order lines / payment / shipping fees. I think as long as it is made clear that tax is calculated later on, that it's fine the tax is zero initially but then calculated at a later point.

    We should only really be re-calculating the order when something changes which would affect the pricing, and once an order is finalized, we don't re-calculate them again, so this should be ok from an API perspective, but I'm sure you could implement some kind of caching if the request rate is too high.

    Hope this helps

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft