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

# Update corporation

> Update an existing corporation

Updates the details of an existing corporation. Only the fields provided in the request will be updated.

<ParamField path="id" type="string" required>
  Unique identifier of the corporation to update.
</ParamField>

<ParamField body="legal_name" type="string">
  Legal name of the entity, including the type suffix (e.g., "Inc.", "LLC").
</ParamField>

<ParamField body="jurisdiction" type="string">
  Jurisdiction where the corporation is registered (e.g., "US", "CA").
</ParamField>

<ParamField body="email_alias" type="string">
  Custom email alias for the corporation.
</ParamField>

<ResponseField name="id" type="string" required>
  Unique identifier for the corporation.
</ResponseField>

<ResponseField name="legal_name" type="string" required>
  Legal name of the entity, including the type suffix.
</ResponseField>

<ResponseField name="created_at" type="integer" required>
  Unix timestamp of when the corporation was created.
</ResponseField>

<ResponseField name="jurisdiction" type="string" required>
  Jurisdiction of the corporation.
</ResponseField>

<ResponseField name="email_alias" type="string">
  Email alias for the corporation.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://transaction-tax.api.in.commenda.io/api/v1/corporations/corp_123abc' \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "legal_name": "Acme Corporation LLC",
      "jurisdiction": "US"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://transaction-tax.api.in.commenda.io/api/v1/corporations/corp_123abc', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer <token>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      legal_name: 'Acme Corporation LLC',
      jurisdiction: 'US'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
    'https://transaction-tax.api.in.commenda.io/api/v1/corporations/corp_123abc',
    headers={'Authorization': 'Bearer <token>'},
    json={
      'legal_name': 'Acme Corporation LLC',
      'jurisdiction': 'US'
    }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "Corporation updated successfully.",
    "data": {
      "id": "corp_123abc",
      "legal_name": "Acme Corporation LLC",
      "created_at": 1704067200,
      "jurisdiction": "US",
      "email_alias": "acme@filings.commenda.io"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "CORPORATION_NOT_FOUND",
      "message": "Corporation with the specified ID was not found"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid request body",
      "details": [
        {
          "field": "jurisdiction",
          "message": "Invalid jurisdiction code"
        }
      ]
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /corporations/{id}
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:
  /corporations/{id}:
    post:
      summary: Update a corporation.
      description: Update details for a corporation.
      operationId: updateCorporation
      parameters:
        - in: path
          required: true
          name: id
          schema:
            type: string
          description: The unique identifier of the corporation to update.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCorporation'
      responses:
        '200':
          description: Update one corporation response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Successfully updated corporation.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateCorporation:
      type: object
      description: Request body for updating a corporation.
      properties:
        legal_name:
          type: string
          description: The legal name of the corporation.
          example: Acme Corporation
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: 'Specific Error type. Example: CLIENT_INVALID_REQUEST_BODY.'
              example: CLIENT_INVALID_REQUEST_BODY
            doc_url:
              type: string
              description: >-
                A link to the docs with details about this error. Example:
                https://sales-tax-docs.commenda.io/
              example: https://sales-tax-docs.commenda.io/
            title:
              type: string
              description: >-
                A short title describing the error. Example: Missing query
                parameters.
              example: Failed to validate the request body
            detail:
              type: string
              description: >-
                A json string with a description on how to fix the error.
                Example {"description":"Please pass in a valid corporation_id"}
            status:
              type: number
              description: >-
                The status code. It should be the same as the HTTP protocol
                status code. Example: 200
              example: 400
            instance:
              type: string
              description: >-
                The relative path that was hit by the user. Example:
                /api/v1/corporations/1
            Errors:
              type: array
              items:
                type: object
                properties:
                  details:
                    type: string
                    description: More details on how to solve this particular error.
                  pointer:
                    type: string
                    description: >-
                      Relative reference to missing or invalid piece of passed
                      information.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````