#imox29

1 messages · Page 1 of 1 (latest)

frozen boltBOT
karmic zealot
#

👋 How can we help?

serene wave
#

when i create checkout I get this error "StripeInvalidRequestError: Automatic tax calculation in Checkout requires a valid address on the Customer. Add a valid address to the Customer or set either customer_update[address] to 'auto' or customer_update[shipping] to 'auto' to save the address entered in Checkout to the Customer."

{
"metadata": {
"uid": "54c6ffdb71878a8f4b0aa17a",
"quantity": "9",
"newPlanId": "price_1MtVU6COWnEzn9o8z2DrFel4",
"stripeCid": "cus_EBCRtZgIpvDX5R"
},
"customer_update": {
"shipping": "auto"
},
"automatic_tax": {
"enabled": "true"
},
"customer": "cus_EBCRtZgIpvDX5R",
"line_items": {
"0": {
"quantity": "9",
"price": "price_1MtVU6COWnEzn9o8z2DrFel4"
}
},
"allow_promotion_codes": "true",
"cancel_url": "http://localhost:8080/api4/users/stripe-handler/failure",
"mode": "subscription",
"success_url": "http://localhost:8080/api4/users/stripe-handler/success"
}

karmic zealot
serene wave
#

sure

#

req_AxeNHNz44U6LmJ

#

the error does not make sense

although the customer may not have address but i am passing "customer_update": {
"shipping": "auto"
},
"automatic_tax": {
"enabled": "true"
},

karmic zealot
#

Can you also add to enable shipping_address_collection to check if it works? For example:

shipping_address_collection: {
    allowed_countries: ['US'],
},
serene wave
#

trying

#

still same error

#

req_s2PmJJVDkpozRy

#

StripeInvalidRequestError: Automatic tax calculation uses fields saved on the Customer. To collect a shipping address with automatic_tax enabled, set customer_update[shipping] to 'auto' to save the shipping address back to the Customer.

#

scratching my head over this for 2 days

karmic zealot
#

Let me double check and get back to you

serene wave
#

🙏

karmic zealot
#

Can you try setting to customer_update.shipping instead?

serene wave
#

it worked with customer_update.shipping

#

i think the stripe needs to update docs that says : shipping_address_collection field is rrequired for automatic_tax collection?

karmic zealot
#

Thanks for sharing! The code example has shipping_address_collection, but it doesn't mention about it explicitly

serene wave
#

right

#

also why not address instead of shipping address, as a sass product there is no shipping needed but we are asking customers for shipping address 🤔

karmic zealot
#

There are a few types of addresses such as billing and shipping addresses. Stripe Tax uses shipping address to determine the tax on the customer.

serene wave
#

ah! makes sense from stripe's pov but still a little odd for us

#

one last question:

if the user is from AS: American Samoa
CC: Cocos (Keeling) Islands
CX: Christmas Island
CU: Cuba
FM: Federated States of Micronesia
HM: Heard Island and McDonald Islands
IR: Iran (Islamic Republic of)
KP: Democratic People's Republic of Korea
MH: Marshall Islands
MP: Northern Mariana Islands
NF: Norfolk Island
PW: Palau
SD: Sudan
SY: Syrian Arab Republic
UM: United States Minor Outlying Islands
VI: Virgin Islands (U.S.)

#

stripe does not automatic tax or it does not support tax itself?

#

shipping_address_collection.allowed_countries
REQUIRED
An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI.

karmic zealot
#

Could you share where you see this message from?