{
  "openapi": "3.1.0",
  "info": {
    "title": "EBM as a service \u2014 client API",
    "version": "1.18.0",
    "description": "Hosted company API: managed CIS invoicing, VSDC compatibility and receipt delivery. Read README.md and cis-api.md for onboarding and recovery. Set the base URL supplied during onboarding."
  },
  "security": [
    {
      "CompanyApiKey": []
    }
  ],
  "paths": {
    "/initializer/selectInitInfo": {
      "post": {
        "operationId": "war_initialize",
        "summary": "selectInitInfo",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcInitInfoRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitInfoReq"
              }
            }
          }
        }
      }
    },
    "/code/selectCodes": {
      "post": {
        "operationId": "war_select_codes",
        "summary": "selectCodes",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcCodeRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodeReq"
              }
            }
          }
        }
      }
    },
    "/itemClass/selectItemsClass": {
      "post": {
        "operationId": "war_select_item_classes",
        "summary": "selectItemsClass",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcItemClsRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemClsReq"
              }
            }
          }
        }
      }
    },
    "/customers/selectCustomer": {
      "post": {
        "operationId": "war_select_customer",
        "summary": "selectCustomer",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcCustRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustReq"
              }
            }
          }
        }
      }
    },
    "/branches/selectBranches": {
      "post": {
        "operationId": "war_select_branches",
        "summary": "selectBranches",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcBhfRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BhfReq"
              }
            }
          }
        }
      }
    },
    "/branches/saveBrancheCustomers": {
      "post": {
        "operationId": "war_save_branche_customers",
        "summary": "saveBrancheCustomers",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BhfCustSaveReq"
              }
            }
          }
        }
      }
    },
    "/branches/saveBrancheUsers": {
      "post": {
        "operationId": "war_save_branche_users",
        "summary": "saveBrancheUsers",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BhfUserSaveReq"
              }
            }
          }
        }
      }
    },
    "/branches/saveBrancheInsurances": {
      "post": {
        "operationId": "war_save_branche_insurances",
        "summary": "saveBrancheInsurances",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BhfInsuranceSaveReq"
              }
            }
          }
        }
      }
    },
    "/notices/selectNotices": {
      "post": {
        "operationId": "war_select_notices",
        "summary": "selectNotices",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcNoticeRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoticeReq"
              }
            }
          }
        }
      }
    },
    "/items/saveItems": {
      "post": {
        "operationId": "war_save_items",
        "summary": "saveItems",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemSaveReq"
              }
            }
          }
        }
      }
    },
    "/items/saveItemComposition": {
      "post": {
        "operationId": "war_save_item_composition",
        "summary": "saveItemComposition",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemCompositionSaveReq"
              }
            }
          }
        }
      }
    },
    "/items/selectItems": {
      "post": {
        "operationId": "war_select_items",
        "summary": "selectItems",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcItemRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemReq"
              }
            }
          }
        }
      }
    },
    "/imports/selectImportItems": {
      "post": {
        "operationId": "war_select_imports",
        "summary": "selectImportItems",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcImportItemRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportItemReq"
              }
            }
          }
        }
      }
    },
    "/imports/updateImportItems": {
      "post": {
        "operationId": "war_update_imports",
        "summary": "updateImportItems",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportItemUpdateReq"
              }
            }
          }
        }
      }
    },
    "/stock/selectStockItems": {
      "post": {
        "operationId": "war_select_stock",
        "summary": "selectStockItems",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcStockMoveRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockMoveReq"
              }
            }
          }
        }
      }
    },
    "/stock/saveStockItems": {
      "post": {
        "operationId": "war_save_stock_items",
        "summary": "saveStockItems",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockIoSaveReq"
              }
            }
          }
        },
        "description": "External CIS stock movement. Supply sarNo, orgSarNo, regTyCd, line count and totals explicitly: the compatibility endpoint preserves the submitted values. Companies with a managed CIS profile use /api/portal/cis/stock and the receiving workflows instead."
      }
    },
    "/stockMaster/saveStockMaster": {
      "post": {
        "operationId": "war_save_stock_master",
        "summary": "saveStockMaster",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockMasterSaveReq"
              }
            }
          }
        }
      }
    },
    "/trnsPurchase/selectTrnsPurchaseSales": {
      "post": {
        "operationId": "war_select_purchases",
        "summary": "selectTrnsPurchaseSales",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcTrnsPurchaseSalesRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrnsPurchaseSalesReq"
              }
            }
          }
        }
      }
    },
    "/trnsPurchase/savePurchases": {
      "post": {
        "operationId": "war_save_purchase",
        "summary": "savePurchases",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrnsPurchaseSaveReq"
              }
            }
          }
        }
      }
    },
    "/trnsSales/saveSales": {
      "post": {
        "operationId": "war_save_sales",
        "summary": "saveSales",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcSaleResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "409": {
            "description": "Changed input under an existing key, unbound legacy replay, managed CIS required, or remote issuance requiring reconciliation.",
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrnsSalesSaveWrReq"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Persist with the order and reuse with identical transaction content. Changed content under a completed key returns HTTP 409. Legacy records without an original input require reconciliation."
          }
        ],
        "description": "External-CIS integration only. A company with a managed CIS profile must use /api/portal/fiscal/invoices. Preserve original input and idempotency key on retry. Successful issuance is not proof of RRA acceptance."
      }
    },
    "/reports/checkZReport": {
      "post": {
        "operationId": "war_check_zreport",
        "summary": "checkZReport",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcReportZCheckRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportZCheckReq"
              }
            }
          }
        }
      }
    },
    "/reports/saveZReports": {
      "post": {
        "operationId": "war_save_zreport",
        "summary": "saveZReports",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportZSaveUpdateReq"
              }
            }
          }
        },
        "description": "Matches the supplied _9 WAR, including its date defect: 8-digit rptDe returns 910; 14-digit or absent rptDe returns 899 and does not submit a report."
      }
    },
    "/main/selectServerTime": {
      "get": {
        "operationId": "war_server_time",
        "summary": "selectServerTime",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcPassthroughEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/test/echoTest": {
      "post": {
        "operationId": "war_echo_test",
        "summary": "echoTest",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200. Null resultDt/data are valid error outcomes; issuance does not confirm upstream delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcTestEchoRes"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials"
          },
          "403": {
            "description": "Company or scope not permitted"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "400": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "description": "WAR-compatible framework rejection; a proxy may return text instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VsdcHttpError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestEchoReq"
              }
            }
          }
        }
      }
    },
    "/api/portal/receipts": {
      "get": {
        "operationId": "listReceiptDelivery",
        "summary": "List your receipts and RRA delivery status",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company-scoped receipt records; status ACCEPTED confirms RRA delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptSummaryList"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company access suspended or forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/portal/receipts/{id}": {
      "get": {
        "operationId": "getReceiptDelivery",
        "summary": "Get your receipt, signing snapshot and delivery status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company-scoped receipt records; status ACCEPTED confirms RRA delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptDetailResult"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company access suspended or forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Receipt not found in this company and environment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/portal/fiscal/invoices": {
      "post": {
        "operationId": "issueCisInvoice",
        "summary": "Issue through managed CIS with stock and original-receipt controls",
        "description": "Requires receipts:write and an initialized branch with a CIS profile. Prices/taxes come from registered company catalogue items. Check resultCd even on HTTP 200. Success adds cisReceiptId at the top level. Preserve the original request and key across uncertain outcomes. NR is a full original cancellation; CS/CR copy a stored normal receipt. Owner sessions and cashier sessions are accepted. Cashiers are restricted to currently assigned branches (no assignments means all branches). Cashier invoice modes are NS, TS and PS; refunds, copies and TR require an owner. Session and branch permissions are rechecked on retries. Optional client_id binds a saved client and snapshots its fiscal identity during initial preparation. Retried prepared/issued invoices retain saved data after edits or deactivation. HTTP 409 CLIENT_SELECTION_CHANGED is definitive before preparation: reload/review the client; it must not be confused with uncertain fiscal conflicts. New NS invoices with payment code 02 or 03 require a saved credit-enabled client for every caller, including API keys. The entire invoice total counts as credit for both codes. Preparation atomically reserves credit across branches. PREPARED/UNKNOWN reservations remain until resolution; rejection releases exposure, and successful issuance posts one ledger entry in the same transaction as ISSUED. A normal refund offsets the linked credit sale; training/proforma/copies post no debt. Existing pre-upgrade requests retain their original replay behavior. Untracked historical credit blocks new credit until reconciliation.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CisInvoice"
              },
              "example": {
                "branch": "00",
                "invoice_number": "42",
                "mode": "NS",
                "customer_name": "Walk-in customer",
                "customer_tin": "",
                "customer_phone": "0781234567",
                "payment_code": "01",
                "lines": [
                  {
                    "item_id": "00000000-0000-0000-0000-000000000001",
                    "quantity": 1,
                    "discount_percent": 0
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fiscal result envelope; inspect resultCd. Successful issuance also returns cisReceiptId (UUID).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CisIssueResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid invoice or missing persistent request identifier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company, environment or operation is not permitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting replay, insufficient stock, refund already issued, busy branch or uncertain previous operation. Reconcile before replacing an invoice. CREDIT_CLIENT_REQUIRED, CREDIT_NOT_ALLOWED, CREDIT_LIMIT_EXCEEDED and CREDIT_HISTORY_REQUIRES_RECONCILIATION are definitive pre-issuance refusals: correct and review before submitting again. CREDIT_LIMIT_EXCEEDED includes available_credit_cents as a decimal string. Other uncertain fiscal conflicts retain the original request/key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "404": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "CompanyApiKey": []
          },
          {
            "CompanySession": []
          }
        ]
      }
    },
    "/api/portal/cis/receipts/{id}/print": {
      "post": {
        "operationId": "prepareCisReceiptPrint",
        "summary": "Reserve or recover the immutable receipt print snapshot",
        "description": "Requires receipts:write. One print preparation per issued receipt; reuse the same request key to recover its snapshot. This does not confirm physical paper output. A new print requires a signed COPY workflow. Owner sessions and cashier sessions are accepted. Cashiers are restricted to currently assigned branches (no assignments means all branches). Cashier invoice modes are NS, TS and PS; refunds, copies and TR require an owner. Session and branch permissions are rechecked on retries.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "data contains id, profile, request, receipt, source_receipt_number, version and print_kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrintSnapshotResult"
                }
              }
            }
          },
          "400": {
            "description": "Missing request key or permission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Print already prepared with another key, or legacy snapshot needs reconciliation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "404": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "CompanyApiKey": []
          },
          {
            "CompanySession": []
          }
        ]
      }
    },
    "/api/portal/items": {
      "get": {
        "operationId": "listCatalogue",
        "summary": "List company catalogue",
        "description": "Company/environment-scoped catalogue ordered by item code, up to 2000 per page. Send next_after as the next after parameter until it is null. Traversal is not a snapshot across concurrent catalogue edits.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueEntryList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exclusive item-code cursor returned in next_after; URL-encode it."
          }
        ]
      },
      "post": {
        "operationId": "saveCatalogueItem",
        "summary": "Create or update a catalogue item",
        "description": "Requires items:write. ItemSaveReq fields; tin is replaced with the authenticated company TIN. An empty itemCd generates a code. Saving clears registration; register before invoicing. Retain itemCd when updating. Returns data.id. Automatic code allocation is not idempotent: reconcile lost responses by listing before creating again. Optional catalogue preconditions protect reviewed edits. Without them, existing item codes retain their previous replacement behavior. Save returns a new version; every save clears registration.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueSavedResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "412": {
            "description": "Catalogue precondition failed; no item change. Reload and review before a new save. A lost successful save response can also cause a replay with the old version to return 412.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemSaveReq"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "One quoted UUID version from the catalogue entry. Replace only that version. Requires explicit itemCd; cannot be combined with If-None-Match."
          },
          {
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "*"
              ]
            },
            "description": "Create only if the explicit itemCd does not yet exist in this company/environment."
          }
        ]
      }
    },
    "/api/portal/cis/items/register/{id}": {
      "post": {
        "operationId": "registerCatalogueItem",
        "summary": "Register catalogue item with configured VSDC",
        "description": "Requires items:write and receipts:write. Uses the saved item body and branch. Check resultCd; only successful registration marks the item ready. If the catalogue body changes while registration is in flight, HTTP 409 means the submitted version was accepted but the current version remains unregistered. Reload and review the current catalogue item before deliberately registering it.",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiscalEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/portal/cis/stock": {
      "get": {
        "operationId": "listCisStock",
        "summary": "List branch inventory",
        "description": "Returns item_id, item, quantity, reserved and available; quantities are units with two decimal places.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockBalanceList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "branch",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            }
          }
        ]
      },
      "post": {
        "operationId": "adjustCisStock",
        "summary": "Record a signed stock adjustment",
        "description": "Requires stock:write and receipts:write. Positive quantity adds stock, negative removes it. Preserve the original body/key. Local movement and downstream delivery are distinct.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockOperationResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CisStockAdjustment"
              }
            }
          }
        }
      }
    },
    "/api/portal/cis/delivery": {
      "get": {
        "operationId": "listCisStockDelivery",
        "summary": "Inspect stock delivery",
        "description": "Lists at most 500 downstream stock messages newest first. Follow next_before_id until null, preserving branch and state. State filters reflect current status, not a frozen snapshot; refresh from the first page to detect status changes. Uncertain outcomes require owner/operator reconciliation.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockDeliveryList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "branch",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Exclusive cursor from next_before_id; pass the returned string unchanged."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "SUBMITTING",
                "UNKNOWN",
                "FAILED",
                "SENT"
              ]
            }
          }
        ]
      }
    },
    "/api/portal/cis/references/{kind}": {
      "post": {
        "operationId": "fetchCisReferences",
        "summary": "Fetch and retain inbound/reference data",
        "description": "Requires stock:write and receipts:write. Imports/purchases populate the inbound inbox. Keep a local synchronization cursor; after a lost response, inspect the inbox before advancing. This endpoint does not promise identical-request replay.",
        "responses": {
          "200": {
            "description": "Inspect resultCd even with HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FiscalEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "imports",
                "purchases",
                "customers",
                "notices"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CisReferenceFetch"
              }
            }
          }
        }
      }
    },
    "/api/portal/cis/inbound": {
      "get": {
        "operationId": "listCisInbound",
        "summary": "List branch receiving inbox",
        "description": "Returns id, kind, body, state and resolution; map each source line to a company catalogue UUID before approval.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboundRecord"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition."
          },
          "401": {
            "description": "Invalid, expired or revoked API key."
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access."
          },
          "404": {
            "description": "Resource not found in this company/environment."
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "branch",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            }
          }
        ]
      }
    },
    "/api/portal/cis/inbound/{id}": {
      "post": {
        "operationId": "decideCisInbound",
        "summary": "Approve or reject incoming goods",
        "description": "Requires stock:write and receipts:write. For approval, items has one UUID per source line; duplicate mappings are allowed. Import approval needs per-line unit costs. Conversions must yield exact two-decimal quantities/packages. A supplier return is full-original only. For rejection use approve:false, items:[] and reason. Preserve the original decision when recovering an uncertain response.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InboundResolution"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition."
          },
          "401": {
            "description": "Invalid, expired or revoked API key."
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access."
          },
          "404": {
            "description": "Resource not found in this company/environment."
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CisInboundDecision"
              }
            }
          }
        }
      }
    },
    "/api/portal/cis/reports": {
      "post": {
        "operationId": "generateCisReport",
        "summary": "Generate a CIS report",
        "description": "Requires receipts:write. X/Z begin after the last closed period; other reports use the supplied dates. Z refuses unresolved receipt/stock states and closes locally. This is not successful submission through the defective WAR report endpoint. Persist an X-Idempotency-Key to recover the identical snapshot after a lost response, including after Z closure. Changed input under that key returns 409. Without a key, generation has no replay guarantee.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CisReportResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CisReportQuery"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": false,
            "description": "Recommended: persist before generation and reuse with identical input.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ]
      },
      "get": {
        "operationId": "listCisReports",
        "summary": "List saved report history",
        "description": "Up to 50 reports, newest first, scoped to the authenticated company and environment.",
        "parameters": [
          {
            "in": "query",
            "name": "branch",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "data array with id, branch, kind, from, to_exclusive and created_at.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CisReportHistory"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company/environment access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/portal/cis/cash": {
      "post": {
        "operationId": "recordCisCash",
        "summary": "Record a cash deposit or withdrawal",
        "description": "Requires receipts:write. Preserve the same key and content on retry; changed content returns a conflict. Does not initiate a bank or Mobile Money payment.",
        "responses": {
          "200": {
            "description": "Result in data envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CisCashResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CisCashEntry"
              }
            }
          }
        }
      }
    },
    "/api/portal/cis/reports/{id}": {
      "get": {
        "operationId": "getCisReport",
        "summary": "Retrieve a saved report snapshot",
        "description": "Returns the originally saved report. Later catalogue/profile changes do not recompute it.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original report snapshot in data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CisReportResult"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company/environment access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Report not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed. Preserve the original body and request key for recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/portal/usage": {
      "get": {
        "operationId": "getMonthlyReceiptUsage",
        "summary": "Read monthly recorded receipt activity",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "YYYY-MM; defaults to the current Kigali month.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Monthly receipt activity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReceiptUsage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Company access suspended or forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "description": "Company/environment-scoped receipt records by creation time in Africa/Kigali. Counts receipts rather than requests; identical replays do not add records. Delivery classifications are current at query time. Not subscription charges, quotas or an immutable billing statement."
      }
    },
    "/api/portal/items/{id}": {
      "get": {
        "operationId": "getCatalogueItem",
        "summary": "Read one catalogue item",
        "description": "Read the current body, version and registration status for a company/environment-scoped item ID. Returns 404 for absent items or IDs outside this company/environment. Use this read to review a version conflict; it does not save or register anything.",
        "responses": {
          "200": {
            "description": "Current catalogue entry in data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueItemResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or workflow precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid, expired or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope, company approval, production enablement or access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found in this company/environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or unresolved workflow state; reconcile before replacing the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for BRANCH_BUSY; delay in seconds before retrying the exact original request/key. Absence does not imply retry permission.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Request rejected or failed; preserve the original request identity before recovery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/portal/staff": {
      "get": {
        "operationId": "listCompanyStaff",
        "summary": "List staff in the signed-in owner company",
        "security": [
          {
            "OwnerSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StaffMember"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Current active company owner required"
          },
          "404": {
            "description": "Company or staff member not found"
          }
        }
      },
      "post": {
        "operationId": "createCompanyStaff",
        "summary": "Create staff with a generated temporary password",
        "security": [
          {
            "OwnerSession": []
          }
        ],
        "description": "Persist X-Idempotency-Key before sending. The same actor/key/input recovers the original result for up to 24 hours while the temporary credential remains current. A changed request conflicts. Expired or superseded requests never create a new credential. Responses use Cache-Control: no-store. Never log or retain temporary passwords in ordinary client logs.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Temporary credential created or recovered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffCredentialResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or request identifier"
          },
          "403": {
            "description": "Active company owner session required"
          },
          "404": {
            "description": "Company/staff not found"
          },
          "409": {
            "description": "Duplicate email, request mismatch, unavailable credential recovery, or own-account reset"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewStaff"
              }
            }
          }
        }
      }
    },
    "/api/portal/staff/{id}": {
      "patch": {
        "operationId": "updateCompanyStaff",
        "summary": "Update company staff details and access",
        "security": [
          {
            "OwnerSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Current active company owner required"
          },
          "404": {
            "description": "Company or staff member not found"
          },
          "400": {
            "description": "Invalid role, name or branch assignments"
          },
          "409": {
            "description": "Self-demotion/deactivation or removal of last active owner"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffChange"
              }
            }
          }
        },
        "description": "Company-wide across environments. Role, activation or branch updates rotate sessions; names on existing receipts remain unchanged. Changes are audited. Cashier sign-in scopes remain disabled pending staff feature qualification."
      }
    },
    "/api/portal/staff/{id}/reset-password": {
      "post": {
        "operationId": "resetCompanyStaffPassword",
        "summary": "Reset staff credentials and revoke existing sessions",
        "security": [
          {
            "OwnerSession": []
          }
        ],
        "description": "Persist X-Idempotency-Key before sending. The same actor/key/input recovers the original result for up to 24 hours while the temporary credential remains current. A changed request conflicts. Expired or superseded requests never create a new credential. Responses use Cache-Control: no-store. Never log or retain temporary passwords in ordinary client logs.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Temporary credential created or recovered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffCredentialResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or request identifier"
          },
          "403": {
            "description": "Active company owner session required"
          },
          "404": {
            "description": "Company/staff not found"
          },
          "409": {
            "description": "Duplicate email, request mismatch, unavailable credential recovery, or own-account reset"
          }
        }
      }
    },
    "/api/portal/staff/{id}/activity": {
      "get": {
        "operationId": "getStaffActivity",
        "summary": "Review staff activity for an inclusive Kigali date period",
        "security": [
          {
            "OwnerSession": []
          }
        ],
        "description": "Selected environment only. Includes issued normal sales/refunds by original issuer; excludes training, copies, proformas and uncertain receipts. Receipt dates use prepared-transaction created_at, movements/cash use posting dates. Stock counts are movement lines; cash entries are deposits/withdrawals, not receivable payments. Historical rows lacking attribution are excluded, never assigned to the current account. Maximum 366 inclusive days.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "X-EBM-Environment",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "sandbox",
                "production"
              ],
              "default": "sandbox"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StaffActivity"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid period"
          },
          "403": {
            "description": "Active company owner required"
          },
          "404": {
            "description": "Staff member not found"
          }
        }
      }
    },
    "/api/portal/clients": {
      "get": {
        "operationId": "listCompanyClients",
        "summary": "Search the company customer master in the selected environment",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "in": "query",
            "name": "active",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Sorted by ID with up to 50 records per page. Pass next_after unchanged as after and retain search/active filters. Search is a literal case-insensitive name substring or TIN/normalized-phone substring. Concurrent edits may change filter membership."
      },
      "post": {
        "operationId": "createCompanyClient",
        "summary": "Create a client as owner or cashier",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "409": {
            "description": "Duplicate tenant identity or request key reused by another actor/input"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientDetails"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            }
          }
        ],
        "description": "Persist request key and original body before sending. Same actor/key/normalized input returns the original creation response, even after later edits. The company and selected environment isolate identities and replay records. Credit is disabled on creation; use GET for current state."
      }
    },
    "/api/portal/clients/{id}": {
      "get": {
        "operationId": "getCompanyClient",
        "summary": "Read a company client",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "put": {
        "operationId": "replaceCompanyClient",
        "summary": "Replace contact details and active state as owner",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          },
          "409": {
            "description": "Another client uses this TIN or phone"
          },
          "412": {
            "description": "Version changed; reload and review before saving"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One quoted version UUID from the latest GET response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientUpdate"
              }
            }
          }
        }
      }
    },
    "/api/portal/clients/{id}/credit": {
      "put": {
        "operationId": "setCompanyClientCredit",
        "summary": "Replace client credit terms as owner",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          },
          "409": {
            "description": "CREDIT_HISTORY_REQUIRES_RECONCILIATION: earlier untracked credit invoices block enabling credit; no financial history is fabricated."
          },
          "412": {
            "description": "Version changed; reload and review before saving"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One quoted version UUID from the latest GET response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientCreditTerms"
              }
            }
          }
        },
        "description": "Interactive owner/operator only. Requires the quoted latest client version in If-Match. Disabling credit or lowering a limit does not cancel prepared/unknown invoices. A lost update response requires reloading and reviewing the latest version; it must not be blindly overwritten."
      }
    },
    "/api/portal/clients/{id}/balance": {
      "get": {
        "operationId": "getCompanyClientBalance",
        "summary": "Read tracked balance and pending credit reservations",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientBalanceResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Interactive owner/cashier/viewer or selected-company operator. API keys are denied. All monetary fields are decimal strings of integer cents. History requiring reconciliation blocks new credit and means the ledger balance is incomplete."
      }
    },
    "/api/portal/clients/{id}/payments": {
      "post": {
        "operationId": "recordClientPayment",
        "summary": "Record a customer payment",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPaymentResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          },
          "409": {
            "description": "IDEMPOTENCY_MISMATCH, PAYMENT_EXCEEDS_BALANCE (includes balance_cents), PAYMENT_ALREADY_REVERSED, or CREDIT_HISTORY_REQUIRES_RECONCILIATION."
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "description": "Persistent printable ASCII request identifier; retain across uncertain responses."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPayment"
              }
            }
          }
        },
        "description": "Interactive sessions only; API keys denied. Recording: owner/operator or cashier on an assigned existing branch. Reversal: owner/operator only, original payment branch retained. Payment settles oldest posted credit sales first unless exact allocations are supplied; no fiscal receipt is issued. Payment date defaults to the Kigali date and cannot be in the future. Amount cannot exceed current ledger balance. Historical untracked credit blocks new payment recording. Inactive clients can repay existing debt. Same actor/key/body returns the original result even after reversal or later balance changes; different actor, target, body or operation conflicts. Reversal is append-only and restores original allocations; original response remains available. Audit and request recovery commit atomically with the ledger."
      }
    },
    "/api/portal/payments/{id}/reverse": {
      "post": {
        "operationId": "reverseClientPayment",
        "summary": "Reverse a customer payment once",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentReversalResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          },
          "409": {
            "description": "IDEMPOTENCY_MISMATCH, PAYMENT_EXCEEDS_BALANCE (includes balance_cents), PAYMENT_ALREADY_REVERSED, or CREDIT_HISTORY_REQUIRES_RECONCILIATION."
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "description": "Persistent printable ASCII request identifier; retain across uncertain responses."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentReversal"
              }
            }
          }
        },
        "description": "Interactive sessions only; API keys denied. Recording: owner/operator or cashier on an assigned existing branch. Reversal: owner/operator only, original payment branch retained. Payment settles oldest posted credit sales first unless exact allocations are supplied; no fiscal receipt is issued. Payment date defaults to the Kigali date and cannot be in the future. Amount cannot exceed current ledger balance. Historical untracked credit blocks new payment recording. Inactive clients can repay existing debt. Same actor/key/body returns the original result even after reversal or later balance changes; different actor, target, body or operation conflicts. Reversal is append-only and restores original allocations; original response remains available. Audit and request recovery commit atomically with the ledger."
      }
    },
    "/api/portal/clients/{id}/statement": {
      "get": {
        "operationId": "getClientStatement",
        "summary": "Read a client ledger statement",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientStatementResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "description": "Interactive owner, cashier, viewer or selected-company operator. API keys denied. Optional inclusive from/to dates use ledger posting dates in Africa/Kigali; paid_on is descriptive and never backdates ledger postings. Opening, lines, closing balance and current reversal markers share one database snapshot. Money is exact decimal strings, including totals above i64. Ordering is posting timestamp then entry UUID. Reversal markers reflect current snapshot status even if reversal is outside the date range; date-filtered balances include only postings through the period. Empty periods retain their opening balance. Historical reconciliation flag means tracked amounts are incomplete; no debts are invented. Pending fiscal reservations are excluded from the posted ledger."
      }
    },
    "/api/portal/receivables/aging": {
      "get": {
        "operationId": "getReceivableAging",
        "summary": "Read current invoice aging and customer credits",
        "security": [
          {
            "ClientSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceivableAgingResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Sign-in required or session revoked"
          },
          "403": {
            "description": "Role or company access denied"
          },
          "404": {
            "description": "Client not found in this company and environment"
          }
        },
        "parameters": [],
        "description": "Interactive owner/cashier/viewer or selected-company operator; API keys denied. Current snapshot grouped by credit-sale ledger posting date in Kigali, with 0\u201330, 31\u201360, 61\u201390 and over-90-day buckets. Remaining invoice amount subtracts refunds and unreversed payment allocations. Positive amounts enter aging; negative remainders after collected invoices are refunded appear as customer_credit_cents without being assigned to another invoice. total_open_cents minus customer_credit_cents equals the posted balance. Includes inactive customers with open invoices or credits, excludes settled customers and pending fiscal reservations. History reconciliation flag means historical balances are incomplete. Exact decimal strings, including aggregate totals above i64. One repeatable-read snapshot covers rows, totals and history status; this is current aging, not a historical as-of reconstruction."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CompanyApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "OwnerSession": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Active company owner session; API keys and platform operator sessions are not accepted by owner staff endpoints."
      },
      "CompanySession": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Active owner or cashier session. Cashiers can issue NS/TS/PS and prepare prints only in their current assigned branches; viewers cannot issue or print."
      },
      "ClientSession": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Company owner/cashier/viewer session: all can read clients, owner/cashier can create, only owner can edit. Operator sessions may select a company. API keys are not accepted."
      }
    },
    "schemas": {
      "BhfCustSaveReq": {
        "type": "object",
        "properties": {
          "adrs": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "custNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "custNo": {
            "type": "string",
            "minLength": 9,
            "maxLength": 9
          },
          "custTin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "email": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100,
            "format": "email"
          },
          "faxNo": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "remark": {
            "type": "string",
            "minLength": 0,
            "maxLength": 1000
          },
          "telNo": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "useYn": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1
          }
        },
        "required": [
          "bhfId",
          "custNm",
          "custNo",
          "custTin",
          "modrId",
          "modrNm",
          "regrId",
          "regrNm",
          "tin",
          "useYn"
        ]
      },
      "BhfInsuranceSaveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "isrcRt": {
            "type": "integer",
            "format": "int32",
            "minimum": 0.0,
            "maximum": 100.0
          },
          "isrccCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "isrccNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "useYn": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1
          }
        },
        "required": [
          "bhfId",
          "isrcRt",
          "isrccCd",
          "isrccNm",
          "modrId",
          "modrNm",
          "regrId",
          "regrNm",
          "tin",
          "useYn"
        ]
      },
      "BhfReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "BhfUserSaveReq": {
        "type": "object",
        "properties": {
          "adrs": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "authCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "cntc": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "pwd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 255
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "remark": {
            "type": "string",
            "minLength": 0,
            "maxLength": 2000
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "useYn": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1
          },
          "userId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "userNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          }
        },
        "required": [
          "bhfId",
          "modrId",
          "modrNm",
          "regrId",
          "regrNm",
          "tin",
          "useYn",
          "userId",
          "userNm"
        ]
      },
      "CodeReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "CustPagedReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string"
          },
          "endPageIndex": {
            "type": "string"
          },
          "lastReqDt": {
            "type": "string"
          },
          "startPageIndex": {
            "type": "string"
          },
          "tin": {
            "type": "string"
          }
        }
      },
      "CustReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "custmTin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "tin"
        ]
      },
      "ImportItemReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "ImportItemRes$ImportItem": {
        "type": "object",
        "properties": {
          "agntNm": {
            "type": "string"
          },
          "dclDe": {
            "type": "string"
          },
          "dclNo": {
            "type": "string"
          },
          "exptNatCd": {
            "type": "string"
          },
          "hsCd": {
            "type": "string"
          },
          "imptItemsttsCd": {
            "type": "string"
          },
          "invcFcurAmt": {
            "type": "number"
          },
          "invcFcurCd": {
            "type": "string"
          },
          "invcFcurExcrt": {
            "type": "number"
          },
          "itemNm": {
            "type": "string"
          },
          "itemSeq": {
            "type": "string"
          },
          "netWt": {
            "type": "number"
          },
          "orgnNatCd": {
            "type": "string"
          },
          "pkg": {
            "type": "number"
          },
          "pkgUnitCd": {
            "type": "string"
          },
          "qty": {
            "type": "number"
          },
          "qtyUnitCd": {
            "type": "string"
          },
          "spplrNm": {
            "type": "string"
          },
          "taskCd": {
            "type": "string"
          },
          "totWt": {
            "type": "number"
          }
        }
      },
      "ImportItemUpdateReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "dclDe": {
            "type": "string",
            "minLength": 0,
            "maxLength": 8
          },
          "hsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 17
          },
          "imptItemSttsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "itemClsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "itemSeq": {
            "type": "integer",
            "format": "int32"
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "remark": {
            "type": "string",
            "minLength": 0,
            "maxLength": 400
          },
          "taskCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 50
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "dclDe",
          "hsCd",
          "imptItemSttsCd",
          "itemSeq",
          "modrId",
          "modrNm",
          "taskCd",
          "tin"
        ]
      },
      "InitInfoReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "dvcSrlNo": {
            "type": "string",
            "minLength": 3,
            "maxLength": 100
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "dvcSrlNo",
          "tin"
        ]
      },
      "ItemClsReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "ItemCompositionSaveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "cpstItemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "cpstQty": {
            "type": "number"
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "cpstItemCd",
          "cpstQty",
          "itemCd",
          "regrId",
          "regrNm",
          "tin"
        ]
      },
      "ItemReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "ItemRes$Item": {
        "type": "object",
        "properties": {
          "addInfo": {
            "type": "string"
          },
          "bcd": {
            "type": "string"
          },
          "btchNo": {
            "type": "string"
          },
          "dftPrc": {
            "type": "number"
          },
          "grpPrcL1": {
            "type": "number"
          },
          "grpPrcL2": {
            "type": "number"
          },
          "grpPrcL3": {
            "type": "number"
          },
          "grpPrcL4": {
            "type": "number"
          },
          "grpPrcL5": {
            "type": "number"
          },
          "isrcAplcbYn": {
            "type": "string"
          },
          "itemCd": {
            "type": "string"
          },
          "itemClsCd": {
            "type": "string"
          },
          "itemNm": {
            "type": "string"
          },
          "itemStdNm": {
            "type": "string"
          },
          "itemTyCd": {
            "type": "string"
          },
          "orgnNatCd": {
            "type": "string"
          },
          "pkgUnitCd": {
            "type": "string"
          },
          "qtyUnitCd": {
            "type": "string"
          },
          "regBhfId": {
            "type": "string"
          },
          "rraModYn": {
            "type": "string"
          },
          "sftyQty": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string"
          },
          "tin": {
            "type": "string"
          },
          "useYn": {
            "type": "string"
          }
        }
      },
      "ItemSaveReq": {
        "type": "object",
        "properties": {
          "addInfo": {
            "type": "string",
            "minLength": 0,
            "maxLength": 7
          },
          "bcd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "btchNo": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "dftPrc": {
            "type": "number"
          },
          "grpPrcL1": {
            "type": "number"
          },
          "grpPrcL2": {
            "type": "number"
          },
          "grpPrcL3": {
            "type": "number"
          },
          "grpPrcL4": {
            "type": "number"
          },
          "grpPrcL5": {
            "type": "number"
          },
          "isrcAplcbYn": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "itemClsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "itemNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "itemStdNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "itemTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "orgnNatCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "pkgUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "qtyUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "sftyQty": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "useYn": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1
          }
        },
        "required": [
          "bhfId",
          "dftPrc",
          "isrcAplcbYn",
          "itemCd",
          "itemClsCd",
          "itemNm",
          "itemTyCd",
          "modrId",
          "modrNm",
          "orgnNatCd",
          "pkgUnitCd",
          "qtyUnitCd",
          "regrId",
          "regrNm",
          "taxTyCd",
          "tin",
          "useYn"
        ]
      },
      "NoticeReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "ReportZCheckReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "rptDe": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "tin"
        ]
      },
      "ReportZSaveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string"
          },
          "cpyRcptClsNo": {
            "type": "integer",
            "format": "int64"
          },
          "cpyRcptOpnNo": {
            "type": "integer",
            "format": "int64"
          },
          "cpyRcptPbctCnt": {
            "type": "integer",
            "format": "int32"
          },
          "cpyRfdAmt": {
            "type": "number"
          },
          "cpyRfdTaxAmt": {
            "type": "number"
          },
          "cpySalesAmt": {
            "type": "number"
          },
          "cpySalesTaxAmt": {
            "type": "number"
          },
          "nrmRcptClsNo": {
            "type": "integer",
            "format": "int64"
          },
          "nrmRcptOpnNo": {
            "type": "integer",
            "format": "int64"
          },
          "nrmRcptPbctCnt": {
            "type": "integer",
            "format": "int32"
          },
          "nrmRfdAmt": {
            "type": "number"
          },
          "nrmRfdTaxAmt": {
            "type": "number"
          },
          "nrmSalesAmt": {
            "type": "number"
          },
          "nrmSalesTaxAmt": {
            "type": "number"
          },
          "pfmRcptClsNo": {
            "type": "integer",
            "format": "int64"
          },
          "pfmRcptOpnNo": {
            "type": "integer",
            "format": "int64"
          },
          "pfmRcptPbctCnt": {
            "type": "integer",
            "format": "int32"
          },
          "pfmRfdAmt": {
            "type": "number"
          },
          "pfmRfdTaxAmt": {
            "type": "number"
          },
          "pfmSalesAmt": {
            "type": "number"
          },
          "pfmSalesTaxAmt": {
            "type": "number"
          },
          "rcptClsNo": {
            "type": "integer",
            "format": "int64"
          },
          "rcptOpnNo": {
            "type": "integer",
            "format": "int64"
          },
          "rcptPbctCnt": {
            "type": "integer",
            "format": "int32"
          },
          "regrId": {
            "type": "string"
          },
          "regrNm": {
            "type": "string"
          },
          "rptDe": {
            "type": "string"
          },
          "rptNo": {
            "type": "integer",
            "format": "int64"
          },
          "sdcId": {
            "type": "string"
          },
          "tin": {
            "type": "string"
          },
          "trnRcptClsNo": {
            "type": "integer",
            "format": "int64"
          },
          "trnRcptOpnNo": {
            "type": "integer",
            "format": "int64"
          },
          "trnRcptPbctCnt": {
            "type": "integer",
            "format": "int32"
          },
          "trnRfdAmt": {
            "type": "number"
          },
          "trnRfdTaxAmt": {
            "type": "number"
          },
          "trnSalesAmt": {
            "type": "number"
          },
          "trnSalesTaxAmt": {
            "type": "number"
          }
        }
      },
      "ReportZSaveUpdateReq": {
        "type": "object",
        "required": [
          "tin",
          "bhfId"
        ],
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "rptDe": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        }
      },
      "StockIoItemSaveReq": {
        "type": "object",
        "properties": {
          "bcd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "itemClsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "itemExprDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 8
          },
          "itemNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "itemSeq": {
            "type": "integer",
            "format": "int32"
          },
          "pkg": {
            "type": "number"
          },
          "pkgUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "prc": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "qtyUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "splyAmt": {
            "type": "number"
          },
          "taxAmt": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "taxblAmt": {
            "type": "number"
          },
          "totAmt": {
            "type": "number"
          },
          "totDcAmt": {
            "type": "number"
          }
        },
        "required": [
          "itemClsCd",
          "itemNm",
          "itemSeq",
          "pkg",
          "pkgUnitCd",
          "prc",
          "qty",
          "qtyUnitCd",
          "splyAmt",
          "taxAmt",
          "taxTyCd",
          "taxblAmt",
          "totAmt",
          "totDcAmt"
        ]
      },
      "StockIoSaveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "custBhfId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 2
          },
          "custNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "custTin": {
            "type": "string",
            "minLength": 0,
            "maxLength": 9,
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "itemList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockIoItemSaveReq"
            }
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "ocrnDt": {
            "type": "string",
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])$)$"
          },
          "orgSarNo": {
            "type": "integer",
            "format": "int32"
          },
          "regTyCd": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "remark": {
            "type": "string",
            "minLength": 0,
            "maxLength": 2000
          },
          "sarNo": {
            "type": "integer",
            "format": "int32"
          },
          "sarTyCd": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "totAmt": {
            "type": "number"
          },
          "totItemCnt": {
            "type": "integer",
            "format": "int32",
            "minimum": 1.0
          },
          "totTaxAmt": {
            "type": "number"
          },
          "totTaxblAmt": {
            "type": "number"
          }
        },
        "required": [
          "bhfId",
          "itemList",
          "modrId",
          "modrNm",
          "ocrnDt",
          "orgSarNo",
          "regTyCd",
          "regrId",
          "regrNm",
          "sarNo",
          "sarTyCd",
          "tin",
          "totAmt",
          "totItemCnt",
          "totTaxAmt",
          "totTaxblAmt"
        ]
      },
      "StockMasterSaveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "rsdQty": {
            "type": "number"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "itemCd",
          "modrId",
          "modrNm",
          "regrId",
          "regrNm",
          "rsdQty",
          "tin"
        ]
      },
      "StockMoveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "StockMoveRes$StockMoveItem": {
        "type": "object",
        "properties": {
          "bcd": {
            "type": "string"
          },
          "itemCd": {
            "type": "string"
          },
          "itemClsCd": {
            "type": "string"
          },
          "itemExprDt": {
            "type": "string"
          },
          "itemNm": {
            "type": "string"
          },
          "itemSeq": {
            "type": "integer",
            "format": "int32"
          },
          "pkg": {
            "type": "number"
          },
          "pkgUnitCd": {
            "type": "string"
          },
          "prc": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "qtyUnitCd": {
            "type": "string"
          },
          "splyAmt": {
            "type": "number"
          },
          "taxAmt": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string"
          },
          "taxblAmt": {
            "type": "number"
          },
          "totAmt": {
            "type": "number"
          },
          "totDcAmt": {
            "type": "number"
          }
        }
      },
      "SwVersionReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string"
          },
          "lastReqDt": {
            "type": "string"
          },
          "tin": {
            "type": "string"
          }
        }
      },
      "TestEchoReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string"
          },
          "testStr": {
            "type": "string"
          },
          "tin": {
            "type": "string"
          }
        }
      },
      "TrnsPurchaseSalesReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "lastReqDt": {
            "type": "string",
            "pattern": "^(?:^20(\\d{2})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          }
        },
        "required": [
          "bhfId",
          "lastReqDt",
          "tin"
        ]
      },
      "TrnsPurchaseSalesRes$TrnsPurchaseSalesItem": {
        "type": "object",
        "properties": {
          "bcd": {
            "type": "string"
          },
          "dcAmt": {
            "type": "number"
          },
          "dcRt": {
            "type": "number"
          },
          "itemCd": {
            "type": "string"
          },
          "itemClsCd": {
            "type": "string"
          },
          "itemNm": {
            "type": "string"
          },
          "itemSeq": {
            "type": "integer",
            "format": "int32"
          },
          "pkg": {
            "type": "number"
          },
          "pkgUnitCd": {
            "type": "string"
          },
          "prc": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "qtyUnitCd": {
            "type": "string"
          },
          "splyAmt": {
            "type": "number"
          },
          "taxAmt": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string"
          },
          "taxblAmt": {
            "type": "number"
          },
          "totAmt": {
            "type": "number"
          }
        }
      },
      "TrnsPurchaseSaveItem": {
        "type": "object",
        "properties": {
          "bcd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "dcAmt": {
            "type": "number"
          },
          "dcRt": {
            "type": "number"
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "itemClsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "itemExprDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 8
          },
          "itemNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "itemSeq": {
            "type": "integer",
            "format": "int32"
          },
          "pkg": {
            "type": "number"
          },
          "pkgUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "prc": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "qtyUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "splyAmt": {
            "type": "number"
          },
          "spplrItemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "spplrItemClsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "spplrItemNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "taxAmt": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "taxblAmt": {
            "type": "number"
          },
          "totAmt": {
            "type": "number"
          }
        },
        "required": [
          "dcAmt",
          "dcRt",
          "itemClsCd",
          "itemNm",
          "itemSeq",
          "pkg",
          "pkgUnitCd",
          "prc",
          "qty",
          "qtyUnitCd",
          "splyAmt",
          "taxAmt",
          "taxTyCd",
          "taxblAmt",
          "totAmt"
        ]
      },
      "TrnsPurchaseSaveReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "cfmDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14
          },
          "cnclDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14
          },
          "cnclReqDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14
          },
          "invcNo": {
            "type": "integer",
            "format": "int64",
            "minimum": 1.0
          },
          "itemList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrnsPurchaseSaveItem"
            }
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "orgInvcNo": {
            "type": "integer",
            "format": "int64",
            "minimum": 0.0
          },
          "pchsDt": {
            "type": "string",
            "minLength": 8,
            "maxLength": 8
          },
          "pchsSttsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "pchsTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "pmtTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "prcOrdCd": {
            "type": "string"
          },
          "rcptTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "regTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "remark": {
            "type": "string",
            "minLength": 0,
            "maxLength": 2000
          },
          "rfdDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14
          },
          "spplrBhfId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 2
          },
          "spplrInvcNo": {
            "type": "integer",
            "format": "int64"
          },
          "spplrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "spplrSdcId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 12
          },
          "spplrTin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "taxAmtA": {
            "type": "number"
          },
          "taxAmtB": {
            "type": "number"
          },
          "taxAmtC": {
            "type": "number"
          },
          "taxAmtD": {
            "type": "number"
          },
          "taxRtA": {
            "type": "number"
          },
          "taxRtB": {
            "type": "number"
          },
          "taxRtC": {
            "type": "number"
          },
          "taxRtD": {
            "type": "number"
          },
          "taxblAmtA": {
            "type": "number"
          },
          "taxblAmtB": {
            "type": "number"
          },
          "taxblAmtC": {
            "type": "number"
          },
          "taxblAmtD": {
            "type": "number"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "totAmt": {
            "type": "number"
          },
          "totItemCnt": {
            "type": "integer",
            "format": "int32",
            "minimum": 1.0
          },
          "totTaxAmt": {
            "type": "number"
          },
          "totTaxblAmt": {
            "type": "number"
          },
          "wrhsDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14
          }
        },
        "required": [
          "bhfId",
          "invcNo",
          "itemList",
          "modrId",
          "modrNm",
          "orgInvcNo",
          "pchsDt",
          "pchsSttsCd",
          "pchsTyCd",
          "pmtTyCd",
          "rcptTyCd",
          "regTyCd",
          "regrId",
          "regrNm",
          "taxAmtA",
          "taxAmtB",
          "taxAmtC",
          "taxAmtD",
          "taxRtA",
          "taxRtB",
          "taxRtC",
          "taxRtD",
          "taxblAmtA",
          "taxblAmtB",
          "taxblAmtC",
          "taxblAmtD",
          "tin",
          "totAmt",
          "totItemCnt",
          "totTaxAmt",
          "totTaxblAmt"
        ]
      },
      "TrnsSalesSaveWrItem": {
        "type": "object",
        "properties": {
          "bcd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "dcAmt": {
            "type": "number"
          },
          "dcRt": {
            "type": "number"
          },
          "isrcAmt": {
            "type": "number"
          },
          "isrcRt": {
            "type": "number",
            "minimum": 0.0,
            "maximum": 100.0
          },
          "isrccCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "isrccNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "itemCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "itemClsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10
          },
          "itemNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "itemSeq": {
            "type": "integer",
            "format": "int32"
          },
          "pkg": {
            "type": "number"
          },
          "pkgUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "prc": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "qtyUnitCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "splyAmt": {
            "type": "number"
          },
          "taxAmt": {
            "type": "number"
          },
          "taxTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "taxblAmt": {
            "type": "number"
          },
          "totAmt": {
            "type": "number"
          }
        },
        "required": [
          "dcAmt",
          "dcRt",
          "itemClsCd",
          "itemNm",
          "itemSeq",
          "pkg",
          "pkgUnitCd",
          "prc",
          "qty",
          "qtyUnitCd",
          "splyAmt",
          "taxAmt",
          "taxTyCd",
          "taxblAmt",
          "totAmt"
        ]
      },
      "TrnsSalesSaveWrReSendReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string"
          },
          "invcNo": {
            "type": "integer",
            "format": "int64"
          },
          "tin": {
            "type": "string"
          }
        }
      },
      "TrnsSalesSaveWrReceipt": {
        "type": "object",
        "properties": {
          "adrs": {
            "type": "string",
            "minLength": 0,
            "maxLength": 200
          },
          "btmMsg": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "curRcptNo": {
            "type": "integer",
            "format": "int64",
            "minimum": 1.0
          },
          "custMblNo": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "custTin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "intrlData": {
            "type": "string"
          },
          "jrnl": {
            "type": "string"
          },
          "prchrAcptcYn": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1
          },
          "rcptPbctDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14
          },
          "rcptSign": {
            "type": "string"
          },
          "rptNo": {
            "type": "integer",
            "format": "int64"
          },
          "topMsg": {
            "type": "string",
            "minLength": 0,
            "maxLength": 300
          },
          "totRcptNo": {
            "type": "integer",
            "format": "int64",
            "minimum": 1.0
          },
          "trdeNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          }
        },
        "required": [
          "prchrAcptcYn"
        ]
      },
      "TrnsSalesSaveWrReq": {
        "type": "object",
        "properties": {
          "bhfId": {
            "type": "string",
            "pattern": "^(?:\\d{2}$)$"
          },
          "cfmDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14,
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "cnclDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14,
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "cnclReqDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14,
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "custNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 100
          },
          "custTin": {
            "type": "string",
            "pattern": "^(?:^[1,9,7]\\d{8}$)$"
          },
          "invcNo": {
            "type": "integer",
            "format": "int64",
            "minimum": 0.0
          },
          "itemList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrnsSalesSaveWrItem"
            }
          },
          "modrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "modrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "orgInvcNo": {
            "type": "integer",
            "format": "int64",
            "minimum": 0.0
          },
          "pmtTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "prcOrdCd": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6
          },
          "prchrAcptcYn": {
            "type": "string",
            "pattern": "^(?:^[YN]$)$"
          },
          "rcptTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "receipt": {
            "$ref": "#/components/schemas/TrnsSalesSaveWrReceipt"
          },
          "regrId": {
            "type": "string",
            "minLength": 0,
            "maxLength": 20
          },
          "regrNm": {
            "type": "string",
            "minLength": 0,
            "maxLength": 60
          },
          "remark": {
            "type": "string",
            "minLength": 0,
            "maxLength": 2000
          },
          "rfdDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14,
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "rfdRsnCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "salesDt": {
            "type": "string",
            "minLength": 8,
            "maxLength": 8,
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])$)$"
          },
          "salesSttsCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "salesTyCd": {
            "type": "string",
            "minLength": 0,
            "maxLength": 5
          },
          "stockRlsDt": {
            "type": "string",
            "minLength": 0,
            "maxLength": 14,
            "pattern": "^(?:^20\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])$)$"
          },
          "taxAmtA": {
            "type": "number"
          },
          "taxAmtB": {
            "type": "number"
          },
          "taxAmtC": {
            "type": "number"
          },
          "taxAmtD": {
            "type": "number"
          },
          "taxRtA": {
            "type": "number"
          },
          "taxRtB": {
            "type": "number"
          },
          "taxRtC": {
            "type": "number"
          },
          "taxRtD": {
            "type": "number"
          },
          "taxblAmtA": {
            "type": "number"
          },
          "taxblAmtB": {
            "type": "number"
          },
          "taxblAmtC": {
            "type": "number"
          },
          "taxblAmtD": {
            "type": "number"
          },
          "tin": {
            "type": "string",
            "pattern": "^(?:^[1,9]\\d{8}$)$"
          },
          "totAmt": {
            "type": "number"
          },
          "totItemCnt": {
            "type": "integer",
            "format": "int32",
            "minimum": 1.0
          },
          "totTaxAmt": {
            "type": "number"
          },
          "totTaxblAmt": {
            "type": "number"
          }
        },
        "required": [
          "bhfId",
          "invcNo",
          "itemList",
          "modrId",
          "modrNm",
          "prchrAcptcYn",
          "rcptTyCd",
          "regrId",
          "regrNm",
          "salesDt",
          "salesSttsCd",
          "salesTyCd",
          "taxAmtA",
          "taxAmtB",
          "taxAmtC",
          "taxAmtD",
          "taxRtA",
          "taxRtB",
          "taxRtC",
          "taxRtD",
          "taxblAmtA",
          "taxblAmtB",
          "taxblAmtC",
          "taxblAmtD",
          "tin",
          "totAmt",
          "totItemCnt",
          "totTaxAmt",
          "totTaxblAmt"
        ]
      },
      "CisInvoiceLine": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "item_id",
          "quantity"
        ],
        "properties": {
          "item_id": {
            "type": "string",
            "format": "uuid",
            "description": "Company catalogue UUID, not the RRA item code."
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "multipleOf": 0.01
          },
          "discount_percent": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "multipleOf": 0.01
          }
        }
      },
      "CisInvoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "branch",
          "invoice_number",
          "payment_code"
        ],
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "invoice_number": {
            "type": "string",
            "pattern": "^[0-9]+$",
            "description": "Positive signed-64-bit invoice identifier, encoded as a string."
          },
          "mode": {
            "type": "string",
            "enum": [
              "NS",
              "NR",
              "CS",
              "CR",
              "TS",
              "TR",
              "PS"
            ],
            "default": "NS"
          },
          "source_receipt": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "payment_code": {
            "type": "string"
          },
          "training_enabled": {
            "type": "boolean",
            "default": false
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CisInvoiceLine"
            },
            "description": "Required for NS/TS/TR/PS. Empty for full-original NR/CS/CR.",
            "maxItems": 100
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_tin": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "purchase_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "refund_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "refund_explanation": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Optional active client in this company and environment. Customer fields may be omitted and are loaded from the client; supplied fields must match current saved details. Refunds/copies inherit the original client and cannot override it. Required for new NS credit or mixed cash/credit invoices (payment codes 02 and 03), including integration-key callers."
          }
        },
        "description": "New NS/TS/TR/PS invoices require 1\u2013100 lines and either an active client_id or customer_name plus customer_tin/customer_phone. NR/CS/CR require source_receipt and empty lines; their original client is inherited. Refunds require reason and explanation; training requires explicit activation."
      },
      "CisStockAdjustment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "item_id": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "number",
            "multipleOf": 0.01,
            "description": "Signed nonzero change, at most 1000000 units in magnitude."
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "branch",
          "item_id",
          "quantity",
          "reason"
        ]
      },
      "CisReferenceFetch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "since": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "yyyyMMddHHmmss; must be later than the previous successful request for this branch/kind."
          }
        },
        "required": [
          "branch",
          "since"
        ]
      },
      "CisConversion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "quantity_numerator": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "quantity_denominator": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "package_numerator": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "package_denominator": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "quantity_numerator",
          "quantity_denominator",
          "package_numerator",
          "package_denominator",
          "reason"
        ]
      },
      "CisInboundDecision": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "approve": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Catalogue UUID per source line, in source order. Use [] when rejecting."
          },
          "invoice_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "purchase_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "original_invoice_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Original approved purchase invoice for a full supplier return."
          },
          "import_unit_costs": {
            "type": "array",
            "items": {
              "type": "number",
              "multipleOf": 0.01
            },
            "default": []
          },
          "reason": {
            "type": "string"
          },
          "conversions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CisConversion"
                },
                {
                  "type": "null"
                }
              ]
            },
            "default": []
          }
        },
        "required": [
          "branch",
          "approve",
          "items",
          "reason"
        ]
      },
      "CisReportQuery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "X",
              "Z",
              "PLU",
              "SALES",
              "STOCK",
              "PURCHASES",
              "IMPORTS",
              "ITEMS"
            ]
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date",
            "description": "Inclusive end, no later than today (Africa/Kigali)."
          }
        },
        "required": [
          "branch",
          "kind",
          "from",
          "to"
        ]
      },
      "CisCashEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "deposit",
              "withdrawal"
            ]
          },
          "amount": {
            "type": "number",
            "multipleOf": 0.01,
            "exclusiveMinimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "branch",
          "kind",
          "amount",
          "reason"
        ]
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "success": {
            "const": false
          },
          "message": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "Optional machine-readable error code. BRANCH_BUSY identifies a lock conflict before the operation begins; retry the unchanged request/key after Retry-After. Other 409 responses are not automatically retryable."
          }
        },
        "required": [
          "success",
          "message"
        ]
      },
      "FiscalEnvelope": {
        "type": "object",
        "properties": {
          "resultCd": {
            "type": "string"
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "CisIssueSuccess": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FiscalEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "resultCd": {
                "const": "000"
              },
              "cisReceiptId": {
                "type": "string",
                "format": "uuid"
              },
              "data": {
                "$ref": "#/components/schemas/FiscalReceipt"
              }
            },
            "required": [
              "resultCd",
              "cisReceiptId",
              "data"
            ]
          }
        ],
        "description": "Issued fiscal response. data contains backend fiscal receipt fields; this does not establish upstream delivery."
      },
      "CisIssueResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CisIssueSuccess"
          },
          {
            "allOf": [
              {
                "$ref": "#/components/schemas/FiscalEnvelope"
              },
              {
                "type": "object",
                "properties": {
                  "resultCd": {
                    "type": "string",
                    "not": {
                      "const": "000"
                    }
                  }
                },
                "required": [
                  "resultCd"
                ]
              }
            ]
          }
        ]
      },
      "ReceiptSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice": {
            "type": "string"
          },
          "branch": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "total": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "invoice",
          "branch",
          "type",
          "created_at",
          "total",
          "status"
        ]
      },
      "ReceiptDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice": {
            "type": "string"
          },
          "branch": {
            "type": [
              "string",
              "null"
            ]
          },
          "request": {
            "type": [
              "object",
              "null"
            ]
          },
          "receipt": {
            "type": [
              "object",
              "null"
            ]
          },
          "receipt_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_receipt_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "signature": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_data": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "accepted_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "ACCEPTED confirms local-backend upstream delivery; VSDC_ISSUED confirms remote issuance only. Other values describe queue state."
          },
          "company": {
            "type": "string"
          },
          "backend": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "invoice",
          "branch",
          "request",
          "receipt",
          "receipt_number",
          "total_receipt_number",
          "signature",
          "internal_data",
          "published_at",
          "accepted_at",
          "status",
          "company",
          "backend"
        ]
      },
      "PrintSnapshot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "type": "object"
          },
          "receipt": {
            "$ref": "#/components/schemas/FiscalReceipt"
          },
          "profile": {
            "type": "object"
          },
          "source_receipt_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "print_kind": {
            "const": "issued"
          },
          "issued_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Original signed-in issuer captured at transaction preparation; null for API-key or historical transactions. Absent in older saved print snapshots."
          },
          "cashier_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Immutable issuer display name (email fallback) captured at transaction preparation. Never recompute using current staff details. Absent in older saved print snapshots."
          },
          "issued_by_api_key": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Integration key identifier captured at preparation, never the credential. Null for staff or historical transactions; absent in older saved print snapshots."
          }
        },
        "required": [
          "id",
          "request",
          "receipt",
          "profile",
          "source_receipt_number",
          "version",
          "print_kind"
        ]
      },
      "CatalogueEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "body": {
            "type": "object"
          },
          "updated_at": {
            "type": "string"
          },
          "registered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Time the current body was recorded as successfully registered with the configured fiscal backend. Null means registration is required; every catalogue save clears this value. Applies to body.bhfId, not all branches."
          },
          "version": {
            "type": "string",
            "format": "uuid",
            "description": "Opaque body version for conditional catalogue saves."
          }
        },
        "required": [
          "id",
          "body",
          "updated_at",
          "registered_at",
          "version"
        ]
      },
      "CatalogueSaved": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "id",
          "message",
          "version"
        ]
      },
      "StockBalance": {
        "type": "object",
        "properties": {
          "item_id": {
            "type": "string",
            "format": "uuid"
          },
          "item": {
            "type": "object"
          },
          "quantity": {
            "type": "number"
          },
          "reserved": {
            "type": "number"
          },
          "available": {
            "type": "number"
          }
        },
        "required": [
          "item_id",
          "item",
          "quantity",
          "reserved",
          "available"
        ]
      },
      "StockOperation": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "operation"
        ]
      },
      "StockDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "response": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "path",
          "state",
          "response",
          "created_at"
        ]
      },
      "ReceiptSummaryList": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReceiptSummary"
            }
          }
        }
      },
      "CatalogueEntryList": {
        "type": "object",
        "required": [
          "data",
          "next_after"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueEntry"
            }
          },
          "next_after": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "StockBalanceList": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockBalance"
            }
          }
        }
      },
      "StockDeliveryList": {
        "type": "object",
        "required": [
          "data",
          "next_before_id"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockDelivery"
            }
          },
          "next_before_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[1-9][0-9]*$",
            "description": "Exclusive cursor for the next page, or null when exhausted."
          }
        }
      },
      "ReceiptDetailResult": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ReceiptDetail"
          }
        },
        "required": [
          "data"
        ]
      },
      "PrintSnapshotResult": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PrintSnapshot"
          }
        },
        "required": [
          "data"
        ]
      },
      "CatalogueSavedResult": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CatalogueSaved"
          }
        },
        "required": [
          "data"
        ]
      },
      "StockOperationResult": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/StockOperation"
          }
        },
        "required": [
          "data"
        ]
      },
      "FiscalReceipt": {
        "type": "object",
        "required": [
          "intrlData",
          "rcptSign",
          "vsdcRcptPbctDate",
          "sdcId",
          "mrcNo",
          "rcptNo",
          "totRcptNo"
        ],
        "properties": {
          "intrlData": {
            "type": "string"
          },
          "rcptSign": {
            "type": "string"
          },
          "vsdcRcptPbctDate": {
            "type": "string"
          },
          "sdcId": {
            "type": "string"
          },
          "mrcNo": {
            "type": "string"
          },
          "rcptNo": {
            "type": "integer",
            "format": "int64"
          },
          "totRcptNo": {
            "type": "integer",
            "format": "int64"
          }
        },
        "description": "Training/proforma signatures can be empty. Counters are JSON integers: preserve 64-bit precision in your client."
      },
      "InboundResolution": {
        "type": "object",
        "required": [
          "input",
          "payload",
          "stock_lines",
          "response",
          "direction",
          "sar_type",
          "stock_reserved"
        ],
        "properties": {
          "input": {
            "type": "object"
          },
          "payload": {
            "type": "object"
          },
          "stock_lines": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "response": {
            "$ref": "#/components/schemas/FiscalEnvelope"
          },
          "direction": {
            "type": "integer"
          },
          "sar_type": {
            "type": "string"
          },
          "stock_reserved": {
            "type": "boolean"
          }
        },
        "description": "Inspect data.response.resultCd; HTTP 200 alone does not confirm approval. Consult inbound state and reconcile UNKNOWN before retry."
      },
      "InboundRecord": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "body",
          "state",
          "resolution"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string"
          },
          "body": {
            "type": "object"
          },
          "state": {
            "type": "string"
          },
          "resolution": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "CisReportTotals": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "gross": {
            "type": "integer",
            "format": "int64"
          },
          "tax": {
            "type": "integer",
            "format": "int64"
          },
          "discount": {
            "type": "integer",
            "format": "int64"
          },
          "items": {
            "type": "integer",
            "format": "int64"
          },
          "taxable": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "minItems": 4,
            "maxItems": 4
          },
          "taxes": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "minItems": 4,
            "maxItems": 4
          },
          "payments": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            }
          }
        },
        "required": [
          "count",
          "gross",
          "tax",
          "discount",
          "items",
          "taxable",
          "taxes",
          "payments"
        ],
        "description": "Amounts are integer cents. count is receipts; items is line count. Tax arrays are ordered A,B,C,D. Mode groups retain unsigned refund amounts; subtract NR from NS for net sales. Payments are keyed by payment code."
      },
      "CisReportCashBalance": {
        "type": "object",
        "properties": {
          "opening": {
            "type": "integer",
            "format": "int64"
          },
          "opening_deposit": {
            "type": "integer",
            "format": "int64"
          },
          "closing": {
            "type": "integer",
            "format": "int64"
          },
          "basis": {
            "type": "string"
          }
        },
        "required": [
          "opening",
          "opening_deposit",
          "closing",
          "basis"
        ]
      },
      "CisReportPlu": {
        "type": "object",
        "properties": {
          "item": {
            "type": "object"
          },
          "quantity_hundredths": {
            "type": "integer",
            "format": "int64"
          },
          "amount_cents": {
            "type": "integer",
            "format": "int64"
          },
          "remaining_quantity_hundredths": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "tax_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percentage from the immutable source receipt. Null when unavailable; absent in older saved report snapshots. Lines with different rates are separate."
          }
        },
        "required": [
          "item",
          "quantity_hundredths",
          "amount_cents",
          "remaining_quantity_hundredths"
        ]
      },
      "CisReportSnapshot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "X",
              "Z",
              "PLU",
              "SALES",
              "STOCK",
              "PURCHASES",
              "IMPORTS",
              "ITEMS"
            ]
          },
          "profile": {
            "type": "object"
          },
          "tin": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "Kigali local timestamp YYYYMMDDhhmmss; from may be 00000000000000 for first X/Z period."
          },
          "to_exclusive": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "Kigali local timestamp YYYYMMDDhhmmss; from may be 00000000000000 for first X/Z period."
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "catalogue": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "item": {
                  "type": "object"
                },
                "registered_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "item",
                "registered_at"
              ]
            }
          },
          "cash_balance_cents": {
            "$ref": "#/components/schemas/CisReportCashBalance"
          },
          "groups_cents": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CisReportTotals"
            }
          },
          "cash": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "deposit",
                    "withdrawal"
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "required": [
                "kind",
                "amount_cents"
              ]
            }
          },
          "incomplete": {
            "type": "integer",
            "minimum": 0
          },
          "plu": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CisReportPlu"
            }
          },
          "closing_stock": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "type": "object"
                },
                "quantity_hundredths": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "required": [
                "item",
                "quantity_hundredths"
              ]
            }
          },
          "receipts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "inbound": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string"
                },
                "body": {
                  "type": "object"
                },
                "state": {
                  "type": "string"
                },
                "resolution": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "required": [
                "kind",
                "body",
                "state",
                "resolution"
              ]
            }
          },
          "rra_submission": {
            "type": "string"
          },
          "plu_categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CisReportPluCategory"
            },
            "description": "Net totals by historical item classification and quantity unit. Absent in older snapshots."
          }
        },
        "required": [
          "id",
          "kind",
          "profile",
          "tin",
          "version",
          "from",
          "to_exclusive",
          "generated_at",
          "catalogue",
          "cash_balance_cents",
          "groups_cents",
          "cash",
          "incomplete",
          "plu",
          "closing_stock",
          "receipts",
          "inbound",
          "rra_submission"
        ],
        "description": "Immutable saved local CIS report. rra_submission describes upstream status; generation does not constitute RRA submission. Catalogue is current at generation, not a historical catalogue reconstruction."
      },
      "CisReportHistoryEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "branch": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "X",
              "Z",
              "PLU",
              "SALES",
              "STOCK",
              "PURCHASES",
              "IMPORTS",
              "ITEMS"
            ]
          },
          "from": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "Kigali local timestamp YYYYMMDDhhmmss; from may be 00000000000000 for first X/Z period."
          },
          "to_exclusive": {
            "type": "string",
            "pattern": "^[0-9]{14}$",
            "description": "Kigali local timestamp YYYYMMDDhhmmss; from may be 00000000000000 for first X/Z period."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "branch",
          "kind",
          "from",
          "to_exclusive",
          "created_at"
        ]
      },
      "CisReportResult": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CisReportSnapshot"
          }
        },
        "required": [
          "data"
        ]
      },
      "CisReportHistory": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CisReportHistoryEntry"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CisCashResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "VsdcBhfRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcBhfRes$CodeResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.BhfRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcBhfRes$Bhf": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "bhfId": {
            "type": [
              "string",
              "null"
            ]
          },
          "bhfNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "bhfSttsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "dstrtNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "locDesc": {
            "type": [
              "string",
              "null"
            ]
          },
          "mgrEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "mgrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "mgrTelNo": {
            "type": [
              "string",
              "null"
            ]
          },
          "prvncNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "sctrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "tin": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.BhfRes$Bhf. Unknown future fields are tolerated by this client contract.",
        "required": [
          "bhfId",
          "bhfNm",
          "bhfSttsCd",
          "dstrtNm",
          "hqYn",
          "locDesc",
          "mgrEmail",
          "mgrNm",
          "mgrTelNo",
          "prvncNm",
          "sctrNm",
          "tin"
        ]
      },
      "VsdcBhfRes$CodeResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "bhfList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcBhfRes$Bhf"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.BhfRes$CodeResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "bhfList"
        ]
      },
      "VsdcCodeRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcCodeRes$CodeResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CodeRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcCodeRes$CodeClassLVO": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "cdCls": {
            "type": [
              "string",
              "null"
            ]
          },
          "cdClsDesc": {
            "type": [
              "string",
              "null"
            ]
          },
          "cdClsNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "dtlList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcCodeRes$CodeDtlLVO"
            }
          },
          "useYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "userDfnNm1": {
            "type": [
              "string",
              "null"
            ]
          },
          "userDfnNm2": {
            "type": [
              "string",
              "null"
            ]
          },
          "userDfnNm3": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CodeRes$CodeClassLVO. Unknown future fields are tolerated by this client contract.",
        "required": [
          "cdCls",
          "cdClsDesc",
          "cdClsNm",
          "dtlList",
          "useYn",
          "userDfnNm1",
          "userDfnNm2",
          "userDfnNm3"
        ]
      },
      "VsdcCodeRes$CodeDtlLVO": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "cd": {
            "type": [
              "string",
              "null"
            ]
          },
          "cdDesc": {
            "type": [
              "string",
              "null"
            ]
          },
          "cdNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "srtOrd": {
            "type": [
              "integer",
              "null"
            ]
          },
          "useYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "userDfnCd1": {
            "type": [
              "string",
              "null"
            ]
          },
          "userDfnCd2": {
            "type": [
              "string",
              "null"
            ]
          },
          "userDfnCd3": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CodeRes$CodeDtlLVO. Unknown future fields are tolerated by this client contract.",
        "required": [
          "cd",
          "cdDesc",
          "cdNm",
          "srtOrd",
          "useYn",
          "userDfnCd1",
          "userDfnCd2",
          "userDfnCd3"
        ]
      },
      "VsdcCodeRes$CodeResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "clsList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcCodeRes$CodeClassLVO"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CodeRes$CodeResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "clsList"
        ]
      },
      "VsdcCustRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcCustRes$CustResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CustRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcCustRes$CustResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "custList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcCustRes$Customer"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CustRes$CustResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "custList"
        ]
      },
      "VsdcCustRes$Customer": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "dstrtNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "locDesc": {
            "type": [
              "string",
              "null"
            ]
          },
          "prvncNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "sctrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxprNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxprSttsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "tin": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.CustRes$Customer. Unknown future fields are tolerated by this client contract.",
        "required": [
          "dstrtNm",
          "locDesc",
          "prvncNm",
          "sctrNm",
          "taxprNm",
          "taxprSttsCd",
          "tin"
        ]
      },
      "VsdcImportItemRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcImportItemRes$ImportItemResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ImportItemRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcImportItemRes$ImportItem": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "agntNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "dclDe": {
            "type": [
              "string",
              "null"
            ]
          },
          "dclNo": {
            "type": [
              "string",
              "null"
            ]
          },
          "exptNatCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "hsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "imptItemsttsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "invcFcurAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "invcFcurCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "invcFcurExcrt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "itemNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemSeq": {
            "type": "integer"
          },
          "netWt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "orgnNatCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "pkg": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pkgUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "qty": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "qtyUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "spplrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "taskCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "totWt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ImportItemRes$ImportItem. Unknown future fields are tolerated by this client contract.",
        "required": [
          "agntNm",
          "dclDe",
          "dclNo",
          "exptNatCd",
          "hsCd",
          "imptItemsttsCd",
          "invcFcurAmt",
          "invcFcurCd",
          "invcFcurExcrt",
          "itemNm",
          "itemSeq",
          "netWt",
          "orgnNatCd",
          "pkg",
          "pkgUnitCd",
          "qty",
          "qtyUnitCd",
          "spplrNm",
          "taskCd",
          "totWt"
        ]
      },
      "VsdcImportItemRes$ImportItemResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "itemList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcImportItemRes$ImportItem"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ImportItemRes$ImportItemResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "itemList"
        ]
      },
      "VsdcInitInfoRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcInitInfoRes$InitInfoResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.InitInfoRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcInitInfoRes$InitInfoResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "info": {
            "$ref": "#/components/schemas/VsdcInitInfoRes$InitInfoVO"
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.InitInfoRes$InitInfoResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "info"
        ]
      },
      "VsdcInitInfoRes$InitInfoVO": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "bhfId": {
            "type": [
              "string",
              "null"
            ]
          },
          "bhfNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "bhfOpenDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "bsnsActv": {
            "type": [
              "string",
              "null"
            ]
          },
          "cmcKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "dstrtNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "dvcId": {
            "type": [
              "string",
              "null"
            ]
          },
          "hqYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "intrlKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastCopyInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "lastInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "lastPchsInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "lastProfrmInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "lastSaleInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "lastSaleRcptNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "lastTrainInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "locDesc": {
            "type": [
              "string",
              "null"
            ]
          },
          "mgrEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "mgrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "mgrTelNo": {
            "type": [
              "string",
              "null"
            ]
          },
          "mrcNo": {
            "type": [
              "string",
              "null"
            ]
          },
          "prvncNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "sctrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "sdcId": {
            "type": [
              "string",
              "null"
            ]
          },
          "signKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxprNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "tin": {
            "type": [
              "string",
              "null"
            ]
          },
          "vatTyCd": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.InitInfoRes$InitInfoVO. Unknown future fields are tolerated by this client contract.",
        "required": [
          "bhfId",
          "bhfNm",
          "bhfOpenDt",
          "bsnsActv",
          "cmcKey",
          "dstrtNm",
          "dvcId",
          "hqYn",
          "intrlKey",
          "lastCopyInvcNo",
          "lastInvcNo",
          "lastPchsInvcNo",
          "lastProfrmInvcNo",
          "lastSaleInvcNo",
          "lastSaleRcptNo",
          "lastTrainInvcNo",
          "locDesc",
          "mgrEmail",
          "mgrNm",
          "mgrTelNo",
          "mrcNo",
          "prvncNm",
          "sctrNm",
          "sdcId",
          "signKey",
          "taxprNm",
          "tin",
          "vatTyCd"
        ]
      },
      "VsdcItemClsRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcItemClsRes$ItemClsResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ItemClsRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcItemClsRes$ItemClassLVO": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "itemClsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemClsLvl": {
            "type": [
              "integer",
              "null"
            ]
          },
          "itemClsNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "mjrTgYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "useYn": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ItemClsRes$ItemClassLVO. Unknown future fields are tolerated by this client contract.",
        "required": [
          "itemClsCd",
          "itemClsLvl",
          "itemClsNm",
          "mjrTgYn",
          "taxTyCd",
          "useYn"
        ]
      },
      "VsdcItemClsRes$ItemClsResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "itemClsList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcItemClsRes$ItemClassLVO"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ItemClsRes$ItemClsResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "itemClsList"
        ]
      },
      "VsdcItemRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcItemRes$ItemResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ItemRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcItemRes$Item": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "addInfo": {
            "type": [
              "string",
              "null"
            ]
          },
          "bcd": {
            "type": [
              "string",
              "null"
            ]
          },
          "btchNo": {
            "type": [
              "string",
              "null"
            ]
          },
          "dftPrc": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "grpPrcL1": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "grpPrcL2": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "grpPrcL3": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "grpPrcL4": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "grpPrcL5": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "isrcAplcbYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemClsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemStdNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "orgnNatCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "pkgUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "qtyUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "regBhfId": {
            "type": [
              "string",
              "null"
            ]
          },
          "rraModYn": {
            "type": [
              "string",
              "null"
            ]
          },
          "sftyQty": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "tin": {
            "type": [
              "string",
              "null"
            ]
          },
          "useYn": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ItemRes$Item. Unknown future fields are tolerated by this client contract.",
        "required": [
          "addInfo",
          "bcd",
          "btchNo",
          "dftPrc",
          "grpPrcL1",
          "grpPrcL2",
          "grpPrcL3",
          "grpPrcL4",
          "grpPrcL5",
          "isrcAplcbYn",
          "itemCd",
          "itemClsCd",
          "itemNm",
          "itemStdNm",
          "itemTyCd",
          "orgnNatCd",
          "pkgUnitCd",
          "qtyUnitCd",
          "regBhfId",
          "rraModYn",
          "sftyQty",
          "taxTyCd",
          "tin",
          "useYn"
        ]
      },
      "VsdcItemRes$ItemResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "itemList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcItemRes$Item"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ItemRes$ItemResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "itemList"
        ]
      },
      "VsdcNoticeRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcNoticeRes$NoticeResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.NoticeRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcNoticeRes$Notice": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "cont": {
            "type": [
              "string",
              "null"
            ]
          },
          "dtlUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "noticeNo": {
            "type": "integer"
          },
          "regDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "regrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.NoticeRes$Notice. Unknown future fields are tolerated by this client contract.",
        "required": [
          "cont",
          "dtlUrl",
          "noticeNo",
          "regDt",
          "regrNm",
          "title"
        ]
      },
      "VsdcNoticeRes$NoticeResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "noticeList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcNoticeRes$Notice"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.NoticeRes$NoticeResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "noticeList"
        ]
      },
      "VsdcReportZCheckRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcReportZCheckRes$ReportZCheckResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ReportZCheckRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcReportZCheckRes$ReportZCheckData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "cpyRcptClsNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "cpyRcptOpnNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "cpyRcptPbctCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cpyRfdAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "cpyRfdTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "cpySalesAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "cpySalesTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "nrmRcptClsNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "nrmRcptOpnNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "nrmRcptPbctCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "nrmRfdAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "nrmRfdTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "nrmSalesAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "nrmSalesTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pfmRcptClsNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "pfmRcptOpnNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "pfmRcptPbctCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "pfmRfdAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pfmRfdTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pfmSalesAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pfmSalesTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "rcptClsNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "rcptOpnNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "rcptPbctCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "trnRcptClsNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "trnRcptOpnNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "trnRcptPbctCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "trnRfdAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "trnRfdTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "trnSalesAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "trnSalesTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ReportZCheckRes$ReportZCheckData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "cpyRcptClsNo",
          "cpyRcptOpnNo",
          "cpyRcptPbctCnt",
          "cpyRfdAmt",
          "cpyRfdTaxAmt",
          "cpySalesAmt",
          "cpySalesTaxAmt",
          "nrmRcptClsNo",
          "nrmRcptOpnNo",
          "nrmRcptPbctCnt",
          "nrmRfdAmt",
          "nrmRfdTaxAmt",
          "nrmSalesAmt",
          "nrmSalesTaxAmt",
          "pfmRcptClsNo",
          "pfmRcptOpnNo",
          "pfmRcptPbctCnt",
          "pfmRfdAmt",
          "pfmRfdTaxAmt",
          "pfmSalesAmt",
          "pfmSalesTaxAmt",
          "rcptClsNo",
          "rcptOpnNo",
          "rcptPbctCnt",
          "trnRcptClsNo",
          "trnRcptOpnNo",
          "trnRcptPbctCnt",
          "trnRfdAmt",
          "trnRfdTaxAmt",
          "trnSalesAmt",
          "trnSalesTaxAmt"
        ]
      },
      "VsdcReportZCheckRes$ReportZCheckResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "checkCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "rcptRpt": {
            "$ref": "#/components/schemas/VsdcReportZCheckRes$ReportZCheckData"
          },
          "zrpt": {
            "$ref": "#/components/schemas/VsdcReportZCheckRes$ReportZCheckData"
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.ReportZCheckRes$ReportZCheckResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "checkCode",
          "rcptRpt",
          "zrpt"
        ]
      },
      "VsdcStockMoveRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcStockMoveRes$StockMoveResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.StockMoveRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcStockMoveRes$StockMove": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "custBhfId": {
            "type": [
              "string",
              "null"
            ]
          },
          "custTin": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcStockMoveRes$StockMoveItem"
            }
          },
          "ocrnDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "sarNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "totAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totItemCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "totTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totTaxblAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.StockMoveRes$StockMove. Unknown future fields are tolerated by this client contract.",
        "required": [
          "custBhfId",
          "custTin",
          "itemList",
          "ocrnDt",
          "remark",
          "sarNo",
          "totAmt",
          "totItemCnt",
          "totTaxAmt",
          "totTaxblAmt"
        ]
      },
      "VsdcStockMoveRes$StockMoveItem": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "bcd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemClsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemExprDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemSeq": {
            "type": [
              "integer",
              "null"
            ]
          },
          "pkg": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pkgUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "prc": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "qty": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "qtyUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "splyAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxblAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totDcAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.StockMoveRes$StockMoveItem. Unknown future fields are tolerated by this client contract.",
        "required": [
          "bcd",
          "itemCd",
          "itemClsCd",
          "itemExprDt",
          "itemNm",
          "itemSeq",
          "pkg",
          "pkgUnitCd",
          "prc",
          "qty",
          "qtyUnitCd",
          "splyAmt",
          "taxAmt",
          "taxTyCd",
          "taxblAmt",
          "totAmt",
          "totDcAmt"
        ]
      },
      "VsdcStockMoveRes$StockMoveResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "stockList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcStockMoveRes$StockMove"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.StockMoveRes$StockMoveResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "stockList"
        ]
      },
      "VsdcTestEchoRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcTestEchoRes$TestEchoResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.TestEchoRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcTestEchoRes$TestEchoResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "testStr": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.TestEchoRes$TestEchoResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "testStr"
        ]
      },
      "VsdcTrnsPurchaseSalesRes": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VsdcTrnsPurchaseSalesRes$TrnsPurchaseSalesResData"
          },
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.TrnsPurchaseSalesRes. Unknown future fields are tolerated by this client contract.",
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcTrnsPurchaseSalesRes$TrnsPurchaseSales": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "cfmDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcTrnsPurchaseSalesRes$TrnsPurchaseSalesItem"
            }
          },
          "pmtTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "rcptTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "remark": {
            "type": [
              "string",
              "null"
            ]
          },
          "salesDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "spplrBhfId": {
            "type": [
              "string",
              "null"
            ]
          },
          "spplrInvcNo": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "spplrNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "spplrTin": {
            "type": [
              "string",
              "null"
            ]
          },
          "stockRlsDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxAmtA": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxAmtB": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxAmtC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxAmtD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxRtA": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxRtB": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxRtC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxRtD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxblAmtA": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxblAmtB": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxblAmtC": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxblAmtD": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totItemCnt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "totTaxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totTaxblAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.TrnsPurchaseSalesRes$TrnsPurchaseSales. Unknown future fields are tolerated by this client contract.",
        "required": [
          "cfmDt",
          "itemList",
          "pmtTyCd",
          "rcptTyCd",
          "remark",
          "salesDt",
          "spplrBhfId",
          "spplrInvcNo",
          "spplrNm",
          "spplrTin",
          "stockRlsDt",
          "taxAmtA",
          "taxAmtB",
          "taxAmtC",
          "taxAmtD",
          "taxRtA",
          "taxRtB",
          "taxRtC",
          "taxRtD",
          "taxblAmtA",
          "taxblAmtB",
          "taxblAmtC",
          "taxblAmtD",
          "totAmt",
          "totItemCnt",
          "totTaxAmt",
          "totTaxblAmt"
        ]
      },
      "VsdcTrnsPurchaseSalesRes$TrnsPurchaseSalesItem": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "bcd": {
            "type": [
              "string",
              "null"
            ]
          },
          "dcAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "dcRt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "itemCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemClsCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemNm": {
            "type": [
              "string",
              "null"
            ]
          },
          "itemSeq": {
            "type": [
              "integer",
              "null"
            ]
          },
          "pkg": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "pkgUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "prc": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "qty": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "qtyUnitCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "splyAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "taxTyCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxblAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          },
          "totAmt": {
            "type": [
              "number",
              "null"
            ],
            "description": "Decimal JSON number; preserve decimal precision when processing fiscal values."
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.TrnsPurchaseSalesRes$TrnsPurchaseSalesItem. Unknown future fields are tolerated by this client contract.",
        "required": [
          "bcd",
          "dcAmt",
          "dcRt",
          "itemCd",
          "itemClsCd",
          "itemNm",
          "itemSeq",
          "pkg",
          "pkgUnitCd",
          "prc",
          "qty",
          "qtyUnitCd",
          "splyAmt",
          "taxAmt",
          "taxTyCd",
          "taxblAmt",
          "totAmt"
        ]
      },
      "VsdcTrnsPurchaseSalesRes$TrnsPurchaseSalesResData": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "saleList": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/VsdcTrnsPurchaseSalesRes$TrnsPurchaseSales"
            }
          }
        },
        "description": "Fields reflected from supplied _9 WAR ebm.vsdc.execute.model.TrnsPurchaseSalesRes$TrnsPurchaseSalesResData. Unknown future fields are tolerated by this client contract.",
        "required": [
          "saleList"
        ]
      },
      "VsdcPassthroughEnvelope": {
        "type": "object",
        "properties": {
          "resultCd": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {}
        },
        "description": "Raw upstream envelope. data is endpoint/backend dependent and can be absent. Always inspect resultCd. No typed upstream data model is enforced by this route."
      },
      "VsdcSaleResponse": {
        "type": "object",
        "properties": {
          "resultCd": {
            "type": "string"
          },
          "resultMsg": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultDt": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FiscalReceipt"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "resultCd",
          "resultMsg",
          "resultDt"
        ]
      },
      "VsdcHttpError": {
        "type": "object",
        "required": [
          "timestamp",
          "status",
          "error",
          "path"
        ],
        "properties": {
          "timestamp": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "description": "Standalone WAR-compatible framework error. Hosted authentication/proxy errors may instead use their own envelopes or plain text."
      },
      "CisReportPluCategory": {
        "type": "object",
        "properties": {
          "item_classification": {
            "type": [
              "string",
              "null"
            ],
            "description": "Item classification from the original receipt; null when missing."
          },
          "quantity_unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Original quantity unit; different units are never combined."
          },
          "quantity_hundredths": {
            "type": "integer",
            "description": "Net normal-sale quantity minus normal refunds, scaled by 100."
          },
          "amount_cents": {
            "type": "integer",
            "description": "Net normal-sale amount minus normal refunds, scaled by 100."
          }
        },
        "required": [
          "item_classification",
          "quantity_unit",
          "quantity_hundredths",
          "amount_cents"
        ]
      },
      "ReceiptUsageCounts": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "accepted": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vsdc_issued": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "total",
          "accepted",
          "pending",
          "vsdc_issued"
        ]
      },
      "ReceiptUsageGroup": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "accepted": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vsdc_issued": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "branch": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "NS",
              "NR",
              "CS",
              "CR",
              "TS",
              "TR",
              "PS",
              "UNKNOWN"
            ]
          }
        },
        "required": [
          "total",
          "accepted",
          "pending",
          "vsdc_issued",
          "branch",
          "mode"
        ]
      },
      "ReceiptUsage": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}$"
          },
          "timezone": {
            "type": "string",
            "const": "Africa/Kigali"
          },
          "environment": {
            "type": "string",
            "enum": [
              "sandbox",
              "production"
            ]
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to_exclusive": {
            "type": "string",
            "format": "date-time"
          },
          "basis": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/ReceiptUsageCounts"
          },
          "by_branch_and_mode": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReceiptUsageGroup"
            }
          }
        },
        "required": [
          "month",
          "timezone",
          "environment",
          "from",
          "to_exclusive",
          "basis",
          "totals",
          "by_branch_and_mode"
        ]
      },
      "CatalogueItemResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CatalogueEntry"
          }
        }
      },
      "StaffMember": {
        "type": "object",
        "required": [
          "id",
          "email",
          "display_name",
          "role",
          "is_active",
          "last_sign_in_at",
          "must_change_password",
          "branches"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "last_sign_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "must_change_password": {
            "type": "boolean"
          },
          "branches": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            },
            "description": "Empty means all branches; owners always have all branches."
          }
        }
      },
      "StaffChange": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "Trimmed printable name; control characters are rejected."
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "cashier",
              "viewer"
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "branches": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            }
          }
        }
      },
      "StaffCredentialResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "temporary_password"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "temporary_password": {
                "type": "string",
                "minLength": 24
              }
            }
          }
        }
      },
      "NewStaff": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "display_name",
          "role"
        ],
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "Trimmed printable name; control characters are rejected."
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "cashier",
              "viewer"
            ]
          },
          "branches": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            }
          }
        }
      },
      "StaffActivity": {
        "type": "object",
        "required": [
          "user_id",
          "from",
          "to",
          "timezone",
          "last_sign_in_at",
          "receipts",
          "refunds",
          "net_sales_cents",
          "stock_movements",
          "cash_entries"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "const": "Africa/Kigali"
          },
          "last_sign_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "receipts": {
            "type": "integer",
            "format": "int64"
          },
          "refunds": {
            "type": "integer",
            "format": "int64"
          },
          "net_sales_cents": {
            "type": "string",
            "pattern": "^-?[0-9]+$",
            "description": "Signed integer cents as a decimal string; parse with integer/decimal arithmetic, not a floating-point number."
          },
          "stock_movements": {
            "type": "integer",
            "format": "int64"
          },
          "cash_entries": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ClientDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "tin": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 9
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          }
        },
        "description": "Supply TIN (nine ASCII digits) or a Rwandan mobile number. Empty optional strings become null. Phones normalize to +2507XXXXXXXX; 07..., 7..., 2507..., +2507... and 002507... inputs are accepted with spaces, parentheses or hyphens. Credit fields cannot be set here."
      },
      "ClientRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "tin",
          "phone",
          "email",
          "address",
          "notes",
          "id",
          "version",
          "created_by",
          "created_at",
          "updated_at",
          "is_active",
          "credit_allowed",
          "credit_limit_cents"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "tin": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 9
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "string",
            "format": "uuid"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "is_active": {
            "type": "boolean"
          },
          "credit_allowed": {
            "type": "boolean"
          },
          "credit_limit_cents": {
            "type": "string",
            "pattern": "^[0-9]+$"
          }
        }
      },
      "ClientResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ClientRecord"
          }
        }
      },
      "ClientPage": {
        "type": "object",
        "required": [
          "data",
          "next_after"
        ],
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ClientRecord"
            }
          },
          "next_after": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "ClientUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "details",
          "is_active"
        ],
        "properties": {
          "details": {
            "$ref": "#/components/schemas/ClientDetails"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "description": "Replaces all contact details; omitted optional fields are cleared. Does not modify credit settings."
      },
      "ClientCreditTerms": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "credit_allowed",
          "credit_limit_cents"
        ],
        "properties": {
          "credit_allowed": {
            "type": "boolean"
          },
          "credit_limit_cents": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,18})$",
            "description": "Nonnegative integer cents, maximum 9223372036854775807. Sent as a decimal string to preserve exact cents."
          }
        }
      },
      "ClientBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client_id",
          "credit_allowed",
          "history_requires_reconciliation",
          "credit_limit_cents",
          "balance_cents",
          "pending_credit_cents",
          "available_credit_cents"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid"
          },
          "credit_allowed": {
            "type": "boolean"
          },
          "history_requires_reconciliation": {
            "type": "boolean"
          },
          "credit_limit_cents": {
            "type": "string",
            "pattern": "^-?[0-9]+$"
          },
          "balance_cents": {
            "type": "string",
            "pattern": "^-?[0-9]+$"
          },
          "pending_credit_cents": {
            "type": "string",
            "pattern": "^-?[0-9]+$"
          },
          "available_credit_cents": {
            "type": "string",
            "pattern": "^-?[0-9]+$"
          }
        },
        "description": "Current tracked ledger balance and pending reservations. If history_requires_reconciliation is true, historical debt is incomplete and new credit is blocked; these figures must not be treated as the full historical balance. Available credit is limit minus balance minus pending, even when credit is disabled."
      },
      "ClientBalanceResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ClientBalance"
          }
        }
      },
      "PaymentAllocation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "credit_sale_entry_id",
          "amount_cents"
        ],
        "properties": {
          "credit_sale_entry_id": {
            "type": "string",
            "format": "uuid"
          },
          "amount_cents": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "Positive integer cents, at most 9223372036854775807. Always a decimal string."
          }
        }
      },
      "ClientPayment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "branch",
          "amount_cents",
          "payment_method"
        ],
        "properties": {
          "branch": {
            "type": "string",
            "pattern": "^[0-9]{2}$"
          },
          "amount_cents": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "Positive integer cents, at most 9223372036854775807. Always a decimal string."
          },
          "payment_method": {
            "type": "string",
            "enum": [
              "cash",
              "mobile_money",
              "bank",
              "cheque"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "allocations": {
            "type": [
              "array",
              "null"
            ],
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/PaymentAllocation"
            }
          }
        }
      },
      "ClientPaymentResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "client_id",
              "branch",
              "amount_cents",
              "payment_method",
              "paid_on",
              "balance_cents",
              "allocations"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "client_id": {
                "type": "string",
                "format": "uuid"
              },
              "branch": {
                "type": "string"
              },
              "amount_cents": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$",
                "description": "Positive integer cents, at most 9223372036854775807. Always a decimal string."
              },
              "payment_method": {
                "type": "string"
              },
              "paid_on": {
                "type": "string",
                "format": "date"
              },
              "balance_cents": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "allocations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PaymentAllocation"
                }
              }
            }
          }
        }
      },
      "PaymentReversal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 5,
            "maxLength": 500
          }
        }
      },
      "PaymentReversalResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "client_id",
              "branch",
              "reverses_entry",
              "amount_cents",
              "balance_cents"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "client_id": {
                "type": "string",
                "format": "uuid"
              },
              "branch": {
                "type": "string"
              },
              "reverses_entry": {
                "type": "string",
                "format": "uuid"
              },
              "amount_cents": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$",
                "description": "Positive integer cents, at most 9223372036854775807. Always a decimal string."
              },
              "balance_cents": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              }
            }
          }
        }
      },
      "ClientStatementLine": {
        "type": "object",
        "required": [
          "entry_id",
          "date",
          "posted_at",
          "paid_on",
          "kind",
          "document",
          "branch",
          "payment_method",
          "reference",
          "note",
          "receipt_id",
          "reverses_entry",
          "actor_id",
          "debit_cents",
          "credit_cents",
          "balance_cents",
          "is_reversed"
        ],
        "properties": {
          "entry_id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "credit_sale",
              "credit_refund",
              "payment",
              "payment_reversal"
            ]
          },
          "document": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "payment_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "receipt_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "reverses_entry": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "actor_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "debit_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "credit_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "balance_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "is_reversed": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ClientStatementResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "client_id",
              "client_name",
              "from",
              "to",
              "timezone",
              "date_basis",
              "history_requires_reconciliation",
              "opening_balance_cents",
              "closing_balance_cents",
              "lines"
            ],
            "properties": {
              "client_id": {
                "type": "string",
                "format": "uuid"
              },
              "client_name": {
                "type": "string"
              },
              "from": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "to": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "timezone": {
                "const": "Africa/Kigali"
              },
              "date_basis": {
                "const": "ledger_posting_date"
              },
              "history_requires_reconciliation": {
                "type": "boolean"
              },
              "opening_balance_cents": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "closing_balance_cents": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "lines": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ClientStatementLine"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ReceivableAgingClient": {
        "type": "object",
        "required": [
          "client_id",
          "name",
          "is_active",
          "days_0_30_cents",
          "days_31_60_cents",
          "days_61_90_cents",
          "over_90_cents",
          "total_open_cents",
          "customer_credit_cents",
          "balance_cents"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "days_0_30_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "days_31_60_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "days_61_90_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "over_90_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "total_open_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "customer_credit_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "balance_cents": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          }
        },
        "additionalProperties": false
      },
      "ReceivableAgingResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "as_of",
              "timezone",
              "date_basis",
              "history_requires_reconciliation",
              "clients",
              "totals"
            ],
            "properties": {
              "as_of": {
                "type": "string",
                "format": "date"
              },
              "timezone": {
                "const": "Africa/Kigali"
              },
              "date_basis": {
                "const": "credit_sale_posting_date"
              },
              "history_requires_reconciliation": {
                "type": "boolean"
              },
              "clients": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReceivableAgingClient"
                }
              },
              "totals": {
                "type": "object",
                "required": [
                  "days_0_30_cents",
                  "days_31_60_cents",
                  "days_61_90_cents",
                  "over_90_cents",
                  "total_open_cents",
                  "customer_credit_cents",
                  "balance_cents"
                ],
                "properties": {
                  "days_0_30_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  },
                  "days_31_60_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  },
                  "days_61_90_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  },
                  "over_90_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  },
                  "total_open_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  },
                  "customer_credit_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  },
                  "balance_cents": {
                    "type": "string",
                    "pattern": "^-?(0|[1-9][0-9]*)$"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    }
  }
}
