> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doola.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Authenticate with the raw API key in the Authorization header. Never add a Bearer prefix.
> Use the sandbox base URL https://api.test.doola.com and a dk_test_ key in examples unless the user asks for production.
> Send an Idempotency-Key header on POST /v1/partner/customers, POST /v1/partner/companies, POST /v1/partner/companies/import, POST /v1/partner/companies/{companyId}/services and POST /v1/partner/companies/{companyId}/documents. No other endpoint takes one.
> Every response is wrapped as {payload, error}. Read fields from payload and branch on error.code, never on the message.
> Drive formation progress from webhooks plus a reconciliation sweep, never a polling loop.
> Embedded SDK (@doola/js): the dk_ key stays on the server and mints customer sessions; the browser gets only a pk_ key and the session. onFormed carries only companyId and can fire more than once. Before charging, read the company with the dk_ key, require formationSubmissionStatus AWAITING_PAYMENT, check the owner's email, and price on the server. Then POST payment-confirmed, which answers 200 with an empty body, and replace the SDK element with a new doola.create() (never append a second one).
> The doola Formation MCP server at https://mcp.doola.com is for founders forming their own company with their own doola account. Platform partners integrate the Partner API or the Embedded SDK. The /mcp endpoint on this docs site only searches these docs.
> Affiliates refer founders to doola with a PartnerStack referral link and coupon code, or with two doola-branded iframe widgets: the Demo Booking Widget (app.doola.com/embed/book-demo?link=<referral link>) and the Company Formation Widget (app.doola.com/embed/partner/<partner ID>). The widgets need no API key and are not the Embedded SDK. Copy the snippets exactly as documented, never add a sandbox attribute to the formation widget iframe.
> For a full capability summary with the rules above, read https://docs.doola.com/skill.md.

# Company formation

> The formation flow, the statuses a company moves through, and where to read progress.

A formation is created in one request, then progresses asynchronously. You submit everything up front; doola validates it, files with the state, and obtains the EIN. You follow along with [webhooks](https://docs.doola.com/api/webhooks.md) and by reading the company.

## Formation flow

```mermaid theme={null}
sequenceDiagram
    participant P as Your backend
    participant D as doola API
    participant TP as ThirdParty (State, IRS)

    P->>D: Create company
    D-->>P: formationSubmissionStatus: PENDING<br/>Formation: InProgress<br/>EinCreation: NotStarted

    D->>D: doola processes formation submission
    D-->>P: webhook company_formation_submitted
    D-->>P: formationSubmissionStatus: SUBMITTED<br/>Formation: InProgress<br/>EinCreation: NotStarted

    TP-->>D: State confirms formation
    D-->>P: webhook company_formation_completed
    D-->>P: webhook document_aoo_uploaded
    D-->>P: formationSubmissionStatus: COMPLETED<br/>Formation: Completed<br/>EinCreation: InProgress

    TP-->>D: IRS issues EIN
    D-->>P: webhook company_ein_issued
    D-->>P: webhook document_einletter_uploaded
    D-->>P: formationSubmissionStatus: COMPLETED<br/>Formation: Completed<br/>EinCreation: Completed
```

> [!NOTE]
>
> The diagram shows the typical order, not a strict dependency. `company_ein_issued` and `document_einletter_uploaded` fire when the IRS issues the EIN, on the IRS's own timeline, so they are independent of the formation-completion webhooks (`company_formation_submitted` and `company_formation_completed`) and can arrive well after them.

> [!TIP]
>
> In sandbox you do not have to wait for the state or the IRS. The [Sandbox playground](https://docs.doola.com/api/sandbox-playground.md) completes each milestone on demand and fires the webhooks above through the normal delivery pipeline.

React to changes via [webhooks](https://docs.doola.com/api/webhooks.md). To display current progress, read each service's `status` on the company. The two signals this involves — submission status and the Formation service status — are explained under [Two things to track](#two-things-to-track) below.

## Entity types

Set `entityType` on the create-company request to choose what to form. It defaults to `LLC` when omitted.

| Entity type | Provide | Omit |
| - | - | - |
| `LLC` (default) | `members` (ownership must total 100) | `executiveMembers`, `ccorpValuation` |
| `CCorp` | `executiveMembers`, `ccorpValuation` | `members` |

For a `CCorp`, the executive team must include at least one **President**, **Secretary**, **Treasurer**, and **Director** — President, Secretary, and Treasurer may each appear only once, while Director may repeat. Each name option's suffix must also match the entity type: an LLC ending (`LLC`, `Limited Liability Company`, …) for an LLC, or a corporate ending (`Inc.`, `Corporation`, …) for a CCorp.

See [Domain objects](https://docs.doola.com/api/domain-objects.md) for the full field list of executive members and share structure.

## Addresses

Every create-company request carries exactly **two** address entries: one `mailing` and one `business`. For each entry you choose a `provider` that decides who supplies the address.

| `provider` | You send `address`? | What doola uses |
| - | - | - |
| `customer` | Yes, required | The address you provide |
| `registeredAgent` | No. Omit it (any address you send is not used) | doola's Registered Agent address for the company's state |

So you can supply your own address, hand the entry to doola's Registered Agent, or mix the two (for example, your own `mailing` address with a `registeredAgent` `business` address):

```json theme={null}
{
  "addresses": [
    { "provider": "customer",        "type": "mailing",  "address": { "line1": "251 W 30th St", "city": "New York", "state": "NY", "postalCode": "10001", "country": "USA" } },
    { "provider": "registeredAgent", "type": "business" }
  ]
}
```

> [!WARNING]
>
> **Indiana and Illinois** reject the registered agent's address as the business or mailing address. For a company in `IN` or `IL`, send both entries with `provider: customer` and the founder's own US address (any state). A request that uses `registeredAgent` there is accepted, but the formation is held behind a [Founder address needed](https://docs.doola.com/api/required-actions/founder-address.md) action until you send the address.

The two types are used differently:

* **`business`** is the company's business address on the state formation filing.
* **`mailing`** is where correspondence for the company is directed. The IRS EIN confirmation letter doesn't follow it: when the founder signs an SS-4, the SS-4 gives doola's Registered Agent address for the letter, and when doola applies online it retrieves the letter digitally. Either way the letter reaches you as `document_einletter_uploaded`.

Set an entry to `registeredAgent` and doola resolves its Registered Agent address for the company's `state` automatically, so routing `mailing` to the Registered Agent means correspondence lands with doola.

> [!NOTE]
>
> Choosing the Registered Agent for an address carries **no separate fee**. The only per-company charge is the state formation filing fee, which you can look up per state and entity type from the [state-fees reference endpoint](https://docs.doola.com/api/api-reference/reference-data/list-state-filing-fees.md).

### Address fields

Within any address, `line1`, `city`, `state`, `postalCode`, and `country` are required; `line2` is optional. `phone` differs by where the address is used:

* **Person addresses** (the `responsibleParty`, each `member`, each executive member): `phone` is **required**.
* **Company addresses** (the `mailing` and `business` entries): `phone` is **optional**.

A `registeredAgent` company entry omits the `address` object entirely, so none of these fields apply to it.

## Non-US founders

doola forms US companies for founders anywhere in the world. An **SS-4** signature is required when the responsible party supplies no SSN in a valid format. An ITIN does not waive signing, and neither does another member's or executive member's SSN; this is not a residency or issuance check. The create-company and retrieve-company responses tell you whether this applies through the `signatureRequirements` field, and the [SS-4 and Form 8821 signing](https://docs.doola.com/api/non-us-formation.md) guide covers the signing flow end to end. Everything else on this page applies unchanged.

## Expedited EIN

You can request prioritized EIN processing for a company whose responsible party has no valid SSN, including one with an ITIN, by ordering `{ "service": "EinCreation", "variant": "Expedite" }` in `services` on the create-company request. The [Expedited EIN](https://docs.doola.com/api/expedited-ein.md) guide covers availability, the request shape, and the errors. Everything else on this page applies unchanged.

## Choosing services

A company gets `Formation`, `RegisteredAgent` and `EinCreation` unless you send `services` to choose. `Formation` is always required and brings `RegisteredAgent` with it; the EIN is optional, and you can [add it later](https://docs.doola.com/api/add-services.md). Without an EIN, the founder signs no SS-4. See [Company services](https://docs.doola.com/api/company-services.md#choosing-services-at-creation).

Your customer's company already exists? [Import it](https://docs.doola.com/api/import-company.md) instead of forming it again.

## Two things to track

A formation has two signals: the submission status, which follows your request from intake until the state filing is recorded, and the per-service statuses, which also follow the EIN and the registered agent. Decide which question you are answering:

| You want to know | Read | Webhook |
| - | - | - |
| Did doola receive and accept my formation request? | `formationSubmissionStatus` on the company | `company_formation_submitted` |
| When did doola submit the filing to the state? | `formationSubmittedToStateAt` on the company | `company_formation_submitted_to_state` |
| Is the company actually formed with the state? | The **Formation** service in [Company services](https://docs.doola.com/api/company-services.md) | `company_formation_completed` |

> [!NOTE]
>
> Both signals settle together: when the state filing is recorded, `formationSubmissionStatus` becomes `COMPLETED`, the **Formation** service becomes `Completed`, and `company_formation_completed` fires. The submission status stops there, so read `services` for the EIN and the registered agent.

### Submission status

`formationSubmissionStatus` tracks how doola is handling your formation request, from intake until the state filing is recorded.

When you submit a formation, the company starts at `PENDING`. A company a founder submits through the [Embedded SDK](https://docs.doola.com/sdk/overview.md) starts at `AWAITING_PAYMENT` instead, and moves to `PENDING` when you [confirm payment](https://docs.doola.com/sdk/payments.md). Once doola confirms it has accepted and started processing the request, it sends the `company_formation_submitted` webhook and the field becomes `SUBMITTED`. When the state filing is recorded, the field becomes `COMPLETED`, at the same moment `company_formation_completed` fires. If the request cannot be accepted, the field becomes `FAILED` and `company_formation_failed` fires.

| Status | Meaning |
| - | - |
| `AWAITING_PAYMENT` | Submitted through the SDK and waiting on your payment confirmation. Nothing is filed and no cost is incurred yet |
| `PENDING` | Request received; doola is processing the submission |
| `SUBMITTED` | doola accepted the request and started the state filing. `formationSubmittedToStateAt` is set once the filing reaches the state |
| `COMPLETED` | The state filing is recorded. `formationFilingDate` is set |
| `FAILED` | Submission failed. Check the company's `adminNotes`, then contact doola |
| `CANCELLED` | doola withdrew an SDK formation at your request before its payment was confirmed. Nothing was filed |

> [!NOTE]
>
> **How do I know the submission succeeded?** Either signal confirms it:
>
> * you received the `company_formation_submitted` webhook, or
> * you fetched the company and `formationSubmissionStatus` is `SUBMITTED`.
>
> This happens asynchronously, so prefer the webhook. Do not sit in a polling loop waiting on the field.

> [!WARNING]
>
> If a company sits in `PENDING` for an extended period, read its `adminNotes` (returned on the get-company endpoint) or contact [engineering@doola.com](mailto:engineering@doola.com).

> [!NOTE]
>
> A formation can also stall because doola needs something from **you** — most often because the state rejected [every company name you submitted](https://docs.doola.com/api/required-actions/name-options.md). That arrives as a [required action](https://docs.doola.com/api/required-actions.md) with its own webhook, and the formation resumes once you answer it.

### Formation progress

To tell a customer their company is formed (filed and confirmed by the state), track the **Formation** service rather than the submission status. Each service appears in the company's `services` array, for example:

```json theme={null}
{ "name": "Formation", "status": "InProgress", "subStatus": "WaitingForRaToSucceed" }
```

The Formation service `status` moves from `InProgress` to `Completed`, and the `company_formation_completed` webhook fires when it does:

| status | subStatus | Meaning |
| - | - | - |
| `InProgress` | `WaitingForRaToSucceed` | Filing submitted to the state; pending completion |
| `Completed` | *(none)* | Articles of organization/incorporation filed |

[Company services](https://docs.doola.com/api/company-services.md#statuses) covers the full per-service lifecycle for Formation, EIN, and Registered Agent, including the sub-statuses that show what each service is waiting on.

## Reading progress

The get-company endpoint returns the live state of a formation, including:

* **`formationSubmissionStatus`** — the submission status above; see [Company services](https://docs.doola.com/api/company-services.md) for the full per-service lifecycle.
* **`formationSubmittedToStateAt`**: when doola submitted the formation filing to the state, as a UTC timestamp. `null` until submitted. The `company_formation_submitted_to_state` webhook fires when it is set. The state then reviews the filing; `formationFilingDate` is set once it approves.
* **`einApplicationSubmittedAt`**: when doola sent the EIN application (Form SS-4) to the IRS, as a UTC timestamp. It is set once the IRS has received the fax, so it stays `null` while the fax is still on its way or if it fails to go through. It also stays `null` when doola gets the EIN without faxing an SS-4, for example online for a founder with an SSN. If doola sends the application again, it holds the latest fax the IRS received. The `company_ein_application_submitted` webhook fires each time it is set.
* **`ein`** — the Employer Identification Number, populated once issued by the IRS. `null` until then. The `company_ein_issued` webhook fires when it is populated.
* **`formationFilingDate`**: the filing date the state recorded, set once the state approves the formation. `null` until then. It is not the date doola submitted the filing; that is `formationSubmittedToStateAt`.
* **`formationFilingNumber`** — the filing number the state assigned when the formation was filed. `null` until filed.
* **`adminNotes`** — notes from the doola operations team flagging anything on the company, such as a filing delay or IRS correspondence.
* **`signatureRequirements`** — when the responsible party supplies no SSN in a valid format, a pending SS-4 entry until the founder signs (plus a pending Form 8821 entry for expedited EIN). An ITIN does not waive signing. Otherwise the list is empty unless doola has [asked for a Form 8821](https://docs.doola.com/api/required-actions/form8821-required.md). See [SS-4 and Form 8821 signing](https://docs.doola.com/api/non-us-formation.md).

Prefer [webhooks](https://docs.doola.com/api/webhooks.md) over polling: subscribe to the formation and document events to react the moment something changes. When a delivery is missed, these same fields are how you catch up — see [Reconciliation](https://docs.doola.com/api/webhooks.md#reconciliation).

## Documents

When formation completes, documents become available and a `document_*` webhook fires for each. Call the document endpoints after receiving the event to list documents and fetch a short lived download URL. Document types are `ArticlesOfOrganization`, `EinLetter`, and `Mail`; `OperatingAgreement` for an LLC or `CorporateBylaws` for a CCorp; `SignedSS4` and `SignedForm8821` when those signatures are required; and `AnnualReportFiling` once an [annual report](https://docs.doola.com/api/compliance/annual-report-filing.md) is filed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.