{
  "info": {
    "name": "Blueport HTML2PDF",
    "description": "HTML in, pixel-perfect PDF out.\n\nQuick start:\n1. Set the `apiKey` collection variable to your organisation's key (the same key as PDF2JSON — app.blueport.io).\n2. Open 'Render — inline template + data' and hit Send; use 'Save Response → Save to file' to keep the PDF.\n3. Store a template with 'Templates — create', then render it with 'Render — stored template'.\n\nA render is one PDF of up to 20 pages. Template management and previews are free.\n\nDocs: https://developer.blueport.io/html2pdf",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "https://api.blueport.io/v1" },
    { "key": "apiKey", "value": "" },
    { "key": "templateId", "value": "" }
  ],
  "item": [
    {
      "name": "Render — static HTML (flavour 1)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "text/html" }
        ],
        "body": { "mode": "raw", "raw": "<style>body{font:14px Inter,sans-serif;color:#112A50}h1{color:#0A1931}</style>\n<h1>Hello from HTML2PDF</h1>\n<p>This exact page becomes the PDF.</p>" },
        "url": { "raw": "{{baseUrl}}/html2pdf", "host": ["{{baseUrl}}"], "path": ["html2pdf"] }
      }
    },
    {
      "name": "Render — inline template + data (flavour 2)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": { "mode": "raw", "raw": "{\n  \"html\": \"<h1>{{supplier.name}}</h1><p>Bill to {{customer.name}}</p><table>{{#each lineItems}}<tr><td>{{description}}</td><td>{{formatCurrency amount \\\"AUD\\\"}}</td></tr>{{/each}}</table><h2>Total {{formatCurrency totals.total \\\"AUD\\\"}}</h2>\",\n  \"data\": {\n    \"supplier\": { \"name\": \"Coastline Powersports Pty Ltd\" },\n    \"customer\": { \"name\": \"Jordan Avery\" },\n    \"lineItems\": [\n      { \"description\": \"30,000 km service\", \"amount\": 289.0 },\n      { \"description\": \"Oil filter HF-204\", \"amount\": 24.5 }\n    ],\n    \"totals\": { \"total\": 508.48 }\n  },\n  \"options\": { \"size\": \"A4\", \"footer\": \"Page {{page}} of {{pages}}\", \"filename\": \"invoice.pdf\" }\n}" },
        "url": { "raw": "{{baseUrl}}/html2pdf", "host": ["{{baseUrl}}"], "path": ["html2pdf"] }
      }
    },
    {
      "name": "Render — stored template (flavour 3)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": { "mode": "raw", "raw": "{\n  \"template_id\": \"{{templateId}}\",\n  \"data\": { \"customer\": { \"name\": \"Jordan Avery\" } },\n  \"options\": { \"filename\": \"invoice.pdf\" }\n}" },
        "url": { "raw": "{{baseUrl}}/html2pdf", "host": ["{{baseUrl}}"], "path": ["html2pdf"] }
      }
    },
    {
      "name": "Render — base64 JSON envelope",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": { "mode": "raw", "raw": "{\n  \"html\": \"<h1>Envelope output</h1>\",\n  \"output\": \"base64\"\n}" },
        "url": { "raw": "{{baseUrl}}/html2pdf", "host": ["{{baseUrl}}"], "path": ["html2pdf"] }
      }
    },
    {
      "name": "Templates — create",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": { "mode": "raw", "raw": "{\n  \"name\": \"Invoice\",\n  \"html\": \"<h1>{{supplier.name}}</h1><p>Bill to {{customer.name}}</p>\"\n}" },
        "url": { "raw": "{{baseUrl}}/html2pdf/templates", "host": ["{{baseUrl}}"], "path": ["html2pdf", "templates"] }
      }
    },
    {
      "name": "Templates — list",
      "request": {
        "method": "GET",
        "header": [{ "key": "x-api-key", "value": "{{apiKey}}" }],
        "url": { "raw": "{{baseUrl}}/html2pdf/templates", "host": ["{{baseUrl}}"], "path": ["html2pdf", "templates"] }
      }
    },
    {
      "name": "Templates — get",
      "request": {
        "method": "GET",
        "header": [{ "key": "x-api-key", "value": "{{apiKey}}" }],
        "url": { "raw": "{{baseUrl}}/html2pdf/templates/{{templateId}}", "host": ["{{baseUrl}}"], "path": ["html2pdf", "templates", "{{templateId}}"] }
      }
    },
    {
      "name": "Templates — update (new version)",
      "request": {
        "method": "PUT",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": { "mode": "raw", "raw": "{\n  \"html\": \"<h1>{{supplier.name}} — v2</h1>\"\n}" },
        "url": { "raw": "{{baseUrl}}/html2pdf/templates/{{templateId}}", "host": ["{{baseUrl}}"], "path": ["html2pdf", "templates", "{{templateId}}"] }
      }
    },
    {
      "name": "Templates — preview (free)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{apiKey}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": { "mode": "raw", "raw": "{\n  \"data\": { \"supplier\": { \"name\": \"Sample Co\" }, \"customer\": { \"name\": \"Sample Customer\" } }\n}" },
        "url": { "raw": "{{baseUrl}}/html2pdf/templates/{{templateId}}/preview", "host": ["{{baseUrl}}"], "path": ["html2pdf", "templates", "{{templateId}}", "preview"] }
      }
    },
    {
      "name": "Templates — delete",
      "request": {
        "method": "DELETE",
        "header": [{ "key": "x-api-key", "value": "{{apiKey}}" }],
        "url": { "raw": "{{baseUrl}}/html2pdf/templates/{{templateId}}", "host": ["{{baseUrl}}"], "path": ["html2pdf", "templates", "{{templateId}}"] }
      }
    }
  ]
}
