{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tlaloc-sh/json-schema/tlaloc-sh-cfdiquery-request-schema.json",
  "title": "CFDIQueryRequest",
  "description": "POST /v1/cfdi/query body.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tlaloc-sh-openapi.json#/components/schemas/CFDIQueryRequest",
  "properties": {
    "flujo": {
      "type": "string",
      "pattern": "^(emitidas|recibidas)$",
      "title": "Flujo"
    },
    "desde": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Desde",
      "description": "YYYY-MM-DD (sólo emitidas)"
    },
    "hasta": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hasta",
      "description": "YYYY-MM-DD (sólo emitidas)"
    },
    "anio": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 2100.0,
          "minimum": 2000.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Anio"
    },
    "mes": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 12.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Mes"
    },
    "dia": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 31.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Dia"
    },
    "uuid": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 36,
          "minLength": 36
        },
        {
          "type": "null"
        }
      ],
      "title": "Uuid"
    },
    "rfc_receptor": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 13,
          "minLength": 12
        },
        {
          "type": "null"
        }
      ],
      "title": "Rfc Receptor"
    },
    "rfc_tercero": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 13,
          "minLength": 12
        },
        {
          "type": "null"
        }
      ],
      "title": "Rfc Tercero"
    },
    "estado": {
      "type": "string",
      "pattern": "^(todos|vigente|cancelado)$",
      "title": "Estado",
      "default": "todos"
    },
    "complemento": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Complemento"
    },
    "descargar_xml": {
      "type": "boolean",
      "title": "Descargar Xml",
      "description": "Si true, descarga XMLs además de metadata",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "flujo"
  ]
}