{
  "openapi": "3.0.1",
  "info": {
    "title": "Generador de QR Verifactu — QR tributario por lotes",
    "description": "Genera por lotes el código QR tributario Verifactu de la AEAT (SVG y PNG al tamaño reglamentario) a partir de NIF, número de serie, fecha e importe, con validación de datos.",
    "version": "0.1",
    "x-build-id": "EntHuBtHWOuZ4yeNH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/angel.carreira~qr-verifactu/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-angel.carreira-qr-verifactu",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/angel.carreira~qr-verifactu/runs": {
      "post": {
        "operationId": "runs-sync-angel.carreira-qr-verifactu",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/angel.carreira~qr-verifactu/run-sync": {
      "post": {
        "operationId": "run-sync-angel.carreira-qr-verifactu",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "facturas"
        ],
        "properties": {
          "facturas": {
            "title": "Facturas",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "Hasta 1000 facturas. De cada una se genera la URL de cotejo de la AEAT y los ficheros SVG y/o PNG.",
            "items": {
              "type": "object",
              "properties": {
                "nif": {
                  "title": "NIF del emisor",
                  "type": "string",
                  "description": "NIF del obligado a expedir la factura. Se normaliza a mayúsculas y sin prefijo ES.",
                  "editor": "textfield",
                  "maxLength": 20
                },
                "numserie": {
                  "title": "Número de serie y factura",
                  "type": "string",
                  "description": "Número de serie y número de factura, sin separar. Hasta 60 caracteres ASCII imprimibles.",
                  "editor": "textfield",
                  "maxLength": 60
                },
                "fecha": {
                  "title": "Fecha de expedición",
                  "type": "string",
                  "description": "Fecha de expedición en formato AAAA-MM-DD. También se acepta DD-MM-AAAA.",
                  "editor": "textfield",
                  "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\d{2}-\\d{2}-\\d{4})$",
                  "errorMessage": {
                    "pattern": "Usa el formato AAAA-MM-DD (o DD-MM-AAAA), por ejemplo 2026-01-15"
                  }
                },
                "importe": {
                  "title": "Importe total",
                  "type": "number",
                  "description": "Importe total de la factura, con punto decimal y como mucho 2 decimales.",
                  "editor": "number"
                },
                "verifactu": {
                  "title": "Sistema VERI*FACTU",
                  "type": "boolean",
                  "description": "Actívalo si la factura procede de un sistema VERI*FACTU. Cambia la URL de ValidarQR a ValidarQRNoVerifactu y añade la frase inferior al SVG.",
                  "editor": "checkbox",
                  "default": true
                }
              },
              "required": [
                "nif",
                "numserie",
                "fecha",
                "importe"
              ],
              "additionalProperties": false
            }
          },
          "tamanoMm": {
            "title": "Tamaño del QR",
            "minimum": 30,
            "maximum": 40,
            "type": "number",
            "description": "Lado total del QR en milímetros, margen incluido. La AEAT exige entre 30 y 40 mm.",
            "default": 35
          },
          "ppp": {
            "title": "Resolución del PNG",
            "minimum": 72,
            "maximum": 1200,
            "type": "integer",
            "description": "Puntos por pulgada del PNG. Se guarda en el trozo pHYs para que el fichero mida los milímetros pedidos al imprimirlo. Con 72 ppp y 30 mm un número de serie largo puede no dejar un píxel por módulo; esa factura se reporta con error y no se cobra.",
            "default": 300
          },
          "formatos": {
            "title": "Formatos",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Ficheros que se generan por factura válida. Por defecto, SVG y PNG.",
            "items": {
              "type": "string",
              "enum": [
                "svg",
                "png"
              ]
            },
            "default": [
              "svg",
              "png"
            ]
          },
          "entorno": {
            "title": "Entorno de la AEAT",
            "enum": [
              "produccion",
              "pruebas"
            ],
            "type": "string",
            "description": "Entorno al que apunta la URL del QR: producción o el Portal de Pruebas Externas.",
            "default": "produccion"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}