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

# Cria uma ou mais empresas de energia

<Note>
  **🚀 API v2 (Recomendada)** - Este endpoint está disponível apenas na v2
</Note>


## OpenAPI

````yaml /openapi/openapi-v2.json POST /company
openapi: 3.0.0
info:
  title: Documentação de API
  version: '2.0'
servers:
  - url: https://backend-pied-prod.piedadmin.com.br/api/v2
security:
  - bearerAuth: []
tags:
  - name: Request
    description: Tudo sobre orçamentos ou pedidos
  - name: Equipment
    description: Tudo sobre equipamentos
  - name: Company
    description: Tudo sobre empresas de energia
  - name: Custom Field
    description: Tudo sobre campos customizados
  - name: Payments
    description: Tudo sobre pagamentos
paths:
  /company:
    post:
      tags:
        - Company
      summary: Cria uma ou mais empresas de energia
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/batchCreateCompanies'
      responses:
        '200':
          description: OK
          content:
            form-data:
              schema:
                $ref: '#/components/schemas/success'
        '400':
          description: Parametros inválidos.
        '401':
          description: Esta funcionalidade está indisponível no momento
        '404':
          description: Não encontrado
        '429':
          $ref: '#/components/schemas/429'
        '500':
          $ref: '#/components/schemas/500'
      security:
        - bearerAuth: []
components:
  schemas:
    '429':
      description: >-
        hardLimit: O limite de requisições por hora foi ultrapassado. Tente
        novamente mais tarde / timeLimit: O limite de 1 minuto de processamento
        de requisição por hora foi atingido. Tente novamente mais tarde
    '500':
      description: Erro na API
    batchCreateCompanies:
      type: object
      properties:
        create:
          type: array
          items:
            $ref: '#/components/schemas/createCompany'
    success:
      type: object
      properties:
        data:
          type: object
          properties:
            success:
              type: boolean
              example: true
        error:
          type: string
          example: null
    createCompany:
      type: object
      properties:
        name:
          type: string
          example: Jon
        surname:
          type: string
          example: Doe
        email:
          type: string
          example: jondoe@email.com
        password:
          type: string
          example: '12345689'
        CPF:
          type: string
          example: 000.000.000-00
          description: >-
            Obrigatório se for pessoa física, se enviado juntamente com o CNPJ,
            será ignorado.
        CNPJ:
          type: string
          example: 00.000.000/0000-00
          description: >-
            Obrigatório se for pessoa jurídica, se enviado juntamente com o CPF,
            o CPF será ignorado.
        address:
          type: object
          properties:
            CEP:
              type: string
              example: 00000-000
            state:
              type: string
              example: SP
              description: UF
            city:
              type: string
              example: São Paulo
            patio:
              type: string
              example: Av. Brasil
            number:
              type: string
              example: '10'
            neighborhood:
              type: string
              example: Centro
            complement:
              type: string
              example: Apt 101
          required:
            - CEP
            - state
            - city
        addressFormatted:
          allOf:
            - $ref: '#/components/schemas/address'
            - type: object
              properties:
                patioFormatted:
                  type: string
                  example: Logradouro
                patioType:
                  type: string
                  example: Tipo do Logradouro
        cellphone:
          type: string
          example: (00) 00000-0000
        responsible:
          type: string
          example: responsible@email.com
          description: >-
            E-mail do responsável, se o usuário não for encontrado, será
            ignorado.
        hasStateInscription:
          type: string
          enum:
            - sim
            - nao
            - isento
          example: sim
        stateInscription:
          type: string
          example: '000000000'
          description: >-
            Este campo é obrigatório caso o campo 'temInscricaoEstadual' seja
            igual a 'sim'.
      required:
        - name
        - email
        - password
        - CPF
        - CNPJ
    address:
      type: object
      properties:
        CEP:
          type: string
          example: 00000-000
        state:
          type: string
          example: SC
        city:
          type: string
          example: Nome da Cidade
        neighborhood:
          type: string
          example: Nome do Bairro
        patio:
          type: string
          example: Nome da Rua
        number:
          type: string
          example: '1000'
        complement:
          type: string
          example: Bloco X, Casa Y
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````