{
  "name": "getpeppr - Peppol Directory lookup and search",
  "nodes": [
    {
      "parameters": {
        "content": "## getpeppr - Peppol Directory\n\nUse this workflow to confirm a buyer exists on Peppol before sending an invoice.\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 both HTTP Request nodes.\n\nThis workflow is read-only: it does not create contacts or send invoices.",
        "height": 300,
        "width": 520
      },
      "id": "db52c0d3-48f1-423f-88f8-118313e95a5f",
      "name": "How to use this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -940,
        -380
      ]
    },
    {
      "parameters": {
        "content": "## Directory query JSON\n\nEdit the `lookup` object for an exact Peppol ID lookup.\n\nEdit the `search` object for a name/country search.\n\nThe sample recipient is ACMEDIA in Belgium:\n- scheme: `0208`\n- participantId: `0685660237`",
        "height": 240,
        "width": 440
      },
      "id": "f9c35627-8e52-4696-a0ee-d33ca4481f12",
      "name": "Directory query notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -500,
        -340
      ]
    },
    {
      "parameters": {},
      "id": "b55f4a1c-614c-4d54-87ef-650e82dbe879",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -760,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const lookup = {\n  scheme: \"0208\",\n  participantId: \"0685660237\"\n};\n\nconst search = {\n  name: \"ACMEDIA\",\n  country: \"BE\",\n  limit: 10\n};\n\nreturn [{ json: { lookup, search } }];"
      },
      "id": "5de5a4fe-4a66-4c83-a790-c7803adfa8af",
      "name": "Directory query JSON (edit me)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -500,
        0
      ]
    },
    {
      "parameters": {
        "url": "={{ 'https://api.getpeppr.dev/v1/directory/' + $json.lookup.scheme + '/' + encodeURIComponent($json.lookup.participantId) }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "options": {}
      },
      "id": "7727a2b7-9f5d-46e7-acf5-622eb5a7b408",
      "name": "Lookup participant",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -180,
        -100
      ],
      "credentials": {
        "httpBearerAuth": {
          "id": "REPLACE_WITH_N8N_CREDENTIAL_ID",
          "name": "getpeppr API key"
        }
      }
    },
    {
      "parameters": {
        "url": "https://api.getpeppr.dev/v1/directory/search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $json.search.name }}"
            },
            {
              "name": "country",
              "value": "={{ $json.search.country }}"
            },
            {
              "name": "limit",
              "value": "={{ $json.search.limit }}"
            }
          ]
        },
        "options": {}
      },
      "id": "513d68c7-d3ac-4d38-9f2c-2cb6f0115771",
      "name": "Search participants",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -180,
        120
      ],
      "credentials": {
        "httpBearerAuth": {
          "id": "REPLACE_WITH_N8N_CREDENTIAL_ID",
          "name": "getpeppr API key"
        }
      }
    },
    {
      "parameters": {
        "content": "## Responses\n\n`Lookup participant` answers whether one Peppol ID is registered.\n\n`Search participants` returns possible matches by company name and country.\n\nUse lookup before sending when you already know the recipient Peppol ID. Use search when a user typed a company name.",
        "height": 260,
        "width": 420
      },
      "id": "5175f17c-690a-4bb7-af33-38d382f2e01c",
      "name": "Response notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -120,
        -420
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Directory query JSON (edit me)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Directory query JSON (edit me)": {
      "main": [
        [
          {
            "node": "Lookup participant",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search participants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "eb5646f4-c5c8-4ac4-8010-d33cdb33a567",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
