{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/doola/json-schema/doola-create-company-request-schema.json",
  "title": "CreateCompanyRequest",
  "description": "Request body to create (form) a company for one of your customers.",
  "x-generated": "2026-11-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/doola-openapi.json#/components/schemas/CreateCompanyRequest",
  "type": "object",
  "properties": {
    "doolaCustomerId": {
      "type": "string",
      "description": "doola customer ID (KSUID) that will own the company.",
      "minLength": 1
    },
    "entityType": {
      "type": "string",
      "default": "LLC",
      "description": "Entity type to form. Defaults to LLC when omitted. An LLC takes `members`; a CCorp takes `executiveMembers` and `ccorpValuation`.",
      "enum": [
        "LLC",
        "CCorp"
      ]
    },
    "state": {
      "type": "string",
      "description": "US state of formation (two-letter abbreviation).",
      "minLength": 1
    },
    "nameOptions": {
      "type": "array",
      "description": "Candidate company names, in order of preference. One to three entries.",
      "items": {
        "$ref": "#/$defs/PartnerCompanyNameOptionDto"
      }
    },
    "industry": {
      "type": "string",
      "description": "Unique NAICS industry label (the `industry` value from GET /v1/partner/references/naics-codes), sent verbatim.",
      "minLength": 1
    },
    "description": {
      "type": "string",
      "description": "Short description of what the business does.",
      "maxLength": 50,
      "minLength": 1
    },
    "responsibleParty": {
      "$ref": "#/$defs/PartnerResponsiblePartyDto",
      "description": "The person legally responsible for the company."
    },
    "addresses": {
      "type": "array",
      "description": "Company addresses. Exactly two entries are required: one `mailing` and one `business`. Each entry is either `customer`-provided or handed to doola's Registered Agent (see the `provider` field).",
      "items": {
        "$ref": "#/$defs/PartnerCompanyAddressDto"
      }
    },
    "members": {
      "type": "array",
      "description": "Company members/owners. Required for an LLC (ownership percentages must total 100); omit for a CCorp.",
      "items": {
        "$ref": "#/$defs/PartnerCompanyMemberDto"
      }
    },
    "executiveMembers": {
      "type": "array",
      "description": "C-Corp officers and directors. Required for a CCorp; omit for an LLC. Include at least one President, Secretary, Treasurer, and Director; the President, Secretary, and Treasurer may each appear only once.",
      "items": {
        "$ref": "#/$defs/PartnerCCorpExecMemberDto"
      }
    },
    "ccorpValuation": {
      "$ref": "#/$defs/PartnerCcorpValuationDto",
      "description": "C-Corp share structure. Required for a CCorp; omit for an LLC."
    },
    "services": {
      "type": "array",
      "description": "Services to create the company with. `Formation` is required; `RegisteredAgent` is always included with it; `EinCreation` is optional and takes a `variant` (`Standard` by default, or `Expedite`). `AiCofounder` comes with every company and cannot be ordered. Each service may appear once. Omit to get Formation, Registered Agent and EIN, as before. Cannot be combined with `requestedServices`. An invalid order is rejected with `E_SERVICE_SELECTION_INVALID`.",
      "items": {
        "$ref": "#/$defs/ServiceOrderDto"
      }
    },
    "requestedServices": {
      "type": "array",
      "deprecated": true,
      "description": "DEPRECATED: use `services` instead. Optional per-service variant overrides. Only the EIN service is configurable: include `{ \"service\": \"EinCreation\", \"variant\": \"Expedite\" }` to request expedited EIN. Available when the responsible party supplies no valid SSN; a responsible party with an ITIN is eligible, and another owner's SSN does not change it. SSNs are checked for format, not issuance. Omit for standard processing. Cannot be combined with `services`.",
      "items": {
        "$ref": "#/$defs/RequestedServiceDto"
      }
    }
  },
  "required": [
    "addresses",
    "description",
    "doolaCustomerId",
    "industry",
    "nameOptions",
    "responsibleParty",
    "state"
  ],
  "$defs": {
    "PartnerAddressDto": {
      "type": "object",
      "description": "A postal address.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Server-assigned ID.",
          "readOnly": true
        },
        "line1": {
          "type": "string",
          "description": "Street address line 1."
        },
        "line2": {
          "type": "string",
          "description": "Street address line 2."
        },
        "city": {
          "type": "string",
          "description": "City."
        },
        "state": {
          "type": "string",
          "description": "State or province."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal or ZIP code."
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-3 country code (e.g. USA)."
        },
        "phone": {
          "type": "string",
          "description": "Phone number in E.164 format. Required for a person's address (the responsible party, a member, or an executive member); optional for a company `mailing` or `business` address."
        }
      },
      "required": [
        "city",
        "country",
        "line1",
        "postalCode",
        "state"
      ]
    },
    "PartnerCCorpExecMemberDto": {
      "type": "object",
      "description": "A C-Corp executive member — an officer or director.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Server-assigned ID, ignored on create and import. In the importCorrections of an IMPORT_INFO_REQUIRED resolution, send it back to keep this person and their stored SSN."
        },
        "type": {
          "type": "string",
          "description": "Executive role. The list must include at least one of each role; President, Secretary, and Treasurer may each appear only once, while Director may repeat.",
          "enum": [
            "President",
            "Secretary",
            "Treasurer",
            "Director"
          ]
        },
        "legalFirstName": {
          "type": "string",
          "description": "Legal first name."
        },
        "legalLastName": {
          "type": "string",
          "description": "Legal last name."
        },
        "ssn": {
          "type": "string",
          "description": "Social Security Number or ITIN. Optional. Input: nine ASCII digits or XXX-XX-XXXX. Handled as sensitive data."
        },
        "address": {
          "$ref": "#/$defs/PartnerAddressDto",
          "description": "Executive member's address."
        }
      },
      "required": [
        "address",
        "legalFirstName",
        "legalLastName",
        "type"
      ]
    },
    "PartnerCcorpValuationDto": {
      "type": "object",
      "description": "C-Corp share structure.",
      "properties": {
        "noOfShares": {
          "type": "integer",
          "format": "int32",
          "description": "Number of authorized shares. Must be greater than 0."
        },
        "shareValue": {
          "type": "number",
          "description": "Par value per share, in USD. Must be greater than 0."
        }
      },
      "required": [
        "noOfShares",
        "shareValue"
      ]
    },
    "PartnerCompanyAddressDto": {
      "type": "object",
      "description": "A company address of a given type.",
      "properties": {
        "provider": {
          "type": "string",
          "description": "Who provides this address. Use `customer` to supply the address yourself in the `address` field. Use `registeredAgent` to have doola fill in its Registered Agent address for the company's state; leave `address` out, as it is not used for a registered-agent entry.",
          "enum": [
            "customer",
            "registeredAgent"
          ]
        },
        "type": {
          "type": "string",
          "description": "Which address this is. Send exactly one `mailing` entry and one `business` entry.",
          "enum": [
            "mailing",
            "business"
          ]
        },
        "address": {
          "$ref": "#/$defs/PartnerAddressDto",
          "description": "The address itself."
        }
      },
      "required": [
        "provider",
        "type"
      ]
    },
    "PartnerCompanyMemberDto": {
      "type": "object",
      "description": "A company member/owner. Ownership across all members must total 100.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Server-assigned ID, ignored on create and import. In the importCorrections of an IMPORT_INFO_REQUIRED resolution, send it back to keep this person and their stored SSN."
        },
        "legalFirstName": {
          "type": "string",
          "description": "Legal first name (natural persons)."
        },
        "legalLastName": {
          "type": "string",
          "description": "Legal last name (natural persons)."
        },
        "contactFullName": {
          "type": "string",
          "description": "Full contact name (entities or where a single name is used)."
        },
        "isNaturalPerson": {
          "type": "boolean",
          "description": "True if the member is a person, false if it is another entity."
        },
        "address": {
          "$ref": "#/$defs/PartnerAddressDto",
          "description": "Member's address."
        },
        "ownershipPercent": {
          "type": "number",
          "description": "Ownership percentage (0–100)."
        },
        "ssn": {
          "type": "string",
          "description": "Social Security Number or ITIN. Optional. Input: nine ASCII digits or XXX-XX-XXXX. Handled as sensitive data."
        }
      },
      "required": [
        "address",
        "isNaturalPerson",
        "ownershipPercent"
      ]
    },
    "PartnerCompanyNameOptionDto": {
      "type": "object",
      "description": "A candidate company name.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Server-assigned ID.",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "Proposed company name, without the entity ending."
        },
        "entityTypeEnding": {
          "type": "string",
          "description": "Entity-type ending appended to the name."
        },
        "position": {
          "type": "integer",
          "format": "int32",
          "description": "Preference order, lowest first. Ignored on create, where array order sets the preference and responses return it starting at 0. On a name-options resolution, options are ordered by this value, or by array order when it is omitted."
        }
      },
      "required": [
        "entityTypeEnding",
        "name"
      ]
    },
    "PartnerResponsiblePartyDto": {
      "type": "object",
      "description": "The person legally responsible for the company (used for tax filings).",
      "properties": {
        "id": {
          "type": "string",
          "description": "Server-assigned ID, ignored on create and import. In the importCorrections of an IMPORT_INFO_REQUIRED resolution, send it back to keep this person and their stored SSN."
        },
        "legalFirstName": {
          "type": "string",
          "description": "Legal first name."
        },
        "legalLastName": {
          "type": "string",
          "description": "Legal last name."
        },
        "ssn": {
          "type": "string",
          "description": "Social Security Number or ITIN. Optional. Input: nine ASCII digits or XXX-XX-XXXX. Handled as sensitive data."
        },
        "email": {
          "type": "string",
          "description": "Contact email."
        },
        "address": {
          "$ref": "#/$defs/PartnerAddressDto",
          "description": "Responsible party's address."
        }
      },
      "required": [
        "email",
        "legalFirstName",
        "legalLastName"
      ]
    },
    "RequestedServiceDto": {
      "type": "object",
      "description": "Requests a specific variant for one of the company's services.",
      "properties": {
        "service": {
          "type": "string",
          "description": "Service to configure. Only `EinCreation` is supported today.",
          "enum": [
            "EinCreation"
          ]
        },
        "variant": {
          "type": "string",
          "description": "Variant for the service. `Expedite` requests the expedited EIN; `Standard` is the default and behaves the same as omitting the entry.",
          "enum": [
            "Standard",
            "Expedite"
          ]
        }
      }
    },
    "ServiceOrderDto": {
      "type": "object",
      "description": "A service to order for a company.",
      "properties": {
        "service": {
          "type": "string",
          "description": "Service to order. When creating a company, `Formation` is required and `RegisteredAgent` is always included with `Formation`, so listing it is optional. `AiCofounder` comes with every company and cannot be ordered. `EinCreation` can be added to an existing company, and `RegisteredAgent` to an imported one.",
          "enum": [
            "Formation",
            "RegisteredAgent",
            "EinCreation"
          ]
        },
        "variant": {
          "type": "string",
          "description": "Only for `EinCreation`. `Standard` is the default; `Expedite` requests the expedited EIN, available when the responsible party supplies no valid SSN. Any other service rejects a variant.",
          "enum": [
            "Standard",
            "Expedite"
          ]
        }
      },
      "required": [
        "service"
      ]
    }
  }
}