{
    "openapi": "3.0.3",
    "info": {
        "title": "API de facturación CFDI Fácil",
        "version": "1.0.0",
        "description": "CFDI 4.0. El servidor calcula importes, impuestos y totales. Llave cfk_test_… = pruebas; cfk_live_… = producción."
    },
    "servers": [
        {
            "url": "https://facturacion.cfdifacil.mx/api/v1"
        }
    ],
    "security": [
        {
            "llave": []
        }
    ],
    "paths": {
        "/cuenta": {
            "get": {
                "operationId": "Cuenta",
                "summary": "Probar la llave: ambiente, RFC y timbres",
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/facturas": {
            "post": {
                "operationId": "Emitir",
                "summary": "Emitir (timbrar) una factura",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Factura"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Factura",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RespuestaFactura"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Factura",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RespuestaFactura"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "Listar",
                "summary": "Listar facturas",
                "parameters": [
                    {
                        "name": "desde",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "hasta",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "rfc",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "estado",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "vigente",
                                "cancelada",
                                "cancelacion_en_proceso",
                                "no_cancelable"
                            ]
                        }
                    },
                    {
                        "name": "pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "por_pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/facturas/{uuid}": {
            "get": {
                "operationId": "Consultar",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Factura",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RespuestaFactura"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/facturas/{uuid}/xml": {
            "get": {
                "operationId": "DescargarXml",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "XML",
                        "content": {
                            "application/xml": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/facturas/{uuid}/pdf": {
            "get": {
                "operationId": "DescargarPdf",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF",
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/facturas/{uuid}/cancelar": {
            "post": {
                "operationId": "Cancelar",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "motivo"
                                ],
                                "properties": {
                                    "motivo": {
                                        "type": "string",
                                        "enum": [
                                            "01",
                                            "02",
                                            "03",
                                            "04"
                                        ]
                                    },
                                    "uuidSustitucion": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "409": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/facturas/{uuid}/enviar": {
            "post": {
                "operationId": "Enviar",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "correos"
                                ],
                                "properties": {
                                    "correos": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "400": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pagos": {
            "post": {
                "operationId": "EmitirPago",
                "summary": "Emitir (timbrar) un complemento de pago",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Pago"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Complemento timbrado"
                    },
                    "200": {
                        "description": "Referencia repetida: el mismo complemento"
                    },
                    "400": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "ListarPagos",
                "summary": "Listar complementos de pago",
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pagos/{uuid}": {
            "get": {
                "operationId": "ConsultarPago",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pagos/{uuid}/xml": {
            "get": {
                "operationId": "DescargarXmlPago",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "XML",
                        "content": {
                            "application/xml": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pagos/{uuid}/pdf": {
            "get": {
                "operationId": "DescargarPdfPago",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF",
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pagos/{uuid}/cancelar": {
            "post": {
                "operationId": "CancelarPago",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "motivo"
                                ],
                                "properties": {
                                    "motivo": {
                                        "type": "string",
                                        "enum": [
                                            "01",
                                            "02",
                                            "03"
                                        ]
                                    },
                                    "uuidSustitucion": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "409": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pagos/{uuid}/enviar": {
            "post": {
                "operationId": "EnviarPago",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "correos"
                                ],
                                "properties": {
                                    "correos": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "400": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tickets": {
            "post": {
                "operationId": "RegistrarTicket",
                "summary": "Autofactura: registrar una venta y recibir la liga para el QR del ticket",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Ticket"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Ticket registrado"
                    },
                    "200": {
                        "description": "Referencia repetida: el mismo ticket"
                    },
                    "400": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "ListarTickets",
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/tickets/global": {
            "post": {
                "operationId": "FacturaGlobalTickets",
                "summary": "Factura global (PUBLICO EN GENERAL) con los tickets no facturados del periodo",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "periodicidad": {
                                        "type": "string",
                                        "enum": [
                                            "01",
                                            "02",
                                            "03",
                                            "04",
                                            "05"
                                        ]
                                    },
                                    "mes": {
                                        "type": "integer"
                                    },
                                    "anio": {
                                        "type": "integer"
                                    },
                                    "desde": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "hasta": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "serie": {
                                        "type": "string"
                                    },
                                    "referencia": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Factura global timbrada"
                    },
                    "200": {
                        "description": "Referencia repetida: la misma"
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tickets/{codigo}": {
            "get": {
                "operationId": "ConsultarTicket",
                "parameters": [
                    {
                        "name": "codigo",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "404": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/tickets/{codigo}/cancelar": {
            "post": {
                "operationId": "CancelarTicket",
                "parameters": [
                    {
                        "name": "codigo",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "409": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/timbrar": {
            "post": {
                "operationId": "TimbrarXml",
                "summary": "Timbrar un XML CFDI 4.0 propio (I o E, sin sellar); se sella con el certificado de la cuenta",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "xml": {
                                        "type": "string"
                                    },
                                    "xmlBase64": {
                                        "type": "string"
                                    },
                                    "referencia": {
                                        "type": "string"
                                    }
                                }
                            }
                        },
                        "application/xml": {
                            "schema": {
                                "type": "string"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Factura",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RespuestaFactura"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Factura",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RespuestaFactura"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error (ver «error», «error_code» y «campo»)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "llave": {
                "type": "http",
                "scheme": "bearer",
                "description": "Authorization: Bearer cfk_test_… o cfk_live_…"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": "string"
                    },
                    "error_code": {
                        "type": "string"
                    },
                    "campo": {
                        "type": "string"
                    },
                    "http_status": {
                        "type": "integer"
                    },
                    "ambiente": {
                        "type": "string"
                    }
                }
            },
            "Impuesto": {
                "type": "object",
                "required": [
                    "impuesto"
                ],
                "properties": {
                    "impuesto": {
                        "type": "string",
                        "description": "002 IVA, 003 IEPS, 001 ISR"
                    },
                    "tipoFactor": {
                        "type": "string",
                        "enum": [
                            "Tasa",
                            "Cuota",
                            "Exento"
                        ]
                    },
                    "tasaOCuota": {
                        "type": "number",
                        "description": "0.16 para 16 %"
                    }
                }
            },
            "Concepto": {
                "type": "object",
                "required": [
                    "descripcion",
                    "cantidad",
                    "valorUnitario"
                ],
                "properties": {
                    "noIdentificacion": {
                        "type": "string"
                    },
                    "claveProdServ": {
                        "type": "string"
                    },
                    "claveUnidad": {
                        "type": "string"
                    },
                    "unidad": {
                        "type": "string"
                    },
                    "descripcion": {
                        "type": "string"
                    },
                    "cantidad": {
                        "type": "number"
                    },
                    "valorUnitario": {
                        "type": "number"
                    },
                    "descuento": {
                        "type": "number"
                    },
                    "objetoImp": {
                        "type": "string"
                    },
                    "impuestos": {
                        "type": "object",
                        "properties": {
                            "traslados": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Impuesto"
                                }
                            },
                            "retenciones": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Impuesto"
                                }
                            }
                        }
                    }
                }
            },
            "Receptor": {
                "type": "object",
                "required": [
                    "rfc",
                    "nombre",
                    "regimenFiscal",
                    "codigoPostal",
                    "usoCfdi"
                ],
                "properties": {
                    "rfc": {
                        "type": "string"
                    },
                    "nombre": {
                        "type": "string"
                    },
                    "regimenFiscal": {
                        "type": "string"
                    },
                    "codigoPostal": {
                        "type": "string"
                    },
                    "usoCfdi": {
                        "type": "string"
                    },
                    "residenciaFiscal": {
                        "type": "string"
                    },
                    "numRegIdTrib": {
                        "type": "string"
                    }
                }
            },
            "Factura": {
                "type": "object",
                "required": [
                    "receptor",
                    "conceptos"
                ],
                "properties": {
                    "referencia": {
                        "type": "string",
                        "description": "Id en tu sistema; si se repite regresa la misma factura (no timbra dos veces)"
                    },
                    "tipo": {
                        "type": "string",
                        "enum": [
                            "I",
                            "E"
                        ]
                    },
                    "serie": {
                        "type": "string"
                    },
                    "folio": {
                        "type": "string"
                    },
                    "fecha": {
                        "type": "string"
                    },
                    "formaPago": {
                        "type": "string"
                    },
                    "metodoPago": {
                        "type": "string",
                        "enum": [
                            "PUE",
                            "PPD"
                        ]
                    },
                    "moneda": {
                        "type": "string"
                    },
                    "tipoCambio": {
                        "type": "number"
                    },
                    "condicionesPago": {
                        "type": "string"
                    },
                    "lugarExpedicion": {
                        "type": "string"
                    },
                    "regimenEmisor": {
                        "type": "string"
                    },
                    "comentarios": {
                        "type": "string"
                    },
                    "receptor": {
                        "$ref": "#/components/schemas/Receptor"
                    },
                    "conceptos": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Concepto"
                        }
                    },
                    "global": {
                        "type": "object",
                        "properties": {
                            "periodicidad": {
                                "type": "string"
                            },
                            "meses": {
                                "type": "string"
                            },
                            "anio": {
                                "type": "string"
                            }
                        }
                    },
                    "relacionados": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "tipoRelacion": {
                                    "type": "string"
                                },
                                "uuids": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Ticket": {
                "type": "object",
                "required": [
                    "formaPago",
                    "conceptos"
                ],
                "properties": {
                    "referencia": {
                        "type": "string"
                    },
                    "formaPago": {
                        "type": "string"
                    },
                    "vence": {
                        "type": "string",
                        "format": "date"
                    },
                    "serie": {
                        "type": "string"
                    },
                    "cliente": {
                        "type": "string"
                    },
                    "telefono": {
                        "type": "string"
                    },
                    "comentarios": {
                        "type": "string"
                    },
                    "conceptos": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Concepto"
                        }
                    }
                }
            },
            "Pago": {
                "type": "object",
                "required": [
                    "formaPago",
                    "documentos"
                ],
                "properties": {
                    "referencia": {
                        "type": "string"
                    },
                    "formaPago": {
                        "type": "string"
                    },
                    "fechaPago": {
                        "type": "string"
                    },
                    "moneda": {
                        "type": "string"
                    },
                    "tipoCambio": {
                        "type": "number"
                    },
                    "serie": {
                        "type": "string"
                    },
                    "folio": {
                        "type": "string"
                    },
                    "numOperacion": {
                        "type": "string"
                    },
                    "sustituye": {
                        "type": "string"
                    },
                    "lugarExpedicion": {
                        "type": "string"
                    },
                    "regimenEmisor": {
                        "type": "string"
                    },
                    "documentos": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "uuid",
                                "importe"
                            ],
                            "properties": {
                                "uuid": {
                                    "type": "string"
                                },
                                "importe": {
                                    "type": "number"
                                },
                                "numParcialidad": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "RespuestaFactura": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "message": {
                        "type": "string"
                    },
                    "ambiente": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "uuid": {
                                "type": "string"
                            },
                            "serie": {
                                "type": "string"
                            },
                            "folio": {
                                "type": "string"
                            },
                            "fecha": {
                                "type": "string"
                            },
                            "estado": {
                                "type": "string"
                            },
                            "subtotal": {
                                "type": "number"
                            },
                            "total": {
                                "type": "number"
                            },
                            "repetida": {
                                "type": "boolean"
                            },
                            "xml_base64": {
                                "type": "string"
                            },
                            "xml_url": {
                                "type": "string"
                            },
                            "pdf_url": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}