{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zertidox-com/json-schema/zertidox-com-solicitud-detalle-schema.json",
  "title": "SolicitudDetalle",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zertidox-com-openapi.yml#/components/schemas/SolicitudDetalle",
  "allOf": [
    {
      "$ref": "#/$defs/SolicitudResumen"
    },
    {
      "type": "object",
      "properties": {
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "historial": {
          "type": "array",
          "description": "Status history, newest first.",
          "items": {
            "type": "object",
            "properties": {
              "estado": {
                "$ref": "#/$defs/Estado"
              },
              "nota": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Only notes written for the end client; internal notes are returned as null."
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        },
        "documentos": {
          "type": "array",
          "description": "Delivered documents.",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "nombre": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Direct download link, no API key needed. Anyone who has the link can download the document: keep it private. Omitted when the request has no `referencia`."
              },
              "tipo": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Estado": {
      "type": "string",
      "enum": [
        "PENDIENTE_PAGO",
        "PAGADA",
        "ENVIADA_AL_MJ",
        "ESPERANDO_CERTIFICADO",
        "ENTREGADA",
        "REEMBOLSADA",
        "REQUIERE_REVISION",
        "RECHAZADA",
        "REQUIERE_FIRMA",
        "FIRMADA",
        "REVISION_ABOGADO",
        "REVISADA",
        "EN_PROCESO",
        "CADUCADA"
      ],
      "description": "Request status."
    },
    "SolicitudResumen": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "referencia": {
          "type": "string",
          "description": "Public reference (CD-… live, PR-… test mode)."
        },
        "tipo": {
          "type": "string",
          "description": "Request type, as listed in `GET /catalogo`."
        },
        "estado": {
          "$ref": "#/$defs/Estado"
        },
        "precio": {
          "type": [
            "string",
            "number"
          ],
          "description": "Amount charged in EUR (decimal string). 0 when covered by the Business balance."
        },
        "pagado": {
          "type": "boolean"
        },
        "clienteNombre": {
          "type": [
            "string",
            "null"
          ],
          "description": "Your internal reference for the end client."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}