polar icon indicating copy to clipboard operation
polar copied to clipboard

Orders API: Use `get_unprefixed_state` for state output to strip country prefix

Open birkjernstrom opened this issue 11 months ago • 0 comments
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.

birkjernstrom avatar Dec 04 '24 10:12 birkjernstrom