Executive Summary: EIN input validation should preserve the identifier the borrower supplied before any name/TIN match runs. Cobalt's TIN verification request takes a string-valued TIN and a business name.[1] Treat the EIN as text throughout intake, imports and serialization, then distinguish a formatting problem from an actual matching result.
Why does an EIN belong in a text field?
A borrower identifier is not a quantity to add, round or average. Your integration needs its characters in the correct order, including any leading zero. Converting that identifier into a number can change the representation before the verification provider receives it.
JSON distinguishes strings from numbers, and its number grammar does not permit leading zeros in a multi-digit numeric value.[2] A text representation is therefore the appropriate starting point when an identifier's characters must survive a JSON-based internal workflow.
What should the intake control do?
Collect the value as text with a clearly explained expected format. A numeric keyboard can help mobile entry without making the underlying identifier a numeric quantity. MDN specifically cautions that number inputs are inappropriate for identifiers that happen to consist of digits, such as postal codes or credit-card numbers.[3]
Apply that distinction to the EIN control: the interface should help the user enter an identifier and show errors clearly. It should not offer arithmetic controls or silently coerce a value because it contains digits.
Does nine-digit validation establish a valid EIN?
No. It can establish only that the submitted string meets a selected input shape. Issuance and a name/TIN match are separate questions. IRS Publication 2108 distinguishes missing or non-nine-digit numeric input, an unissued TIN, and a name/TIN combination that does not match.[4]
Use distinct labels in the application so a borrower does not receive “EIN does not match” when the request never contained a properly formed identifier.
Where can the identifier change before verification?
Trace the entire route from borrower entry to the outgoing request. Include the broker submission form, loan origination system, CSV transfer, spreadsheet review, database field, internal event and API client. These are inspection points for your own workflow, not a claim that every lending team uses each one.
For each boundary, record the data type and allowed transformation. The useful acceptance question is whether the same normalized identifier arrives at the provider boundary, rather than whether it looked correct on the first screen.
Why inspect spreadsheet handoffs?
Microsoft documents that Excel can remove leading zeros when it converts numerical text into numbers. Its guidance describes importing columns as text and controlling automatic conversions in supported versions.[5]
For a lending operations handoff, test a synthetic identifier through the actual import, edit, export and reimport sequence. Do not assume a workbook display proves what the downstream system receives.
Can a display format repair the problem?
A custom format can display digits differently inside a workbook; Microsoft distinguishes that approach from preserving data as text for use by other programs.[6] Your acceptance test should inspect the exported value, not just a screenshot of the cell.
If the original characters were already lost, formatting is not evidence of what the borrower entered. Retrieve the original source or request a correction. Do not add a leading zero to an eight-digit value simply because that would satisfy the length check.
What should normalization allow and reject?
Define a narrow normalization policy. For example, your intake may accept nine ASCII digits or the same digits with one hyphen after the second digit. That is a proposed application policy; confirm the exact outbound format against the provider contract.
Preserve the original input in an authorized, appropriately protected evidence store and keep the normalized value separate. Record the transformation rule version where it matters to diagnosing a later mismatch.
A suggested checklist is:
• Input type. Require text at the application boundary rather than accepting a number and guessing its original formatting.
• Permitted format. State the accepted characters and any explicitly permitted separator.
• Digit preservation. Remove only an allowed separator; never invent, reorder or replace identifier digits.
• Length check. Validate the normalized shape before sending the request, while retaining the distinction from IRS matching.[7]
• Business-name pairing. Keep the name associated with that input and application revision; Cobalt requires a business name in the TIN request.[8]
• Correction route. Tell operations which source must be checked when the input cannot be normalized safely.
What should happen to ambiguous input?
Reject it into an input-correction state with a useful explanation. Examples include embedded letters, unexpected punctuation, a decimal representation, or a value already converted to scientific notation. Do not strip every nondigit character and assume the remainder is what the borrower intended.
Should names be normalized the same way?
Treat name handling as a separate rule. IRS name-control guidance explains that its matching convention is derived from the legal name information associated with the EIN application.[9] That does not authorize a lender to invent a universal rule that deleting every suffix will fix a mismatch.
Keep the supplied name, any verified correction and the submitted pair traceable. A technically well-formed EIN attached to the wrong application name can still produce a different result from the intended request.
What could a narrow input validator look like?
The following customer-side example accepts only two explicitly defined text forms. It does not verify issuance, query the IRS or make a lending decision.
import re
def normalize_ein(value):
if not isinstance(value, str):
raise ValueError("EIN must arrive as text")
candidate = value.strip()
if re.fullmatch(r"[0-9]{9}", candidate):
return candidate
if re.fullmatch(r"[0-9]{2}-[0-9]{7}", candidate):
return candidate.replace("-", "")
raise ValueError("Confirm the EIN from the original source")
Use synthetic fixtures such as 012345678 and 01-2345678 to test character preservation. Those values are illustrative test strings, not verified or recommended identifiers for a live request. Both should produce the same nine-character string in this example.
Why reject numeric input instead of converting it?
Because the validator cannot establish whether an upstream numeric conversion already removed a character. Converting a number back to text may preserve the number's current representation while concealing the earlier change.
If an existing system sends numeric values, fix that boundary and plan a controlled review of affected data. Do not disguise the incompatibility with a padding function that manufactures apparently valid identifiers.
What does the example intentionally omit?
Production use also needs appropriate data access, error handling, application correlation and provider-specific request construction. The sample is limited to input normalization so those responsibilities remain visible rather than being implied by a few lines of code.
Cobalt's documented request uses /tinVerification with tin and businessName parameters.[10] Use the supported client route and ensure sensitive request values are handled according to your organization's logging and access policies.
How should operations interpret the next result?
After input validation, preserve the actual provider response rather than reducing every unsuccessful outcome to “bad EIN.” Cobalt documents separate status, IRS code, reason and service-status fields.[11] They provide information about the matching request that an input validator alone cannot supply.
For example, the documented code table distinguishes a missing or incorrectly shaped TIN from a name/TIN mismatch. It also identifies an invalid request and duplicate-request response.[12] Map each supported result to a deliberate workflow action instead of prompting the borrower to reenter the same information for every condition.
What belongs in a correction request?
Ask for the specific fact that needs confirmation. If the intake string has eight digits, explain that the original identifier must be checked. If the properly formed name/TIN pair does not match, direct the review to that pair and its source rather than claiming the identifier is necessarily nonexistent.
Our guide to common TIN verification failures provides broader troubleshooting context. Keep this article's control at the earlier boundary: preserving what was submitted.
What if the service is unavailable?
Keep service availability separate from borrower-input quality. The IRS TIN matching outage workflow addresses the retry decision. A service problem should not cause your normalization layer to alter an identifier or your analyst interface to accuse the borrower of a mismatch.
Validate the representation before interpreting the match, and preserve the evidence of both steps.
How should you test the full round trip?
Test the route operations actually uses, including any manual spreadsheet step. A unit test for the validator is useful, but it cannot prove that a CSV import or an internal event did not change the input before the validator saw it.
Start with a synthetic case set: a leading-zero text value, the allowed hyphenated form, surrounding whitespace, an eight-digit value, an unexpected letter, a numeric value, and an empty input. Add the exact edge cases your existing integration contract allows or rejects.
What should the test assert at each boundary?
Compare the original permitted string with the normalized outbound identifier and confirm that only the documented transformation occurred. Inspect the actual serialized value and data type. Keep these test artifacts free of real borrower identifiers.
For the valid fixtures, verify that reopening an export and resubmitting it produces the same normalized string. For invalid fixtures, verify that the workflow stops with an input-correction state and does not call a live verification endpoint as part of the test.
What should the borrower and analyst see?
Use different messages for different audiences. The borrower should receive a clear request to confirm the identifier when necessary. The analyst should see the specific validation failure and the original-source reference needed to resolve it, with sensitive values displayed only as permitted.
Test that a corrected identifier creates an updated application input and a new matching request where required. A later result for the old pair must remain attached to the old submission rather than replacing the result for the corrected one.
How should you roll this out to an existing lending workflow?
Begin by mapping the affected entry points and agreeing on the accepted format. Review forms, import templates and API contracts together so one team does not accept values that another team silently changes.
Use a controlled set of synthetic submissions through each route. Confirm the resulting values with operations before switching the route for live applications. If existing stored identifiers may have been changed, create an evidence-based remediation plan rather than applying a blanket zero-padding update.
Which operating measures help?
Measure your own input-shape failures, corrections by entry route and confirmed transport changes. Keep them separate from genuine name/TIN mismatch results and service errors. That tells you whether the next improvement belongs in a broker template, a form control, an import process or result handling.
Do not claim that eliminating a formatting problem eliminates fraud or establishes creditworthiness. IRS describes TIN matching as a way to validate name/TIN combinations before information-return submission.[13] Its result has a defined scope.
What should a provider evaluation demonstrate?
Ask to see the accepted input representation, required name field and response distinctions. TIN Comply's public API guide, for example, documents a separate IRS name/TIN matching endpoint and JSON request structure.[14] Use each provider's own contract rather than assuming request formats are interchangeable.
Schedule a Cobalt demo with your permitted input workflow and synthetic edge cases. The practical objective is a request that preserves the intended identifier and a review process that distinguishes input correction from the matching result.












.png)