#andrew-yk_api
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/1420924093561307167
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi
Hi @light sapphire I'll be with you shortly.
No problem, thank you ๐
Hi @light sapphire Thanks for waiting. You can use the "make line item quantities adjustable" feature to create checkout sessions with prices of exclusive tax_behavior.
I will check that out now thank you
Will that allow us to set differeing pricing based on quantity i.e. if they select over 10k pricing is 'x' and over 25k pricing is 'y' etc.
Is it a one-time payment or subscription?
One time
I see. The price has a tiers attribute that allows you specify different unit_amount based on quantity https://docs.stripe.com/api/prices/create?#create_price-tiers . However this attribute is only available to recurring prices, not one-time prices.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What do you mean by this? So it is not possible?
Not possible with one-time payments. Btw I just created a checkout session with custom_unit_amount and an exclusive tax_rate.
Is this something that you want to achieve?
Yes
Ok, can you share with me the code that you wrote to create a checkout session?
One second
mode: "payment",
payment_method_types: ["card"],
customer: stripeCustomerId,
line_items: [
{
price_data: {
currency: "aud",
product: process.env.STRIPE_PRODUCT_ID,
unit_amount: Math.round(totalPrice * 100),
tax_behavior: "exclusive",
},
quantity: 1,
},
],```
OK, you haven't specified a tax_rate in the request.
You should create a tax rate object, and pass its ID to the line_items
mode: "payment",
payment_method_types: ["card"],
customer: stripeCustomerId,
line_items: [
{
price_data: {
currency: "aud",
product: process.env.STRIPE_PRODUCT_ID,
unit_amount: Math.round(totalPrice * 100),
tax_behavior: "exclusive",
},
quantity: 1,
tax_rates: [
TAX_RATE_ID
]
},
],```
Ok, what is the tax rate ID ?
You need to create one.https://docs.stripe.com/api/tax_rates/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok is this it?
taxcstm_test_61TKokLPElhIfgC9941COYj7uUtbdC1o
how did you get this ID? A tax rate object should have an ID starts with txr
Via Tax -> Customisations on the dashboard
No, that's not tax rate. you should just use the API to create one.
Will this only apply to people w/ a jurisdiciton of AU or anyone? As it seems to be applying to anyone:
id: 'txr_1SBQrtCOYj7uUtbdc7zDXyvp',
object: 'tax_rate',
active: true,
country: null,
created: 1758851681,
description: 'Goods and Services Tax',
display_name: 'GST',
effective_percentage: 10,
flat_amount: null,
inclusive: false,
jurisdiction: 'AU',
jurisdiction_level: null,
livemode: false,
metadata: {},
percentage: 10,
rate_type: 'percentage',
state: null,
tax_type: null
}```
This tax rate will be applied to the checkout session if you include in the creation request.
To everybody, irrespective of their jurisdition / country?
To clarify, are you worried that creating a new tax rate object will make Stripe automatically applying it to all checkout sessions?
Yes. As we have tonnes of different products on our stripe account and onlt want tax to apply to this product