{
  "info": {
    "name": "Invoice Navigator API",
    "description": "Complete API collection for Invoice Navigator - E-invoice validation, Evidence Packs, and compliance data.\n\n## Getting Started\n\n1. Get your API key at https://www.invoicenavigator.eu/dashboard/api\n2. Set the `apiKey` variable in Collection Variables\n3. Start validating invoices!\n\n## Need Help?\n\n- Documentation: https://www.invoicenavigator.eu/developers\n- Support: api@invoicenavigator.eu",
    "version": "1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.invoicenavigator.eu/v1",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "YOUR_API_KEY_HERE",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Quickstart",
      "description": "Get started in under 5 minutes",
      "item": [
        {
          "name": "1. Get Test Key (No Auth)",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"your@email.com\"\n}"
            },
            "url": {
              "raw": "https://www.invoicenavigator.eu/api/developers/instant-key",
              "protocol": "https",
              "host": ["www", "invoicenavigator", "eu"],
              "path": ["api", "developers", "instant-key"]
            },
            "description": "Get an instant test API key without signing up. Limited to 10 requests and expires in 1 hour."
          }
        },
        {
          "name": "2. Validate Sample Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"xml\": \"<?xml version=\\\"1.0\\\"?>\\n<Invoice xmlns=\\\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\\\">\\n  <ID>INV-2025-001</ID>\\n  <IssueDate>2025-01-10</IssueDate>\\n</Invoice>\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/validate",
              "host": ["{{baseUrl}}"],
              "path": ["validate"]
            },
            "description": "Validate an e-invoice XML document against EN 16931 and format-specific rules."
          }
        },
        {
          "name": "3. Verify Certificate",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/verify/:certificateId",
              "host": ["{{baseUrl}}"],
              "path": ["verify", ":certificateId"],
              "variable": [
                {
                  "key": "certificateId",
                  "value": "ep_abc123"
                }
              ]
            },
            "description": "Verify an Evidence Pack certificate."
          }
        }
      ]
    },
    {
      "name": "Validation",
      "description": "Invoice validation endpoints",
      "item": [
        {
          "name": "Validate Invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"xml\": \"<your-invoice-xml>\",\n  \"options\": {\n    \"profile\": \"auto\",\n    \"includeWarnings\": true\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/validate",
              "host": ["{{baseUrl}}"],
              "path": ["validate"]
            },
            "description": "Validate a single e-invoice against EN 16931 and profile-specific rules.\n\n**Supported Formats:**\n- UBL 2.1\n- CII D16B\n- XRechnung 3.0\n- Peppol BIS 3.0\n- Factur-X / ZUGFeRD"
          }
        },
        {
          "name": "Batch Validate",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoices\": [\n    { \"id\": \"inv-1\", \"xml\": \"<invoice-1-xml>\" },\n    { \"id\": \"inv-2\", \"xml\": \"<invoice-2-xml>\" }\n  ],\n  \"options\": {\n    \"stopOnFirstError\": false\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/validate/batch",
              "host": ["{{baseUrl}}"],
              "path": ["validate", "batch"]
            },
            "description": "Validate multiple invoices in a single request. Requires Startup tier or above."
          }
        }
      ]
    },
    {
      "name": "Evidence Packs",
      "description": "Generate audit-proof compliance certificates",
      "item": [
        {
          "name": "Generate Evidence Pack",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"validationRef\": \"val_abc123xyz\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/evidence-pack",
              "host": ["{{baseUrl}}"],
              "path": ["evidence-pack"]
            },
            "description": "Generate a cryptographically signed Evidence Pack for a validated invoice. Requires Growth tier or above."
          }
        },
        {
          "name": "Get Evidence Pack",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/evidence-pack/:id",
              "host": ["{{baseUrl}}"],
              "path": ["evidence-pack", ":id"],
              "variable": [
                {
                  "key": "id",
                  "value": "ep_abc123"
                }
              ]
            },
            "description": "Retrieve an existing Evidence Pack by ID."
          }
        },
        {
          "name": "Download Evidence Pack PDF",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/evidence-pack/:id/download",
              "host": ["{{baseUrl}}"],
              "path": ["evidence-pack", ":id", "download"],
              "variable": [
                {
                  "key": "id",
                  "value": "ep_abc123"
                }
              ]
            },
            "description": "Download the Evidence Pack as a PDF document."
          }
        },
        {
          "name": "Verify Evidence Pack",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/verify/:certificateId",
              "host": ["{{baseUrl}}"],
              "path": ["verify", ":certificateId"],
              "variable": [
                {
                  "key": "certificateId",
                  "value": "ep_abc123"
                }
              ]
            },
            "description": "Verify the authenticity of an Evidence Pack certificate."
          }
        }
      ]
    },
    {
      "name": "Compliance Data",
      "description": "Country rules, deadlines, and requirements",
      "item": [
        {
          "name": "List Countries",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/countries",
              "host": ["{{baseUrl}}"],
              "path": ["countries"]
            },
            "description": "Get all countries with e-invoicing regulations."
          }
        },
        {
          "name": "Get Country Details",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/countries/:code",
              "host": ["{{baseUrl}}"],
              "path": ["countries", ":code"],
              "variable": [
                {
                  "key": "code",
                  "value": "DE"
                }
              ]
            },
            "description": "Get detailed e-invoicing requirements for a specific country."
          }
        },
        {
          "name": "Get Deadlines",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/deadlines?country=DE",
              "host": ["{{baseUrl}}"],
              "path": ["deadlines"],
              "query": [
                {
                  "key": "country",
                  "value": "DE"
                }
              ]
            },
            "description": "Get upcoming e-invoicing compliance deadlines."
          }
        },
        {
          "name": "Get Rules",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/rules?profile=xrechnung",
              "host": ["{{baseUrl}}"],
              "path": ["rules"],
              "query": [
                {
                  "key": "profile",
                  "value": "xrechnung"
                }
              ]
            },
            "description": "Get validation rules for a specific profile."
          }
        },
        {
          "name": "Get Regulatory Changes",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/changes?since=2025-01-01",
              "host": ["{{baseUrl}}"],
              "path": ["changes"],
              "query": [
                {
                  "key": "since",
                  "value": "2025-01-01"
                }
              ]
            },
            "description": "Get recent regulatory changes. Requires Scale tier or above."
          }
        }
      ]
    },
    {
      "name": "Error Intelligence",
      "description": "Error codes and fixes",
      "item": [
        {
          "name": "List Errors",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/errors?category=business",
              "host": ["{{baseUrl}}"],
              "path": ["errors"],
              "query": [
                {
                  "key": "category",
                  "value": "business"
                }
              ]
            },
            "description": "List validation error codes with descriptions and fixes."
          }
        },
        {
          "name": "Get Error Details",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/errors/:code",
              "host": ["{{baseUrl}}"],
              "path": ["errors", ":code"],
              "variable": [
                {
                  "key": "code",
                  "value": "BR-01"
                }
              ]
            },
            "description": "Get detailed information about a specific error code."
          }
        }
      ]
    },
    {
      "name": "Conversion",
      "description": "Format conversion",
      "item": [
        {
          "name": "Convert Invoice Format",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"xml\": \"<source-invoice-xml>\",\n  \"targetFormat\": \"ubl\",\n  \"targetProfile\": \"xrechnung-3.0\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/convert",
              "host": ["{{baseUrl}}"],
              "path": ["convert"]
            },
            "description": "Convert an invoice between formats (UBL, CII, etc.). Requires Startup tier or above."
          }
        }
      ]
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Add timestamp to requests for debugging",
          "pm.variables.set('timestamp', new Date().toISOString());"
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Log response time",
          "console.log('Response time: ' + pm.response.responseTime + 'ms');",
          "",
          "// Check for errors",
          "if (pm.response.code >= 400) {",
          "    console.error('Error: ' + pm.response.json().error);",
          "}"
        ]
      }
    }
  ]
}
