javascriptexpressstripe-paymentspayment-gatewaystripe-tax

When using `automatic_tax`, each shipping option needs to have a defined `tax_behavior` set. error while automatic tax in stripe


While calculating tax according to the shipping region I am getting this error

Error while hitting the checkout API

I have used the following code the checkout

Code for the checkout


Solution

  • If you're using Shipping Options with Checkout and automatic tax, then you need to set shipping_options.shipping_rate_data.tax_behavior when you create the Session. You can see it in the API reference here: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-shipping_options-shipping_rate_data-tax_behavior