BlogForms

Choose the company, then keep its ID

Show why a company matched a name, domain, or ticker search, then save the chosen company ID instead of repeating the search.

A company picker has two jobs. It helps someone find the business they mean, then gives the application a way to remember that choice. A name, a website, and a ticker are useful for the first job. The company ID is what you keep for the second.

The Company API accepts those searches through separate selectors. These examples use API contract 2.0.0:

GET /company?q=Microsoft
GET /company?domain=microsoft.com
GET /company?ticker=MSFT&exchange=NASDAQ

Each request returns a companies array. Each candidate includes its usable profile and a match object explaining which recorded value matched. A name search can match a display name or an alias. A domain search can match the main website or another recorded domain. A ticker match includes the exchange alongside the symbol.

That explanation earns a place in the picker. Show the company name as the main label and the matched value underneath it. If a former name brought the company into the results, showing the alias explains why the current name looks different. If a symbol matched, showing its exchange keeps the context that the user supplied. A matching field is evidence for the result, not an instruction to choose it automatically.

An exact domain match still doesn't mean a domain belongs to only one company. Companies can share recorded hostnames, and the API does not treat every subdomain as its parent company's domain. A ticker also belongs with its market context. Taking the first result quietly discards those distinctions, even when the input looks precise.

After the user chooses, save the candidate's id. You already have the profile from search, so there's no need to make another request just to fill the form. Later, GET /company/id/{id} retrieves the chosen record directly. A saved search phrase remembers what someone typed. A saved ID remembers what they selected. Pinning the ID keeps that identity choice while allowing recorded profile facts to change.

If the saved ID later returns a 404, keep the missing-record state explicit. Repeating the old name search and taking a new first result would replace a deliberate choice with a new guess. Let the user review a replacement when one is needed.

The directory covers a selected cohort of issuers in the US public markets. It isn't a register of every business, and a company's incorporation country can differ from the market where it is listed. An empty search result means no match in this directory, so a form should say "No match in this directory" rather than "Company does not exist." The coverage endpoint describes the loaded scope. The application can keep that boundary visible without making the user learn how the directory is maintained.