{
  "name": "Tutorial - Generate Invoice (First Invoice)",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "operation": "generate",
        "countryCode": "DE",
        "format": "pdf",
        "invoiceData": "{\n  \"invoiceNumber\": \"INV-2025-001\",\n  \"invoiceDate\": \"2025-01-15\",\n  \"dueDate\": \"2025-02-14\",\n  \"seller\": {\n    \"name\": \"ACME GmbH\",\n    \"address\": {\n      \"street\": \"Hauptstra\u00dfe 1\",\n      \"city\": \"Berlin\",\n      \"postalCode\": \"10115\",\n      \"country\": \"DE\"\n    },\n    \"vatId\": \"DE123456789\",\n    \"email\": \"invoices@acme.de\",\n    \"bankAccount\": {\n      \"iban\": \"DE89370400440532013000\",\n      \"bic\": \"COBADEFFXXX\",\n      \"bankName\": \"Commerzbank\"\n    }\n  },\n  \"buyer\": {\n    \"name\": \"Customer AG\",\n    \"address\": {\n      \"street\": \"Nebenstra\u00dfe 2\",\n      \"city\": \"M\u00fcnchen\",\n      \"postalCode\": \"80331\",\n      \"country\": \"DE\"\n    },\n    \"vatId\": \"DE987654321\",\n    \"email\": \"billing@customer.de\"\n  },\n  \"lineItems\": [\n    {\n      \"position\": 1,\n      \"description\": \"Consulting Services - Project Alpha\",\n      \"quantity\": 10,\n      \"unit\": \"HUR\",\n      \"unitPrice\": 150.00,\n      \"vatRate\": 19\n    },\n    {\n      \"position\": 2,\n      \"description\": \"Software License - Annual\",\n      \"quantity\": 1,\n      \"unit\": \"C62\",\n      \"unitPrice\": 500.00,\n      \"vatRate\": 19\n    }\n  ],\n  \"currency\": \"EUR\",\n  \"total\": 2499.00,\n  \"paymentTerms\": \"Net 30 days\",\n  \"notes\": \"Thank you for your business!\"\n}",
        "options": {
          "outputBinary": true,
          "binaryPropertyName": "data",
          "includeWarnings": true
        }
      },
      "id": "invoice-xhub-generate",
      "name": "invoice-api.xhub - Generate PDF",
      "type": "n8n-nodes-invoice-api-xhub.invoiceXhub",
      "typeVersion": 1,
      "position": [
        480,
        300
      ],
      "credentials": {
        "invoiceXhubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "fileName": "={{ $json.filename }}",
        "options": {}
      },
      "id": "write-binary-file",
      "name": "Save Invoice to File (Optional)",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        720,
        300
      ],
      "disabled": true
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "invoice-api.xhub - Generate PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "invoice-api.xhub - Generate PDF": {
      "main": [
        [
          {
            "node": "Save Invoice to File (Optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    {
      "name": "tutorial",
      "id": "tutorial-1"
    },
    {
      "name": "invoice-xhub",
      "id": "invoice-xhub-1"
    }
  ]
}