{
  "info": {
    "name": "A8PRO CR 1.1.30.0 R4 — manual requests",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Set request timeout to 15000 ms. Local workstation only. GET read starts a real device read. ACK clears cache. Use synthetic/approved test data; do not share filled environments or response history."
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:9010"
    },
    {
      "key": "token",
      "value": ""
    },
    {
      "key": "scanId",
      "value": ""
    },
    {
      "key": "savedConfirmed",
      "value": "no"
    }
  ],
  "item": [
    {
      "name": "1. Status",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-A8PRO-Token",
            "value": "{{token}}"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/v2/status",
        "description": "Manual use only. Do not run the entire collection. Never log/export token or real document responses."
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if ((pm.variables.get('token') || '').length < 32) { pm.execution.skipRequest(); throw new Error('Set local token (32+ characters).'); }"
            ]
          }
        }
      ]
    },
    {
      "name": "2. Read once",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-A8PRO-Token",
            "value": "{{token}}"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/v2/getInfo",
        "description": "Manual use only. Do not run the entire collection. Never log/export token or real document responses."
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if ((pm.variables.get('token') || '').length < 32) { pm.execution.skipRequest(); throw new Error('Set local token (32+ characters).'); }"
            ]
          }
        }
      ]
    },
    {
      "name": "3. Last (inspect known ID only)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-A8PRO-Token",
            "value": "{{token}}"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/v2/getInfo/last",
        "description": "Manual use only. Do not run the entire collection. Never log/export token or real document responses."
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if ((pm.variables.get('token') || '').length < 32) { pm.execution.skipRequest(); throw new Error('Set local token (32+ characters).'); }"
            ]
          }
        }
      ]
    },
    {
      "name": "4. ACK only after save",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "X-A8PRO-Token",
            "value": "{{token}}"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/v2/getInfo/ack?scanId={{scanId}}",
        "description": "Manual use only. Do not run the entire collection. Never log/export token or real document responses."
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if ((pm.variables.get('token') || '').length < 32) { pm.execution.skipRequest(); throw new Error('Set local token (32+ characters).'); }",
              "if (pm.variables.get('savedConfirmed') !== 'yes' || !/^[a-f0-9]{32}$/.test(pm.variables.get('scanId') || '')) { pm.execution.skipRequest(); throw new Error('Save first; set exact scanId and savedConfirmed=yes.'); }",
              "pm.collectionVariables.set('savedConfirmed', 'no');"
            ]
          }
        }
      ]
    }
  ]
}
