{
  "info": {
    "_postman_id": "a66c9ea1-dc75-4caa-b923-392f5706f980",
    "name": "SIGN-SE Demo",
    "description": "End-to-end SIGN-SE (Sweden / InfraSec TCS) demo against the unified UAPI v5.\n\nFolder layout mirrors the public FR collection on workspace.fiskaly.com:\n  setup/{tokens (management), organizations, subjects, tokens (operation), taxpayers, locations, systems}\n  records/{records (RECEIPT), (RECEIPT - Training), (CANCELLATION), (CORRECTION::RECEIPT), (DUPLICATE::RECEIPT), (PRO_FORMA_INVOICE), List Records}\n  teardown/, debug/\n\nEnv credentials are a single GROUP/ACCOUNT-level API key. The setup folder bootstraps a fresh unit + unit-scoped API key, then runs taxpayer/location/system as that unit. After setup completes, the collection-level Pre-request script auto-refreshes the operational bearer using the bootstrapped credentials.\n\nTweakable env variables: `taxpayerLegalName`, `taxpayerTradeName`, `taxIdNumber` (Swedish organisationsnummer), `unitName`, `locationName`.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "53336304",
    "_collection_link": "https://go.postman.co/collection/53336304-a66c9ea1-dc75-4caa-b923-392f5706f980?source=collection_link"
  },
  "item": [
    {
      "name": "setup",
      "item": [
        {
          "name": "tokens (management)",
          "item": [
            {
              "name": "Create a Token",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"apiBearerToken\", data.content.authentication.bearer);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"API_KEY\",\n    \"key\": \"{{apiKey}}\",\n    \"secret\": \"{{apiSecret}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/tokens",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "tokens"
                  ]
                },
                "description": "Exchange the env-provided account/group-level API key for a management bearer used by the organizations + subjects endpoints below to create a fresh unit and a unit-scoped API key."
              },
              "response": []
            }
          ]
        },
        {
          "name": "organizations",
          "item": [
            {
              "name": "Create an Organization::UNIT",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"organizationUnitId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{apiBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"UNIT\",\n    \"name\": \"{{unitName}}\"\n  },\n  \"metadata\": {\n    \"sector\": \"demo-sign-se\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/organizations",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "organizations"
                  ]
                },
                "description": "Creates a fresh UNIT organization under the parent group/account."
              },
              "response": []
            },
            {
              "name": "Retrieve an Organization::UNIT",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{apiBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/organizations/{{organizationUnitId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "organizations",
                    "{{organizationUnitId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "List Organizations",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{apiBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/organizations?limit=20",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "organizations"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "20"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "subjects",
          "item": [
            {
              "name": "Create a Subject::API_KEY",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"subjectApiKey\", data.content.credentials.key);",
                      "    pm.environment.set(\"subjectApiSecret\", data.content.credentials.secret);",
                      "    pm.environment.set(\"subjectApiKeyId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{apiBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  },
                  {
                    "key": "X-Scope-Identifier",
                    "value": "{{organizationUnitId}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"API_KEY\",\n    \"name\": \"sign-se-demo-key\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/subjects",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "subjects"
                  ]
                },
                "description": "Creates an API_KEY subject scoped to the unit (via X-Scope-Identifier). The captured credentials are used by the operational token below and by the collection-level Pre-request auto-refresh."
              },
              "response": []
            },
            {
              "name": "Retrieve a Subject::API_KEY",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{apiBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/subjects/{{subjectApiKeyId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "subjects",
                    "{{subjectApiKeyId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "tokens (operation)",
          "item": [
            {
              "name": "Create a Token",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"opBearerToken\", data.content.authentication.bearer);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"API_KEY\",\n    \"key\": \"{{subjectApiKey}}\",\n    \"secret\": \"{{subjectApiSecret}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/tokens",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "tokens"
                  ]
                },
                "description": "Exchange the newly-created unit-scoped API key for an operational bearer. From here on every taxpayer/location/system/record request runs as that unit."
              },
              "response": []
            }
          ]
        },
        {
          "name": "taxpayers",
          "item": [
            {
              "name": "Create a Taxpayer::COMPANY",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"taxpayerId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"COMPANY\",\n    \"name\": {\n      \"legal\": \"{{taxpayerLegalName}}\",\n      \"trade\": \"{{taxpayerTradeName}}\"\n    },\n    \"address\": {\n      \"line\": {\n        \"type\": \"STREET_NUMBER\",\n        \"street\": \"Kungsgatan\",\n        \"number\": \"10\"\n      },\n      \"code\": \"11122\",\n      \"city\": \"Stockholm\",\n      \"country\": \"SE\"\n    },\n    \"fiscalization\": {\n      \"type\": \"SE\",\n      \"tax_id_number\": \"{{taxIdNumber}}\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/taxpayers",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "taxpayers"
                  ]
                },
                "description": "Swedish taxpayer. fiscalization.type=SE, tax_id_number is the Swedish organisationsnummer (10 digits, no hyphen) — set via the env variable `taxIdNumber`. Name and trade name are also env variables so customers can tailor the demo without editing the body."
              },
              "response": []
            },
            {
              "name": "Retrieve a Taxpayer::COMPANY",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/taxpayers/{{taxpayerId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "taxpayers",
                    "{{taxpayerId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Update a Taxpayer::COMPANY (Commission)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "PATCH",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"state\": \"COMMISSIONED\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/taxpayers/{{taxpayerId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "taxpayers",
                    "{{taxpayerId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "List Taxpayers",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/taxpayers?limit=20",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "taxpayers"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "20"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "locations",
          "item": [
            {
              "name": "Create a Location::BRANCH",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"locationId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"BRANCH\",\n    \"taxpayer\": {\n      \"id\": \"{{taxpayerId}}\"\n    },\n    \"name\": \"{{locationName}}\",\n    \"address\": {\n      \"line\": {\n        \"type\": \"STREET_NUMBER\",\n        \"street\": \"Kungsgatan\",\n        \"number\": \"10\"\n      },\n      \"code\": \"11122\",\n      \"city\": \"Stockholm\",\n      \"country\": \"SE\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/locations",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "locations"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Location::BRANCH",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/locations/{{locationId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "locations",
                    "{{locationId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Update a Location::BRANCH (Commission)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "PATCH",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"state\": \"COMMISSIONED\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/locations/{{locationId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "locations",
                    "{{locationId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "List Locations",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/locations?limit=20",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "locations"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "20"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "systems",
          "item": [
            {
              "name": "Create a System::FISCAL_DEVICE",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"systemId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"FISCAL_DEVICE\",\n    \"location\": {\n      \"id\": \"{{locationId}}\"\n    },\n    \"producer\": {\n      \"type\": \"MPN\",\n      \"number\": \"SE-POS-001\",\n      \"details\": {\n        \"name\": \"Nordic POS\",\n        \"model\": \"POS-1000\",\n        \"brand\": \"fiskaly\",\n        \"serial\": \"SN-SE-0001\",\n        \"date_of_entry\": \"2026-01-01\"\n      }\n    },\n    \"software\": {\n      \"name\": \"Nordic POS App\",\n      \"version\": \"1.0.0\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/systems",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "systems"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a System::FISCAL_DEVICE",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/systems/{{systemId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "systems",
                    "{{systemId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Update a System::FISCAL_DEVICE (Commission)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "PATCH",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"state\": \"COMMISSIONED\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/systems/{{systemId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "systems",
                    "{{systemId}}"
                  ]
                },
                "description": "Commissioning triggers SE IDM enrollment: the system interceptor obtains a Tillverkningsnummer (TSSI) from InfraSec IDM and stores it on the system as compliance.technical_security_system_id."
              },
              "response": []
            },
            {
              "name": "List Systems",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/systems?limit=20",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "systems"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "20"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        }
      ],
      "description": "End-to-end bootstrap: management token → fresh unit + API key → operational token → taxpayer / location / system (all commissioned). Right-click and 'Run folder' to execute every step in order."
    },
    {
      "name": "records",
      "item": [
        {
          "name": "records (OPENING)",
          "item": [
            {
              "name": "Create a Record::INTENTION::OPENING",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"openingRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"OPENING\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                },
                "description": "Required before any TRANSACTION record (system-behavior.md §3). Triggers TCS RegisterStatus check; on STATUS_OK / CONTACT_WITH_KS the system's operating_mode transitions CLOSED → OPENED."
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::INTENTION::OPENING",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{openingRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{openingRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "records (RECEIPT)",
          "item": [
            {
              "name": "Create a Record::INTENTION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"receiptIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::INTENTION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{receiptIntentionId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{receiptIntentionId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::RECEIPT",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"receiptRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{receiptIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"RECEIPT\",\n      \"document\": {\n        \"number\": \"1\",\n        \"series\": \"2026\",\n        \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n        \"operation_date\": \"2026-04-22\"\n      },\n      \"entries\": [\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Bröd 25%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"63.06\",\n                \"exclusive\": \"50.45\"\n              }\n            },\n            \"value\": {\n              \"base\": \"50.45\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"STANDARD\",\n              \"percentage\": \"25.00\",\n              \"amount\": \"12.61\",\n              \"exclusive\": \"50.45\",\n              \"inclusive\": \"63.06\"\n            }\n          }\n        },\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Mjölk 12%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"53.20\",\n                \"exclusive\": \"47.50\"\n              }\n            },\n            \"value\": {\n              \"base\": \"47.50\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"REDUCED_1\",\n              \"percentage\": \"12.00\",\n              \"amount\": \"5.70\",\n              \"exclusive\": \"47.50\",\n              \"inclusive\": \"53.20\"\n            }\n          }\n        }\n      ],\n      \"payments\": [\n        {\n          \"type\": \"CARD\",\n          \"kind\": \"CREDIT\",\n          \"number\": \"1234\",\n          \"details\": {\n            \"amount\": \"116.26\",\n            \"currency\": \"EUR\",\n            \"date\": \"2026-04-22\"\n          }\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"STANDARD\",\n          \"percentage\": \"25.00\",\n          \"amount\": \"12.61\",\n          \"exclusive\": \"50.45\",\n          \"inclusive\": \"63.06\"\n        },\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"REDUCED_1\",\n          \"percentage\": \"12.00\",\n          \"amount\": \"5.70\",\n          \"exclusive\": \"47.50\",\n          \"inclusive\": \"53.20\"\n        }\n      ],\n      \"totals\": {\n        \"vat\": {\n          \"amount\": \"18.31\",\n          \"exclusive\": \"97.95\",\n          \"inclusive\": \"116.26\"\n        }\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::TRANSACTION::RECEIPT",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{receiptRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{receiptRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ],
          "description": "Single normal sale signed end-to-end through InfraSec TCS verify."
        },
        {
          "name": "records (RECEIPT - Training)",
          "item": [
            {
              "name": "Create a Record::INTENTION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"trainingReceiptIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\",\n      \"details\": {\n        \"training\": true,\n        \"creators\": [\n          {\n            \"type\": \"PERSON\",\n            \"label\": \"cashier\"\n          }\n        ]\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::INTENTION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{trainingReceiptIntentionId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{trainingReceiptIntentionId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::RECEIPT",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"trainingReceiptRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{trainingReceiptIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"RECEIPT\",\n      \"document\": {\n        \"number\": \"2\",\n        \"series\": \"2026\",\n        \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n        \"operation_date\": \"2026-04-22\"\n      },\n      \"entries\": [\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Bröd 25%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"63.06\",\n                \"exclusive\": \"50.45\"\n              }\n            },\n            \"value\": {\n              \"base\": \"50.45\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"STANDARD\",\n              \"percentage\": \"25.00\",\n              \"amount\": \"12.61\",\n              \"exclusive\": \"50.45\",\n              \"inclusive\": \"63.06\"\n            }\n          }\n        },\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Mjölk 12%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"53.20\",\n                \"exclusive\": \"47.50\"\n              }\n            },\n            \"value\": {\n              \"base\": \"47.50\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"REDUCED_1\",\n              \"percentage\": \"12.00\",\n              \"amount\": \"5.70\",\n              \"exclusive\": \"47.50\",\n              \"inclusive\": \"53.20\"\n            }\n          }\n        }\n      ],\n      \"payments\": [\n        {\n          \"type\": \"CARD\",\n          \"kind\": \"CREDIT\",\n          \"number\": \"1234\",\n          \"details\": {\n            \"amount\": \"116.26\",\n            \"currency\": \"EUR\",\n            \"date\": \"2026-04-22\"\n          }\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"STANDARD\",\n          \"percentage\": \"25.00\",\n          \"amount\": \"12.61\",\n          \"exclusive\": \"50.45\",\n          \"inclusive\": \"63.06\"\n        },\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"REDUCED_1\",\n          \"percentage\": \"12.00\",\n          \"amount\": \"5.70\",\n          \"exclusive\": \"47.50\",\n          \"inclusive\": \"53.20\"\n        }\n      ],\n      \"totals\": {\n        \"vat\": {\n          \"amount\": \"18.31\",\n          \"exclusive\": \"97.95\",\n          \"inclusive\": \"116.26\"\n        }\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::TRANSACTION::RECEIPT",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{trainingReceiptRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{trainingReceiptRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ],
          "description": "SE-TR-002 training receipt (övningskvitto). details.training=true on the intention propagates to the transaction. TCS replies STATUS_OK with an empty ControlCode → compliance.data = '<ControlServerID>,,STATUS_OK,…'."
        },
        {
          "name": "records (CANCELLATION)",
          "item": [
            {
              "name": "Create a Record::INTENTION (sale to be cancelled)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"cancelTargetIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::RECEIPT (to be cancelled)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"cancelTargetRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{cancelTargetIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"RECEIPT\",\n      \"document\": {\n        \"number\": \"3\",\n        \"series\": \"2026\",\n        \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n        \"operation_date\": \"2026-04-22\"\n      },\n      \"entries\": [\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Bröd 25%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"63.06\",\n                \"exclusive\": \"50.45\"\n              }\n            },\n            \"value\": {\n              \"base\": \"50.45\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"STANDARD\",\n              \"percentage\": \"25.00\",\n              \"amount\": \"12.61\",\n              \"exclusive\": \"50.45\",\n              \"inclusive\": \"63.06\"\n            }\n          }\n        },\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Mjölk 12%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"53.20\",\n                \"exclusive\": \"47.50\"\n              }\n            },\n            \"value\": {\n              \"base\": \"47.50\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"REDUCED_1\",\n              \"percentage\": \"12.00\",\n              \"amount\": \"5.70\",\n              \"exclusive\": \"47.50\",\n              \"inclusive\": \"53.20\"\n            }\n          }\n        }\n      ],\n      \"payments\": [\n        {\n          \"type\": \"CARD\",\n          \"kind\": \"CREDIT\",\n          \"number\": \"1234\",\n          \"details\": {\n            \"amount\": \"116.26\",\n            \"currency\": \"EUR\",\n            \"date\": \"2026-04-22\"\n          }\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"STANDARD\",\n          \"percentage\": \"25.00\",\n          \"amount\": \"12.61\",\n          \"exclusive\": \"50.45\",\n          \"inclusive\": \"63.06\"\n        },\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"REDUCED_1\",\n          \"percentage\": \"12.00\",\n          \"amount\": \"5.70\",\n          \"exclusive\": \"47.50\",\n          \"inclusive\": \"53.20\"\n        }\n      ],\n      \"totals\": {\n        \"vat\": {\n          \"amount\": \"18.31\",\n          \"exclusive\": \"97.95\",\n          \"inclusive\": \"116.26\"\n        }\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::INTENTION (cancellation)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"cancellationIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::CANCELLATION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"cancellationRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{cancellationIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"CANCELLATION\",\n      \"record\": {\n        \"id\": \"{{cancelTargetRecordId}}\"\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::TRANSACTION::CANCELLATION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{cancellationRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{cancellationRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "records (CORRECTION::RECEIPT)",
          "item": [
            {
              "name": "Create a Record::INTENTION (sale to be corrected)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"corrTargetIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::RECEIPT (to be corrected)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"corrTargetRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{corrTargetIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"RECEIPT\",\n      \"document\": {\n        \"number\": \"4\",\n        \"series\": \"2026\",\n        \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n        \"operation_date\": \"2026-04-22\"\n      },\n      \"entries\": [\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Bröd 25%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"63.06\",\n                \"exclusive\": \"50.45\"\n              }\n            },\n            \"value\": {\n              \"base\": \"50.45\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"STANDARD\",\n              \"percentage\": \"25.00\",\n              \"amount\": \"12.61\",\n              \"exclusive\": \"50.45\",\n              \"inclusive\": \"63.06\"\n            }\n          }\n        },\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Mjölk 12%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"53.20\",\n                \"exclusive\": \"47.50\"\n              }\n            },\n            \"value\": {\n              \"base\": \"47.50\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"REDUCED_1\",\n              \"percentage\": \"12.00\",\n              \"amount\": \"5.70\",\n              \"exclusive\": \"47.50\",\n              \"inclusive\": \"53.20\"\n            }\n          }\n        }\n      ],\n      \"payments\": [\n        {\n          \"type\": \"CARD\",\n          \"kind\": \"CREDIT\",\n          \"number\": \"1234\",\n          \"details\": {\n            \"amount\": \"116.26\",\n            \"currency\": \"EUR\",\n            \"date\": \"2026-04-22\"\n          }\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"STANDARD\",\n          \"percentage\": \"25.00\",\n          \"amount\": \"12.61\",\n          \"exclusive\": \"50.45\",\n          \"inclusive\": \"63.06\"\n        },\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"REDUCED_1\",\n          \"percentage\": \"12.00\",\n          \"amount\": \"5.70\",\n          \"exclusive\": \"47.50\",\n          \"inclusive\": \"53.20\"\n        }\n      ],\n      \"totals\": {\n        \"vat\": {\n          \"amount\": \"18.31\",\n          \"exclusive\": \"97.95\",\n          \"inclusive\": \"116.26\"\n        }\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::INTENTION (correction)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"correctionIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::CORRECTION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"correctionRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{correctionIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"CORRECTION\",\n      \"record\": {\n        \"id\": \"{{corrTargetRecordId}}\"\n      },\n      \"reason\": \"Customer return — correction of an already-signed receipt\",\n      \"data\": {\n        \"type\": \"RECEIPT\",\n        \"document\": {\n          \"number\": \"7\",\n          \"series\": \"2026\",\n          \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n          \"operation_date\": \"2026-04-22\"\n        },\n        \"entries\": [\n          {\n            \"type\": \"RETURN\",\n            \"details\": {\n              \"concept\": \"GOOD\"\n            },\n            \"data\": {\n              \"type\": \"ITEM\",\n              \"text\": \"Bröd 25% (return)\",\n              \"unit\": {\n                \"quantity\": \"1\",\n                \"price\": {\n                  \"inclusive\": \"63.06\",\n                  \"exclusive\": \"50.45\"\n                }\n              },\n              \"value\": {\n                \"base\": \"50.45\"\n              },\n              \"vat\": {\n                \"type\": \"VAT_RATE\",\n                \"code\": \"STANDARD\",\n                \"percentage\": \"25.00\",\n                \"amount\": \"12.61\",\n                \"exclusive\": \"50.45\",\n                \"inclusive\": \"63.06\"\n              }\n            }\n          }\n        ],\n        \"breakdown\": [\n          {\n            \"type\": \"VAT_RATE\",\n            \"code\": \"STANDARD\",\n            \"percentage\": \"25.00\",\n            \"amount\": \"12.61\",\n            \"exclusive\": \"50.45\",\n            \"inclusive\": \"63.06\"\n          }\n        ],\n        \"totals\": {\n          \"vat\": {\n            \"amount\": \"12.61\",\n            \"exclusive\": \"50.45\",\n            \"inclusive\": \"63.06\"\n          }\n        },\n        \"payments\": [\n          {\n            \"type\": \"CASH\",\n            \"details\": {\n              \"amount\": \"63.06\",\n              \"currency\": \"EUR\",\n              \"date\": \"2026-04-22\"\n            }\n          }\n        ]\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::TRANSACTION::CORRECTION",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{correctionRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{correctionRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "records (DUPLICATE::RECEIPT)",
          "item": [
            {
              "name": "Create a Record::INTENTION (sale to be duplicated)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"dupTargetIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::RECEIPT (to be duplicated)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"dupTargetRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{dupTargetIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"RECEIPT\",\n      \"document\": {\n        \"number\": \"5\",\n        \"series\": \"2026\",\n        \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n        \"operation_date\": \"2026-04-22\"\n      },\n      \"entries\": [\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Bröd 25%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"63.06\",\n                \"exclusive\": \"50.45\"\n              }\n            },\n            \"value\": {\n              \"base\": \"50.45\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"STANDARD\",\n              \"percentage\": \"25.00\",\n              \"amount\": \"12.61\",\n              \"exclusive\": \"50.45\",\n              \"inclusive\": \"63.06\"\n            }\n          }\n        },\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Mjölk 12%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"53.20\",\n                \"exclusive\": \"47.50\"\n              }\n            },\n            \"value\": {\n              \"base\": \"47.50\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"REDUCED_1\",\n              \"percentage\": \"12.00\",\n              \"amount\": \"5.70\",\n              \"exclusive\": \"47.50\",\n              \"inclusive\": \"53.20\"\n            }\n          }\n        }\n      ],\n      \"payments\": [\n        {\n          \"type\": \"CARD\",\n          \"kind\": \"CREDIT\",\n          \"number\": \"1234\",\n          \"details\": {\n            \"amount\": \"116.26\",\n            \"currency\": \"EUR\",\n            \"date\": \"2026-04-22\"\n          }\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"STANDARD\",\n          \"percentage\": \"25.00\",\n          \"amount\": \"12.61\",\n          \"exclusive\": \"50.45\",\n          \"inclusive\": \"63.06\"\n        },\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"REDUCED_1\",\n          \"percentage\": \"12.00\",\n          \"amount\": \"5.70\",\n          \"exclusive\": \"47.50\",\n          \"inclusive\": \"53.20\"\n        }\n      ],\n      \"totals\": {\n        \"vat\": {\n          \"amount\": \"18.31\",\n          \"exclusive\": \"97.95\",\n          \"inclusive\": \"116.26\"\n        }\n      }\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::INTENTION::DUPLICATE",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"duplicateRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"DUPLICATE\",\n      \"record\": {\n        \"id\": \"{{dupTargetRecordId}}\"\n      },\n      \"number\": \"2\",\n      \"reason\": \"Customer requested copy\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::INTENTION::DUPLICATE",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{duplicateRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{duplicateRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "records (PRO_FORMA_INVOICE)",
          "item": [
            {
              "name": "Create a Record::INTENTION (pro forma)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"profoIntentionId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"TRANSACTION\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Create a Record::TRANSACTION::PRO_FORMA_INVOICE",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "    var data = pm.response.json();",
                      "    pm.environment.set(\"profoRecordId\", data.content.id);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  },
                  {
                    "key": "X-Idempotency-Key",
                    "value": "{{$guid}}"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"content\": {\n    \"type\": \"TRANSACTION\",\n    \"record\": {\n      \"id\": \"{{profoIntentionId}}\"\n    },\n    \"operation\": {\n      \"type\": \"PRO_FORMA_INVOICE\",\n      \"document\": {\n        \"number\": \"8\",\n        \"series\": \"2026\",\n        \"issued_at\": \"2026-04-22T12:00:00+00:00\",\n        \"operation_date\": \"2026-04-22\"\n      },\n      \"entries\": [\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Bröd 25%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"63.06\",\n                \"exclusive\": \"50.45\"\n              }\n            },\n            \"value\": {\n              \"base\": \"50.45\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"STANDARD\",\n              \"percentage\": \"25.00\",\n              \"amount\": \"12.61\",\n              \"exclusive\": \"50.45\",\n              \"inclusive\": \"63.06\"\n            }\n          }\n        },\n        {\n          \"type\": \"SALE\",\n          \"details\": {\n            \"concept\": \"GOOD\"\n          },\n          \"data\": {\n            \"type\": \"ITEM\",\n            \"text\": \"Mjölk 12%\",\n            \"unit\": {\n              \"quantity\": \"1\",\n              \"price\": {\n                \"inclusive\": \"53.20\",\n                \"exclusive\": \"47.50\"\n              }\n            },\n            \"value\": {\n              \"base\": \"47.50\"\n            },\n            \"vat\": {\n              \"type\": \"VAT_RATE\",\n              \"code\": \"REDUCED_1\",\n              \"percentage\": \"12.00\",\n              \"amount\": \"5.70\",\n              \"exclusive\": \"47.50\",\n              \"inclusive\": \"53.20\"\n            }\n          }\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"STANDARD\",\n          \"percentage\": \"25.00\",\n          \"amount\": \"12.61\",\n          \"exclusive\": \"50.45\",\n          \"inclusive\": \"63.06\"\n        },\n        {\n          \"type\": \"VAT_RATE\",\n          \"code\": \"REDUCED_1\",\n          \"percentage\": \"12.00\",\n          \"amount\": \"5.70\",\n          \"exclusive\": \"47.50\",\n          \"inclusive\": \"53.20\"\n        }\n      ],\n      \"totals\": {\n        \"vat\": {\n          \"amount\": \"18.31\",\n          \"exclusive\": \"97.95\",\n          \"inclusive\": \"116.26\"\n        }\n      },\n      \"recipients\": [\n        {\n          \"type\": \"BUSINESS\",\n          \"name\": \"Acme Buyer AB\",\n          \"address\": {\n            \"line\": {\n              \"type\": \"STREET_NUMBER\",\n              \"street\": \"Storgatan\",\n              \"number\": \"5\"\n            },\n            \"code\": \"11122\",\n            \"city\": \"Stockholm\",\n            \"country\": \"SE\"\n          },\n          \"identification\": {\n            \"type\": \"VAT\",\n            \"number\": \"SE556011122301\"\n          }\n        }\n      ]\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{apiBaseUrl}}/records",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Retrieve a Record::TRANSACTION::PRO_FORMA_INVOICE",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Status code is 200\", function () {",
                      "    pm.response.to.have.status(200);",
                      "});"
                    ]
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{opBearerToken}}",
                      "type": "string"
                    }
                  ]
                },
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "X-Api-Version",
                    "value": "{{apiVersion}}"
                  }
                ],
                "url": {
                  "raw": "{{apiBaseUrl}}/records/{{profoRecordId}}",
                  "host": [
                    "{{apiBaseUrl}}"
                  ],
                  "path": [
                    "records",
                    "{{profoRecordId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "List Records",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/records?limit=20",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "records"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "20"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "teardown",
      "item": [
        {
          "name": "Create a Record::INTENTION::CLOSING",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"type\": \"INTENTION\",\n    \"system\": {\n      \"id\": \"{{systemId}}\"\n    },\n    \"operation\": {\n      \"type\": \"CLOSING\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/records",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "records"
              ]
            },
            "description": "operating_mode OPENED → CLOSED. Required before decommissioning the system."
          },
          "response": []
        },
        {
          "name": "Decommission System",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"state\": \"DECOMMISSIONED\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/systems/{{systemId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "systems",
                "{{systemId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Decommission Location",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"state\": \"DECOMMISSIONED\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/locations/{{locationId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "locations",
                "{{locationId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Decommission Taxpayer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              },
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"state\": \"DECOMMISSIONED\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/taxpayers/{{taxpayerId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "taxpayers",
                "{{taxpayerId}}"
              ]
            }
          },
          "response": []
        }
      ],
      "description": "Tear the demo down so the collection can be re-run cleanly. Cash register must be CLOSED before system decommissioning (system-behavior.md §4)."
    },
    {
      "name": "debug",
      "item": [
        {
          "name": "List Taxpayers",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/taxpayers?limit=50",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "taxpayers"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve Taxpayer",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/taxpayers/{{taxpayerId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "taxpayers",
                "{{taxpayerId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "List Locations",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/locations?limit=50",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "locations"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve Location",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/locations/{{locationId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "locations",
                "{{locationId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "List Systems",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/systems?limit=50",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "systems"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve System",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/systems/{{systemId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "systems",
                "{{systemId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "List Records",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{opBearerToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Api-Version",
                "value": "{{apiVersion}}"
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/records?limit=50",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "records"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          },
          "response": []
        }
      ],
      "description": "Read-only helpers for diagnosing collection state — list existing resources, inspect a specific entity by id. Useful when 'cannot create more than 1 taxpayer per fiscalization country' fires."
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Auto-refresh the operational bearer (opBearerToken) when missing or stale.",
          "// Skipped when the request itself is hitting /tokens to avoid recursion.",
          "",
          "const TOKEN_TTL_MS = 25 * 60 * 1000;",
          "",
          "if (pm.request.url.toString().includes('/tokens')) {",
          "    return;",
          "}",
          "",
          "const now = Date.now();",
          "const bearer = pm.environment.get('opBearerToken');",
          "const bearerSetAt = parseInt(pm.environment.get('opBearerTokenSetAtMs') || '0', 10);",
          "const isExpired = !bearer || (now - bearerSetAt) > TOKEN_TTL_MS;",
          "",
          "if (!isExpired) {",
          "    return;",
          "}",
          "",
          "// Prefer the bootstrapped unit-scoped key (set by setup/subjects), fall back",
          "// to the env key — which lets read-only debug calls work even before bootstrap.",
          "const subjectApiKey = pm.environment.get('subjectApiKey');",
          "const subjectApiSecret = pm.environment.get('subjectApiSecret');",
          "const apiKey = subjectApiKey || pm.environment.get('apiKey');",
          "const apiSecret = subjectApiSecret || pm.environment.get('apiSecret');",
          "",
          "if (!apiKey || !apiSecret) {",
          "    console.warn('auto-refresh: no api key/secret available — run setup folder or set env apiKey/apiSecret');",
          "    return;",
          "}",
          "",
          "console.log('auto-refresh: opBearerToken missing or stale, calling /tokens');",
          "",
          "pm.sendRequest({",
          "    url: pm.environment.get('apiBaseUrl') + '/tokens',",
          "    method: 'POST',",
          "    header: {",
          "        'Content-Type': 'application/json',",
          "        'X-Api-Version': pm.environment.get('apiVersion'),",
          "        'X-Idempotency-Key': pm.variables.replaceIn('{{$guid}}'),",
          "    },",
          "    body: {",
          "        mode: 'raw',",
          "        raw: JSON.stringify({",
          "            content: { type: 'API_KEY', key: apiKey, secret: apiSecret },",
          "        }),",
          "    },",
          "}, (err, res) => {",
          "    if (err) {",
          "        console.error('auto-refresh failed:', err);",
          "        return;",
          "    }",
          "    if (res.code !== 200) {",
          "        console.error('auto-refresh non-200:', res.code, res.text());",
          "        return;",
          "    }",
          "    const json = res.json();",
          "    pm.environment.set('opBearerToken', json.content.authentication.bearer);",
          "    pm.environment.set('opBearerTokenSetAtMs', Date.now().toString());",
          "    console.log('auto-refresh: opBearerToken refreshed');",
          "});"
        ]
      }
    }
  ]
}