#eric_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1357696755210129408
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
Thank you
I am not a tax expert but I think you can calculate taxes just for one country, which is where the customer is.
I am looking to utilize the automatic tax for shipping costs, I need to have the shipping costs as a line item. Then set the taxrate_id to 'txcd_92010001' to the tax shows up in the tax line. I just can't seem to find out where to set the shipping origin address and shipping destination address?
Do you need both addresses for tax calculation?
I understand you might need to calculate shipping amount using both addresses, which in turn impacts taxes. But the customer only pays taxes in one country in a transaction.
Correct
So, you need both addresses to calculate the shipping costs. Stripe doesn't calculate shipping costs, and they need to be provided by you. So there's no need to provide the origin address to Stripe.
I am items shipping from Province to Province in Canada and State to State in US
The customer is not paying for the product, just the shipping costs
I need a way to display an invoice for just the shipping costs.
Is there a way to manually set the shipping costs and manual set the tax amount and description?
I would suggest just treating your shipping cost as a Price object, not ShippingRate: https://docs.stripe.com/api/prices/create
If you're not planning to sell any other items on the session - that wouldn't work.
The shipping costs will vary, as shipping costs fluctuate daily. I cannot use a price object.
And the origin and destination will always change.
Then you can use price_data to set the custom amount for each Checkout Session: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Using price_data as @edgy swallow indicates lets you define your price ad-hoc as you calculate your rates.
Sure, you can find an example of using price_data in all supported server languages here in the docs: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=stripe-hosted#redirect-customers