{
  "name": "getpeppr - Validate invoice server-side",
  "nodes": [
    {
      "parameters": {
        "content": "## getpeppr - Validate invoice\n\nUse this workflow to validate invoice JSON before sending.\n\nBefore running:\n1. Create an n8n **HTTP Bearer Auth** credential named `getpeppr API key`.\n2. Paste your `sk_sandbox_...` token into that credential, never into a node.\n3. Select the credential on the `Validate invoice` node.\n\nThis endpoint is side-effect free: it validates the payload and does not send an invoice.",
        "height": 280,
        "width": 520
      },
      "id": "df9f1529-a7f1-43bb-90fb-d1ba93567b18",
      "name": "How to use this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -860,
        -340
      ]
    },
    {
      "parameters": {
        "content": "## Invoice JSON\n\nEdit the `invoice` object in the next node. Validation accepts a full invoice shape, including buyer address, Peppol ID, line items, VAT rate, and references.\n\nThe response is HTTP `200` even when `valid` is `false`, so downstream nodes can inspect detailed validation errors.",
        "height": 240,
        "width": 460
      },
      "id": "af103cda-7884-4cf1-9423-70725ebc78dc",
      "name": "Invoice JSON notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -320
      ]
    },
    {
      "parameters": {},
      "id": "ec015d92-28b2-42b6-a7bc-692350bbffab",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -700,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const invoice = {\n  number: `N8N-VALIDATE-${$execution.id}`,\n  date: \"2026-05-27\",\n  dueDate: \"2026-06-26\",\n  currency: \"EUR\",\n  to: {\n    name: \"ACMEDIA\",\n    peppolId: \"0208:0685660237\",\n    vatNumber: \"BE0685660237\",\n    street: \"Example Street 1\",\n    city: \"Brussels\",\n    postalCode: \"1000\",\n    country: \"BE\"\n  },\n  lines: [\n    {\n      description: \"API integration setup\",\n      quantity: 1,\n      unit: \"EA\",\n      unitPrice: 500,\n      vatRate: 21,\n      vatCategory: \"S\"\n    }\n  ],\n  buyerReference: \"PO-N8N-VALIDATE-001\"\n};\n\nreturn [{ json: { invoice } }];"
      },
      "id": "723748f0-e7d4-487b-828b-6ff484089079",
      "name": "Invoice JSON (edit me)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -380,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.getpeppr.dev/v1/validate/server",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.invoice) }}",
        "options": {}
      },
      "id": "ad829d9d-361c-4da0-a397-2d4cd86aec13",
      "name": "Validate invoice",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -80,
        0
      ],
      "credentials": {
        "httpBearerAuth": {
          "id": "REPLACE_WITH_N8N_CREDENTIAL_ID",
          "name": "getpeppr API key"
        }
      }
    },
    {
      "parameters": {
        "content": "## Response\n\nExpected response shape:\n\n```json\n{\n  \"valid\": true,\n  \"errors\": [],\n  \"warnings\": []\n}\n```\n\nUse this before `POST /v1/invoices` when building an automated workflow.",
        "height": 240,
        "width": 380
      },
      "id": "7908ec81-c4d6-40e2-b30e-5f0572ad8258",
      "name": "Response notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        -320
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Invoice JSON (edit me)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice JSON (edit me)": {
      "main": [
        [
          {
            "node": "Validate invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "21689262-f66c-4f89-9903-916036a78799",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
