{
  "openapi": "3.0.1",
  "info": {
    "title": "Factur-X Validator & Generator: ZUGFeRD, EN 16931, FR 2026",
    "description": "Validate Factur-X/ZUGFeRD invoices (XSD, official schematrons, French 2026 BR-FR rules, PDF/A-3), extract them to JSON, generate PDF/A-3 Factur-X with totals and French legal notes, or convert a plain PDF invoice (OCR included). Each check explained. Not an approved platform (PA).",
    "version": "0.1",
    "x-build-id": "2Dncbs1pfayrDZqKx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rigel~facturx-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rigel-facturx-toolkit",
        "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/rigel~facturx-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-rigel-facturx-toolkit",
        "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/rigel~facturx-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-rigel-facturx-toolkit",
        "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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "validate",
              "extract",
              "validate-and-extract",
              "generate",
              "from-pdf"
            ],
            "type": "string",
            "description": "What to do with the documents. from-pdf reads a plain PDF invoice (OCR included) and produces a Factur-X when every check passes.",
            "default": "validate"
          },
          "documents": {
            "title": "Documents (validate / extract)",
            "type": "array",
            "description": "List of {\"url\"}, {\"base64\", \"name\"} or {\"kvKey\"}. PDF (Factur-X/ZUGFeRD) or XML (CII/UBL). Max 20 MB each."
          },
          "frenchCtcRules": {
            "title": "Check French 2026 e-invoicing rules (BR-FR)",
            "type": "boolean",
            "description": "Adds the BR-FR schematron of the French e-invoicing reform (mandatory notes, billing mode, SIREN, electronic addresses...). Reported separately from EN16931 conformance.",
            "default": true
          },
          "fullPdfaCheck": {
            "title": "Full PDF/A-3 validation (veraPDF)",
            "type": "boolean",
            "description": "Runs veraPDF (extra charge). A lightweight Factur-X container check is always run.",
            "default": false
          },
          "includeWarnings": {
            "title": "Include warnings",
            "type": "boolean",
            "description": "Include warnings.",
            "default": true
          },
          "includeRawXml": {
            "title": "Include raw XML in extraction",
            "type": "boolean",
            "description": "Include raw XML in extraction.",
            "default": false
          },
          "invoices": {
            "title": "Invoices to generate (generate)",
            "type": "array",
            "description": "Simple format (number, issueDate, seller, buyer, lines[name, quantity, unitPrice, vatRate]) – totals and VAT breakdown are computed – or an EN16931 semantic dict (BT-xx keys, as returned by extract)."
          },
          "profile": {
            "title": "Factur-X profile (generate)",
            "enum": [
              "en16931",
              "basic",
              "extended"
            ],
            "type": "string",
            "description": "Factur-X profile (generate).",
            "default": "en16931"
          },
          "basePdf": {
            "title": "Your own PDF to turn into Factur-X (generate, optional)",
            "type": "object",
            "description": "{\"url\"} or {\"base64\"}. If omitted, a clean PDF/A-3 invoice is rendered. Full PDF/A conformance then depends on your PDF (fonts embedded, etc.)."
          },
          "lang": {
            "title": "PDF language",
            "type": "string",
            "description": "PDF language.",
            "default": "fr"
          },
          "returnBase64": {
            "title": "Also return PDF as base64 in dataset",
            "type": "boolean",
            "description": "Also return PDF as base64 in dataset.",
            "default": false
          },
          "ocr": {
            "title": "OCR (from-pdf)",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "auto OCRs only a PDF with no text layer. OCR is included in invoice-from-pdf and pdf-read, and reads at most 5 pages.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages (from-pdf)",
            "type": "string",
            "description": "Tesseract language string.",
            "default": "fra+eng+deu"
          },
          "generateFacturx": {
            "title": "Produce a Factur-X (from-pdf)",
            "type": "boolean",
            "description": "When false, a readable PDF is charged as pdf-read and no Factur-X is produced.",
            "default": true
          },
          "generateEvenIfReview": {
            "title": "Produce even if review is needed (from-pdf)",
            "type": "boolean",
            "description": "Not recommended. A result that is not valid EN 16931 is still charged as pdf-read.",
            "default": false
          },
          "keepOriginalLayout": {
            "title": "Keep original PDF layout (from-pdf)",
            "type": "boolean",
            "description": "Embed the XML in the source PDF only when veraPDF accepts the output as PDF/A-3. Otherwise a clean PDF/A-3 is rendered.",
            "default": false
          },
          "maxPages": {
            "title": "Max pages read (from-pdf)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Pages read from the PDF. When OCR runs, at most 5 pages are passed to Tesseract.",
            "default": 5
          },
          "timeoutSecsPerPdf": {
            "title": "Max seconds per PDF (from-pdf)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "A PDF that exceeds this is abandoned and not charged.",
            "default": 90
          },
          "aiApiKey": {
            "title": "AI API key (from-pdf, optional)",
            "type": "string",
            "description": "OpenAI-compatible key. Fills missing or low-confidence fields only. You pay your provider. The invoice text is sent there."
          },
          "aiBaseUrl": {
            "title": "AI base URL (from-pdf)",
            "type": "string",
            "description": "OpenAI-compatible base URL. Private, loopback and cloud-metadata hosts are refused.",
            "default": "https://api.openai.com/v1"
          },
          "aiModel": {
            "title": "AI model (from-pdf)",
            "type": "string",
            "description": "Model name sent to aiBaseUrl.",
            "default": "gpt-4o-mini"
          },
          "aiAlways": {
            "title": "Call AI for every invoice (from-pdf)",
            "type": "boolean",
            "description": "Call AI even when the rules did not flag a review.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}