#Cookie-TaxRate

1 messages · Page 1 of 1 (latest)

forest vault
#

Hi there, so you want to pass a tax rate when creating a checkout session?

left leaf
#

yeah

forest vault
left leaf
#

checkout session req: req_XP5VuESqQ86Y9H

#

tax rate req: req_fk2wRagkoAQdNs

forest vault
left leaf
#

its not working

forest vault
#

Can you show me your code? I don't see the tax_rate in the request.

left leaf
#

stripe.TaxRate.create(
display_name="Sales tax",
percentage=8.75,
inclusive=False,
)
@app.route('/create-checkout-session-difo-pack', methods=['POST'])
def create_checkout_session():
if db['dimensionstock'] == "0 left":
return redirect('/outofstock')
else:
try:
checkout_session = stripe.checkout.Session.create(
line_items=[
{
'price': "price_1LI1xeL4D9X9MODjA1kSr5KN",
'quantity': 1,

            },
        ],
      
        shipping_address_collection={
            'allowed_countries': ['US'],
        },
            shipping_options=[
  {
    'shipping_rate_data': {
      'type': 'fixed_amount',
      'fixed_amount': {
        'amount': 0,
        'currency': 'usd',
      },
      'display_name': 'Free shipping',
      # Delivers between 5-7 business days
      'delivery_estimate': {
        'minimum': {
          'unit': 'day',
          'value': 7,
        },
        'maximum': {
          'unit': 'day',
          'value': 12,
        },
      }
    }
  },
  {
    'shipping_rate_data': {
      'type': 'fixed_amount',
      'fixed_amount': {
        'amount': 400,
        'currency': 'usd',
      },
      'display_name': 'USPS Tracking + Fast Shipping',
      # Delivers in exactly 1 business day
      'delivery_estimate': {
        'm
forest vault
#

Please remove your api_key in this chat

left leaf
#

there is the code

#

done

left leaf
forest vault
#

Yes

left leaf
#

oop

forest vault
#

discord is a public channel

#

you should roll the key asap

left leaf
#

ok

forest vault
#

You should specify the tax_rates in the checkout session creation request, something like this.

            line_items=[
                {
                    'price': "price_1LI1xeL4D9X9MODjA1kSr5KN",
                    'quantity': 1,
                    'tax_rates': ['txr_1LI2yYL4D9X9MODjUGkkjngM']

                },
            ],```
left leaf
#

got it

left leaf
forest vault
left leaf
#

ok i rolled

#

ok ty