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

# Emitir Boleta o DTE al SII

> Emite un Documento Tributario Electrónico (Boleta 39/41, Factura 33/34, Guía 52, Nota de Débito 56 o Nota de Crédito 61) mediante Facturación de Mercado de IA ERP. Exige Idempotency-Key para garantizar cero doble emisión.



## OpenAPI

````yaml /openapi.json post /v1/dte
openapi: 3.1.0
info:
  contact:
    email: cloud@ia-erp.cl
    name: IA ERP
    url: https://ia-erp.cl
  description: >-
    API REST de Facturación Electrónica de Mercado ante el SII de Chile (Boletas
    39/41, Facturas 33/34, Guías 52, Notas de Crédito/Débito 61/56). Incluye
    idempotencia estricta (Idempotency-Key), sandbox sin tocar SII (sk_test_),
    consulta de contribuyentes y folios CAF.
  title: IA ERP — API Pública de DTE (Chile)
  version: 1.0.0
servers:
  - description: Producción y Sandbox (diferenciados por prefijo sk_live_ / sk_test_)
    url: https://dte.ia-erp.cl
security: []
paths:
  /v1/dte:
    post:
      tags:
        - DTE
      summary: Emitir Boleta o DTE al SII
      description: >-
        Emite un Documento Tributario Electrónico (Boleta 39/41, Factura 33/34,
        Guía 52, Nota de Débito 56 o Nota de Crédito 61) mediante Facturación de
        Mercado de IA ERP. Exige Idempotency-Key para garantizar cero doble
        emisión.
      operationId: emitir-dte
      parameters:
        - description: Clave única por orden/operación para evitar doble emisión.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            description: Clave única por orden/operación para evitar doble emisión.
            maxLength: 128
            minLength: 8
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmitirDTEBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentoRespuesta'
          description: Created
          headers:
            Idempotent-Replayed:
              schema:
                type: string
            X-Quota-Limit:
              schema:
                type: string
            X-Quota-Remaining:
              schema:
                type: string
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - bearerAuth: []
components:
  schemas:
    EmitirDTEBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://dte.ia-erp.cl/schemas/EmitirDTEBody.json
          format: uri
          readOnly: true
          type: string
        despacho:
          description: Monto de despacho en CLP a sumar como línea adicional (opcional).
          format: int64
          maximum: 1000000000
          minimum: 0
          type: integer
        forma_pago:
          default: 1
          description: 1=Contado (defecto), 2=Crédito, 3=Sin costo.
          format: int64
          maximum: 3
          minimum: 1
          type: integer
        items:
          description: Ítems del documento (1 a 60 líneas).
          items:
            $ref: '#/components/schemas/ItemInput'
          maxItems: 60
          minItems: 1
          type:
            - array
            - 'null'
        observaciones:
          description: Observación opcional en el DTE.
          maxLength: 100
          type: string
        perfil_emision_id:
          description: ID de perfil de giro/logo (opcional).
          maxLength: 50
          type: string
        precios_incluyen_iva:
          default: true
          description: >-
            Si true (defecto), los precios unitarios ya incluyen IVA 19%. Usa
            false para precios netos (Factura 33 B2B).
          type: boolean
        receptor:
          $ref: '#/components/schemas/ReceptorInput'
          description: Datos del receptor. Opcional en Boleta 39/41.
        referencia_externa:
          description: ID de orden o pedido en tu ecommerce (ej. ORD-2026-00481).
          maxLength: 120
          type: string
        referencias:
          description: Referencias tributarias (obligatorias en NC 61 y ND 56).
          items:
            $ref: '#/components/schemas/ReferenciaInput'
          type:
            - array
            - 'null'
        tipo_dte:
          description: >-
            Tipo de DTE SII: 39 (Boleta), 41 (Boleta Exenta), 33 (Factura), 34
            (Factura Exenta), 52 (Guía), 56 (Nota de Débito), 61 (Nota de
            Crédito).
          format: int64
          type: integer
      required:
        - tipo_dte
        - items
      type: object
    DocumentoRespuesta:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://dte.ia-erp.cl/schemas/DocumentoRespuesta.json
          format: uri
          readOnly: true
          type: string
        creado_en:
          format: date-time
          type: string
        estado_sii:
          type: string
        fecha_emision:
          type: string
        folio:
          format: int64
          type: integer
        id:
          type: string
        modo:
          description: live (SII real) o test (sandbox).
          type: string
        monto_exento:
          format: int64
          type: integer
        monto_iva:
          format: int64
          type: integer
        monto_neto:
          format: int64
          type: integer
        monto_total:
          format: int64
          type: integer
        pdf_url:
          type: string
        receptor_nombre:
          type: string
        receptor_rut:
          type: string
        referencia_externa:
          type: string
        rut_emisor:
          type: string
        tipo_dte:
          format: int64
          type: integer
        track_id:
          type: string
        xml_url:
          type: string
      required:
        - id
        - modo
        - rut_emisor
        - tipo_dte
        - folio
        - fecha_emision
        - monto_neto
        - monto_iva
        - monto_exento
        - monto_total
        - estado_sii
        - pdf_url
        - xml_url
        - creado_en
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://dte.ia-erp.cl/schemas/ErrorModel.json
          format: uri
          readOnly: true
          type: string
        code:
          description: Código de error estable de IA ERP.
          examples:
            - rut_invalido
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - receptor.rut es obligatorio y debe ser un RUT chileno válido
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: Identificador único de la solicitud (coincide con X-Request-ID).
          examples:
            - urn:uuid:75acf40d-e49d-4267-9199-fdb9a0f98264
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Datos del DTE inválidos
          type: string
        type:
          default: about:blank
          description: URI estable del tipo de problema RFC 9457.
          examples:
            - urn:ia-erp:api:rut_invalido
          format: uri
          type: string
      type: object
    ItemInput:
      additionalProperties: false
      properties:
        cantidad:
          description: Cantidad entera positiva.
          format: int64
          maximum: 1000000
          minimum: 1
          type: integer
        nombre:
          description: Descripción del producto o servicio.
          maxLength: 80
          minLength: 1
          type: string
        precio_unitario:
          description: Precio unitario en CLP.
          format: int64
          maximum: 10000000000
          minimum: 1
          type: integer
        sku:
          description: Código SKU interno (opcional).
          maxLength: 80
          type: string
      required:
        - nombre
        - cantidad
        - precio_unitario
      type: object
    ReceptorInput:
      additionalProperties: false
      properties:
        ciudad:
          description: Ciudad del receptor (opcional).
          maxLength: 20
          type: string
        comuna:
          description: >-
            Comuna del receptor (máx. 20 chars SII). Obligatorio en Factura
            33/34.
          maxLength: 20
          type: string
        direccion:
          description: >-
            Dirección tributaria del receptor (máx. 70 chars SII). Obligatorio
            en Factura 33/34.
          maxLength: 70
          type: string
        email:
          description: Correo del comprador (opcional).
          maxLength: 80
          type: string
        giro:
          description: Giro del receptor (máx. 40 chars SII). Obligatorio en Factura 33/34.
          maxLength: 40
          type: string
        razon_social:
          description: Razón social o nombre del comprador. Obligatorio en Factura 33/34.
          maxLength: 100
          type: string
        rut:
          description: >-
            RUT chileno del receptor. Opcional en Boleta 39/41 (por omisión
            66666666-6).
          maxLength: 16
          type: string
      type: object
    ReferenciaInput:
      additionalProperties: false
      properties:
        codigo_ref:
          description: 1=Anula documento, 2=Corrige texto, 3=Corrige montos.
          format: int64
          maximum: 3
          minimum: 1
          type: integer
        fecha_ref:
          description: Fecha del documento de origen (YYYY-MM-DD).
          maxLength: 10
          minLength: 10
          type: string
        folio_ref:
          description: Folio numérico del documento de origen.
          maxLength: 18
          minLength: 1
          type: string
        razon_ref:
          description: Motivo de la referencia.
          maxLength: 90
          minLength: 1
          type: string
        tipo_documento_ref:
          description: Tipo DTE de origen (ej. 33 o 39).
          maxLength: 4
          minLength: 2
          type: string
      required:
        - tipo_documento_ref
        - folio_ref
        - fecha_ref
        - razon_ref
        - codigo_ref
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key (sk_live_... o sk_test_...)
      description: >-
        Llave de API por empresa emitida desde IA ERP (rol owner). Prefijo
        sk_live_ emite al SII; sk_test_ ejecuta en sandbox.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.