#smiley717
1 messages · Page 1 of 1 (latest)
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.
I believe to get automatic tax working as a connect platform you'll need to write in because it's still in beta (https://stripe.com/docs/tax/connect)
Hi @young raptor You mean I cannot use this feature for checkout session?
https://stripe.com/docs/tax/checkout#create-session
I thought we can collect tax by customer's shipping / billing address when create a chekcout session. Is it not possible?
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
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"?
connect platform means that you have connect accounts
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
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)
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?
Yup, you'd need to pass it in for every checkout session you create
this may be a helpful read too: https://stripe.com/docs/payments/checkout/taxes?tax-calculation=tax-rates
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