# Générer une facture Factur-X depuis un JSON

**Use case:** 

Crée un PDF/A-3 Factur-X (profil EN 16931) avec XML CII à partir d'un JSON simple : totaux et TVA calculés, mentions légales françaises ajoutées (indemnité de 40 €, pénalités, escompte), facture auto-validée. Facturé seulement si le résultat est valide. 0,04 $ par facture.

## Input

```json
{
  "mode": "generate",
  "documents": [
    {
      "url": "https://raw.githubusercontent.com/ZUGFeRD/corpus/master/ZUGFeRDv2/correct/FNFE-factur-x-examples/Facture_FR_BASICWL.pdf"
    }
  ],
  "frenchCtcRules": true,
  "fullPdfaCheck": false,
  "includeWarnings": true,
  "includeRawXml": false,
  "invoices": [
    {
      "number": "FA-2026-0042",
      "issueDate": "2026-10-16",
      "dueDate": "2026-11-15",
      "iban": "FR7630006000011234567890189",
      "seller": {
        "name": "Exemple Fictif SARL",
        "address": "1 rue de la Démonstration",
        "postcode": "75011",
        "city": "Paris",
        "siren": "687675066",
        "vat": "FR13687675066"
      },
      "buyer": {
        "name": "Démo Client SAS",
        "address": "2 avenue de l'Exemple",
        "postcode": "69002",
        "city": "Lyon",
        "siren": "345253645"
      },
      "lines": [
        {
          "name": "Développement",
          "quantity": 3,
          "unitPrice": 450,
          "unit": "DAY",
          "vatRate": 20
        }
      ]
    }
  ],
  "profile": "en16931",
  "lang": "fr",
  "returnBase64": false,
  "ocr": "auto",
  "ocrLanguages": "fra+eng+deu",
  "generateFacturx": true,
  "generateEvenIfReview": false,
  "keepOriginalLayout": false,
  "maxPages": 5,
  "timeoutSecsPerPdf": 90,
  "aiBaseUrl": "https://api.openai.com/v1",
  "aiModel": "gpt-4o-mini",
  "aiAlways": false
}
```

## Output

```json
{
  "mode": {
    "label": "Mode"
  },
  "document": {
    "label": "Document"
  },
  "invoiceNumber": {
    "label": "Invoice number"
  },
  "validation.valid": {
    "label": "Valid"
  },
  "validation.frenchCtcReady": {
    "label": "French ctc ready"
  },
  "validation.profile": {
    "label": "Profile"
  },
  "validation.summaryFr": {
    "label": "Summary fr"
  },
  "valid": {
    "label": "Valid"
  },
  "frenchCtcReady": {
    "label": "French ctc ready"
  },
  "summaryFr": {
    "label": "Summary fr"
  },
  "pdfUrl": {
    "label": "Pdf url"
  },
  "xmlUrl": {
    "label": "Xml url"
  },
  "error": {
    "label": "Error"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Factur-X Validator & Generator: ZUGFeRD, EN 16931, FR 2026 Actor is ready to run with the inputs already set for "Générer une facture Factur-X depuis un JSON". [Sign up or log in](https://console.apify.com/create-task-from-example/pyjcdMfVt6gmVonKo) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Générer une facture Factur-X depuis un JSON" task

The Factur-X Validator & Generator: ZUGFeRD, EN 16931, FR 2026 Actor will start running based on the input automatically. You can also change all the input fields, like mode, documents (validate / extract), and more, to match your specific use case.

### 3. Receive the "Générer une facture Factur-X depuis un JSON" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as mode, document, invoice number, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Générer une facture Factur-X depuis un JSON" task via API](https://apify.com/rigel/facturx-toolkit.md).

## About this Actor

This example demonstrates how to use [Factur-X Validator & Generator: ZUGFeRD, EN 16931, FR 2026](https://apify.com/rigel/facturx-toolkit.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/rigel/facturx-toolkit.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/rigel/facturx-toolkit.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
