{
  "name": "getpeppr - Send Peppol invoice",
  "nodes": [
    {
      "parameters": {
        "content": "## getpeppr - Send Peppol invoice\n\nUse this workflow to submit one sandbox Peppol invoice with the HTTP Request node.\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. Complete sandbox onboarding for the organization behind that API key.\n4. Select the credential on the `Send invoice` node.\n\nA production key sends a real Peppol invoice. Keep this sample on sandbox.",
        "height": 300,
        "width": 520
      },
      "id": "78a0fbc8-81e8-4d2b-b49c-0f4d5e8b20f5",
      "name": "How to use this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -900,
        -360
      ]
    },
    {
      "parameters": {
        "content": "## Invoice JSON\n\nEdit the `invoice` object in the next node.\n\nThe seller is the Legal Entity linked to the API key. The sample uses `vatRate: 0` + `vatCategory: \"O\"` so it works on a default sandbox Legal Entity. VAT-bearing invoices require VAT administration on the sender in Storecove.",
        "height": 220,
        "width": 440
      },
      "id": "47fa0055-bc28-4c2b-9c80-51ef17be0a23",
      "name": "Invoice JSON notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -440,
        -320
      ]
    },
    {
      "parameters": {},
      "id": "0fda9264-5f8d-4d0e-b1d4-73c01dfda521",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -760,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const invoice = {\n  number: `N8N-${$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    email: \"ap@example.com\"\n  },\n  lines: [\n    {\n      description: \"API integration setup\",\n      quantity: 1,\n      unit: \"EA\",\n      unitPrice: 500,\n      vatRate: 0,\n      vatCategory: \"O\"\n    }\n  ],\n  buyerReference: \"PO-N8N-001\",\n  paymentTerms: \"Net 30 days\"\n};\n\nreturn [\n  {\n    json: {\n      invoice,\n      idempotencyKey: `n8n-invoice-${$execution.id}`\n    }\n  }\n];"
      },
      "id": "373f3e5b-0101-46e1-ae53-2e577cb66d90",
      "name": "Invoice JSON (edit me)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -460,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.getpeppr.dev/v1/invoices",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Idempotency-Key",
              "value": "={{ $json.idempotencyKey }}"
            },
            {
              "name": "X-Validate-Recipient",
              "value": "warn"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.invoice) }}",
        "options": {}
      },
      "id": "b73019cb-30e2-45d4-b9a4-6a67e31ac464",
      "name": "Send invoice",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -120,
        0
      ],
      "credentials": {
        "httpBearerAuth": {
          "id": "REPLACE_WITH_N8N_CREDENTIAL_ID",
          "name": "getpeppr API key"
        }
      }
    },
    {
      "parameters": {
        "content": "## Response\n\nExpected success response:\n\n```json\n{\n  \"id\": \"provider-guid\",\n  \"status\": \"submitted\",\n  \"createdAt\": \"...\"\n}\n```\n\nIf this node returns `422`, check sandbox onboarding first, then recipient Peppol ID, then VAT configuration.",
        "height": 260,
        "width": 420
      },
      "id": "49ad2a26-cd6d-4fc3-aed1-33868f89ad3e",
      "name": "Response notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -80,
        -320
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Invoice JSON (edit me)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice JSON (edit me)": {
      "main": [
        [
          {
            "node": "Send invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3298e5cb-223d-49d5-82bb-71237d7a6521",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
