{
  "info": {
    "_postman_id": "9d64f20a-6f4e-4d55-9c74-4b37bd112053",
    "name": "InvoiceCraftly Developer Document API — Official",
    "description": "Official Postman collection for the InvoiceCraftly Developer Document API (Beta).\n\nGenerate invoice PDFs, check EN16931-core e-invoice readiness, and generate EN16931-core UBL/XML.\n\nAuthentication: Bearer API key (`dk_live_…`). Keep API keys secret and server-side.\n\nDocs: https://invoicecraftly.com/developers/\nTypeScript SDK: https://www.npmjs.com/package/@invoicecraftly/client\nPython SDK: https://pypi.org/project/invoicecraftly/\nTypeScript source: https://github.com/abaidurrehman/invoicecraftly-js\nPython source: https://github.com/abaidurrehman/invoicecraftly-python\n\nScope note: structured output targets EN16931-core only. It is not a Peppol BIS artifact, does not transmit through an Access Point, and is not an official conformance claim.\n\nAll example companies and invoice data in this collection are fictional.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://invoicecraftly.com",
      "type": "string"
    },
    {
      "key": "docs_url",
      "value": "https://invoicecraftly.com/developers/",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Core API",
      "description": "The three released v1 Developer Document API endpoints.",
      "item": [
        {
          "name": "Generate invoice PDF",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"invoice\",\n  \"number\": \"INV-1042\",\n  \"issueDate\": \"2026-09-05\",\n  \"dueDate\": \"2026-09-19\",\n  \"currency\": \"USD\",\n  \"seller\": {\n    \"name\": \"Fixture Seller Studio\",\n    \"addressLines\": [\n      \"12 Render Way\",\n      \"Austin, TX 73301\",\n      \"United States\"\n    ]\n  },\n  \"buyer\": {\n    \"name\": \"Fixture Buyer Co\",\n    \"addressLines\": [\n      \"400 Client Ave\",\n      \"Denver, CO 80202\",\n      \"United States\"\n    ]\n  },\n  \"items\": [\n    {\n      \"description\": \"Brand design retainer\",\n      \"quantity\": 2,\n      \"unitPrice\": 150,\n      \"taxRate\": 8.25,\n      \"taxLabel\": \"Sales Tax\"\n    }\n  ],\n  \"payment\": {\n    \"iban\": \"DE89370400440532013000\",\n    \"reference\": \"INV-1042\",\n    \"terms\": \"Net 14\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/documents/pdf",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "pdf"
              ]
            },
            "description": "Generate a print-ready invoice PDF using the released Ledger template. Successful responses are `application/pdf`. The beta currently supports invoices only and includes 100 PDF renders per API key per month."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
                  "pm.test('Response is a PDF', function () { pm.expect(pm.response.headers.get('Content-Type')).to.include('application/pdf'); });"
                ]
              }
            }
          ]
        },
        {
          "name": "Check EN16931-core readiness",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document\": {\n    \"type\": \"invoice\",\n    \"issueDate\": \"2026-08-23\",\n    \"currency\": \"NOK\",\n    \"locale\": \"nb-NO\",\n    \"seller\": {\n      \"name\": \"Eksempel AS\",\n      \"addressLines\": [\n        \"Karl Johans gate 1\",\n        \"0154 Oslo\"\n      ]\n    },\n    \"buyer\": {\n      \"name\": \"Kunde AS\",\n      \"addressLines\": [\n        \"Storgata 2\",\n        \"0184 Oslo\"\n      ]\n    },\n    \"items\": [\n      {\n        \"description\": \"Consulting\",\n        \"quantity\": 2,\n        \"unitPrice\": 1000,\n        \"taxRate\": 25,\n        \"taxLabel\": \"MVA\"\n      }\n    ]\n  },\n  \"supplement\": {\n    \"version\": 1,\n    \"seller\": {\n      \"postalAddress\": {\n        \"countryCode\": \"NO\",\n        \"city\": \"Oslo\",\n        \"postalCode\": \"0154\"\n      },\n      \"taxId\": {\n        \"role\": \"legal-registration\",\n        \"schemeId\": \"0192\"\n      },\n      \"vatIdentifier\": \"NO123456785MVA\"\n    },\n    \"buyer\": {\n      \"postalAddress\": {\n        \"countryCode\": \"NO\",\n        \"city\": \"Oslo\",\n        \"postalCode\": \"0184\"\n      }\n    },\n    \"lines\": [\n      {\n        \"sourceIndex\": 0,\n        \"unitCode\": \"HUR\",\n        \"vatCategoryCode\": \"S\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/invoices/readiness",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "invoices",
                "readiness"
              ]
            },
            "description": "Return EN16931-core readiness diagnostics without generating XML. The request wraps the invoice as `document` and may include an EN16931-core `supplement`."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
                  "const body = pm.response.json();",
                  "pm.test('Uses the v1 EN16931-core profile', function () {",
                  "  pm.expect(body.apiVersion).to.eql('v1');",
                  "  pm.expect(body.profileId).to.eql('en16931-core');",
                  "  pm.expect(body.specificationIdentifier).to.eql('urn:cen.eu:en16931:2017');",
                  "  pm.expect(body).to.have.property('ready');",
                  "  pm.expect(body).to.not.have.property('artifact');",
                  "});"
                ]
              }
            }
          ]
        },
        {
          "name": "Generate EN16931-core structured XML",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document\": {\n    \"type\": \"invoice\",\n    \"issueDate\": \"2026-08-23\",\n    \"currency\": \"NOK\",\n    \"locale\": \"nb-NO\",\n    \"seller\": {\n      \"name\": \"Eksempel AS\",\n      \"addressLines\": [\n        \"Karl Johans gate 1\",\n        \"0154 Oslo\"\n      ]\n    },\n    \"buyer\": {\n      \"name\": \"Kunde AS\",\n      \"addressLines\": [\n        \"Storgata 2\",\n        \"0184 Oslo\"\n      ]\n    },\n    \"items\": [\n      {\n        \"description\": \"Consulting\",\n        \"quantity\": 2,\n        \"unitPrice\": 1000,\n        \"taxRate\": 25,\n        \"taxLabel\": \"MVA\"\n      }\n    ]\n  },\n  \"supplement\": {\n    \"version\": 1,\n    \"seller\": {\n      \"postalAddress\": {\n        \"countryCode\": \"NO\",\n        \"city\": \"Oslo\",\n        \"postalCode\": \"0154\"\n      },\n      \"taxId\": {\n        \"role\": \"legal-registration\",\n        \"schemeId\": \"0192\"\n      },\n      \"vatIdentifier\": \"NO123456785MVA\"\n    },\n    \"buyer\": {\n      \"postalAddress\": {\n        \"countryCode\": \"NO\",\n        \"city\": \"Oslo\",\n        \"postalCode\": \"0184\"\n      }\n    },\n    \"lines\": [\n      {\n        \"sourceIndex\": 0,\n        \"unitCode\": \"HUR\",\n        \"vatCategoryCode\": \"S\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/documents/structured",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "documents",
                "structured"
              ]
            },
            "description": "Return readiness diagnostics plus an EN16931-core UBL/XML artifact when the invoice is ready. This is not a Peppol BIS artifact and does not perform network delivery."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
                  "const body = pm.response.json();",
                  "pm.test('Uses the v1 EN16931-core profile', function () {",
                  "  pm.expect(body.apiVersion).to.eql('v1');",
                  "  pm.expect(body.profileId).to.eql('en16931-core');",
                  "  pm.expect(body.specificationIdentifier).to.eql('urn:cen.eu:en16931:2017');",
                  "});",
                  "if (body.ready) {",
                  "  pm.test('Ready response includes XML artifact', function () {",
                  "    pm.expect(body.artifact.mediaType).to.eql('application/xml');",
                  "    pm.expect(body.artifact.content).to.include('<Invoice');",
                  "  });",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Error examples",
      "description": "Executable examples for stable public error envelopes. Other documented errors include TARGET_NOT_SUPPORTED (422), RATE_LIMITED (429), RENDER_TIMEOUT (503), and PDF_RENDER_FAILED (504).",
      "item": [
        {
          "name": "401 — Missing authentication",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document\": {\n    \"type\": \"invoice\",\n    \"issueDate\": \"2026-08-23\",\n    \"currency\": \"NOK\",\n    \"locale\": \"nb-NO\",\n    \"seller\": {\n      \"name\": \"Eksempel AS\",\n      \"addressLines\": [\n        \"Karl Johans gate 1\",\n        \"0154 Oslo\"\n      ]\n    },\n    \"buyer\": {\n      \"name\": \"Kunde AS\",\n      \"addressLines\": [\n        \"Storgata 2\",\n        \"0184 Oslo\"\n      ]\n    },\n    \"items\": [\n      {\n        \"description\": \"Consulting\",\n        \"quantity\": 2,\n        \"unitPrice\": 1000,\n        \"taxRate\": 25,\n        \"taxLabel\": \"MVA\"\n      }\n    ]\n  },\n  \"supplement\": {\n    \"version\": 1,\n    \"seller\": {\n      \"postalAddress\": {\n        \"countryCode\": \"NO\",\n        \"city\": \"Oslo\",\n        \"postalCode\": \"0154\"\n      },\n      \"taxId\": {\n        \"role\": \"legal-registration\",\n        \"schemeId\": \"0192\"\n      },\n      \"vatIdentifier\": \"NO123456785MVA\"\n    },\n    \"buyer\": {\n      \"postalAddress\": {\n        \"countryCode\": \"NO\",\n        \"city\": \"Oslo\",\n        \"postalCode\": \"0184\"\n      }\n    },\n    \"lines\": [\n      {\n        \"sourceIndex\": 0,\n        \"unitCode\": \"HUR\",\n        \"vatCategoryCode\": \"S\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/invoices/readiness",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "invoices",
                "readiness"
              ]
            },
            "description": "Demonstrates the stable AUTHENTICATION_FAILED envelope returned when the Authorization header is missing."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 401', function () { pm.response.to.have.status(401); });",
                  "pm.test('Error code is AUTHENTICATION_FAILED', function () { pm.expect(pm.response.json().error.code).to.eql('AUTHENTICATION_FAILED'); });"
                ]
              }
            }
          ]
        },
        {
          "name": "400 — Invalid request",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"unexpectedField\": \"x\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/invoices/readiness",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "invoices",
                "readiness"
              ]
            },
            "description": "Demonstrates the stable INVALID_REQUEST envelope for malformed or unknown request fields."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 400', function () { pm.response.to.have.status(400); });",
                  "pm.test('Error code is INVALID_REQUEST', function () { pm.expect(pm.response.json().error.code).to.eql('INVALID_REQUEST'); });"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}