#brookflok_api

1 messages ยท Page 1 of 1 (latest)

bleak oakBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

๐Ÿ”— 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/1212412906747199519

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

โฒ๏ธ 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. Thank you for your patience!

pearl hazelBOT
strong relic
#

Okay, in Stripe I will have 3 products and all 3 will have 2 prices.

1 price on the product is for monthly subscription
1 price on the product is for yearly subscription

The user would chose monthly or yearly plan and he would come to billing information page.

#

The Country will be a dropdown, and when the user choses a country, the VAT in the pricing should be calculated

#

And it should be added to the price

#

I would love to use Stripe api, to send the product price id and the country and to get the vat value, so I can show it to the user

#

Also I would love to include the price with vat in monthly or yearly subscription, so it will be done by stripe automaticly for every next payment

unkempt notch
#

Hello ๐Ÿ‘‹
Give me a moment to catch up here and I'll respond as soon as I can

strong relic
#

Sure, no problems. Maybe it will take me longer time to respond also, so pls don't close the thread if I get stuck somewhere.

pearl hazelBOT
strong relic
#

Also I didn't want to ask more things, but as I see I have time so I will ask it also.

In my app there is also a company VAT that needs to be added in the application, and I would love to do a VAT check before giving free tax. Is it something that Stripe has integrated?

#

And this is the look of the company payment

trail pebble
#

Apologies I may have misunderstood what you are unclear on. Are you unsure how to calculate the tax or how to apply tax specifically in the way you laid out?

strong relic
#

Well both, mostly I understand how to do it.
I will send an API to a specific route and it will do the calculation for me.

#

But I see I have to put amount as an integer, and I would love to use the stripe price_id for the item, so I don't need to send number data.

And also I would love it to work the way it is planned

trail pebble
#

Using Stripe Tax directly with our subscription objects will calculate tax based on the Price IDs that you provide

#

Same with invoices for one off payments

strong relic
#

Oh okay, so I just turn on the tax, and send the user data(Adress, country...) and Stripe will calculate the rest ?

trail pebble
#

Yep yep

strong relic
#

Also is there a way to check the Business VAT validity?

#

For example a user says he is a company from England and he just put Lorem Ipsum as a name and put random numbers in VAT

#

Can Stripe check that VAT before I give him free tax

trail pebble
strong relic
#

Okay I see, but how do I check is it valid with this?

#

Something like this?

#

and you just send the VAT number and it will return an object that has
valid = true or false

trail pebble
#

I don't think we have an endpoint that directly checks the VAT Id like that unfortunately

strong relic
#

oh okay, no problem I will use viseapi then

#

So, just to see did I figure everything out.

I will turn on the tax in Stripe dashboard, I will set Germany and Germany OSS.

OSS registration applies to all European Union countries.

And also it will calculate for Germany because the business is registered there.

In my code, where I need to calculate the tax and add it to my checkout card, I will use Tax Calculations

It will return me the amount of tax and the amount of the current item.

I will go to payment, and in the payment when I create the subscription, I will pass user billing information, like Address , Country, City, Zip, Name, Email...

And because the tax is turned on it will see that I have send the country in the creation of a subscriptions and it will calculate the tax for me.

And also if the user is a company and has a valid VAT I can send to the same subscription that the user doesn't need to pay for tax and it will not be calculated

#

Is there something that I didn't understand or that I created a mistke in the process

trail pebble
#

In my code, where I need to calculate the tax and add it to my checkout card, I will use Tax Calculations
Actually for subscriptions, you shouldn't need to use our tax calculations API. This doc shows how you can tell Stripe to calculate taxes for your subscription and apply them appropriately https://docs.stripe.com/billing/taxes/collect-taxes

strong relic
#

Yes I would use that to calculate my tax when the user enter the card info or if he pays with paypal.

But I will need to change the tax, depending on the selected country for the UI of the user

#

So if he selects England, I will need to get the VAT percentage for englad, calculate it all for the user and show it to him in the UI

#

And I was thinking to use stripe, because all the percentages are up to date

trail pebble
strong relic
#

I will probably use both, because to create paypal payment over stripe I used upcoming invoices

#

Then I pay it when I create it

#

or something like that

trail pebble
#

I think Quotes should also support that but am not as familiar with them. If you play around with both in test mode that should be informative to which ones are viable for you

strong relic
#

but in the Quote I need to create the user?

#

And in the customer you will put the billing info like adress, country and so?

trail pebble
#

Ah good point, for upcoming invoice you can create without a Customer.

strong relic
#

I think we must make it for invoice also, so it knows who needs to pay the invoice

#

But I was thinking that I need Country to determine the tax

#

and I need to create a Customer to put the Country

#

Now my question is can a Customer only be a country?

#

customer = stripe.Customer.create( address={"country": "DE"} )

I can do this for an example?

trail pebble
#

Yep, you can create customers with no data at all, so just providing a country is totally fine. Also for the upcoming invoice endpoint specifically, you can use the customer_details parameter to preview what taxes would be for a prospective customer in that country
https://docs.stripe.com/api/invoices/upcoming#upcoming_invoice-customer_details-address-country

strong relic
#

Perfect

#

I think I understand it now. If I will have more questions I will ask you guys again

#

Thx Pompey

#

You were a great help

#

For now this thread can be closed, I have no more questions, only if there is something more you wish to add ๐Ÿ˜„

trail pebble
#

Glad I could help! Definitely let us know if you run in to anything else