Non-existing company number returns 500

Presumably the “fix” is on the user-side - simply parse anything we want to request from Companies House. For the moment, if it’s not exactly 8 characters - don’t send it! If you get a 404 back, the number didn’t exist.

If you want to e.g. regexp these then:

a) In the specifications (the XML Gateway Schemas) CH define this as [A-Z0-9]{8,8} - although that is wider than what is found in the data so that is probably “for simplicity” / “future expansion”.

There is some (old) official documentation on the number format referenced in this query:

https://forum.aws.chdev.org/t/valid-company-number-format/713

That is 2016 so now both missing some new entities and also there are some entries on there which no longer get created.

The ones added after that date are (not totally sure if this is comprehensive):

SG - Scottish Qualifying Partnership
RS - Registered Society
PC - Protected Cell Company
CE - Charitable incorporated organisation
CS - Scottish charitable incorporated organisation
FE - Further Education or 6th form college
OE - Overseas Entity

Hope this helps.