EIN Filing Workflow

The EIN (Employer Identification Number) filing workflow allows you to obtain a federal tax identification number for your business entity. Unlike formation workflows, EIN filings are not jurisdiction-specific and only require entity type and filing type parameters.

Prerequisites

  • Valid API access token
  • Existing organization and entity (EIN filings require a formed entity)
  • Entity type information (LLC, Corporation, etc.)
  • Required business information (addresses, responsible party details)

Step 1: Organization and Entity Setup

EIN filings require an existing formed business entity:

# Set variables
ORGANIZATION_ID="org_1234567890"
ENTITY_NAME="Acme AI Solutions LLC"
ACCESS_TOKEN="your_bearer_token_here"

# GET entities and parse for the entity by name (use jq or manual inspection)
curl -X GET "https://api.demo.singlefile.io/external-api/v1/organization/${ORGANIZATION_ID}/entities" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
import requests

def get_existing_entity(organization_id, entity_name, access_token):
    response = requests.get(
        f"https://api.demo.singlefile.io/external-api/v1/organization/{organization_id}/entities",
        headers={"Authorization": f"Bearer {access_token}"}
    )
    
    if response.status_code == 200:
        for entity in response.json()["data"]:
            if entity["name"] == entity_name:
                return entity["id"]
    
    raise Exception(f"Entity '{entity_name}' not found. EIN filings require a formed business entity.")

ACCESS_TOKEN = "your_bearer_token_here"
entity_id = get_existing_entity("org_1234567890", "Acme AI Solutions LLC", ACCESS_TOKEN)
async function getExistingEntity(organizationId, entityName, accessToken) {
  const response = await fetch(
    `https://api.demo.singlefile.io/external-api/v1/organization/${organizationId}/entities`,
    { headers: { Authorization: `Bearer ${accessToken}` } }
  );
  
  if (response.ok) {
    const { data } = await response.json();
    const entity = data.find(e => e.name === entityName);
    if (entity) return entity.id;
  }
  
  throw new Error(`Entity '${entityName}' not found. EIN filings require a formed business entity.`);
}

const ACCESS_TOKEN = "your_bearer_token_here";
const entityId = await getExistingEntity("org_1234567890", "Acme AI Solutions LLC", ACCESS_TOKEN);
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func getExistingEntity(organizationID, entityName, accessToken string) (string, error) {
	url := fmt.Sprintf("https://api.demo.singlefile.io/external-api/v1/organization/%s/entities", organizationID)
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer "+accessToken)

	resp, err := http.DefaultClient.Do(req)
	if err != nil { return "", err }
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return "", fmt.Errorf("request failed: %d", resp.StatusCode)
	}

	var result struct {
		Data []struct {
			ID   string `json:"id"`
			Name string `json:"name"`
		} `json:"data"`
	}
	if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return "", err }

	for _, e := range result.Data {
		if e.Name == entityName { return e.ID, nil }
	}
	return "", fmt.Errorf("entity '%s' not found", entityName)
}

func main() {
	entityID, err := getExistingEntity("org_1234567890", "Acme AI Solutions LLC", "your_bearer_token_here")
	if err != nil { panic(err) }
	_ = entityID
}
using System.Net.Http;
using System.Text.Json;

var organizationId = "org_1234567890";
var entityName = "Acme AI Solutions LLC";
var accessToken = "your_bearer_token_here";

var entityId = await GetExistingEntity(organizationId, entityName, accessToken);

async Task<string> GetExistingEntity(string orgId, string name, string token)
{
    using var client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
    var response = await client.GetAsync(
        $"https://api.demo.singlefile.io/external-api/v1/organization/{orgId}/entities");
    if (!response.IsSuccessStatusCode) throw new Exception($"Request failed: {response.StatusCode}");

    var json = await response.Content.ReadAsStringAsync();
    var doc = JsonDocument.Parse(json);
    foreach (var entity in doc.RootElement.GetProperty("data").EnumerateArray())
        if (entity.GetProperty("name").GetString() == name)
            return entity.GetProperty("id").GetString()!;
    throw new Exception($"Entity '{name}' not found.");
}

Step 2: Retrieve EIN Filing Schema

EIN schemas do not require jurisdiction parameters.

ParameterDescriptionValues
entity_typeType of business entityllc, lp, corporation
filing_typeAlways einein
purposePurpose of EIN applicationnew_business, created_pension_plan
ENTITY_TYPE="llc"
PURPOSE="new_business"

curl -X GET "https://api.demo.singlefile.io/external-api/v1/schemas?entity_type=${ENTITY_TYPE}&filing_type=ein&purpose=${PURPOSE}" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
def get_ein_schema(entity_type, purpose, access_token):
    params = {
        "entity_type": entity_type,
        "filing_type": "ein",
        "purpose": purpose
    }
    
    response = requests.get(
        "https://api.demo.singlefile.io/external-api/v1/schemas",
        params=params,
        headers={"Authorization": f"Bearer {access_token}"}
    )
    
    if response.status_code == 200:
        return response.json()["data"]
    elif response.status_code == 404:
        raise Exception(f"EIN schema not found for {entity_type} with purpose {purpose}")
    raise Exception(f"Failed to retrieve EIN schema: {response.status_code}")

new_business_schema = get_ein_schema("llc", "new_business", ACCESS_TOKEN)
pension_plan_schema = get_ein_schema("corporation", "created_pension_plan", ACCESS_TOKEN)
async function getEinSchema(entityType, purpose, accessToken) {
  const params = new URLSearchParams({ entity_type: entityType, filing_type: "ein", purpose });
  const res = await fetch(
    `https://api.demo.singlefile.io/external-api/v1/schemas?${params}`,
    { headers: { Authorization: `Bearer ${accessToken}` } }
  );
  if (res.ok) return (await res.json()).data;
  if (res.status === 404) throw new Error(`EIN schema not found for ${entityType} with purpose ${purpose}`);
  throw new Error(`Failed to retrieve EIN schema: ${res.status}`);
}

const newBusinessSchema = await getEinSchema("llc", "new_business", ACCESS_TOKEN);
const pensionPlanSchema = await getEinSchema("corporation", "created_pension_plan", ACCESS_TOKEN);
func getEinSchema(entityType, purpose, accessToken string) (interface{}, error) {
	url := fmt.Sprintf("https://api.demo.singlefile.io/external-api/v1/schemas?entity_type=%s&filing_type=ein&purpose=%s",
		entityType, purpose)
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer "+accessToken)
	resp, err := http.DefaultClient.Do(req)
	if err != nil { return nil, err }
	defer resp.Body.Close()
	if resp.StatusCode == 404 {
		return nil, fmt.Errorf("EIN schema not found for %s with purpose %s", entityType, purpose)
	}
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("failed to retrieve EIN schema: %d", resp.StatusCode)
	}
	var result struct { Data interface{} `json:"data"` }
	if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return nil, err }
	return result.Data, nil
}
async Task<JsonElement> GetEinSchema(string entityType, string purpose, string token)
{
    var url = $"https://api.demo.singlefile.io/external-api/v1/schemas?entity_type={entityType}&filing_type=ein&purpose={purpose}";
    using var client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
    var res = await client.GetAsync(url);
    if (res.StatusCode == System.Net.HttpStatusCode.NotFound)
        throw new Exception($"EIN schema not found for {entityType} with purpose {purpose}");
    res.EnsureSuccessStatusCode();
    var doc = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
    return doc.RootElement.GetProperty("data").Clone();
}

Step 3: Create EIN Filing Payload

The payload includes business details, responsible party information, and IRS-specific fields:

# Step 3 is payload construction only; use the structure from Python/JS/Go/C# examples.
# For cURL, you would build a JSON file and pass it with -d @payload.json in Steps 4 and 5.
def create_ein_payload(organization_id, entity_id, entity_type, schema):
    payload = {
        "filing_type": "EIN",
        "entity_id": entity_id,
        "entity_name": "Tech Innovations LLC",
        "mailing_address": {
            "street_address": "123 Innovation Drive, Suite 100",
            "city": "San Francisco",
            "state": "CA",
            "postal_code": "94105",
            "country": "US"
        },
        "principal_business_location": {
            "county": "San Francisco",
            "state": "CA"
        },
        "responsible_party": {
            "name": "John Doe",
            "identification_type": "SSN",
            "identification_number": "123-45-6789",
            "is_foreign": False
        },
        "type_of_entity": {
            "entity_type": "Partnership"
        },
        "reason_for_applying": "Started new business",
        "business_type": "Technology consulting and software development",
        "business_start_date": "2024-01-15",
        "closing_month": "December",
        "employee_information": {
            "agricultural_employees": 0,
            "household_employees": 0,
            "other_employees": 5
        },
        "principal_activity": {
            "category": "Other",
            "other_specify": "Technology consulting and software development"
        },
        "principal_description": "Technology consulting and software development services",
        "previous_ein": {
            "has_applied_before": False
        },
        "applicant_information": {
            "name_and_title": "John Doe, Managing Member",
            "telephone_number": "555-123-4567",
            "signature_date": "2024-01-15"
        }
    }
    
    if entity_type.lower() == "llc":
        payload.update({"number_of_members": 2, "organized_in_us": True})
    elif entity_type.lower() == "lp":
        payload.update({"number_of_partners": 2, "organized_in_us": True})
    
    return payload

ein_payload = create_ein_payload("org_123", entity_id, "llc", new_business_schema)
function createEinPayload(organizationId, entityId, entityType) {
  const payload = {
    filing_type: "EIN",
    entity_id: entityId,
    entity_name: "Tech Innovations LLC",
    mailing_address: {
      street_address: "123 Innovation Drive, Suite 100",
      city: "San Francisco", state: "CA", postal_code: "94105", country: "US"
    },
    principal_business_location: { county: "San Francisco", state: "CA" },
    responsible_party: {
      name: "John Doe", identification_type: "SSN",
      identification_number: "123-45-6789", is_foreign: false
    },
    type_of_entity: { entity_type: "Partnership" },
    reason_for_applying: "Started new business",
    business_type: "Technology consulting and software development",
    business_start_date: "2024-01-15", closing_month: "December",
    employee_information: { agricultural_employees: 0, household_employees: 0, other_employees: 5 },
    principal_activity: {
      category: "Other",
      other_specify: "Technology consulting and software development"
    },
    principal_description: "Technology consulting and software development services",
    previous_ein: { has_applied_before: false },
    applicant_information: {
      name_and_title: "John Doe, Managing Member",
      telephone_number: "555-123-4567", signature_date: "2024-01-15"
    }
  };
  if (entityType.toLowerCase() === "llc") Object.assign(payload, { number_of_members: 2, organized_in_us: true });
  else if (entityType.toLowerCase() === "lp") Object.assign(payload, { number_of_partners: 2, organized_in_us: true });
  return payload;
}
func createEinPayload(organizationID, entityID, entityType string) map[string]interface{} {
	payload := map[string]interface{}{
		"filing_type": "EIN", "entity_id": entityID, "entity_name": "Tech Innovations LLC",
		"mailing_address": map[string]string{
			"street_address": "123 Innovation Drive, Suite 100",
			"city": "San Francisco", "state": "CA", "postal_code": "94105", "country": "US",
		},
		"principal_business_location": map[string]string{"county": "San Francisco", "state": "CA"},
		"responsible_party": map[string]interface{}{
			"name": "John Doe", "identification_type": "SSN",
			"identification_number": "123-45-6789", "is_foreign": false,
		},
		"type_of_entity": map[string]string{"entity_type": "Partnership"},
		"reason_for_applying": "Started new business",
		"business_type": "Technology consulting and software development",
		"business_start_date": "2024-01-15", "closing_month": "December",
		"employee_information": map[string]int{"agricultural_employees": 0, "household_employees": 0, "other_employees": 5},
		"principal_activity": map[string]string{
			"category": "Other",
			"other_specify": "Technology consulting and software development",
		},
		"principal_description": "Technology consulting and software development services",
		"previous_ein": map[string]bool{"has_applied_before": false},
		"applicant_information": map[string]string{
			"name_and_title": "John Doe, Managing Member",
			"telephone_number": "555-123-4567", "signature_date": "2024-01-15",
		},
	}
	if strings.ToLower(entityType) == "llc" {
		payload["number_of_members"], payload["organized_in_us"] = 2, true
	} else if strings.ToLower(entityType) == "lp" {
		payload["number_of_partners"], payload["organized_in_us"] = 2, true
	}
	return payload
}
Dictionary<string, object> CreateEinPayload(string organizationId, string entityId, string entityType)
{
    var payload = new Dictionary<string, object> {
        ["filing_type"] = "EIN", ["entity_id"] = entityId,
        ["entity_name"] = "Tech Innovations LLC",
        ["mailing_address"] = new Dictionary<string, string> {
            ["street_address"] = "123 Innovation Drive, Suite 100", ["city"] = "San Francisco",
            ["state"] = "CA", ["postal_code"] = "94105", ["country"] = "US"
        },
        ["principal_business_location"] = new Dictionary<string, string> { ["county"] = "San Francisco", ["state"] = "CA" },
        ["responsible_party"] = new Dictionary<string, object> {
            ["name"] = "John Doe", ["identification_type"] = "SSN",
            ["identification_number"] = "123-45-6789", ["is_foreign"] = false
        },
        ["type_of_entity"] = new Dictionary<string, string> { ["entity_type"] = "Partnership" },
        ["reason_for_applying"] = "Started new business",
        ["business_type"] = "Technology consulting and software development",
        ["business_start_date"] = "2024-01-15", ["closing_month"] = "December",
        ["employee_information"] = new Dictionary<string, int> { ["agricultural_employees"] = 0, ["household_employees"] = 0, ["other_employees"] = 5 },
        ["principal_activity"] = new Dictionary<string, string> { ["category"] = "Other", ["other_specify"] = "Technology consulting and software development" },
        ["principal_description"] = "Technology consulting and software development services",
        ["previous_ein"] = new Dictionary<string, bool> { ["has_applied_before"] = false },
        ["applicant_information"] = new Dictionary<string, string> {
            ["name_and_title"] = "John Doe, Managing Member", ["telephone_number"] = "555-123-4567", ["signature_date"] = "2024-01-15"
        }
    };
    if (entityType.ToLower() == "llc") { payload["number_of_members"] = 2; payload["organized_in_us"] = true; }
    else if (entityType.ToLower() == "lp") { payload["number_of_partners"] = 2; payload["organized_in_us"] = true; }
    return payload;
}

Step 4: Preview the EIN Filing

curl -X POST "https://api.demo.singlefile.io/external-api/v1/orders?preview=True" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d @ein_payload.json
def preview_ein_application(payload, access_token):
    response = requests.post(
        "https://api.demo.singlefile.io/external-api/v1/orders",
        json=payload,
        params={"preview": True},
        headers={
            "Authorization": f"Bearer {access_token}",
            "Content-Type": "application/json"
        }
    )
    
    if response.status_code == 200:
        print("EIN filing preview successful")
        return True
    else:
        print(f"Preview failed: {response.json().get('error', {}).get('message', 'Unknown error')}")
        return False

if not preview_ein_application(ein_payload, ACCESS_TOKEN):
    raise Exception("EIN filing preview failed")
async function previewEinApplication(payload, accessToken) {
  const res = await fetch(
    "https://api.demo.singlefile.io/external-api/v1/orders?preview=true",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify(payload)
    }
  );
  if (res.ok) {
    console.log("EIN filing preview successful");
    return true;
  }
  const err = await res.json().catch(() => ({}));
  console.log("Preview failed:", err?.error?.message ?? "Unknown error");
  return false;
}
if (!(await previewEinApplication(einPayload, ACCESS_TOKEN))) throw new Error("EIN filing preview failed");
func previewEinApplication(payload map[string]interface{}, accessToken string) bool {
	body, _ := json.Marshal(payload)
	req, _ := http.NewRequest("POST", "https://api.demo.singlefile.io/external-api/v1/orders?preview=true", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+accessToken)
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil { return false }
	defer resp.Body.Close()
	if resp.StatusCode == http.StatusOK {
		fmt.Println("EIN filing preview successful")
		return true
	}
	var errResp struct { Error struct { Message string `json:"message"` } `json:"error"` }
	json.NewDecoder(resp.Body).Decode(&errResp)
	fmt.Println("Preview failed:", errResp.Error.Message)
	return false
}
async Task<bool> PreviewEinApplication(object payload, string token)
{
    var json = JsonSerializer.Serialize(payload);
    using var client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
    var content = new StringContent(json, Encoding.UTF8, "application/json");
    var res = await client.PostAsync("https://api.demo.singlefile.io/external-api/v1/orders?preview=true", content);
    if (res.IsSuccessStatusCode) { Console.WriteLine("EIN filing preview successful"); return true; }
    var err = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
    var msg = err.RootElement.TryGetProperty("error", out var e) ? e.GetProperty("message").GetString() : "Unknown error";
    Console.WriteLine($"Preview failed: {msg}");
    return false;
}

Step 5: Submit the EIN Filing

curl -X POST "https://api.demo.singlefile.io/external-api/v1/orders" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d @ein_payload.json
def submit_ein_application(payload, access_token):
    response = requests.post(
        "https://api.demo.singlefile.io/external-api/v1/orders",
        json=payload,
        headers={
            "Authorization": f"Bearer {access_token}",
            "Content-Type": "application/json"
        }
    )
    
    if response.status_code == 201:
        order = response.json()["data"]
        print(f"EIN filing submitted! Order ID: {order['order_id']}")
        return order
    else:
        print(f"Submission failed: {response.json().get('error', {}).get('message', 'Unknown error')}")
        return None

submitted_order = submit_ein_application(ein_payload, ACCESS_TOKEN)
async function submitEinApplication(payload, accessToken) {
  const res = await fetch("https://api.demo.singlefile.io/external-api/v1/orders", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${accessToken}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(payload)
  });
  if (res.status === 201) {
    const { data } = await res.json();
    console.log("EIN filing submitted! Order ID:", data.order_id);
    return data;
  }
  const err = await res.json().catch(() => ({}));
  console.log("Submission failed:", err?.error?.message ?? "Unknown error");
  return null;
}
func submitEinApplication(payload map[string]interface{}, accessToken string) map[string]interface{} {
	body, _ := json.Marshal(payload)
	req, _ := http.NewRequest("POST", "https://api.demo.singlefile.io/external-api/v1/orders", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+accessToken)
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil { return nil }
	defer resp.Body.Close()
	if resp.StatusCode == 201 {
		var result struct { Data map[string]interface{} `json:"data"` }
		json.NewDecoder(resp.Body).Decode(&result)
		fmt.Println("EIN filing submitted! Order ID:", result.Data["order_id"])
		return result.Data
	}
	var errResp struct { Error struct { Message string `json:"message"` } `json:"error"` }
	json.NewDecoder(resp.Body).Decode(&errResp)
	fmt.Println("Submission failed:", errResp.Error.Message)
	return nil
}
async Task<JsonElement?> SubmitEinApplication(object payload, string token)
{
    var json = JsonSerializer.Serialize(payload);
    using var client = new HttpClient();
    client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
    var content = new StringContent(json, Encoding.UTF8, "application/json");
    var res = await client.PostAsync("https://api.demo.singlefile.io/external-api/v1/orders", content);
    if (res.StatusCode == System.Net.HttpStatusCode.Created)
    {
        var doc = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
        var data = doc.RootElement.GetProperty("data");
        Console.WriteLine($"EIN filing submitted! Order ID: {data.GetProperty("order_id").GetString()}");
        return data;
    }
    var errDoc = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
    var errMsg = errDoc.RootElement.TryGetProperty("error", out var errE) ? errE.GetProperty("message").GetString() : "Unknown error";
    Console.WriteLine($"Submission failed: {errMsg}");
    return null;
}

Complete EIN Workflow

Here's a complete function that orchestrates the entire process:

# Chain the cURL commands from Steps 1-5 in sequence:
# 1. GET entities to find entity_id
# 2. GET schema
# 3. Build payload JSON file
# 4. POST with ?preview=True
# 5. POST without preview to submit
def complete_ein_workflow(org_name, org_domain, entity_name, entity_type, purpose, access_token):
    try:
        # 1. Organization setup
        organization_id = get_or_create_organization(org_name, org_domain, access_token)
        
        # 2. Get existing entity
        entity_id = get_existing_entity(organization_id, entity_name, access_token)
        
        # 3. Get EIN schema
        ein_schema = get_ein_schema(entity_type, purpose, access_token)
        
        # 4. Create payload
        ein_payload = create_ein_payload(organization_id, entity_id, entity_type, ein_schema)
        
        # 5. Preview
        if not preview_ein_application(ein_payload, access_token):
            raise Exception("EIN filing preview failed")
        
        # 6. Submit
        submitted_order = submit_ein_application(ein_payload, access_token)
        if not submitted_order:
            raise Exception("EIN filing submission failed")
        
        return {
            "organization_id": organization_id,
            "entity_id": entity_id,
            "order_id": submitted_order["order_id"]
        }
    except Exception as e:
        print(f"EIN filing workflow failed: {e}")
        raise

# New business EIN for LLC
result = complete_ein_workflow(
    org_name="Acme Ventures LLC",
    org_domain="acmeventures.com",
    entity_name="Acme AI Solutions LLC",
    entity_type="llc",
    purpose="new_business",
    access_token=ACCESS_TOKEN
)

# Pension plan EIN for Corporation
pension_result = complete_ein_workflow(
    org_name="Acme Ventures LLC",
    org_domain="acmeventures.com",
    entity_name="Acme AI Solutions LLC",
    entity_type="corporation",
    purpose="created_pension_plan",
    access_token=ACCESS_TOKEN
)
async function completeEinWorkflow(orgName, orgDomain, entityName, entityType, purpose, accessToken) {
  const organizationId = await getOrCreateOrganization(orgName, orgDomain, accessToken);
  const entityId = await getExistingEntity(organizationId, entityName, accessToken);
  const einSchema = await getEinSchema(entityType, purpose, accessToken);
  const einPayload = createEinPayload(organizationId, entityId, entityType);
  if (!(await previewEinApplication(einPayload, accessToken)))
    throw new Error("EIN filing preview failed");
  const order = await submitEinApplication(einPayload, accessToken);
  if (!order) throw new Error("EIN filing submission failed");
  return { organization_id: organizationId, entity_id: entityId, order_id: order.order_id };
}
func completeEinWorkflow(orgName, orgDomain, entityName, entityType, purpose, accessToken string) (map[string]string, error) {
	orgID, err := getOrCreateOrganization(orgName, orgDomain, accessToken)
	if err != nil { return nil, err }
	entityID, err := getExistingEntity(orgID, entityName, accessToken)
	if err != nil { return nil, err }
	schema, err := getEinSchema(entityType, purpose, accessToken)
	if err != nil { return nil, err }
	_ = schema
	payload := createEinPayload(orgID, entityID, entityType)
	if !previewEinApplication(payload, accessToken) {
		return nil, fmt.Errorf("EIN filing preview failed")
	}
	order := submitEinApplication(payload, accessToken)
	if order == nil { return nil, fmt.Errorf("EIN filing submission failed") }
	return map[string]string{
		"organization_id": orgID, "entity_id": entityID,
		"order_id": fmt.Sprintf("%v", order["order_id"]),
	}, nil
}
async Task<Dictionary<string, string>> CompleteEinWorkflow(string orgName, string orgDomain, string entityName, string entityType, string purpose, string token)
{
    var orgId = await GetOrCreateOrganization(orgName, orgDomain, token);
    var entityId = await GetExistingEntity(orgId, entityName, token);
    var schema = await GetEinSchema(entityType, purpose, token);
    var payload = CreateEinPayload(orgId, entityId, entityType);
    if (!(await PreviewEinApplication(payload, token))) throw new Exception("EIN filing preview failed");
    var order = await SubmitEinApplication(payload, token);
    if (order == null) throw new Exception("EIN filing submission failed");
    return new Dictionary<string, string> { ["organization_id"] = orgId, ["entity_id"] = entityId, ["order_id"] = order.Value.GetProperty("order_id").GetString()! };
}

After submission, webhooks will provide real-time status updates. You can retrieve the EIN document once a webhook confirms completion.

EIN Filing Schemas

The full JSON schemas for EIN filings (LLC, Corporation, LP) define all required fields, validation rules, and conditional logic. Retrieve the schema for your specific entity type and purpose using the Schema API endpoint:

GET /external-api/v1/schemas?entity_type=llc&filing_type=ein&purpose=new_business

Key schema fields include:

FieldDescriptionRequired
entity_idExisting entity identifierYes
mailing_addressBusiness mailing addressYes
responsible_partyName, SSN/ITIN, foreign statusYes
type_of_entityEntity classification for IRSYes
business_start_dateDate business startedYes
employee_informationExpected employee countsYes
principal_activityBusiness activity categoryYes
applicant_informationSigner name, phone, dateYes