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

# Criar Empresa

> Cria uma nova empresa sob o tenant atual autenticado.

Permite que um usuário autenticado crie uma "Company", que representa uma entidade fiscal ou filial, dentro de seu lojista (tenant).

### Body

<ParamField body="name" type="string" required>
  Razão Social ou Nome Fantasia da empresa. (ex: Acme Corp)
</ParamField>

<ParamField body="document" type="string" required>
  CNPJ ou CPF (somente números). Deve ser único globalmente.
</ParamField>

<ParamField body="email" type="string">
  Email de contato da empresa.
</ParamField>

<ParamField body="address" type="object">
  Endereço completo estruturado. (ex: rua, número, cidade, estado, cep)
</ParamField>

<ParamField body="settings" type="object">
  Configurações iniciais extras estruturadas em JSON.
</ParamField>

### Response

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
    "tenantId": "e305e9a4-585e-49b8-bc88-9fba992c6326",
    "name": "Acme Corp",
    "document": "12345678000199",
    "status": "ACTIVE",
    "email": "contact@acme.com",
    "address": null,
    "settings": {},
    "taxRegime": "SIMPLES_NACIONAL",
    "costMethod": "WEIGHTED_AVERAGE",
    "createdAt": "2024-01-01T12:00:00.000Z",
    "updatedAt": "2024-01-01T12:00:00.000Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /companies
openapi: 3.0.0
info:
  title: Hub Marketplace API
  description: API for managing marketplace listings and keys
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: listings
    description: ''
paths:
  /companies:
    post:
      tags:
        - Companies
      summary: Create a new company
      operationId: CompaniesController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompanyDto'
      responses:
        '201':
          description: Company created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          description: Invalid input or document validation failed.
      security:
        - bearer: []
components:
  schemas:
    CreateCompanyDto:
      type: object
      properties:
        name:
          type: string
          description: Company Name
          example: Acme Corp
        document:
          type: string
          description: CNPJ or CPF
          example: '12345678000199'
        email:
          type: string
          description: Contact Email
          example: contact@acme.com
        address:
          type: object
          description: Address Structure
        settings:
          type: object
          description: Initial Settings
      required:
        - name
        - document
    Company:
      type: object
      properties:
        name:
          type: string
          description: Company Name
          example: Acme Corp
        document:
          type: string
          description: CNPJ or CPF
          example: '12345678000199'
        status:
          type: string
          enum:
            - ACTIVE
            - DISABLED
            - BLOCKED
            - SUSPENDED
          example: ACTIVE
          description: Company Status
        email:
          type: string
          description: Contact Email
          example: contact@acme.com
        address:
          type: object
          description: Address Object
        settings:
          type: object
          description: Configuration Settings
          example: {}
        taxRegime:
          type: string
          enum:
            - SIMPLES_NACIONAL
            - LUCRO_PRESUMIDO
            - LUCRO_REAL
          example: SIMPLES_NACIONAL
          description: Tax Regime
        costMethod:
          type: string
          enum:
            - REPLACEMENT
            - WEIGHTED_AVERAGE
          example: WEIGHTED_AVERAGE
          description: Cost Method
      required:
        - name
        - document
        - status
        - settings
        - taxRegime
        - costMethod

````