#andrew-yk_api

1 messages ยท Page 1 of 1 (latest)

heavy ravineBOT
#

๐Ÿ‘‹ 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.

light sapphire
#

Hi

inland jungle
#

Hi @light sapphire I'll be with you shortly.

light sapphire
#

No problem, thank you ๐Ÿ™‚

inland jungle
#

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.

light sapphire
#

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.

inland jungle
#

Is it a one-time payment or subscription?

light sapphire
#

One time

inland jungle
light sapphire
#

What do you mean by this? So it is not possible?

inland jungle
#

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?

light sapphire
#

Yes

inland jungle
#

Ok, can you share with me the code that you wrote to create a checkout session?

light sapphire
#

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,
                },
            ],```
inland jungle
#

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
                          ]
              },
            ],```
light sapphire
#

Ok, what is the tax rate ID ?

inland jungle
light sapphire
#

Ok is this it?

taxcstm_test_61TKokLPElhIfgC9941COYj7uUtbdC1o

inland jungle
#

how did you get this ID? A tax rate object should have an ID starts with txr

light sapphire
#

Via Tax -> Customisations on the dashboard

inland jungle
#

No, that's not tax rate. you should just use the API to create one.

light sapphire
#

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
}```
inland jungle
#

This tax rate will be applied to the checkout session if you include in the creation request.

light sapphire
#

To everybody, irrespective of their jurisdition / country?

inland jungle
#

To clarify, are you worried that creating a new tax rate object will make Stripe automatically applying it to all checkout sessions?

light sapphire
#

Yes. As we have tonnes of different products on our stripe account and onlt want tax to apply to this product