{
  "info": {
    "_postman_id": "e373368d-f118-44ce-bac7-c4adc30edb86",
    "name": "Fiscal API updated",
    "description": "Current REST collection, aligned with repository implementation on 2026-09-18. 14 routes / 15 requests (GET and POST discovery).\n\n## Setup\nSet base_url to the Cashbox application's device HTTP address and merchant_id to its configured merchant ID. Existing connection settings were retained from the supplied collection. Keep merchant_id private when sharing. Use a current Postman version with Web Crypto support. Set request timeout above 310000 ms if waiting for long-running operations.\n\n## Editing and sending\nFor signed POST requests, edit `payload` in Scripts → Pre-request. Body is {{cashbox_form_body}}. The script resolves variables, serializes UTF-8 JSON, Base64-encodes data, computes Base64(UTF-8(lowercase SHA1 hex(data + merchant_id))), and URL-encodes both form values. It does not log credentials. Empty business requests send {} through this envelope. Discovery requires no envelope.\n\n## Examples and identifiers\nSet tax_code to a configured tax code; A is retained only as an example. Monetary values are integer minor units, itemQty is quantity × 1000, taxPrc is percentage × 100. Currency comes from Cashbox configuration. Set a distinct documentExtID for every new operation and retain it when checking that operation. Lookup variables are manual; the collection does not overwrite them from responses. Set document_id for check_copy and parent_fiscal_number before refund. Execute individual requests in the intended business order; the collection includes sale, refund, shift closure and cash operations.\n\n## Additional payments\npayments supports cashAmount, cashlessAmount, creditAmount, bonusesAmount and prepaymentAmount. payments.tips is preferred; sale.tips is its fallback. extraPayments entries: {\"code\":\"<configured payment code>\",\"amount\":1000,\"trxParams\":{\"rrn\":\"...\",\"cardNumber\":\"...\",\"bankName\":\"...\",\"binName\":\"...\"}}. Use configured payment codes; do not duplicate a type across payments and extraPayments. Partial payment failures may include paidAmount, dueAmount and totalPayments with settled flags. genPreview=true may add preview_data on supported operations.\n\n## Responses and errors\nAPI result is in JSON status/code, normally with HTTP 200. Success code is 0; normal error codes are -1, 1, 6, 9, 15, 24 and 44; code can be omitted. A print failure can occur after the operation commits. Unsupported methods return 405 and unavailable routes 404; these can be plain text. Null properties are omitted. Examples use synthetic identifiers; GHS and C are illustrative configured currency/payment values. Discovery example shows possible routes, not guaranteed device support. Provider-specific get_info and report responses should be inspected on the actual device.\n\n## Changes from imported collection\nAdded discovery (GET/POST) and dates_report; added external IDs, preview options, extraParams and extraPayments; corrected abort identifier type, x_report body and empty requests; removed unsupported client fields and ineffective fields from runnable examples. Replaced duplicated legacy CryptoJS signing and hardcoded connection values with Web Crypto and variables. Historical response captures were replaced by illustrative current-contract examples or omitted where provider-specific. No requests were sent to a device.\n\nPostman scripting reference: https://learning.postman.com/v11/docs/tests-and-scripts/write-scripts/postman-sandbox-reference/pm-require\n",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "7091588"
  },
  "item": [
    {
      "name": "GET /supported_operations",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{base_url}}/supported_operations",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "supported_operations"
          ]
        },
        "description": "Discovers available route names without leading slash. Both GET and POST are accepted without a body or signature. Only operations supported by the configured fiscal core are listed."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/supported_operations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "supported_operations"
              ]
            },
            "description": "Discovers available route names without leading slash. Both GET and POST are accepted without a body or signature. Only operations supported by the configured fiscal core are listed."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"operations\": [\n    \"sale\",\n    \"refund\",\n    \"check_status\",\n    \"check_copy\",\n    \"x_report\",\n    \"open_shift\",\n    \"close_shift\",\n    \"check_shift\",\n    \"deposit\",\n    \"withdraw\",\n    \"abort\",\n    \"get_info\",\n    \"dates_report\",\n    \"supported_operations\"\n  ]\n}"
        }
      ]
    },
    {
      "name": "POST /supported_operations",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{base_url}}/supported_operations",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "supported_operations"
          ]
        },
        "description": "Discovers available route names without leading slash. Both GET and POST are accepted without a body or signature. Only operations supported by the configured fiscal core are listed."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/supported_operations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "supported_operations"
              ]
            },
            "description": "Discovers available route names without leading slash. Both GET and POST are accepted without a body or signature. Only operations supported by the configured fiscal core are listed."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"operations\": [\n    \"sale\",\n    \"refund\",\n    \"check_status\",\n    \"check_copy\",\n    \"x_report\",\n    \"open_shift\",\n    \"close_shift\",\n    \"check_shift\",\n    \"deposit\",\n    \"withdraw\",\n    \"abort\",\n    \"get_info\",\n    \"dates_report\",\n    \"supported_operations\"\n  ]\n}"
        }
      ]
    },
    {
      "name": "POST /sale",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentExtID\": \"{{sale_document_ext_id}}\",",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"items\": [",
              "    {",
              "      \"itemAssortId\": \"7\",",
              "      \"itemName\": \"Lay’s\",",
              "      \"itemUnit\": \"pcs\",",
              "      \"itemQty\": 3000,",
              "      \"itemAmount\": 1992,",
              "      \"itemTaxes\": [",
              "        {",
              "          \"taxCode\": \"{{tax_code}}\"",
              "        }",
              "      ]",
              "    }",
              "  ],",
              "  \"payments\": {",
              "    \"cashAmount\": 1992",
              "  },",
              "  \"extraPayments\": [],",
              "  \"extraParams\": {},",
              "  \"genPreview\": false",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/sale",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "sale"
          ]
        },
        "description": "Creates a sale. itemAssortId is the product code; itemId is only diagnostic. itemAmount is the final line total after line discount. Optional receipt and line discounts: discount (integer minor units), discountPrc (number), discountName (string). Percentage takes precedence when both are supplied. genPreview requests preview_data when available. extraParams is a string-to-string/null map (alias extra_params). Configured currency is used. amount, currency, printFooter and skipReceiptPrint do not control the operation; clientPhone/clientName are unsupported and removed from this example.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/sale",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "sale"
              ]
            },
            "description": "Creates a sale. itemAssortId is the product code; itemId is only diagnostic. itemAmount is the final line total after line discount. Optional receipt and line discounts: discount (integer minor units), discountPrc (number), discountName (string). Percentage takes precedence when both are supplied. genPreview requests preview_data when available. extraParams is a string-to-string/null map (alias extra_params). Configured currency is used. amount, currency, printFooter and skipReceiptPrint do not control the operation; clientPhone/clientName are unsupported and removed from this example.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 7,\n  \"documentExtID\": \"example-001\",\n  \"fiscalID\": \"example-fiscal-id\",\n  \"fiscalNum\": \"example-fiscal-number\",\n  \"docStatus\": 1,\n  \"currency_name\": \"GHS\",\n  \"totalPayments\": [\n    {\n      \"type\": \"C\",\n      \"amount\": 1992,\n      \"currency_name\": \"GHS\"\n    }\n  ]\n}"
        }
      ]
    },
    {
      "name": "POST /refund",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentExtID\": \"{{refund_document_ext_id}}\",",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"items\": [",
              "    {",
              "      \"itemAssortId\": \"7\",",
              "      \"itemName\": \"Lay’s\",",
              "      \"itemUnit\": \"pcs\",",
              "      \"itemQty\": 3000,",
              "      \"itemAmount\": 1992,",
              "      \"itemTaxes\": [",
              "        {",
              "          \"taxCode\": \"{{tax_code}}\"",
              "        }",
              "      ]",
              "    }",
              "  ],",
              "  \"payments\": {",
              "    \"cashAmount\": 1992",
              "  },",
              "  \"extraPayments\": [],",
              "  \"extraParams\": {},",
              "  \"genPreview\": false,",
              "  \"parentDocNum\": \"{{parent_fiscal_number}}\"",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/refund",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "refund"
          ]
        },
        "description": "Returns the original sale. Set parent_fiscal_number to its fiscal number, not internal documentID. parentDocID/parentDocNum also accept aliases parentFiscalID/parentFiscalNum. Source lookup must succeed if a parent reference is supplied. originAmount and currency have no operational effect.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/refund",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "refund"
              ]
            },
            "description": "Returns the original sale. Set parent_fiscal_number to its fiscal number, not internal documentID. parentDocID/parentDocNum also accept aliases parentFiscalID/parentFiscalNum. Source lookup must succeed if a parent reference is supplied. originAmount and currency have no operational effect.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 7,\n  \"documentExtID\": \"example-001\",\n  \"fiscalID\": \"example-fiscal-id\",\n  \"fiscalNum\": \"example-fiscal-number\",\n  \"docStatus\": 1,\n  \"currency_name\": \"GHS\",\n  \"totalPayments\": [\n    {\n      \"type\": \"C\",\n      \"amount\": 1992,\n      \"currency_name\": \"GHS\"\n    }\n  ]\n}"
        }
      ]
    },
    {
      "name": "POST /check_status",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentExtID\": \"{{document_ext_id}}\"",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/check_status",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "check_status"
          ]
        },
        "description": "Looks up documentExtID (string), or replace the payload with {\"documentID\": 7}. Internal documentID takes precedence if both are supplied. Does not return preview_data.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/check_status",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "check_status"
              ]
            },
            "description": "Looks up documentExtID (string), or replace the payload with {\"documentID\": 7}. Internal documentID takes precedence if both are supplied. Does not return preview_data.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 7,\n  \"documentExtID\": \"example-001\",\n  \"fiscalID\": \"example-fiscal-id\",\n  \"fiscalNum\": \"example-fiscal-number\",\n  \"docStatus\": 1,\n  \"currency_name\": \"GHS\",\n  \"totalPayments\": [\n    {\n      \"type\": \"C\",\n      \"amount\": 1992,\n      \"currency_name\": \"GHS\"\n    }\n  ]\n}"
        }
      ]
    },
    {
      "name": "POST /check_copy",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentID\": \"__NUMERIC_DOCUMENT_ID__\"",
              "};",
              "const id = String(pm.variables.get('document_id'));",
              "if (!/^[0-9]+$/.test(id) || !Number.isSafeInteger(Number(id))) throw new Error('Set document_id to a safe integer.');",
              "payload.documentID = Number(id);",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/check_copy",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "check_copy"
          ]
        },
        "description": "Prints a copy. documentID (integer int64) is required; documentExtID cannot replace it. Response items use itemAmount before discount and itemFinalAmount after discount; payment entries use code instead of type.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/check_copy",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "check_copy"
              ]
            },
            "description": "Prints a copy. documentID (integer int64) is required; documentExtID cannot replace it. Response items use itemAmount before discount and itemFinalAmount after discount; payment entries use code instead of type.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 7,\n  \"docStatus\": 1,\n  \"currency_name\": \"GHS\",\n  \"items\": [\n    {\n      \"itemId\": \"7\",\n      \"itemName\": \"Lay’s\",\n      \"itemQty\": 3000,\n      \"itemAmount\": 1992,\n      \"itemFinalAmount\": 1992\n    }\n  ],\n  \"totalPayments\": [\n    {\n      \"code\": \"C\",\n      \"amount\": 1992,\n      \"currency_name\": \"GHS\"\n    }\n  ]\n}"
        }
      ]
    },
    {
      "name": "POST /x_report",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"skipReceipt\": false",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/x_report",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "x_report"
          ]
        },
        "description": "Prints the current X report; skipReceipt=true suppresses printing (alias skipReceiptPrint). shiftID is not a request field.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": []
    },
    {
      "name": "POST /open_shift",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"employeeName\": \"{{employee_name}}\"",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/open_shift",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "open_shift"
          ]
        },
        "description": "Opens a shift. REST response does not include cash or currency_name.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/open_shift",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "open_shift"
              ]
            },
            "description": "Opens a shift. REST response does not include cash or currency_name.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"shiftID\": 1,\n  \"fiscalID\": \"example-fiscal-id\",\n  \"shiftOpenAt\": \"2026-09-18 09:00:00\"\n}"
        }
      ]
    },
    {
      "name": "POST /close_shift",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"openOrdersOperation\": \"check\",",
              "  \"genPreview\": false",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/close_shift",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "close_shift"
          ]
        },
        "description": "Closes a shift. openOrdersOperation: check (default), delete, or renew; policy and terminal-paid documents can restrict the action. genPreview optionally requests preview_data.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": []
    },
    {
      "name": "POST /check_shift",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/check_shift",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "check_shift"
          ]
        },
        "description": "Empty business object {} is still encoded as data=e30%3D. isShiftOpen is a STRING; shiftStatus is 1 (open) or 2 (closed). Closed response omits shiftID/shiftOpenAt.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/check_shift",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "check_shift"
              ]
            },
            "description": "Empty business object {} is still encoded as data=e30%3D. isShiftOpen is a STRING; shiftStatus is 1 (open) or 2 (closed). Closed response omits shiftID/shiftOpenAt.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"isShiftOpen\": \"false\",\n  \"shiftStatus\": 2,\n  \"currency_name\": \"GHS\"\n}"
        }
      ]
    },
    {
      "name": "POST /deposit",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentExtID\": \"{{deposit_document_ext_id}}\",",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"amount\": 10000,",
              "  \"genPreview\": false",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/deposit",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "deposit"
          ]
        },
        "description": "Cash deposit in integer minor units; configured currency is used. Supports documentExtID and genPreview.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/deposit",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "deposit"
              ]
            },
            "description": "Cash deposit in integer minor units; configured currency is used. Supports documentExtID and genPreview.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 8,\n  \"documentExtID\": \"example-cash-001\",\n  \"amount\": 10000,\n  \"currency_name\": \"GHS\",\n  \"fiscalID\": \"example-fiscal-id\"\n}"
        }
      ]
    },
    {
      "name": "POST /withdraw",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentExtID\": \"{{withdraw_document_ext_id}}\",",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"amount\": 10000,",
              "  \"genPreview\": false",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/withdraw",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "withdraw"
          ]
        },
        "description": "Cash withdrawal in integer minor units; configured currency is used. Supports documentExtID and genPreview.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/withdraw",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "withdraw"
              ]
            },
            "description": "Cash withdrawal in integer minor units; configured currency is used. Supports documentExtID and genPreview.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 8,\n  \"documentExtID\": \"example-cash-001\",\n  \"amount\": 10000,\n  \"currency_name\": \"GHS\",\n  \"fiscalID\": \"example-fiscal-id\"\n}"
        }
      ]
    },
    {
      "name": "POST /abort",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"documentExtID\": \"{{document_ext_id}}\"",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/abort",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "abort"
          ]
        },
        "description": "Aborts an open document by documentExtID (string). documentID alone is not a lookup key.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/abort",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "abort"
              ]
            },
            "description": "Aborts an open document by documentExtID (string). documentID alone is not a lookup key.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0,\n  \"documentID\": 7,\n  \"documentExtID\": \"example-open-document\"\n}"
        }
      ]
    },
    {
      "name": "POST /get_info",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/get_info",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "get_info"
          ]
        },
        "description": "Empty business object {} is sent in the signed form envelope. fiscalData is provider-specific JSON; consult the actual device response for its structure.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": []
    },
    {
      "name": "POST /dates_report",
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Edit the business JSON payload below. The Body tab contains the generated form envelope.",
              "const payload = {",
              "  \"employeeName\": \"{{employee_name}}\",",
              "  \"dateFrom\": \"{{date_from}}\",",
              "  \"dateFor\": \"{{date_to}}\"",
              "};",
              "const Buffer = require('buffer').Buffer;",
              "function resolve(value) {",
              "    if (typeof value === 'string') return pm.variables.replaceIn(value);",
              "    if (Array.isArray(value)) return value.map(resolve);",
              "    if (value && typeof value === 'object') return Object.fromEntries(Object.entries(value).map(([k,v]) => [k, resolve(v)]));",
              "    return value;",
              "}",
              "const resolved = resolve(payload);",
              "if (/\\{\\{[^{}]+\\}\\}/.test(JSON.stringify(resolved))) throw new Error('Resolve all payload variables before sending.');",
              "const data = Buffer.from(JSON.stringify(resolved), 'utf8').toString('base64');",
              "const merchantId = String(pm.variables.get('merchant_id') || '');",
              "const digest = await crypto.subtle.digest('SHA-1', Buffer.from(data + merchantId, 'utf8'));",
              "const hex = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');",
              "const sign = Buffer.from(hex, 'utf8').toString('base64');",
              "pm.variables.set('cashbox_form_body', 'data=' + encodeURIComponent(data) + '&sign=' + encodeURIComponent(sign));"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/x-www-form-urlencoded"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{{cashbox_form_body}}",
          "options": {
            "raw": {
              "language": "text"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/dates_report",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "dates_report"
          ]
        },
        "description": "Prints a report for dateFrom/dateFor (yyyy-MM-dd). Success returns status/code only, not report contents. Availability depends on the fiscal core.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
      },
      "response": [
        {
          "name": "Illustrative success (optional fields may be omitted)",
          "originalRequest": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{{cashbox_form_body}}",
              "options": {
                "raw": {
                  "language": "text"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/dates_report",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dates_report"
              ]
            },
            "description": "Prints a report for dateFrom/dateFor (yyyy-MM-dd). Success returns status/code only, not report contents. Availability depends on the fiscal core.\n\nEdit the JSON object named `payload` in Scripts → Pre-request. Variables are resolved before signing. Saved response examples are illustrative, not live test results."
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"code\": 0\n}"
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "http://192.168.0.246:8008",
      "type": "string"
    },
    {
      "key": "merchant_id",
      "value": "22ca221c402d45d9af23f42629a3de9a",
      "type": "string"
    },
    {
      "key": "employee_name",
      "value": "John Doe",
      "type": "string"
    },
    {
      "key": "tax_code",
      "value": "A",
      "type": "string"
    },
    {
      "key": "document_id",
      "value": "7",
      "type": "string"
    },
    {
      "key": "document_ext_id",
      "value": "sale-example-001",
      "type": "string"
    },
    {
      "key": "sale_document_ext_id",
      "value": "sale-example-001",
      "type": "string"
    },
    {
      "key": "refund_document_ext_id",
      "value": "refund-example-001",
      "type": "string"
    },
    {
      "key": "deposit_document_ext_id",
      "value": "deposit-example-001",
      "type": "string"
    },
    {
      "key": "withdraw_document_ext_id",
      "value": "withdraw-example-001",
      "type": "string"
    },
    {
      "key": "parent_fiscal_number",
      "value": "REPLACE_WITH_ORIGINAL_SALE_FISCAL_NUMBER",
      "type": "string"
    },
    {
      "key": "date_from",
      "value": "2026-09-01",
      "type": "string"
    },
    {
      "key": "date_to",
      "value": "2026-09-18",
      "type": "string"
    }
  ]
}