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

# Crear empresa

> Registra un emisor en la cuenta. El RFC debe ser único por cuenta.



## OpenAPI

````yaml /openapi.json post /empresas
openapi: 3.1.0
info:
  title: Ipsofactura API
  description: API de timbrado CFDI 4.0 de Palenca.
  version: v1
servers:
  - url: https://api.ipsofactura.com
    description: Producción
  - url: https://sandbox.api.ipsofactura.com
    description: Sandbox (pruebas, sin validez fiscal)
security:
  - apiKeyAuth: []
tags:
  - name: CFDI
    description: Timbrado, complemento de pago, cancelación y descarga de CFDIs.
  - name: Empresas
    description: Alta y consulta de empresas emisoras.
  - name: Certificados
    description: Administración del Certificado de Sello Digital (CSD).
paths:
  /empresas:
    post:
      tags:
        - Empresas
      summary: Crear empresa
      description: Registra un emisor en la cuenta. El RFC debe ser único por cuenta.
      operationId: create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrearEmpresaRequest'
            example:
              rfc: EKU9003173C9
              nombre_fiscal: ESCUELA KEMPER URGATE
              regimen_fiscal: '601'
              codigo_postal: '06000'
              nombre_empresa: Escuela Kemper Urgate
        required: true
      responses:
        '201':
          description: Empresa creada
          content:
            '*/*':
              example:
                id: a1b2c3d4-...
                rfc: EKU9003173C9
                nombre_empresa: Escuela Kemper Urgate
                nombre_fiscal: ESCUELA KEMPER URGATE
                regimen_fiscal: '601'
                codigo_postal: '06000'
                es_activo: true
        '400':
          description: RFC, régimen o código postal inválidos
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EmpresaResponse'
        '409':
          description: Ya existe una empresa con ese RFC en la cuenta
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EmpresaResponse'
components:
  schemas:
    CrearEmpresaRequest:
      type: object
      properties:
        rfc:
          type: string
          minLength: 1
          pattern: ^[A-ZÑ&]{3,4}[0-9]{6}[A-Z0-9]{3}$
        nombre_fiscal:
          type: string
          minLength: 1
        regimen_fiscal:
          type: string
          minLength: 1
        codigo_postal:
          type: string
          minLength: 1
          pattern: ^[0-9]{5}$
        nombre_empresa:
          type: string
      required:
        - codigo_postal
        - nombre_fiscal
        - regimen_fiscal
        - rfc
    EmpresaResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        rfc:
          type: string
        nombre_empresa:
          type: string
        nombre_fiscal:
          type: string
        regimen_fiscal:
          type: string
        codigo_postal:
          type: string
        es_activo:
          type: boolean
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: API key emitida por Ipsofactura, enviada en el header x-api.
      name: x-api
      in: header

````