{
  "openapi": "3.0.1",
  "info": {
    "title": "Factur-X & ZUGFeRD E-Invoice Generator + Validator",
    "description": "Generate compliant Factur-X / ZUGFeRD e-invoices (PDF/A-3 with embedded EN 16931 XML) from simple JSON, and validate or extract existing e-invoice PDFs & XML including XRechnung. Schematron-checked, UBL export. Ready for the France & Germany B2B e-invoicing mandates.",
    "version": "0.1",
    "x-build-id": "daefauSbmqlJt4dbW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/josefbednar~factur-x-zugferd-e-invoice/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-josefbednar-factur-x-zugferd-e-invoice",
        "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/josefbednar~factur-x-zugferd-e-invoice/runs": {
      "post": {
        "operationId": "runs-sync-josefbednar-factur-x-zugferd-e-invoice",
        "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/josefbednar~factur-x-zugferd-e-invoice/run-sync": {
      "post": {
        "operationId": "run-sync-josefbednar-factur-x-zugferd-e-invoice",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "generate",
              "validate",
              "extract"
            ],
            "type": "string",
            "description": "What to do: **generate** a new e-invoice from JSON, **validate** an existing e-invoice (PDF or XML), or **extract** the embedded XML from a Factur-X/ZUGFeRD PDF.",
            "default": "generate"
          },
          "invoice": {
            "title": "Invoice data (generate mode)",
            "type": "object",
            "description": "The invoice as JSON. Required: `number`, `issueDate` (YYYY-MM-DD), `currency`, `seller` {name, countryCode, vatId…}, `buyer` {…}, `lines` [{name, quantity, unitPrice, vatRate}]. Optional: `dueDate`, `note`, `buyerReference`, `orderReference`, `deliveryDate`, `paidAmount`, `payment` {iban, bic, terms, reference}, per-line `unitCode`, `vatCategory` (S/Z/E/AE/K/G), `description`. Totals and VAT breakdown are computed automatically."
          },
          "profile": {
            "title": "Profile / standard",
            "enum": [
              "en16931",
              "basic",
              "extended",
              "xrechnung"
            ],
            "type": "string",
            "description": "Conformance profile of the generated invoice. `en16931` (default) satisfies both the French Factur-X and German ZUGFeRD requirements; `xrechnung` produces the XML-only German federal flavour (CII syntax, XRechnung 3.0).",
            "default": "en16931"
          },
          "basePdf": {
            "title": "Existing PDF to embed into (optional)",
            "type": "string",
            "description": "Your own invoice PDF (URL, data: URI, or base64). It is converted to PDF/A-3 and the XML is embedded into it, so the invoice keeps your branding. If omitted, a clean standardized PDF is rendered from the data."
          },
          "language": {
            "title": "PDF language",
            "enum": [
              "en",
              "de",
              "fr"
            ],
            "type": "string",
            "description": "Language of the rendered PDF labels (only used when no basePdf is given).",
            "default": "en"
          },
          "outputUbl": {
            "title": "Also output UBL 2.1 XML",
            "type": "boolean",
            "description": "Additionally convert the invoice to UBL 2.1 syntax (used by Peppol BIS Billing and many national platforms).",
            "default": false
          },
          "validateResult": {
            "title": "Validate the generated invoice",
            "type": "boolean",
            "description": "Run the full EN 16931 schematron validation on the generated invoice and include the report in the output. Recommended.",
            "default": true
          },
          "filename": {
            "title": "Output filename",
            "type": "string",
            "description": "Base name for the generated files (extension added automatically).",
            "default": "invoice"
          },
          "file": {
            "title": "File to validate / extract",
            "type": "string",
            "description": "For validate and extract modes: the e-invoice to check — a URL, data: URI, base64 string, or (for validation) raw XML pasted directly. PDF and XML are auto-detected."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}