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

# Incorporation API

> Create affiliate-scoped companies and incorporation services, then track the resulting payment-intent and document flow.

## Overview

This API surface is authenticated with an affiliate `x-api-key` and scoped to the companies your affiliate firm can access.

Base URL:

```text theme={null}
https://api.prod.commenda.io/api/v1/public
```

## Authentication

Pass your affiliate API key in the `x-api-key` header on every request.

```bash theme={null}
curl --request GET \
  --url 'https://api.prod.commenda.io/api/v1/public/payment-intents' \
  --header 'x-api-key: <affiliate_api_key>'
```

## Current Flow

1. Create a company with `POST /public/company`.
2. Start an incorporation service with `POST /public/services`.
3. Poll payment intent and service status with the payment-intent endpoints.
4. Use the Commenda OS documents endpoints for document retrieval.
5. Download a concrete file with `GET /public/file/{fileId}`.

## Contract notes

* Access is resolved through affiliate-firm ownership, not end-user login.
* `POST /public/services` only accepts [supported incorporation service types](/engine/incorporation/services-POST). Unsupported types return `400 Bad Request`.
* `POST /public/services` returns a `paymentIntentId`, which is the current public anchor for the flow.
* Filtering payment intents by `companyId` enforces affiliate ownership — requests for companies outside your affiliate return `403 Forbidden`.
* `GET /public/documents` is deprecated. Callers should use the Commenda OS documents endpoints instead.

## Partner Incorporation API

New partner integrations that need an incorporation resource lifecycle can use the [Partner Incorporation API](/engine/incorporation/partner-incorporation-introduction).

That surface is scoped under `/partner/incorporation`, creates incorporations directly under a company, and does not create or return payment intents.

## Commenda OS Partner API

A separate Commenda OS Partner API is available under the `/partner/commenda-os` base URL.

* See [Commenda OS Partner API](/engine/commendaos/partner-api/commenda-os-introduction) for business-entity, persons, documents, and registrations endpoints.
* Use [List documents](/engine/commendaos/partner-api/commenda-os-business-entities-id-documents-GET) and [List supported document types](/engine/commendaos/partner-api/commenda-os-business-entities-id-documents-supported-GET) instead of the deprecated `GET /public/documents` route.
