> ## 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.

# Create an incorporation service

> Start a supported incorporation service for an affiliate-owned company and return the linked payment intent id.

Creates a supported incorporation service for an affiliate-owned company and returns the `paymentIntentId` used by the current public handoff flow.

## Supported service types

Only the following `serviceType` values are accepted:

| Service type                  | Description                 |
| ----------------------------- | --------------------------- |
| `US_CCORP_INCORPORATION`      | United States C-Corporation |
| `US_LLC_INCORPORATION`        | United States LLC           |
| `CA_CORP_INCORPORATION`       | Canada Corporation          |
| `INDIA_PVT_LTD_INCORPORATION` | India Private Limited       |
| `INDIA_LLP_INCORPORATION`     | India LLP                   |
| `UAE_INCORPORATION`           | United Arab Emirates        |
| `UK_INCORPORATION`            | United Kingdom              |
| `IE_INCORPORATION`            | Ireland                     |
| `SG_INCORPORATION`            | Singapore                   |

Requests with an unsupported `serviceType` return `400 Bad Request` with a message listing the valid options.

```json Example error response theme={null}
{
  "statusCode": 400,
  "message": [
    "serviceType must be one of the supported legacy affiliate API services: US_CCORP_INCORPORATION, US_LLC_INCORPORATION, CA_CORP_INCORPORATION, INDIA_PVT_LTD_INCORPORATION, INDIA_LLP_INCORPORATION, UAE_INCORPORATION, UK_INCORPORATION, IE_INCORPORATION, SG_INCORPORATION"
  ],
  "error": "Bad Request"
}
```


## OpenAPI

````yaml POST /public/services
openapi: 3.0.1
info:
  title: Commenda Public APIs
  description: >-
    APIs for Commenda entity management, partner incorporation, indirect tax,
    compliance, and corporate operations.
  license:
    name: NONE
    url: NONE
  version: 1.0.0
servers:
  - url: https://api.prod.commenda.io/api/v1
    description: Commenda platform APIs, including Partner Incorporation and Commenda OS.
  - url: https://transaction-tax.api.in.commenda.io/api/v1
    description: Global Indirect Tax API.
security:
  - bearerAuth: []
paths:
  /public/services:
    post:
      summary: Create an incorporation service for a company
      description: >-
        Start a supported incorporation service for an affiliate-owned company
        and return the linked payment intent id.
      operationId: createAffiliateService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AffiliateCreateServiceRequest'
      responses:
        '201':
          description: Service and payment intent created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateCreateServiceResponse'
        '400':
          description: Unsupported service type or company not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliatePublicError'
        '401':
          description: Missing or invalid affiliate API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliatePublicError'
        '403':
          description: Company is not accessible to the affiliate
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliatePublicError'
      security:
        - xApiKeyAuth: []
      servers:
        - url: https://api.prod.commenda.io/api/v1
components:
  schemas:
    AffiliateCreateServiceRequest:
      type: object
      required:
        - companyId
        - serviceType
      properties:
        companyId:
          type: integer
          description: Company that the new incorporation service should be attached to.
          example: 77
        serviceType:
          $ref: '#/components/schemas/AffiliateServiceCatalog'
    AffiliateCreateServiceResponse:
      type: object
      required:
        - paymentIntentId
      properties:
        paymentIntentId:
          type: string
          description: >-
            Identifier for the newly created payment intent that anchors the
            current public flow.
          example: pi_123
    AffiliatePublicError:
      type: object
      required:
        - statusCode
        - message
        - error
      properties:
        statusCode:
          type: integer
          example: 403
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Company does not belong to this affiliate firm
        error:
          type: string
          example: Forbidden
    AffiliateServiceCatalog:
      type: string
      description: >-
        Incorporation service types currently supported by the legacy affiliate
        API.
      enum:
        - US_CCORP_INCORPORATION
        - US_LLC_INCORPORATION
        - CA_CORP_INCORPORATION
        - INDIA_PVT_LTD_INCORPORATION
        - INDIA_LLP_INCORPORATION
        - UAE_INCORPORATION
        - UK_INCORPORATION
        - IE_INCORPORATION
        - SG_INCORPORATION
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    xApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````