#mangle8582

1 messages ยท Page 1 of 1 (latest)

upper mauveBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

spiral echo
latent osprey
#

I'm doing a custom implementation of Stripe inside Electron.

I tried using invoice.finalized or invoice.created webhook to update the metadata of invoice from metadata from subscription.
But it's getting updated after the invoice is paid somehow.

#

I don't use Stripe checkout because my app is installable not in the browser.

spiral echo
#

Are you talking about the first Invoice for the Subscription?

latent osprey
#

Yea, i have a custom field for VAT value. I send it to metadata
Then i want to update any upcoming invoices ever with that metadata from subscription.
User pays the invoice, when user downloads the invoice or receipt i want him to have the VAT value there in the invoice so he can deduct to his government.

spiral echo
latent osprey
#

let me see

#

const subscriptionParams = {
customer: customerId,
items: [{
price: priceId,
}],
payment_behavior: 'default_incomplete',
expand: ['latest_invoice.payment_intent'],
metadata
}

yes

#

I'm creating the subscription and with the clientSecret then paying it. Otherwise it will be incomplete and expired afterwards

spiral echo
#

Okay, I'm not sure I understand what your concern is then. Do you have specific examples that you can share, which illustrate what behavior you're seeing now? Can you also elaborate on what it is about the current flow you're trying to change?

latent osprey
#

Sure

#
  1. I want to show VAT value to user inside an invoice when he is buying as a business. By not using Checkout Page i had to send this to metadata inside subscription.
  2. I tried using TaxID Object, and crete a taxId Object once the subscription is paid, and i saw that the VAT value comes on invoice, but i don't like this approach because user needs to select from a dropdown of VAT types(because Tax ID Type is mandatory) and that can be confusing.
  3. I want to show the user on invoice:

Bill to:
Company Name
Email
VAT: 123123123

Can i do this by updating the invoice metadata before user is paying it?

I see Customer API has VAT value there but it's only on creation of the customer not on PUT when you want to update the VAT value of the customer object.

What can i do to show just a VAT value to the invoice.
I don't need the calculate Taxes or anything else, my product is a Digital product, i have an accountant so no need, and no need to calculate tax based on users country because it's a digital product.

I want just to show VAT value that user enters when paying for the subscription

spiral echo
#

Hm, I was hoping for examples like what code you're running to set those values now, IDs of Invoices from your testing, things along those lines.

metadata is not displayed on the Invoice, it's purely for you to pass values important to your flows on Stripe objects, it won't be useful here.

Did you try setting the value you want to display in the custom_fields array?

latent osprey
#

Did not try it yet, when can i do it, on which webhook?

I tried updating metadata for invoice on invoice.finalized or invoice.created and invoice.updated came after invoice was paid.

#

I can update custom_fields now, but don't know when

spiral echo
#

I think that field may lock on finalization, and would likely recommend trying to do it on invoice.created. However, I don't think that will work well for the first Invoice of a Subscription, since if I recall correctly those Invoices are immediately finalized before you can update them.

latent osprey
#

Yea, it might work for future ones maybe, but not first one

#

Is there an alternative to attach VAT value to Invoices in an custom implementation of Stripe and not Checkout?

It's just a value that i want to add to the invoice.
It would be sad if i cannot to this with custom implementation and i need to switch to Stripe Checkout because of this

#

On Stripe Checkout i believe Stripe determines the Tax Type based on the VAT value with some API that we don't have if we want to do a custom implementation.

#

If we could've updated the Customer Object on PUT with the VAT value after creation of the subscription, and maybe it would come to the invoice, would be awesome.

spiral echo
#

custom_fields is where you put custom information for your Invoices.

#

It sounds like you may want to redesign your flow, so you create the Customer object with all of the relevant details before you create their Subscription.

latent osprey
#

The customer object is created when user is creating the account for the app

#

Then he goes to the subscription page and he enters the details, his card number and his VAT value

#

Then i need to add the VAT value to the invoice and upcoming invoices in the future

#

When creating an account it's odd to ask them about their VAT type tax from their country

spiral echo
#

Maybe ask them on the Subscription page, but update the Customer before you create the Subscription?

latent osprey
#

Yea but Customer API doens't support on Update, the VAT value

#

Asking Users for VAT number is okay, but asking Users for VAT Number Tax Type is a little bit odd, Stripe on Checkout determines by VAT value or IP address maybe, but when doing a custom implementation of this it's harder because we don't have access to the API's that Stripe uses behind.

#

I don't care about tax type, i just want a value of VAT shown to the Invoice

spiral echo
#

How important is that the information is on every Invoice? You're not going to be able to put it on the first Invoice for your Subscription, if that's a dealbreaker you need to explore alternative flows to accomplish what you're hoping.

latent osprey
#

It kinda is. Anybody who has a company and wants to deduct his VAT, needs to have VAT value on the invoice he paid.

This limits the custom implementation of Stripe and encourages the Stripe Checkout, but doing this in Electron app which is installable app on PC and not on browser is a bit weird.

If we can't help users buy subscriptions on their company name with the Unique Code Identifier or VAT, there is no point in using custom implementation of Stripe anymore.

#

And showing dropdown with every tax type will be confusing to users and i haven't seen that anywhere in any app.
If the Tax ID Object didn't had the tax type mandatory it would be awesome.

#

We would just send the VAT value and it would appear inside the invoice and voila.

#

You still here?

spiral echo
#

Yup, were there more questions?

latent osprey
#

Yea, there are more alternatives to add that value to invoices? Or anything related to what i said above, alternative to taxID object?

#

Or custom_field but keeping the first invoice with VAT value

spiral echo
#

Nope, sounds like you've seen all the options and need to figure out which one best fits what you're trying to do.

latent osprey
#
  • TaxID object is odd, it works but it's odd.
  • Move to Stripe Checkout i don't think i can, but it's weird after working so much for this custom implementation
  • Custom Field on invoices, but when? To be able to see VAT value
#

message: "Finalized invoices can't be updated in this way",

const updatedInvoice = await stripe.invoices.update(dataObject?.id, {
custom_fields: [
{ name: 'VAT', value: subscription_details.metadata.taxId }
]
});

#

And i receive error from stripe when updating custom fields

spiral echo
#

Before the Invoice is finalized.

latent osprey
#

I tried it on invoice.created

spiral echo
#

Do you have more details that you can share? Is this a first Invoice for a Subscription where we already discussed this isn't possible?

latent osprey
#

Yea, the first invoice, uff..

spiral echo
#

Yup, you won't be able to update those. They immediately and automatically get finalized.

latent osprey
#

Other alternatives besides TaxID object and ditching the custom implementation and going to Stripe Checkout there are?

spiral echo
#

Nope, still nothing new coming to mind

upper mauveBOT
latent osprey
#

Can you suggest the Stripe Team to remove Tax Object Type as mandatory? :)) or add Customer VAT values on PUT so we can update them before creating a subscription?

#

Otherwise i don't see why someone would create a custom implementation of stripe and should stick with Stripe Checkout

#

Not having the ability for users to buy on their companies and add VAT to their Invoices on a Custom Implementation, rules out the companies for apps and let's only to buy as a person, which is sad.

spiral echo
#

But type seems pretty important, you keep explicitly indicating you're working with VAT values, so you keep explicitly indicating the type in this discussion (as opposed to a US based EIN or some other type of tax ID).

latent osprey
#

I'm indicating the type because without type i cannot add the VAT value to the Invoice, becuase Type is mandatory on Stripe API. Otherwise i wouldn't need type at all. When the user goes to their government to pay taxes they know already their type, because he lives in that country.

#

And in my custom implementation is weird to show them the dropdown, in Stripe Checkout there isn't any dropdown.

potent nimbus
#

๐Ÿ‘‹ stepping in as toby needs to step away

#

Currently there isn't a workaround here other than you knowing the type

latent osprey
#

There are 5 types of Canadian Tax Types, and users needs to go through each one of them

potent nimbus
#

This is the way our API works for Tax IDs

#

I'm happy to submit feedback

#

But afaik we use that type to perform validation on our end when you enter Tax ID and this is how that API was built

#

Yes, it is different than Stripe Checkout where we have client-side data to work with

#

But really you are going to have to indicate type for now in a custom flow. There isn't really another way around it.

latent osprey
#

I understand, it's already done and works but was curious if i can not give the users complicated selections, i will need to handle errors if they select Bulgarian VAT and adds a format of USA VAT, etc.

#

It would be nice to change the VAT of the Customer.
What if the user changes countries and he needs to buy the subscription on a new company?

#

He needs to cancel subscription, and then buy again with a new VAT?

#

By updating the Customer VAT in the customer object, it would be nice to avoid that

#

I see that Customer API on POST, it has VAT you can add

potent nimbus
#

Hmm I actually didn't realize you can't update Tax ID via our Customer update API. I'm surprised by that, give me a moment to check

latent osprey
#

Also there is a weird thing, i've selected eu_vat and added Romanian VAT value and on the invoice it says HU VAT which is Hungarian VAT. InvoiceId: in_1Oil3lDmVlmqORBIjnCppUrh, testmode

potent nimbus
#

Looking

latent osprey
#

Okay, i'm creating the taxID on creation of subscription, i'm deleting it on customer.subscription.deleted webhook, and if i want to update the VAT i need to add the same dropdown with Tax Types in Profile page as well so i can delete the last tax id Object and create the new one and then on new upcoming invoices it will be with updated VAT

#

Do you know a way to determine the tax type based on value? Does Stripe use an API or something behind?

Also i noticed a weird thing with the Tax Types, that's why i'm not a fan of selecting the dropdown.

I've selected eu_vat for Romania, but Romania has ro_tin as well. I've added eu_vat and the TIN actually, and it's saying Hungarian VAT.

My first VAT subscription was wrong , because i've selected the wrong thing there. And when users go with the invoice to their government will have HU tax type which is weird.

potent nimbus
#

Do you know a way to determine the tax type based on value? Does Stripe use an API or something behind?
No, you would need to do this yourself.

#

I understand you don't want to input type, as noted, I'll file feedback internally for that.

#

But that is a requirement at this point

latent osprey
#

Thank you. That would save the Custom Implementation of Stripe.
There is no problem in not showing the Tax Type inside Invoices. VAT value is enough for customers to deduct their VAT to their government.

potent nimbus
#

What about just using Customer custom fields?

#

That actually might be a better workaround for you here

latent osprey
#

Oh, so i can update this before payment and the invoice will have the VAT value?

potent nimbus
#

As long as this is updated before an Invoice is finalized then the Invoice will show these custom fields, yes.

latent osprey
#

Thank you very much! I will try this, and thank you also for submitting the feedback for Tax Type. Can i get back if i have issues with customer invoice settings?

potent nimbus
#

Yep, we are here 24/5 so feel free to pop in whenever we can help

latent osprey
#

Thank you! Have a nice day

potent nimbus
#

You too

latent osprey
#

It works haha, thank you!

#

And how do i remove the invoice settings custom fields?

await stripe.customers.update(
customerId,
{
invoice_settings: {
custom_fields: []
}
}
);

Would this be ok?

potent nimbus
#

Yeah that looks correct, you may need to use an empty string