Company Numbers prefixed with SC are not returned

GET /company/sc106758 returns a 404 Not Found

GET /search/companies?q=sc106758 shows that this is the correct company number; I am assuming this is due to the SC prefix but may be incorrect

{
  "start_index": 0,
  "items_per_page": 20,
  "total_results": 1,
  "kind": "search#companies",
  "page_number": 1,
  "items": [
    {
      "company_type": "ltd",
      "date_of_creation": "1987-09-17",
      "company_number": "SC106758",
      "description_identifier": [
        "incorporated-on"
      ],
      "links": {
        "self": "/company/SC106758"
      },
      "address": {
        "postal_code": "EH41 4NZ",
        "address_line_1": "Lennoxlove",
        "region": "East Lothian",
        "premises": "Lennoxlove Estate Office",
        "locality": "Haddington"
      },
      "description": "SC106758 - Incorporated on 17 September 1987",
      "kind": "searchresults#company",
      "address_snippet": "Lennoxlove Estate Office, Lennoxlove, Haddington, East Lothian, EH41 4NZ",
      "company_status": "active",
      "title": "H AND K ENTERPRISES LIMITED"
    }
  ]
}

I think when requesting from the CH /company endpoint you need to have exactly the right company number. In this case, using /company/SC106758 (e.g. upper case - as it shows in the “self” field in “links”) is the way to go, and worked for me just now. The search should be more “forgiving” e.g. it tries to match using various algorithms.

I don’t know of any exceptions (please post any) to the general rule that:

  1. Company numbers with non-numeric prefix need that in upper case.
  2. Company numbers must be 8 characters long e.g. if shorter they’ll have leading zeros.
1 Like

Thank you for the quick response; you are absolutely correct :smile: