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

# Timbrar CFDI

> Genera, sella y timbra un CFDI 4.0 (ingreso o egreso) ante el SAT; devuelve el folio fiscal (UUID) y el Timbre Fiscal Digital.



## OpenAPI

````yaml /openapi.json post /cfdi/timbrar
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:
  /cfdi/timbrar:
    post:
      tags:
        - CFDI
      summary: Timbrar CFDI
      description: >-
        Genera, sella y timbra un CFDI 4.0 (ingreso o egreso) ante el SAT;
        devuelve el folio fiscal (UUID) y el Timbre Fiscal Digital.
      operationId: timbrar
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TimbrarRequest'
            examples:
              Ingreso PUE en MXN:
                description: Ingreso PUE en MXN
                value:
                  rfc_emisor: EKU9003173C9
                  tipo_comprobante: I
                  forma_pago: '03'
                  metodo_pago: PUE
                  moneda: MXN
                  subtotal: 1000
                  total: 1160
                  receptor:
                    rfc: URE180429TM6
                    nombre: UNIVERSIDAD ROBOTICA ESPANOLA
                    domicilio_fiscal: '65000'
                    regimen_fiscal: '601'
                    uso_cfdi: G03
                  conceptos:
                    - clave_prod_serv: '01010101'
                      cantidad: 1
                      clave_unidad: H87
                      descripcion: Servicio
                      valor_unitario: 1000
                      importe: 1000
                      objeto_imp: '02'
                      impuestos:
                        traslados:
                          - base: 1000
                            impuesto: '002'
                            tipo_factor: Tasa
                            tasa_o_cuota: '0.160000'
                            importe: 160
                  impuestos:
                    total_impuestos_trasladados: 160
                    traslados:
                      - base: 1000
                        impuesto: '002'
                        tipo_factor: Tasa
                        tasa_o_cuota: '0.160000'
                        importe: 160
        required: true
      responses:
        '201':
          description: CFDI timbrado
          content:
            '*/*':
              example:
                id: 9a4f07ff-3abc-435f-b7a6-88c2bc65b4c1
                uuid: 6128396f-c09b-4ec6-8699-43da5a244971
                folio: '1'
                fecha_timbrado: '2026-05-28T10:00:00'
                numero_certificado_sat: '00001000000500000000'
                sello_cfdi: ...
                sello_sat: ...
                cadena_original_sat: '||1.1|...||'
        '400':
          description: >-
            Error de validación (incluye códigos CFDIxxxxx del SAT en
            pacs[].message)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TimbrarResponse'
        '409':
          description: CFDI duplicado (misma serie + folio + RFC emisor)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TimbrarResponse'
        '503':
          description: Servicio de timbrado no disponible
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TimbrarResponse'
components:
  schemas:
    TimbrarRequest:
      type: object
      properties:
        serie:
          type: string
        folio:
          type: string
        fecha:
          type: string
          pattern: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})?
        exportacion:
          type: string
        subtotal:
          type: number
        descuento:
          type: number
        moneda:
          type: string
        total:
          type: number
        emisor:
          $ref: '#/components/schemas/EmisorDTO'
        receptor:
          $ref: '#/components/schemas/ReceptorDTO'
        conceptos:
          type: array
          items:
            $ref: '#/components/schemas/ConceptoDTO'
          minItems: 1
        impuestos:
          $ref: '#/components/schemas/ImpuestosGlobalesDTO'
        rfc_emisor:
          type: string
          minLength: 1
          pattern: >-
            [A-Z&Ñ]{3,4}[0-9]{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])[A-Z0-9]{2}[0-9A]
        lugar_expedicion:
          type: string
        tipo_comprobante:
          type: string
          minLength: 1
          pattern: '[IETPN]'
        forma_pago:
          type: string
        metodo_pago:
          type: string
        condiciones_pago:
          type: string
        tipo_cambio:
          type: number
        informacion_global:
          $ref: '#/components/schemas/InformacionGlobalDTO'
      required:
        - conceptos
        - receptor
        - rfc_emisor
        - subtotal
        - tipo_comprobante
        - total
    TimbrarResponse:
      type: object
      properties:
        id:
          type: string
        uuid:
          type: string
        serie:
          type: string
        folio:
          type: string
        sandbox:
          type: boolean
        fecha_timbrado:
          type: string
        numero_certificado_sat:
          type: string
        sello_cfdi:
          type: string
        sello_sat:
          type: string
        cadena_original_sat:
          type: string
    EmisorDTO:
      type: object
      properties:
        nombre:
          type: string
        regimen_fiscal:
          type: string
    ReceptorDTO:
      type: object
      properties:
        rfc:
          type: string
          minLength: 1
        nombre:
          type: string
        domicilio_fiscal:
          type: string
        regimen_fiscal:
          type: string
        uso_cfdi:
          type: string
      required:
        - rfc
    ConceptoDTO:
      type: object
      properties:
        cantidad:
          type: number
        unidad:
          type: string
        descripcion:
          type: string
          minLength: 1
        importe:
          type: number
        descuento:
          type: number
        impuestos:
          $ref: '#/components/schemas/ImpuestosConceptoDTO'
        clave_prod_serv:
          type: string
          minLength: 1
        numero_identificacion:
          type: string
        clave_unidad:
          type: string
          minLength: 1
        valor_unitario:
          type: number
        objeto_imp:
          type: string
      required:
        - cantidad
        - clave_prod_serv
        - clave_unidad
        - descripcion
        - valor_unitario
    ImpuestosGlobalesDTO:
      type: object
      properties:
        traslados:
          type: array
          items:
            $ref: '#/components/schemas/TrasladoDTO'
        retenciones:
          type: array
          items:
            $ref: '#/components/schemas/RetencionDTO'
        total_impuestos_retenidos:
          type: number
        total_impuestos_trasladados:
          type: number
    InformacionGlobalDTO:
      type: object
      properties:
        periodicidad:
          type: string
          minLength: 1
        meses:
          type: string
          minLength: 1
        año:
          type: integer
          format: int32
      required:
        - año
        - meses
        - periodicidad
    ImpuestosConceptoDTO:
      type: object
      properties:
        traslados:
          type: array
          items:
            $ref: '#/components/schemas/TrasladoDTO'
        retenciones:
          type: array
          items:
            $ref: '#/components/schemas/RetencionDTO'
    TrasladoDTO:
      type: object
      properties:
        base:
          type: number
        impuesto:
          type: string
        importe:
          type: number
        tipo_factor:
          type: string
        tasa_o_cuota:
          type: string
    RetencionDTO:
      type: object
      properties:
        base:
          type: number
        impuesto:
          type: string
        importe:
          type: number
        tipo_factor:
          type: string
        tasa_o_cuota:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: API key emitida por Ipsofactura, enviada en el header x-api.
      name: x-api
      in: header

````