#brookflok_api
1 messages ยท Page 1 of 1 (latest)
๐ 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!
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
Hello ๐
Give me a moment to catch up here and I'll respond as soon as I can
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.
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
Have you looked in to our tax calculation API for this? https://docs.stripe.com/api/tax/calculations
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Though I guess that is more for one-off payments. Stripe Tax will work with subscriptions https://docs.stripe.com/billing/taxes/collect-taxes
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?
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
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
Oh okay, so I just turn on the tax, and send the user data(Adress, country...) and Stripe will calculate the rest ?
Yep yep
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
Our docs mention that we support automatic validation to some extent but I am not seeing a way to check this programmatically https://docs.stripe.com/billing/customer/tax-ids#validation
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay I see, but how do I check is it valid with this?
Something like this?
this is from viesapi.eu
and you just send the VAT number and it will return an object that has
valid = true or false
I don't think we have an endpoint that directly checks the VAT Id like that unfortunately
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
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
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
In that case I think you can use our "retrieve an upcoming invoice" API. It supports Stripe Tax calculations so it can accurately preview what things will look like when the subscription is actually created https://docs.stripe.com/api/invoices/upcoming
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Wait actually this may be a better job for Quotes https://docs.stripe.com/quotes
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
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
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?
Ah good point, for upcoming invoice you can create without a Customer.
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?
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 ๐
Glad I could help! Definitely let us know if you run in to anything else