Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect validation case for swiss #336

Open
harryparmar opened this issue Oct 14, 2022 · 3 comments
Open

Incorrect validation case for swiss #336

harryparmar opened this issue Oct 14, 2022 · 3 comments

Comments

@harryparmar
Copy link

for example with stdnum both CHE394021985MWST and CHE394021985 MWST are valid.
But from Swiss govt office API CHE394021985MWST returns data validation error while CHE394021985 MWST works. So Space is expected.

@arthurdejong
Copy link
Owner

Hi @harryparmar,
Thanks for pointing this out. If you're talking about the search at https://www.uid.admin.ch/ it seems to do weird things with spaces in general. It most likely also expects only handles the UID and not the VAT number.

For example: searching for CHE394021985 XXXXX also returns a result. Even more interesting is the search result for CHE 394021985 which returns results for a different number instead. The value CHE-394021985 returns reasonable results again while CHE-394.021.985MWST returns information for a different number again (but no error like is returned for CHE394021985MWST).

It might be an option to provide a to_uid() function in the stdnum.ch.vat module to help dealing with this search.

If it is a different API, please let ne know.

@harryparmar
Copy link
Author

harryparmar commented Oct 19, 2022

Hi @arthurdejong I am talking about their soap service https://www.uid-wse.admin.ch/V5.0/PublicServices.svc?wsdl ValidateVatNumber method.its possible this is bug on their end as rather than giving boolean false it causes data validation error exception.

arthurdejong added a commit that referenced this issue Nov 12, 2022
This function can be used to performa a lookup of organisation
information by the Swiss Federal Statistical Office web service.

Related to #336
@arthurdejong
Copy link
Owner

According to the documentation in https://dam-api.bfs.admin.ch/hub/api/dam/assets/11007266/master the SOAP interface expects the vatNumber parameter to be without the "MWST" suffix.

There might be some confusion between the difference of a UID and a proper VAT number. When the module was added to python-stdnum it was expected that the "MWST" suffix was what differentiated the UID from the VAT number. If you have any clarifications in this area I'd be happy to update the implementation.

Btw, since researching this got me 90% to the way of implementing support for checking the SOAP service I've added a check_uid() function to the stdnum.ch.uid module in a218032.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants