#smiley717

1 messages · Page 1 of 1 (latest)

native stirrupBOT
gleaming tundra
#

const session = await StripeAPI.createCheckoutSession(
{
line_items: lineItems,
mode: 'payment',
payment_intent_data: {
application_fee_amount: Math.round(order.total * STRIPE_APPLICATION_FEE),
},
customer_email: email,
metadata: {
orderId: dbOrder.id,
},
automatic_tax: {
enabled: true,
},
success_url: 'https://example.com',
cancel_url: 'https://example.com/cart/checkout',
shipping_address_collection: {
allowed_countries: ['US'],
},
},
{
stripeAccount: supplier.stripeConnectId,
},
);

#
automatic_tax: {
                    enabled: true,
                },

I found this one from document, but still figuring out its available to add tax prices automatically without add tax line items.

young raptor
gleaming tundra
#

I thought we can collect tax by customer's shipping / billing address when create a chekcout session. Is it not possible?

young raptor
#

It is possible generally, but there are special considerations if you're a connect platform because of the tax obligation and it depends on a few things

gleaming tundra
#

Anway, when I try to run above code, I am getting below error "Stripe Tax has not been activated on your account. Please visit https://stripe.com/docs/tax/set-up to get started."

#

connect platform means "connect account"?

young raptor
#

connect platform means that you have connect accounts

gleaming tundra
#

Yes, we have connect accounts for sellers, what I was trying to solve this problem, we are going to integrate third party api to get tax rate by states (ie. TX or IL etc). and then add line item for tax price, Do you think it's the right way then?

#

I just want to make sure stripe support tax rate api or something else. we do need to pay for third party api and it would be good if you have similar ones

young raptor
#

Ah then you shouldn't be enabling automatic tax at all - instead, you can take the rates calculated by your third party api and create a Tax Rate with them that can be used with checkout (https://stripe.com/docs/billing/taxes/tax-rates)

gleaming tundra
#

Yep, it is original plan what i am going to do. Tax rates are various according to county and states, so I need to add tax rates when create checkout session everytime?

young raptor
#

Yup, you'd need to pass it in for every checkout session you create

#

we have something called dynamic tax rates that would allow you to pass in all the tax rates you have calculated and then we'll match which one to use out of the list you provide

gleaming tundra
#

Sine there are too complex logic for tax rates, I am not entirely sure what are the unique value (state, zipcode etc) to addd tax rates to retrieve if it's exist or not

#

Okay, thank you for your time @young raptor.