polar
polar copied to clipboard
Orders API: Use `get_unprefixed_state` for state output to strip country prefix
trafficstars
Stripe Tax uses ISO 3166-2 with subdivisions to perform a lookup on tax rates, e.g country-state, which makes sense. On checkout we therefore store the state in this format too for tax calculations.
However, customers expect a separation. Getting country from orders.billing_address.country and state from orders.billing_address.state (clean from country codes).
So our output of the schema should use get_unprefixed_state to strip the country code from the state output in our API.