Phoenix Product Codex: Develop and deploy a REST API for Product Data Management with Elixir and Phoenix (self-published/Leanpub)

Hi @noargs, it works just fine here, albeit with a Greek TIN:

iex(1)> Viex.lookup("EL802586446")
...%Viex.Response{
  valid: true,
  company: "OVERBRING ΜΟΝΟΠΡΟΣΩΠΗ ΙΔΙΩΤΙΚΗ ΚΕΦΑΛΑΙΟΥΧΙΚΗ ΕΤΑΙΡΕΙΑ||OVERBRING LABS",
  address: "ΛΕΩΦΟΡΟΣ ΑΝΔΡΕΑ ΣΥΓΓΡΟΥ 110       11741 - ΑΘΗΝΑ"
}

Note that EU VIES doesn’t work correctly for some countries, most notably Germany, due to national data privacy laws. However, this is already addressed in the book w.r.t. testing.

Each country (should) have its own national commercial registry anyway that offers an API with richer (and better) data. For example, Greece has the GSIS RgWsPublic2 SOAP web service (for which I wrote VatchexGreece) and the ΓΕΜΗ Open Data API that one day I’ll write an Elixir client for.

In case you are interested in data for businesses in countries with crappy VIES info, there are paid services around: Google Search. I found this one that has a free tier with 100 requests that should be plenty for running through the book: Start using the API | vatlayer API. You’ll need to make GET requests with Req, and the shape of the returned data will be different, but it should be trivial to use. No affiliation or endorsement on my end, and I have never used it.

In any case, you could also mock Viex until you find a solution, or simply avoid it altogether and enter data manually. EU VIES it is not central to the book’s quest, even though it is a useful part of the app, when its data are available for a country.

Hope this helps!