#edutomesco
1 messages · Page 1 of 1 (latest)
in stripe you need the tax type to create a taxID for a customer
I mean "eu_vat" nomenclature
And where are you looking to get the type in relation to an amount? In an Invoice? On the Dashboard?
I mean I take this tax type on my business logic depending the country the user enters
But now, I want to know if just with the tax value example ATU12345678 I can know the tax type ?
That's still not clear to me where you are tying to get the tax type. What Stripe object are you accessing?
I need to create the tax id object for a customer
My question is my customer enter the tax id value and I'm managing this on my backend
so I want to know the easier way to extract the tax type
"Extract the tax type" from where? Is retrieving the Customer object and looking up tax_ids.data.type not an acceptable approach?
But when I create the user
I need want to put the tax id object on it
I need the tax type and the tax value right?
then the tax value the user enters, but the tax type is there any way?
to know the tax type given a tax value
Okay, is the customer record being created at that point? Or updated?
created
actually I create the user passing the taxID as parameters.
the thing is that to know the vat type I ask the user to introduce his country then I map the name of the country with your vat type codes. I want to know if there is a better way to do that?
So what you want is the Customer record after it has been created/updated in Stripe. So I would listen for the customer.created event https://stripe.com/docs/api/events/types#event_types-customer.created
That will return the Customer object that you can examine to determine the tax type
Are you currently using webhooks?
yes
but how the customer know the tax type?
I dont understand
I create an empty customer with any data
I mean having this: ATU12345678 how I can know that the tax type is "eu_vat"?
You mean when you are making the update to Stripe?
yes
Wouldn't that be something the Customer would provide? https://stripe.com/docs/invoicing/customer/tax-ids?dashboard-or-api=api
let me try testing something
Sorry it got a little busy, still testing
Wait, nope you will need to know the tax_id type before you submit it to Stripe. So this is something either your customer would need to identify or your integration should pick up on.
what do you mean?
When you provide the tax_id value it is required that you also provide the type: https://stripe.com/docs/api/customers/create#create_customer-tax_id_data
So it isn't something you would get from Stripe, you would need to know it and provide it when creating/updating the Customer.