{
  "components": {
    "schemas": {
      "ArapVoucherBillOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Code"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "vouch_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "U8 单据类型代码（26 / 27 / 01 / 02 / 48 / 49 / R0 / P0）",
            "title": "Vouch Type"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "ArapVoucherBillOut",
        "type": "object"
      },
      "ArapVoucherKeyOut": {
        "additionalProperties": true,
        "properties": {
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期",
            "title": "Date"
          },
          "no": {
            "description": "凭证号",
            "title": "No",
            "type": "integer"
          },
          "num": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据上回写的凭证号，如 转-0172",
            "title": "Num"
          },
          "period": {
            "description": "会计期间",
            "title": "Period",
            "type": "integer"
          },
          "sign": {
            "description": "凭证类别",
            "title": "Sign",
            "type": "string"
          },
          "year": {
            "description": "会计年度",
            "title": "Year",
            "type": "integer"
          }
        },
        "required": [
          "year",
          "period",
          "sign",
          "no"
        ],
        "title": "ArapVoucherKeyOut",
        "type": "object"
      },
      "ArapVoucherLineOut": {
        "additionalProperties": true,
        "properties": {
          "account": {
            "description": "科目编码",
            "title": "Account",
            "type": "string"
          },
          "bill_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "该行的来源单据号（凭证行 coutid；合并制单时各行是各自单据的单号）",
            "title": "Bill Code"
          },
          "credit": {
            "description": "贷方金额",
            "title": "Credit",
            "type": "number"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户",
            "title": "Customer"
          },
          "debit": {
            "description": "借方金额",
            "title": "Debit",
            "type": "number"
          },
          "dept": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门",
            "title": "Dept"
          },
          "digest": {
            "description": "摘要",
            "title": "Digest",
            "type": "string"
          },
          "entry": {
            "description": "分录号",
            "title": "Entry",
            "type": "integer"
          },
          "item": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目",
            "title": "Item"
          },
          "item_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目大类",
            "title": "Item Class"
          },
          "person": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "个人",
            "title": "Person"
          },
          "settle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "结算方式",
            "title": "Settle"
          },
          "supplier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商",
            "title": "Supplier"
          }
        },
        "required": [
          "entry",
          "account",
          "digest",
          "debit",
          "credit"
        ],
        "title": "ArapVoucherLineOut",
        "type": "object"
      },
      "ArapVoucherRef": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "单据主键",
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "单据类型，各项相同",
            "enum": [
              "sale_invoice",
              "purchase_invoice",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ar_refund",
              "ap_refund"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "ArapVoucherRef",
        "type": "object"
      },
      "ArcCreateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "archive": {
            "description": "档案名。\n\n- `customer` 客户、`vendor` 供应商、`inventory` 存货、`department` 部门、`person` 人员、`warehouse` 仓库\n- `customer_class` 客户分类、`vendor_class` 供应商分类、`inventory_class` 存货分类、`reason` 原因码\n\n**其他可写档案**\n- `bank` 本单位开户银行：编码最长 3\n- `project` 项目：编码 `<项目大类>:<项目编码>`；已被单据、凭证等引用的不能删除\n- `position` 货位：编码最长 20，warehouse_code 必填\n- `unit` 计量单位：编码最长 35，group_code 必填\n- `unit_group` 计量单位组：type 必填（0 无换算、1 固定换算、2 浮动换算）\n- `user_define` 自定义项档案：编码 `<自定义项号>:<档案值>`\n- `customer_inventory` 客户存货对照：编码 `<客户编码>:<存货编码>`，ccusinvname 必填\n- `settle_style` 结算方式：编码最长 3，按编码方案分级\n- `rd_style` 收发类别：编码最长 5，按编码方案分级，一级须给 rsflag\n- `purchase_type` 采购类型、`sale_type` 销售类型：编码最长 2\n- 采购类型、销售类型：U8 档案设置可能要求 rstype_code 入（出）库类别必输\n- `district_class` 地区分类：编码最长 12，按编码方案分级\n- `aa_bank` 银行档案：编码最长 5\n\n**currency 币种**\n- 编码是币种名称，最长 8\n- fields 的 code 是币种符号：新增必填，不能修改\n- 本位币不能写\n- 已被单据、档案引用的不能修改、删除；删除时连同汇率一起删\n\n**voucher_sign 凭证类别**\n- 编码是类别字，最长 2\n- 新增必须给 type_name；修改只收 type_name\n- 预置的收付转记、最后一个和已被凭证等引用的不能删除\n\n**exchange_rate 汇率**\n- `<币种>:<年度>:<期间>` 是固定汇率：fields 收 rate 记账汇率、adjust_rate 调整汇率\n- `<币种>:<年度>:<期间>:<日>` 是浮动汇率：只收 rate，新增时日写成 yyyy-mm-dd\n- 新增走 U8 的 EAI 导入：年度必须是登录年度，一次只写一种汇率，已存在的用 update\n- 修改、删除由桥直接改表；删除删掉该编码下的全部汇率\n- 本位币、总账已结账的期间不能写\n\n**reason 原因码**\n- 编码最长 10\n- fields 收 name 名称（最长 30）、ReasonMemo 说明（最长 240）\n- Reasontype 所属类型：新增必填，0 到 255 的整数\n- Reasontype 取值：1 不良品原因、2 让步放行原因、3 采购退货原因、4 销售退货原因、5 变更原因、6 拖欠原因\n- Reasontype 的其他取值按 U8 原因码分类\n- 已被不良品处理单、检验单、发货单、销售发票等引用的不能删除\n\n**customer_bank 客户银行账户、vendor_bank 供应商银行账户**\n- 编码 `<客户或供应商编码>:<银行账号>`，账号最长 50\n- fields：branch 开户银行（新增必填）、bank_code 所属银行编码（须在银行档案里）\n- fields 另收 account_name 账户名称、default 默认账户\n- 以及 province、city、cbb_dep_id、branch_id、branch_id_sec\n- 每个客户至多一个默认账户；设为默认时其余账户清成非默认\n- 第一个账户必须是默认；默认账户不能取消默认，也不能在还有其他账户时删除\n\n**customer_contact 客户联系人**\n- 联系人编码由 U8 自动编号：新增的 code 写成 `<客户编码>:`（冒号后留空）\n- 响应的 code 是 `<客户编码>:<U8 编的号>`，修改、删除用它\n- 新增必须给 name\n- sex 男 / 女 / 不详，marriage 已婚 / 未婚 / 离异 / 不详，没给按不详\n- birthday 写 yyyy-mm-dd；be_main_linker 主要联系人\n- 另有 mobile、office_phone、email、position、memo、self_define1–10 等\n- 被客户档案的主要联系人、收货地址、销售单据或合同引用的不能删除\n\n**vendor_contact 供应商联系人**\n- 同样由 U8 自动编号，新增的 code 写成 `<供应商编码>:`\n- 新增走 U8 的 EAI 导入；修改、删除由桥直接改表\n- 标签同客户联系人，但没有 position、favorite\n- 每个供应商至多一个主要联系人；已有其他主要联系人时设为主要返回 409\n- 被供应商档案的主要联系人、采购和委外单据、进项发票登记或合同引用的不能删除\n\n**fa_card 固定资产卡片（可新增、撤销本期新增）**\n- 新增走 U8 官方 EAI 导入原始卡片；code 是资产编号，最长 20\n- fields 必填：name、type_code、original_value、start_date、origin_code、status_code、depreciation_method_code、dept_code\n- start_date 早于固定资产当前期间\n- fields 可选：useful_life_months、used_months、accumulated_depreciation、net_salvage、net_salvage_rate、spec、location、keeper、impairment、currency\n- 响应的 code 是 U8 编的卡片编号，另有 asset_num、card_id\n- 删除的 code 是卡片编号，只删本期新增、没有变动单的卡片\n- 固定资产卡片不能直接修改：原值、使用状况等的变化请在 U8 客户端录入变动单（U8 的 EAI 没有变动单导入样式表）\n- 资产减少也请在 U8 客户端录入\n\n**equipment 设备台账（只能新增）**\n- code 是设备编码，最长 30\n- fields 收 name（必填）和 EAI 标签 ceqtypecode、cdepcode、cvencode、dtsydate、cassetnum、cmemo、cdefine1 到 cdefine16 等",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "bank",
              "project",
              "position",
              "unit",
              "user_define",
              "customer_inventory",
              "unit_group",
              "settle_style",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "aa_bank",
              "currency",
              "voucher_sign",
              "customer_bank",
              "vendor_bank",
              "customer_contact",
              "exchange_rate",
              "vendor_contact",
              "reason",
              "fa_card",
              "equipment"
            ],
            "title": "Archive",
            "type": "string"
          },
          "code": {
            "description": "档案编码，首尾不能有空白，不含控制字符。\n\n**用法**\n- project：`<项目大类>:<项目编码>`，大类 1 到 2 位字母数字，项目编码 1 到 60 个字符\n- customer_address：`<客户编码>:<地址编码>`，两段最长 20、30\n- user_define：`<自定义项号>:<档案值>`，两段最长 10、400\n- customer_inventory：`<客户编码>:<存货编码>`，两段最长 20、60\n- exchange_rate：`<币种>:<年度>:<期间>[:<日>]`；get 也可以写 `<币种>:<yyyy-mm-dd>`\n\n**限制**\n- 一般最长 30 个字符\n- account 40；unit、unit_group 35；position、operator、role 20\n- rd_style、aa_bank 5；purchase_type、sale_type 2；district_class、trade_class 12\n- settle_style 3，currency 8，reason 10",
            "maxLength": 411,
            "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
            "title": "Code",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fields": {
            "additionalProperties": {
              "anyOf": [
                {
                  "maxLength": 2000,
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "EAI 标签名 → 值（字符串、数字或布尔）。null 表示不发送。标签名以桥的 RsXml 为准，未知标签返回 400",
            "title": "Fields",
            "type": "object"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "template": {
            "anyOf": [
              {
                "description": "档案编码，1 到 30 个字符，首尾不能有空白，不含控制字符",
                "maxLength": 30,
                "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "模板档案编码。存货必填：桥先按模板读出全部表头，再用 code、name、start_date 和 fields 覆盖",
            "title": "Template"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "archive",
          "code",
          "fields"
        ],
        "title": "ArcCreateIn",
        "type": "object"
      },
      "ArcGetIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "archive": {
            "description": "档案名。\n\n- `customer` 客户、`vendor` 供应商、`inventory` 存货、`department` 部门、`person` 人员、`warehouse` 仓库\n- `customer_class` 客户分类、`vendor_class` 供应商分类、`inventory_class` 存货分类、`reason` 原因码\n\n**按表列名读取**\n- 只读（不能新增、修改、删除）：account、trade_class、customer_address、operator、role\n- `account` 科目：按登录日期的年份\n- `unit` 计量单位、`unit_group` 计量单位组、`settle_style` 结算方式、`voucher_sign` 凭证类别\n- `currency` 币种：编码是币种名称\n- `bank` 本单位开户银行、`rd_style` 收发类别、`purchase_type` 采购类型、`sale_type` 销售类型\n- `district_class` 地区分类、`trade_class` 行业分类、`aa_bank` 银行档案（所属银行）\n- `project` 项目：编码 `<项目大类>:<项目编码>`\n- `position` 货位：class_code 是仓库\n- `customer_address` 客户收货地址：编码 `<客户编码>:<地址编码>`\n- `user_define` 自定义项档案：编码 `<自定义项号>:<档案值>`\n- `customer_inventory` 客户存货对照：编码 `<客户编码>:<存货编码>`\n- `exchange_rate` 汇率：编码 `<币种>:<年度>:<期间>[:<日>]`\n- `exchange_rate` 的 get 另收 `<币种>:<yyyy-mm-dd>`，取该日期单据会用的汇率\n- `fa_card` 固定资产卡片：编码是卡片编号，按登录日期所在月的月末取卡片当时的版本和累计折旧\n- `fa_card` 列表缺省不含已减少的卡片，可按 type_code、dept_code 过滤\n- `equipment` 设备台账：编码是设备编码，支持 changed_since\n- `operator` U8 操作员：编码是操作员编码；返回姓名、部门、停用标志、所属角色 roles、关联人员 person_code，不含口令\n- `role` 角色：返回成员 members\n- `customer_bank`、`vendor_bank` 客户、供应商银行账户：编码 `<客户或供应商编码>:<银行账号>`，class_code 是客户或供应商编码\n- `customer_contact`、`vendor_contact` 客户、供应商联系人：编码 `<客户或供应商编码>:<联系人编码>`\n\n**权限**\n- operator、role 只列在本账套有授权的，只有账套主管能读\n- aa_bank 银行档案也只有账套主管能读",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "account",
              "unit",
              "unit_group",
              "settle_style",
              "voucher_sign",
              "currency",
              "bank",
              "project",
              "position",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "trade_class",
              "aa_bank",
              "customer_address",
              "user_define",
              "customer_inventory",
              "exchange_rate",
              "fa_card",
              "operator",
              "role",
              "customer_bank",
              "vendor_bank",
              "customer_contact",
              "vendor_contact",
              "reason",
              "equipment"
            ],
            "title": "Archive",
            "type": "string"
          },
          "code": {
            "description": "档案编码，首尾不能有空白，不含控制字符。\n\n**用法**\n- project：`<项目大类>:<项目编码>`，大类 1 到 2 位字母数字，项目编码 1 到 60 个字符\n- customer_address：`<客户编码>:<地址编码>`，两段最长 20、30\n- user_define：`<自定义项号>:<档案值>`，两段最长 10、400\n- customer_inventory：`<客户编码>:<存货编码>`，两段最长 20、60\n- exchange_rate：`<币种>:<年度>:<期间>[:<日>]`；get 也可以写 `<币种>:<yyyy-mm-dd>`\n\n**限制**\n- 一般最长 30 个字符\n- account 40；unit、unit_group 35；position、operator、role 20\n- rd_style、aa_bank 5；purchase_type、sale_type 2；district_class、trade_class 12\n- settle_style 3，currency 8，reason 10",
            "maxLength": 411,
            "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
            "title": "Code",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "archive",
          "code"
        ],
        "title": "ArcGetIn",
        "type": "object"
      },
      "ArcGetOut": {
        "additionalProperties": true,
        "properties": {
          "archive": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案",
            "title": "Archive"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案编码",
            "title": "Code"
          },
          "fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "EAI 标签名 → 当前值。返回全部有值的标签（含银行账号、联系方式），只去掉口令类列。只读档案按表列名返回全部非空列；exchange_rate 返回 code、currency、year、period、day、rate、adjust_rate、mode；fa_card 返回与列表项相同的卡片（原值、累计折旧、净值、使用部门 depts 等）；operator、role 返回与列表项相同的对象",
            "title": "Fields"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "account：读的是这一会计年度（登录日期的年份）的科目",
            "title": "Fiscal Year"
          },
          "ok": {
            "description": "是否读到档案",
            "title": "Ok",
            "type": "boolean"
          },
          "project_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "project：项目大类",
            "title": "Project Class"
          },
          "rate_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate 按日期读取时：账套的汇率方式，fixed 固定汇率（按月）或 floating 浮动汇率（按日）",
            "title": "Rate Mode"
          },
          "ufts": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "只读档案：rowversion 的十进制字符串。没有 rowversion 的档案省略",
            "title": "Ufts"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ArcGetOut",
        "type": "object"
      },
      "ArcKeyIn": {
        "additionalProperties": false,
        "description": "删除（新增、修改继承它）：多一个 dry_run。读取 ArcGetIn 直接继承 ArcKeyBase，不收。",
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "archive": {
            "description": "档案名。\n\n- `customer` 客户、`vendor` 供应商、`inventory` 存货、`department` 部门、`person` 人员、`warehouse` 仓库\n- `customer_class` 客户分类、`vendor_class` 供应商分类、`inventory_class` 存货分类、`reason` 原因码\n\n**其他可写档案**\n- `bank` 本单位开户银行：编码最长 3\n- `project` 项目：编码 `<项目大类>:<项目编码>`；已被单据、凭证等引用的不能删除\n- `position` 货位：编码最长 20，warehouse_code 必填\n- `unit` 计量单位：编码最长 35，group_code 必填\n- `unit_group` 计量单位组：type 必填（0 无换算、1 固定换算、2 浮动换算）\n- `user_define` 自定义项档案：编码 `<自定义项号>:<档案值>`\n- `customer_inventory` 客户存货对照：编码 `<客户编码>:<存货编码>`，ccusinvname 必填\n- `settle_style` 结算方式：编码最长 3，按编码方案分级\n- `rd_style` 收发类别：编码最长 5，按编码方案分级，一级须给 rsflag\n- `purchase_type` 采购类型、`sale_type` 销售类型：编码最长 2\n- 采购类型、销售类型：U8 档案设置可能要求 rstype_code 入（出）库类别必输\n- `district_class` 地区分类：编码最长 12，按编码方案分级\n- `aa_bank` 银行档案：编码最长 5\n\n**currency 币种**\n- 编码是币种名称，最长 8\n- fields 的 code 是币种符号：新增必填，不能修改\n- 本位币不能写\n- 已被单据、档案引用的不能修改、删除；删除时连同汇率一起删\n\n**voucher_sign 凭证类别**\n- 编码是类别字，最长 2\n- 新增必须给 type_name；修改只收 type_name\n- 预置的收付转记、最后一个和已被凭证等引用的不能删除\n\n**exchange_rate 汇率**\n- `<币种>:<年度>:<期间>` 是固定汇率：fields 收 rate 记账汇率、adjust_rate 调整汇率\n- `<币种>:<年度>:<期间>:<日>` 是浮动汇率：只收 rate，新增时日写成 yyyy-mm-dd\n- 新增走 U8 的 EAI 导入：年度必须是登录年度，一次只写一种汇率，已存在的用 update\n- 修改、删除由桥直接改表；删除删掉该编码下的全部汇率\n- 本位币、总账已结账的期间不能写\n\n**reason 原因码**\n- 编码最长 10\n- fields 收 name 名称（最长 30）、ReasonMemo 说明（最长 240）\n- Reasontype 所属类型：新增必填，0 到 255 的整数\n- Reasontype 取值：1 不良品原因、2 让步放行原因、3 采购退货原因、4 销售退货原因、5 变更原因、6 拖欠原因\n- Reasontype 的其他取值按 U8 原因码分类\n- 已被不良品处理单、检验单、发货单、销售发票等引用的不能删除\n\n**customer_bank 客户银行账户、vendor_bank 供应商银行账户**\n- 编码 `<客户或供应商编码>:<银行账号>`，账号最长 50\n- fields：branch 开户银行（新增必填）、bank_code 所属银行编码（须在银行档案里）\n- fields 另收 account_name 账户名称、default 默认账户\n- 以及 province、city、cbb_dep_id、branch_id、branch_id_sec\n- 每个客户至多一个默认账户；设为默认时其余账户清成非默认\n- 第一个账户必须是默认；默认账户不能取消默认，也不能在还有其他账户时删除\n\n**customer_contact 客户联系人**\n- 联系人编码由 U8 自动编号：新增的 code 写成 `<客户编码>:`（冒号后留空）\n- 响应的 code 是 `<客户编码>:<U8 编的号>`，修改、删除用它\n- 新增必须给 name\n- sex 男 / 女 / 不详，marriage 已婚 / 未婚 / 离异 / 不详，没给按不详\n- birthday 写 yyyy-mm-dd；be_main_linker 主要联系人\n- 另有 mobile、office_phone、email、position、memo、self_define1–10 等\n- 被客户档案的主要联系人、收货地址、销售单据或合同引用的不能删除\n\n**vendor_contact 供应商联系人**\n- 同样由 U8 自动编号，新增的 code 写成 `<供应商编码>:`\n- 新增走 U8 的 EAI 导入；修改、删除由桥直接改表\n- 标签同客户联系人，但没有 position、favorite\n- 每个供应商至多一个主要联系人；已有其他主要联系人时设为主要返回 409\n- 被供应商档案的主要联系人、采购和委外单据、进项发票登记或合同引用的不能删除\n\n**fa_card 固定资产卡片（可新增、撤销本期新增）**\n- 新增走 U8 官方 EAI 导入原始卡片；code 是资产编号，最长 20\n- fields 必填：name、type_code、original_value、start_date、origin_code、status_code、depreciation_method_code、dept_code\n- start_date 早于固定资产当前期间\n- fields 可选：useful_life_months、used_months、accumulated_depreciation、net_salvage、net_salvage_rate、spec、location、keeper、impairment、currency\n- 响应的 code 是 U8 编的卡片编号，另有 asset_num、card_id\n- 删除的 code 是卡片编号，只删本期新增、没有变动单的卡片\n- 固定资产卡片不能直接修改：原值、使用状况等的变化请在 U8 客户端录入变动单（U8 的 EAI 没有变动单导入样式表）\n- 资产减少也请在 U8 客户端录入\n\n**equipment 设备台账（只能新增）**\n- code 是设备编码，最长 30\n- fields 收 name（必填）和 EAI 标签 ceqtypecode、cdepcode、cvencode、dtsydate、cassetnum、cmemo、cdefine1 到 cdefine16 等",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "bank",
              "position",
              "unit",
              "user_define",
              "customer_inventory",
              "project",
              "unit_group",
              "settle_style",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "aa_bank",
              "currency",
              "voucher_sign",
              "customer_bank",
              "vendor_bank",
              "customer_contact",
              "exchange_rate",
              "vendor_contact",
              "reason",
              "fa_card"
            ],
            "title": "Archive",
            "type": "string"
          },
          "code": {
            "description": "档案编码，首尾不能有空白，不含控制字符。\n\n**用法**\n- project：`<项目大类>:<项目编码>`，大类 1 到 2 位字母数字，项目编码 1 到 60 个字符\n- customer_address：`<客户编码>:<地址编码>`，两段最长 20、30\n- user_define：`<自定义项号>:<档案值>`，两段最长 10、400\n- customer_inventory：`<客户编码>:<存货编码>`，两段最长 20、60\n- exchange_rate：`<币种>:<年度>:<期间>[:<日>]`；get 也可以写 `<币种>:<yyyy-mm-dd>`\n\n**限制**\n- 一般最长 30 个字符\n- account 40；unit、unit_group 35；position、operator、role 20\n- rd_style、aa_bank 5；purchase_type、sale_type 2；district_class、trade_class 12\n- settle_style 3，currency 8，reason 10",
            "maxLength": 411,
            "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
            "title": "Code",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "archive",
          "code"
        ],
        "title": "ArcKeyIn",
        "type": "object"
      },
      "ArcListIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "description": "档案编码，首尾不能有空白，不含控制字符。\n\n**用法**\n- project：`<项目大类>:<项目编码>`，大类 1 到 2 位字母数字，项目编码 1 到 60 个字符\n- customer_address：`<客户编码>:<地址编码>`，两段最长 20、30\n- user_define：`<自定义项号>:<档案值>`，两段最长 10、400\n- customer_inventory：`<客户编码>:<存货编码>`，两段最长 20、60\n- exchange_rate：`<币种>:<年度>:<期间>[:<日>]`；get 也可以写 `<币种>:<yyyy-mm-dd>`\n\n**限制**\n- 一般最长 30 个字符\n- account 40；unit、unit_group 35；position、operator、role 20\n- rd_style、aa_bank 5；purchase_type、sale_type 2；district_class、trade_class 12\n- settle_style 3，currency 8，reason 10",
                "maxLength": 411,
                "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next（最后一个编码），按编码续读",
            "title": "After"
          },
          "archive": {
            "description": "档案名。\n\n- `customer` 客户、`vendor` 供应商、`inventory` 存货、`department` 部门、`person` 人员、`warehouse` 仓库\n- `customer_class` 客户分类、`vendor_class` 供应商分类、`inventory_class` 存货分类、`reason` 原因码\n\n**按表列名读取**\n- 只读（不能新增、修改、删除）：account、trade_class、customer_address、operator、role\n- `account` 科目：按登录日期的年份\n- `unit` 计量单位、`unit_group` 计量单位组、`settle_style` 结算方式、`voucher_sign` 凭证类别\n- `currency` 币种：编码是币种名称\n- `bank` 本单位开户银行、`rd_style` 收发类别、`purchase_type` 采购类型、`sale_type` 销售类型\n- `district_class` 地区分类、`trade_class` 行业分类、`aa_bank` 银行档案（所属银行）\n- `project` 项目：编码 `<项目大类>:<项目编码>`\n- `position` 货位：class_code 是仓库\n- `customer_address` 客户收货地址：编码 `<客户编码>:<地址编码>`\n- `user_define` 自定义项档案：编码 `<自定义项号>:<档案值>`\n- `customer_inventory` 客户存货对照：编码 `<客户编码>:<存货编码>`\n- `exchange_rate` 汇率：编码 `<币种>:<年度>:<期间>[:<日>]`\n- `exchange_rate` 的 get 另收 `<币种>:<yyyy-mm-dd>`，取该日期单据会用的汇率\n- `fa_card` 固定资产卡片：编码是卡片编号，按登录日期所在月的月末取卡片当时的版本和累计折旧\n- `fa_card` 列表缺省不含已减少的卡片，可按 type_code、dept_code 过滤\n- `equipment` 设备台账：编码是设备编码，支持 changed_since\n- `operator` U8 操作员：编码是操作员编码；返回姓名、部门、停用标志、所属角色 roles、关联人员 person_code，不含口令\n- `role` 角色：返回成员 members\n- `customer_bank`、`vendor_bank` 客户、供应商银行账户：编码 `<客户或供应商编码>:<银行账号>`，class_code 是客户或供应商编码\n- `customer_contact`、`vendor_contact` 客户、供应商联系人：编码 `<客户或供应商编码>:<联系人编码>`\n\n**权限**\n- operator、role 只列在本账套有授权的，只有账套主管能读\n- aa_bank 银行档案也只有账套主管能读",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "account",
              "unit",
              "unit_group",
              "settle_style",
              "voucher_sign",
              "currency",
              "bank",
              "project",
              "position",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "trade_class",
              "aa_bank",
              "customer_address",
              "user_define",
              "customer_inventory",
              "exchange_rate",
              "fa_card",
              "operator",
              "role",
              "customer_bank",
              "vendor_bank",
              "customer_contact",
              "vendor_contact",
              "reason",
              "equipment"
            ],
            "title": "Archive",
            "type": "string"
          },
          "changed_since": {
            "anyOf": [
              {
                "description": "rowversion 的十进制字符串",
                "pattern": "^\\d{1,19}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只返回 ufts 大于该值的档案。用上一轮第一页的 watermark",
            "title": "Changed Since"
          },
          "code_prefix": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]{1,411}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "编码前缀，不含控制字符，最长与该档案的编码相同（一般 30，project 63）。project 和两列主键的档案按整串 <第一段>:<第二段> 匹配，例如 C001:",
            "title": "Code Prefix"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 8,
                "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只给 exchange_rate：只列这个币种（币种名称，如 美元）",
            "title": "Currency"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dept_code": {
            "anyOf": [
              {
                "maxLength": 12,
                "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只给 fa_card：使用部门编码，多部门卡片任一部门匹配即可",
            "title": "Dept Code"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 9999.0,
                "minimum": 1900.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "只给 exchange_rate：汇率的年度，省略时取登录日期的年份",
            "title": "Fiscal Year"
          },
          "include_disposed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "只给 fa_card：true 时也列出已减少的卡片。省略或 false 只列在役卡片",
            "title": "Include Disposed"
          },
          "keys_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时每项只返回 code 和 ufts，便于比对删除",
            "title": "Keys Only"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 500.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 500，缺省 100",
            "title": "Limit"
          },
          "name_like": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "名称包含的文字，1 到 60 个字符，不含控制字符",
            "title": "Name Like"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "project_class": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z]{1,2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只给 project：只列这个项目大类。省略时列出全部项目大类",
            "title": "Project Class"
          },
          "type_code": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只给 fa_card：资产类别编码，含下级类别（按编码前缀匹配）",
            "title": "Type Code"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "archive"
        ],
        "title": "ArcListIn",
        "type": "object"
      },
      "ArcListItem": {
        "additionalProperties": true,
        "properties": {
          "adjust_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：该期间的调整汇率（期末调汇用）。未录入为 null",
            "title": "Adjust Rate"
          },
          "batch_managed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "inventory：批次管理（bInvBatch）。keys_only 时省略",
            "title": "Batch Managed"
          },
          "bin_managed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "warehouse：启用货位管理（bWhPos）。keys_only 时省略",
            "title": "Bin Managed"
          },
          "class_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分类编码（unit 是计量单位组，project 是项目分类，position 是仓库，customer_address、customer_inventory 是客户编码，user_define 是自定义项号）。没有分类的档案省略",
            "title": "Class Code"
          },
          "closed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "project：项目已关闭",
            "title": "Closed"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "编码",
            "title": "Code"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：币种名称",
            "title": "Currency"
          },
          "day": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：浮动汇率的日期（U8 原文）。固定汇率为 null",
            "title": "Day"
          },
          "dept": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "operator：U8 操作员档案上的所属部门（文本原样）",
            "title": "Dept"
          },
          "disabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "operator：nState 不是 0（已停用或注销）；customer、vendor、warehouse、department、person、inventory：已填停用日期（不比较当天日期）",
            "title": "Disabled"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "customer、vendor、warehouse、department、person、inventory：停用日期（人员是失效日期，yyyy-mm-dd）。未填停用日期或 keys_only 时省略",
            "title": "End Date"
          },
          "leaf": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "position：末级货位（bPosEnd），只有末级能出入库。keys_only 时省略",
            "title": "Leaf"
          },
          "members": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "role：成员操作员编码",
            "title": "Members"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：fixed 按月的固定汇率，floating 按日的浮动汇率",
            "title": "Mode"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "名称",
            "title": "Name"
          },
          "period": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：期间（月份）",
            "title": "Period"
          },
          "person_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "operator：关联的人员编码（UserHrPersonContro），没有关联为 null",
            "title": "Person Code"
          },
          "person_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "operator：关联人员的姓名",
            "title": "Person Name"
          },
          "project_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "project：项目大类",
            "title": "Project Class"
          },
          "rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：记账汇率（固定汇率）或当日的浮动汇率",
            "title": "Rate"
          },
          "roles": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "operator：所属角色编码（只含本账套有授权的角色）",
            "title": "Roles"
          },
          "shelf_life_managed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "inventory：保质期管理（bInvQuality）。keys_only 时省略",
            "title": "Shelf Life Managed"
          },
          "state": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "operator：U8 的 nState 原值，0 正常",
            "title": "State"
          },
          "ufts": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "rowversion 的十进制字符串。voucher_sign、project、customer_address 为 null",
            "title": "Ufts"
          },
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：年度",
            "title": "Year"
          }
        },
        "title": "ArcListItem",
        "type": "object"
      },
      "ArcListOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "account、exchange_rate、fa_card：读的是这一年度（account、fa_card 取登录日期的年份，exchange_rate 取请求的 fiscal_year 或登录年份）",
            "title": "Fiscal Year"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ArcListItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按编码排序的档案",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页省略",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到列表",
            "title": "Ok",
            "type": "boolean"
          },
          "rate_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "exchange_rate：账套的汇率方式，fixed 或 floating",
            "title": "Rate Mode"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "读这一页之前的 MIN_ACTIVE_ROWVERSION()-1。整轮读完后，把第一页的 watermark 作为下一轮的 changed_since。voucher_sign、project、customer_address、fa_card、operator、role 为 null",
            "title": "Watermark"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ArcListOut",
        "type": "object"
      },
      "ArcUpdateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "archive": {
            "description": "档案名。\n\n- `customer` 客户、`vendor` 供应商、`inventory` 存货、`department` 部门、`person` 人员、`warehouse` 仓库\n- `customer_class` 客户分类、`vendor_class` 供应商分类、`inventory_class` 存货分类、`reason` 原因码\n\n**其他可写档案**\n- `bank` 本单位开户银行：编码最长 3\n- `project` 项目：编码 `<项目大类>:<项目编码>`；已被单据、凭证等引用的不能删除\n- `position` 货位：编码最长 20，warehouse_code 必填\n- `unit` 计量单位：编码最长 35，group_code 必填\n- `unit_group` 计量单位组：type 必填（0 无换算、1 固定换算、2 浮动换算）\n- `user_define` 自定义项档案：编码 `<自定义项号>:<档案值>`\n- `customer_inventory` 客户存货对照：编码 `<客户编码>:<存货编码>`，ccusinvname 必填\n- `settle_style` 结算方式：编码最长 3，按编码方案分级\n- `rd_style` 收发类别：编码最长 5，按编码方案分级，一级须给 rsflag\n- `purchase_type` 采购类型、`sale_type` 销售类型：编码最长 2\n- 采购类型、销售类型：U8 档案设置可能要求 rstype_code 入（出）库类别必输\n- `district_class` 地区分类：编码最长 12，按编码方案分级\n- `aa_bank` 银行档案：编码最长 5\n\n**currency 币种**\n- 编码是币种名称，最长 8\n- fields 的 code 是币种符号：新增必填，不能修改\n- 本位币不能写\n- 已被单据、档案引用的不能修改、删除；删除时连同汇率一起删\n\n**voucher_sign 凭证类别**\n- 编码是类别字，最长 2\n- 新增必须给 type_name；修改只收 type_name\n- 预置的收付转记、最后一个和已被凭证等引用的不能删除\n\n**exchange_rate 汇率**\n- `<币种>:<年度>:<期间>` 是固定汇率：fields 收 rate 记账汇率、adjust_rate 调整汇率\n- `<币种>:<年度>:<期间>:<日>` 是浮动汇率：只收 rate，新增时日写成 yyyy-mm-dd\n- 新增走 U8 的 EAI 导入：年度必须是登录年度，一次只写一种汇率，已存在的用 update\n- 修改、删除由桥直接改表；删除删掉该编码下的全部汇率\n- 本位币、总账已结账的期间不能写\n\n**reason 原因码**\n- 编码最长 10\n- fields 收 name 名称（最长 30）、ReasonMemo 说明（最长 240）\n- Reasontype 所属类型：新增必填，0 到 255 的整数\n- Reasontype 取值：1 不良品原因、2 让步放行原因、3 采购退货原因、4 销售退货原因、5 变更原因、6 拖欠原因\n- Reasontype 的其他取值按 U8 原因码分类\n- 已被不良品处理单、检验单、发货单、销售发票等引用的不能删除\n\n**customer_bank 客户银行账户、vendor_bank 供应商银行账户**\n- 编码 `<客户或供应商编码>:<银行账号>`，账号最长 50\n- fields：branch 开户银行（新增必填）、bank_code 所属银行编码（须在银行档案里）\n- fields 另收 account_name 账户名称、default 默认账户\n- 以及 province、city、cbb_dep_id、branch_id、branch_id_sec\n- 每个客户至多一个默认账户；设为默认时其余账户清成非默认\n- 第一个账户必须是默认；默认账户不能取消默认，也不能在还有其他账户时删除\n\n**customer_contact 客户联系人**\n- 联系人编码由 U8 自动编号：新增的 code 写成 `<客户编码>:`（冒号后留空）\n- 响应的 code 是 `<客户编码>:<U8 编的号>`，修改、删除用它\n- 新增必须给 name\n- sex 男 / 女 / 不详，marriage 已婚 / 未婚 / 离异 / 不详，没给按不详\n- birthday 写 yyyy-mm-dd；be_main_linker 主要联系人\n- 另有 mobile、office_phone、email、position、memo、self_define1–10 等\n- 被客户档案的主要联系人、收货地址、销售单据或合同引用的不能删除\n\n**vendor_contact 供应商联系人**\n- 同样由 U8 自动编号，新增的 code 写成 `<供应商编码>:`\n- 新增走 U8 的 EAI 导入；修改、删除由桥直接改表\n- 标签同客户联系人，但没有 position、favorite\n- 每个供应商至多一个主要联系人；已有其他主要联系人时设为主要返回 409\n- 被供应商档案的主要联系人、采购和委外单据、进项发票登记或合同引用的不能删除\n\n**fa_card 固定资产卡片（可新增、撤销本期新增）**\n- 新增走 U8 官方 EAI 导入原始卡片；code 是资产编号，最长 20\n- fields 必填：name、type_code、original_value、start_date、origin_code、status_code、depreciation_method_code、dept_code\n- start_date 早于固定资产当前期间\n- fields 可选：useful_life_months、used_months、accumulated_depreciation、net_salvage、net_salvage_rate、spec、location、keeper、impairment、currency\n- 响应的 code 是 U8 编的卡片编号，另有 asset_num、card_id\n- 删除的 code 是卡片编号，只删本期新增、没有变动单的卡片\n- 固定资产卡片不能直接修改：原值、使用状况等的变化请在 U8 客户端录入变动单（U8 的 EAI 没有变动单导入样式表）\n- 资产减少也请在 U8 客户端录入\n\n**equipment 设备台账（只能新增）**\n- code 是设备编码，最长 30\n- fields 收 name（必填）和 EAI 标签 ceqtypecode、cdepcode、cvencode、dtsydate、cassetnum、cmemo、cdefine1 到 cdefine16 等\n\n**不能修改**\n- `user_define`、`customer_inventory`：U8 不提供修改，删除后重新新增\n- `fa_card`、`equipment`",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "bank",
              "project",
              "position",
              "unit",
              "unit_group",
              "settle_style",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "aa_bank",
              "currency",
              "voucher_sign",
              "customer_bank",
              "vendor_bank",
              "customer_contact",
              "exchange_rate",
              "vendor_contact",
              "reason"
            ],
            "title": "Archive",
            "type": "string"
          },
          "code": {
            "description": "档案编码，首尾不能有空白，不含控制字符。\n\n**用法**\n- project：`<项目大类>:<项目编码>`，大类 1 到 2 位字母数字，项目编码 1 到 60 个字符\n- customer_address：`<客户编码>:<地址编码>`，两段最长 20、30\n- user_define：`<自定义项号>:<档案值>`，两段最长 10、400\n- customer_inventory：`<客户编码>:<存货编码>`，两段最长 20、60\n- exchange_rate：`<币种>:<年度>:<期间>[:<日>]`；get 也可以写 `<币种>:<yyyy-mm-dd>`\n\n**限制**\n- 一般最长 30 个字符\n- account 40；unit、unit_group 35；position、operator、role 20\n- rd_style、aa_bank 5；purchase_type、sale_type 2；district_class、trade_class 12\n- settle_style 3，currency 8，reason 10",
            "maxLength": 411,
            "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
            "title": "Code",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fields": {
            "additionalProperties": {
              "anyOf": [
                {
                  "maxLength": 2000,
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "只改列出的标签，至少一个非 null。桥会补发该档案必需的当前值（例如部门的 name）。不能改 code",
            "title": "Fields",
            "type": "object"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "archive",
          "code",
          "fields"
        ],
        "title": "ArcUpdateIn",
        "type": "object"
      },
      "ArcWriteOut": {
        "additionalProperties": true,
        "properties": {
          "archive": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案",
            "title": "Archive"
          },
          "asset_num": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "fa_card 新增：资产编号（即请求的 code；响应的 code 是卡片编号）",
            "title": "Asset Num"
          },
          "card_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "fa_card 新增：U8 卡片内部编号 sCardID",
            "title": "Card Id"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案编码",
            "title": "Code"
          },
          "deleted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删除成功时为 true",
            "title": "Deleted"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ArcWriteOut",
        "type": "object"
      },
      "AutoBatchOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "description": "这一批的核销合计",
            "title": "Amount",
            "type": "number"
          },
          "cancel_no": {
            "description": "这一批的 U8 核销号（HXAR… / HXAP…）",
            "title": "Cancel No",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/WriteoffItemOut"
            },
            "title": "Items",
            "type": "array"
          },
          "receipt": {
            "$ref": "#/components/schemas/WriteoffReceiptOut"
          }
        },
        "required": [
          "cancel_no",
          "receipt",
          "items",
          "amount"
        ],
        "title": "AutoBatchOut",
        "type": "object"
      },
      "AutoPlanOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "description": "这一批的计划合计",
            "title": "Amount",
            "type": "number"
          },
          "receipt": {
            "additionalProperties": true,
            "description": "收付款单行：type、id、line_id、code、date、remaining（核销前余额）",
            "title": "Receipt",
            "type": "object"
          },
          "targets": {
            "description": "分到的单据行：type、id、line_id、code、date、balance（分配前余额）、amount",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Targets",
            "type": "array"
          }
        },
        "required": [
          "receipt",
          "targets",
          "amount"
        ],
        "title": "AutoPlanOut",
        "type": "object"
      },
      "AutoReceiptIn": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "收付款单主键 Ap_CloseBill.iID",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "line_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "只核这一行 Ap_CloseBills.ID",
            "title": "Line Id"
          },
          "type": {
            "description": "收款单 ar_receipt（AR）或付款单 ap_payment（AP）",
            "enum": [
              "ar_receipt",
              "ap_payment"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "AutoReceiptIn",
        "type": "object"
      },
      "AutoTargetIn": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "单据主键（SBVID、PBVID 或 Ap_Vouch.Auto_ID）",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "sale_invoice、ar_bill（AR）或 purchase_invoice、ap_bill（AP）",
            "enum": [
              "sale_invoice",
              "ar_bill",
              "purchase_invoice",
              "ap_bill"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "AutoTargetIn",
        "type": "object"
      },
      "BadDebtLineIn": {
        "additionalProperties": false,
        "description": "坏账发生的一张单据（或发票的一行）及本次金额。",
        "properties": {
          "amount": {
            "description": "本次坏账金额（原币），最多两位小数",
            "exclusiveMinimum": 0.0,
            "maximum": 1000000000000.0,
            "title": "Amount",
            "type": "number"
          },
          "id": {
            "description": "单据号",
            "maxLength": 30,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "line_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票表体行；省略按行主键从小到大依次分摊。应收单按整单，不能带",
            "title": "Line Id"
          },
          "type": {
            "description": "26 / 27 / 28 / 29 销售发票，R0 到 R9 应收单",
            "maxLength": 2,
            "minLength": 2,
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "amount"
        ],
        "title": "BadDebtLineIn",
        "type": "object"
      },
      "BadDebtRowOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次坏账金额（原币）",
            "title": "Amount"
          },
          "amount_native": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次坏账金额（本币）",
            "title": "Amount Native"
          },
          "doc_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键",
            "title": "Doc Id"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Id"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票行；整单时省略",
            "title": "Line Id"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理后的余额（原币）",
            "title": "Remaining"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "U8 单据类型代码",
            "title": "Type"
          }
        },
        "title": "BadDebtRowOut",
        "type": "object"
      },
      "CancelLineOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "description": "加回的金额",
            "title": "Amount",
            "type": "number"
          },
          "line_id": {
            "description": "收付款单表体行 Ap_CloseBills.ID",
            "title": "Line Id",
            "type": "integer"
          },
          "remaining": {
            "description": "取消后的未核销余额",
            "title": "Remaining",
            "type": "number"
          }
        },
        "required": [
          "line_id",
          "amount",
          "remaining"
        ],
        "title": "CancelLineOut",
        "type": "object"
      },
      "CancelReceiptOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "收付款单号",
            "title": "Code"
          },
          "id": {
            "description": "Ap_CloseBill.iID",
            "title": "Id",
            "type": "integer"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "只涉及一行时的行 Ap_CloseBills.ID",
            "title": "Line Id"
          },
          "lines": {
            "description": "涉及的每一行",
            "items": {
              "$ref": "#/components/schemas/CancelLineOut"
            },
            "title": "Lines",
            "type": "array"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "只涉及一行时，该行取消后的未核销余额",
            "title": "Remaining"
          },
          "type": {
            "description": "收付款单类型 ar_receipt / ap_payment",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "CancelReceiptOut",
        "type": "object"
      },
      "CoActionOut": {
        "properties": {
          "action": {
            "description": "本次动作，例如 approve、submit",
            "title": "Action",
            "type": "string"
          },
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "description": "审批动作是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "orphan_tasks_cleaned": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "审批后清理掉的 U8 孤儿任务行数（只在大于 0 时出现）",
            "title": "Orphan Tasks Cleaned"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "u8_message": {
            "default": "",
            "description": "U8 返回的说明。没有则为空字符串",
            "title": "U8 Message",
            "type": "string"
          },
          "wf": {
            "$ref": "#/components/schemas/CoWf",
            "description": "动作之后重新读到的审批状态"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code",
          "action",
          "wf"
        ],
        "title": "CoActionOut",
        "type": "object"
      },
      "CoArapBadDebtIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "occur 坏账发生（9G）、recover 坏账收回（9H）、provision 计提坏账准备（9F）",
            "enum": [
              "occur",
              "recover",
              "provision"
            ],
            "title": "Action",
            "type": "string"
          },
          "amount": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "收回金额（原币），须等于收款单的全部余额（recover 必填）",
            "title": "Amount"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种名称；省略为本位币",
            "title": "Currency"
          },
          "customer": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码（occur、recover 必填）",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dept": {
            "anyOf": [
              {
                "maxLength": 12,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码（只用于 occur）：末级、未停用",
            "title": "Dept"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；省略或为空为「坏账发生」「坏账收回」",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BadDebtLineIn"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "坏账发生的单据，1 到 50 项（occur 必填）",
            "title": "Lines"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "person": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码（只用于 occur）：未停用",
            "title": "Person"
          },
          "receipt": {
            "anyOf": [
              {
                "maxLength": 30,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "未审核、未核销的收款单（48）单号（recover 必填）",
            "title": "Receipt"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "action"
        ],
        "title": "CoArapBadDebtIn",
        "type": "object"
      },
      "CoArapBadDebtOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "occur、recover 或 provision",
            "title": "Action"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次金额：坏账发生、收回为原币合计，计提为本次计提（本币）",
            "title": "Amount"
          },
          "base": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "计提：计提基数（应收余额、账龄合计或销售收入）",
            "title": "Base"
          },
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理号（HZAR + 13 位数字），取消、制单要用",
            "title": "Cancel No"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种",
            "title": "Currency"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理日期",
            "title": "Date"
          },
          "method_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "计提：计提方法名称（应收余额百分比法、账龄分析法、销售收入百分比法）",
            "title": "Method Name"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "计提：计提比率；账龄分析法省略",
            "title": "Rate"
          },
          "remain_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理后的坏账准备余额（本币）",
            "title": "Remain After"
          },
          "remain_before": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理前的坏账准备余额（本币）",
            "title": "Remain Before"
          },
          "rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BadDebtRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "坏账发生：每张单据行的本次金额和余额",
            "title": "Rows"
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理方式：9G 坏账发生、9H 坏账收回、9F 计提坏账准备",
            "title": "Style"
          },
          "style_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理方式名称：坏账发生、坏账收回、计提坏账",
            "title": "Style Name"
          },
          "target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "计提：应计坏账准备",
            "title": "Target"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapBadDebtOut",
        "type": "object"
      },
      "CoArapExGainCancelIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "cancel_nos": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 200,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "1 到 200 个处理号（SYRAR… / SYPAP…）；省略时取消登记日期为登录日期 date 的全部未制单汇兑损益",
            "title": "Cancel Nos"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag"
        ],
        "title": "CoArapExGainCancelIn",
        "type": "object"
      },
      "CoArapExGainCancelOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "batches": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ExGainBatchOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "取消的处理号",
            "title": "Batches"
          },
          "by_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "按登记日期取消时的日期；按处理号取消时省略",
            "title": "By Date"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "ok": {
            "description": "是否已取消",
            "title": "Ok",
            "type": "boolean"
          },
          "rows": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删掉的明细行数",
            "title": "Rows"
          },
          "total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "取消的本币差额合计",
            "title": "Total"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapExGainCancelOut",
        "type": "object"
      },
      "CoArapExGainIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "currency": {
            "description": "外币名称，如 美元",
            "maxLength": 20,
            "minLength": 1,
            "title": "Currency",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 200,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "1 到 200 个客户（供应商）编码，不能重复；省略为全部",
            "title": "Partners"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "rate": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "调整汇率，最多 10 位小数；省略取该期外币设置里的调整汇率",
            "title": "Rate"
          },
          "settle_cleared": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：原币已结清只剩本币尾差的单据一并结清",
            "title": "Settle Cleared"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "currency"
        ],
        "title": "CoArapExGainIn",
        "type": "object"
      },
      "CoArapExGainOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "batches": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ExGainBatchOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "每个处理号",
            "title": "Batches"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外币",
            "title": "Currency"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记日期",
            "title": "Date"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "使用的调整汇率",
            "title": "Rate"
          },
          "rows": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "写入的明细行数",
            "title": "Rows"
          },
          "total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本币差额合计",
            "title": "Total"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapExGainOut",
        "type": "object"
      },
      "CoArapMergeIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；省略为「并账」",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "from": {
            "description": "并出的客户（供应商）编码",
            "maxLength": 20,
            "minLength": 1,
            "title": "From",
            "type": "string"
          },
          "lines": {
            "description": "并账的单据，1 到 50 项：AR 收 26 / 27 / R0，AP 收 01 / 02 / P0；amount 可省略",
            "items": {
              "$ref": "#/components/schemas/MergeLineIn"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Lines",
            "type": "array"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "to": {
            "description": "并入的客户（供应商）编码，不能与 from 相同",
            "maxLength": 20,
            "minLength": 1,
            "title": "To",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "from",
          "to",
          "lines"
        ],
        "title": "CoArapMergeIn",
        "type": "object"
      },
      "CoArapMergeOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并账金额合计（原币）",
            "title": "Amount"
          },
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并账号（BZAR… / BZAP…），取消、制单要用",
            "title": "Cancel No"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种",
            "title": "Currency"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并账日期",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并出的往来单位",
            "title": "From"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/MergeRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "每张单据（行）的本次金额和并账后两边的余额",
            "title": "Rows"
          },
          "to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并入的往来单位",
            "title": "To"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapMergeOut",
        "type": "object"
      },
      "CoArapProcCancelIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "cancel_no": {
            "description": "处理号，前缀后接数字：YCFAP、FCYAR、BZAR / BZAP、HRAR / HPAP、PJJAR / PJTAR / PJBAR / CLAR、PJJAP / CLAP、HZAR；含义见接口说明",
            "pattern": "^(YCFAP|FCYAR|BZAR|BZAP|HRAR|HPAP|PJJAR|PJTAR|PJBAR|CLAR|PJJAP|CLAP|HZAR)[0-9]{1,20}$",
            "title": "Cancel No",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "cancel_no"
        ],
        "title": "CoArapProcCancelIn",
        "type": "object"
      },
      "CoArapProcCancelOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "ap_rows": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付明细删掉的行数",
            "title": "Ap Rows"
          },
          "ar_rows": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "应收明细删掉的行数",
            "title": "Ar Rows"
          },
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "已取消的处理号",
            "title": "Cancel No"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcCancelItemOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "删掉的处理行，按单据行汇总",
            "title": "Items"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理种类：transfer、merge 等",
            "title": "Kind"
          },
          "ok": {
            "description": "是否已取消",
            "title": "Ok",
            "type": "boolean"
          },
          "restored": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcRestoredOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "加回了余额的单据行",
            "title": "Restored"
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理方式：9I、9J、BZ、9N、9A 等；坏账 9F、9G、9H",
            "title": "Style"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapProcCancelOut",
        "type": "object"
      },
      "CoArapProcListIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回：明细是整数 Auto_ID，摘要是字符串游标",
            "title": "After"
          },
          "changed_since": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "pattern": "^[0-9]{1,10}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细：上一轮的 watermark（十进制字符串或整数），只要 Auto_ID 更大的行；缺省 0 即全量",
            "title": "Changed Since"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时按（处理方式、处理号）返回期间摘要",
            "title": "Digest"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要：会计年度。缺省为登录日期（date）的年份；year 是账套库年度",
            "title": "Fiscal Year"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "keys_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细：为 true 时每行只有 id、flag、style、code",
            "title": "Keys Only"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 500.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数（摘要是批数），1 到 500，明细缺省 100，摘要缺省 500",
            "title": "Limit"
          },
          "open_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细：只要登记期间未结账的行。缺省在 changed_since > 0 时为 true，否则 false",
            "title": "Open Only"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "periods": {
            "anyOf": [
              {
                "items": {
                  "maximum": 12.0,
                  "minimum": 1.0,
                  "type": "integer"
                },
                "maxItems": 12,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要：期间 1 到 12，不能重复。省略时取未结账期间",
            "title": "Periods"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag"
        ],
        "title": "CoArapProcListIn",
        "type": "object"
      },
      "CoArapProcListOut": {
        "additionalProperties": true,
        "properties": {
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要时为 true",
            "title": "Digest"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "ident": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细：往来明细表的 IDENT_CURRENT，十进制字符串，不小于 watermark",
            "title": "Ident"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细：每行 id（Auto_ID）、flag、style（处理方式 cProcStyle）、code（处理号 cCancelNo）、vouch_type、vouch_id、co_vouch_type、co_vouch_id、partner、dept、person、line_id、debit_f、credit_f、pz_id、gl_sign、gl_no、reg_date、period、fiscal_year（处理所在的会计年度）、row_flag。摘要：每批 flag、style、code、min_id、max_id、pz、sum_d_f、sum_c_f、rows、fiscal_year、partners",
            "title": "Items"
          },
          "last_closed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProcPeriodOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "最近一个已结账期间；没有为 null"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "open_periods": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcPeriodOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "该侧未结账的期间（GL_mend，1 到 12 期，年度不晚于登录年度）",
            "title": "Open Periods"
          },
          "periods": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcPeriodOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要：实际汇总的期间",
            "title": "Periods"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细：查询前已提交可见的最大 Auto_ID，十进制字符串",
            "title": "Watermark"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapProcListOut",
        "type": "object"
      },
      "CoArapProcVoucherIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "cancel_nos": {
            "description": "同一类处理的 1 到 50 个处理号（如 YCFAP000000000001），不能重复",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Cancel Nos",
            "type": "array"
          },
          "cash_items": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "指定现金流量项目：{科目编码: 现金流量项目编码}，最多 20 个科目。\n\n- 何时要挂：凭证里既有现金流量科目又有别的科目、总账开了现金流量（bXJLL），别的科目每行挂一个项目\n- 不给：桥按「现金流量项目数据来源」推（U8 客户端由用户手选）\n- 推不出：409「…请用 cash_items 指定，或在 U8 客户端制单」\n- 给了的科目直接用给的项目，不再推\n- 400：项目不存在或已关闭\n- 400「科目 X 在本次凭证里没有现金流量行」：科目没有要挂项目的行，或这张凭证不挂项目",
            "examples": [
              {
                "660399": "07"
              }
            ],
            "title": "Cash Items"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；省略取往来明细上的摘要",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "expense_code": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "pattern": "^\\S+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现费用科目编码：只用于票据贴现（PJTAR），省略取基本科目设置",
            "title": "Expense Code"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统和凭证的制单系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "pl_code": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "pattern": "^\\S+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "汇兑损益科目编码（如 660399）：只用于汇兑损益，且必填",
            "title": "Pl Code"
          },
          "sign": {
            "anyOf": [
              {
                "maxLength": 2,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别；省略为「转」",
            "title": "Sign"
          },
          "voucher_date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期；省略取各批次处理日期中最晚的",
            "title": "Voucher Date"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "cancel_nos"
        ],
        "title": "CoArapProcVoucherIn",
        "type": "object"
      },
      "CoArapProcVoucherOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "cancel_nos": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "本凭证覆盖的处理号",
            "title": "Cancel Nos"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcVoucherLineOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证分录（回读）",
            "title": "Lines"
          },
          "making_system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "导入凭证时用的制单系统",
            "title": "Making System"
          },
          "ok": {
            "description": "是否已制单",
            "title": "Ok",
            "type": "boolean"
          },
          "out_sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证来源 coutsign：ZZ、BZ、SY、JT 等",
            "title": "Out Sign"
          },
          "proc_style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理方式：9I、9J、BZ、9N、9M、9F、9G、9H 等",
            "title": "Proc Style"
          },
          "pz_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外部业务号（往来明细 cPZid = 凭证 coutno_id），取消制单要用",
            "title": "Pz Id"
          },
          "rows": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "回写的往来明细行数（两张表合计）",
            "title": "Rows"
          },
          "voucher": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProcVoucherKeyOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "生成的凭证"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapProcVoucherOut",
        "type": "object"
      },
      "CoArapRedOffsetIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "blue": {
            "description": "蓝字一侧，1 到 50 项，合计须等于 red",
            "items": {
              "$ref": "#/components/schemas/ProcLineIn"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Blue",
            "type": "array"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种名称；省略为本位币",
            "title": "Currency"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；U8 组件不收时忽略",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "description": "客户（AR）或供应商（AP）编码",
            "maxLength": 20,
            "minLength": 1,
            "title": "Partner",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "red": {
            "description": "红字一侧，1 到 50 项（红字发票或负余额的应收单 / 应付单）",
            "items": {
              "$ref": "#/components/schemas/ProcLineIn"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Red",
            "type": "array"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "partner",
          "red",
          "blue"
        ],
        "title": "CoArapRedOffsetIn",
        "type": "object"
      },
      "CoArapRedOffsetOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "对冲金额（原币）",
            "title": "Amount"
          },
          "blue_rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "蓝字一侧每张单据（行）",
            "title": "Blue Rows"
          },
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理号（HRAR… / HPAP…），取消、制单要用",
            "title": "Cancel No"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "red_rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字一侧每张单据（行）",
            "title": "Red Rows"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapRedOffsetOut",
        "type": "object"
      },
      "CoArapTransferIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "ap_lines": {
            "description": "应付一侧，1 到 50 项（01 / 02 / P0），合计须等于 ar_lines",
            "items": {
              "$ref": "#/components/schemas/ProcLineIn"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Ap Lines",
            "type": "array"
          },
          "ar_lines": {
            "description": "应收一侧，1 到 50 项（26 / 27 / R0）",
            "items": {
              "$ref": "#/components/schemas/ProcLineIn"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Ar Lines",
            "type": "array"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种名称；省略为本位币",
            "title": "Currency"
          },
          "customer": {
            "description": "客户编码",
            "maxLength": 20,
            "minLength": 1,
            "title": "Customer",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；省略用 U8 的缺省摘要",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "AR 应收冲应付（9I），AP 应付冲应收（9J）；也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "vendor": {
            "description": "供应商编码",
            "maxLength": 20,
            "minLength": 1,
            "title": "Vendor",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "customer",
          "vendor",
          "ar_lines",
          "ap_lines"
        ],
        "title": "CoArapTransferIn",
        "type": "object"
      },
      "CoArapTransferOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "转账金额（原币）",
            "title": "Amount"
          },
          "ap_rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付一侧每张单据每一行",
            "title": "Ap Rows"
          },
          "ar_rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "应收一侧每张单据每一行",
            "title": "Ar Rows"
          },
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理号（YCFAP… / FCYAR…），取消、制单要用",
            "title": "Cancel No"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种",
            "title": "Currency"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理日期",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理方式：9I 应收冲应付，9J 应付冲应收",
            "title": "Style"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商编码",
            "title": "Vendor"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoArapTransferOut",
        "type": "object"
      },
      "CoArapVoucherDeleteIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "pz_id": {
            "description": "外部业务号（AR… / AP…），前缀须与 flag 一致",
            "pattern": "^(AR|AP)[0-9]{1,20}$",
            "title": "Pz Id",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "pz_id"
        ],
        "title": "CoArapVoucherDeleteIn",
        "type": "object"
      },
      "CoArapVoucherDeleteOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "deleted": {
            "description": "凭证已删除",
            "title": "Deleted",
            "type": "boolean"
          },
          "flag": {
            "description": "AR 或 AP",
            "title": "Flag",
            "type": "string"
          },
          "ok": {
            "description": "是否已取消",
            "title": "Ok",
            "type": "boolean"
          },
          "pz_id": {
            "description": "已取消的外部业务号",
            "title": "Pz Id",
            "type": "string"
          },
          "voucher": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ArapVoucherKeyOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "删掉的凭证"
          }
        },
        "required": [
          "ok",
          "flag",
          "pz_id",
          "deleted"
        ],
        "title": "CoArapVoucherDeleteOut",
        "type": "object"
      },
      "CoArapVoucherIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "cash_items": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "指定现金流量项目：{科目编码: 现金流量项目编码}，最多 20 个科目。\n\n- 何时要挂：凭证里既有现金流量科目又有别的科目、总账开了现金流量（bXJLL），别的科目每行挂一个项目\n- 不给：桥按「现金流量项目数据来源」推（U8 客户端由用户手选）\n- 推不出：409「…请用 cash_items 指定，或在 U8 客户端制单」\n- 给了的科目直接用给的项目，不再推\n- 400：项目不存在或已关闭\n- 400「科目 X 在本次凭证里没有现金流量行」：科目没有要挂项目的行，或这张凭证不挂项目",
            "examples": [
              {
                "660399": "07"
              }
            ],
            "title": "Cash Items"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；省略取往来明细上的摘要",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "id": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键（发票 SBVID / PBVID、收付款单和退款单 iID、应收应付单 Auto_ID）；与 ids 二选一",
            "title": "Id"
          },
          "ids": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ArapVoucherRef"
                },
                "maxItems": 20,
                "minItems": 2,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "合并制单：同类型的 2 到 20 张单据 [{type, id}]，合成一张凭证；与 id 二选一",
            "title": "Ids"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "sign": {
            "anyOf": [
              {
                "maxLength": 2,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别；省略按规则选（收 / 付 / 转）",
            "title": "Sign"
          },
          "type": {
            "anyOf": [
              {
                "enum": [
                  "sale_invoice",
                  "purchase_invoice",
                  "ar_receipt",
                  "ap_payment",
                  "ar_bill",
                  "ap_bill",
                  "ar_refund",
                  "ap_refund"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型，须与 flag 同侧；用 ids 时可省略（取 ids 的）",
            "title": "Type"
          },
          "voucher_date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期；省略取单据日期（请求的 date 是登录日期）",
            "title": "Voucher Date"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag"
        ],
        "title": "CoArapVoucherIn",
        "type": "object"
      },
      "CoArapVoucherOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "bills": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ArapVoucherBillOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "本凭证覆盖的单据（按请求顺序；单张制单也有一项）。type / id / code 是第一张",
            "title": "Bills"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号（合并制单时是第一张的）",
            "title": "Code"
          },
          "flag": {
            "description": "AR 或 AP",
            "title": "Flag",
            "type": "string"
          },
          "id": {
            "description": "单据主键（合并制单时是第一张的）",
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "description": "凭证分录（回读）",
            "items": {
              "$ref": "#/components/schemas/ArapVoucherLineOut"
            },
            "title": "Lines",
            "type": "array"
          },
          "making_system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "导入凭证时用的制单系统（AR / AP，被拒时改用的 GL）；凭证上最终都写成 flag",
            "title": "Making System"
          },
          "ok": {
            "description": "是否已制单",
            "title": "Ok",
            "type": "boolean"
          },
          "pz_id": {
            "description": "外部业务号（往来明细 cPZid = 凭证 coutno_id），取消制单要用",
            "title": "Pz Id",
            "type": "string"
          },
          "type": {
            "description": "单据类型（合并制单时是第一张的）",
            "title": "Type",
            "type": "string"
          },
          "voucher": {
            "$ref": "#/components/schemas/ArapVoucherKeyOut"
          }
        },
        "required": [
          "ok",
          "flag",
          "type",
          "id",
          "pz_id",
          "voucher",
          "lines"
        ],
        "title": "CoArapVoucherOut",
        "type": "object"
      },
      "CoAuth": {
        "additionalProperties": false,
        "description": "账套、操作员和口令。日期与年度的缺省值在服务里填，不在模型里。",
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "CoAuth",
        "type": "object"
      },
      "CoBomComponent": {
        "properties": {
          "base_qty_d": {
            "description": "基本用量分母",
            "title": "Base Qty D",
            "type": "number"
          },
          "base_qty_n": {
            "description": "基本用量分子",
            "title": "Base Qty N",
            "type": "number"
          },
          "inv_code": {
            "description": "子件存货编码",
            "title": "Inv Code",
            "type": "string"
          },
          "line_id": {
            "description": "子件行主键 OpComponentId",
            "title": "Line Id",
            "type": "integer"
          },
          "sort_seq": {
            "description": "子件行号",
            "title": "Sort Seq",
            "type": "integer"
          }
        },
        "required": [
          "line_id",
          "sort_seq",
          "inv_code",
          "base_qty_n",
          "base_qty_d"
        ],
        "title": "CoBomComponent",
        "type": "object"
      },
      "CoCloseIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "close 关闭，open 打开",
            "enum": [
              "close",
              "open"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "line_ids": {
            "anyOf": [
              {
                "items": {
                  "exclusiveMinimum": 0.0,
                  "maximum": 2147483647.0,
                  "type": "integer"
                },
                "maxItems": 200,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细主键，1 到 200 个不重复的整数。省略则处理整张单据。不能传 null",
            "title": "Line Ids"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "可关闭或打开的单据类型：销售订单、采购订单、请购单（只能整单，不带 line_ids）、生产订单（id 为 MoId，line_ids 为 MoDId）、到货单（line_ids 为 Autoid）",
            "enum": [
              "sale_order",
              "purchase_order",
              "purchase_requisition",
              "production_order",
              "arrival"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id",
          "action"
        ],
        "title": "CoCloseIn",
        "type": "object"
      },
      "CoCloseLine": {
        "properties": {
          "closed": {
            "description": "该行是否已关闭",
            "title": "Closed",
            "type": "boolean"
          },
          "line_id": {
            "description": "明细主键",
            "title": "Line Id",
            "type": "integer"
          }
        },
        "required": [
          "line_id",
          "closed"
        ],
        "title": "CoCloseLine",
        "type": "object"
      },
      "CoCloseOut": {
        "properties": {
          "action": {
            "description": "close 关闭，open 打开",
            "enum": [
              "close",
              "open"
            ],
            "title": "Action",
            "type": "string"
          },
          "changed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单本次关闭或打开的行数。其它类型不返回",
            "title": "Changed"
          },
          "closed": {
            "description": "表头关闭人是否非空",
            "title": "Closed",
            "type": "boolean"
          },
          "closed_at": {
            "description": "关闭时间。打开后为空",
            "title": "Closed At",
            "type": "string"
          },
          "closed_by": {
            "description": "关闭人。打开后为空",
            "title": "Closed By",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单编号。其它类型不返回",
            "title": "Code"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "description": "全部明细行的关闭状态",
            "items": {
              "$ref": "#/components/schemas/CoCloseLine"
            },
            "title": "Lines",
            "type": "array"
          },
          "ok": {
            "description": "是否已关闭或打开",
            "title": "Ok",
            "type": "boolean"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoLoadState"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单处理后的整单状态。其它类型不返回"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "action",
          "closed",
          "closed_by",
          "closed_at",
          "lines"
        ],
        "title": "CoCloseOut",
        "type": "object"
      },
      "CoCreateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "head": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "description": "表头。值只能是字符串、数字或布尔，不能嵌套",
            "title": "Head",
            "type": "object"
          },
          "lines": {
            "description": "明细，1 到 200 行（生产订单 1 到 50 行，采购手工结算 1 到 400 行）。每行的值只能是字符串、数字或布尔，不能嵌套。\n\n**生产订单（production_order）**\n- 表头只收 mo_code（最长 30，省略则 U8 自动编号）和 remark（最长 255，作各行备注的缺省）\n- 明细 1 到 50 行，必须有 inv_code（自制件）、qty、start_date、due_date、mo_type、dept_code\n- qty 大于 0，最多 6 位小数，且不超过账套的存货数量小数位\n- start_date、due_date 为 yyyy-MM-dd，完工不早于开工\n- mo_type 是生产订单类别编码，dept_code 是末级生产部门\n- 可选 wh_code（预入仓库）和 remark\n- U8 按存货的标准 BOM 自动展开子件\n- 没有有效 BOM 时照样新增，响应里该行 allocates 为 0 并带 warnings\n\n**物料清单（bom）**\n- 只建标准 BOM（主 BOM）的新版本；新版本按账套设置多为未审核\n- 表头必填 inv_code（母件，自制且允许做 BOM 母件）\n- 表头可省 version（整数，省略时取该母件最大版本加版本增量）、version_desc（最长 255）\n- 表头可省 eff_date（yyyy-MM-dd，缺省登录日期，不能与该母件其他版本相同）\n- 表头可省 parent_scrap（母件损耗率 0 到小于 100）\n- 明细 1 到 200 行，必填 inv_code（子件）、base_qty_n（基本用量分子，大于 0，最多 6 位小数）\n- 明细可省 base_qty_d（分母，缺省 1）、comp_scrap（子件损耗率）、wip_type（1 到 5，缺省 3 领用）\n- 明细可省 wh_code、remark、op_seq（缺省 0000）、sort_seq（缺省按 10、20… 往后排）\n\n**其他报检单（qm_other_inspect）无来源新增**\n- 表头只收 dDate、cInspectDepCode、cDefine1–16、chDefine11–16\n- cInspectDepCode 省略时取本操作员最近一张的报检部门\n- U8 单据模板设为必输的（如 cDefine10、chDefine16）缺了 400\n- 明细 1 到 200 行，每行 cInvCode、大于 0 的 quantity；不收来源字段\n- 每行可带 iTestStyle（0 到 3 的整数，省略时取存货档案）和 cWhCode\n- 保存由 U8 自行提交（按选项自动审核），dry_run 只做校验\n\n**退货申请单（sale_return_apply）**\n- 每行 source_line_id 是已审核蓝字发货单的行 iDLsID\n- quantity 填正数，桥写负数；不超过发货数量减累计退货数量和其他未完成的申请\n- 每行另可带 cWhCode、cMemo、cReasonCode、cDefine22–37\n- 表头只收 dDate、cMemo、cDepCode、cPersonCode、cDefine1–16；客户、币种等照发货单\n- 所有行须同一客户、同一币种\n\n**采购结算单手工结算（purchase_settle，第一级写入）**\n- 表头只收 settle_date（可省，即本次 U8 登录日期）\n- 明细 1 到 400 行，每行 in_line_id（采购入库行 AutoID）、invoice_line_id（采购发票行 ID）、quantity（带符号）\n- amount 可省：结算无税金额，缺省按发票行金额比例\n- 两个 id 都给是配对；只给 in_line_id 是红蓝入库对冲；只给 invoice_line_id 是红蓝发票对冲\n- 对冲时各自同一存货的数量合计须为 0\n- 只做普通采购、人民币、专用或普通发票、一个供应商\n- 委外、外币、费用分摊、同一发票行既对冲又配对：400 / 409，请在 U8 客户端结算",
            "items": {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "type": "object"
            },
            "maxItems": 400,
            "minItems": 1,
            "title": "Lines",
            "type": "array"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "可新增的单据类型。\n\n- 销售订单、采购订单、其他入库单、其他出库单、调拨单、采购入库单（无来源）、请购单\n- 收款单、付款单、应收单、应付单、供应商退款（ap_refund）、客户退款（ar_refund）\n- 生产订单；物料清单（bom，标准 BOM 的新版本）\n- 形态转换单（shape_change）、调拨申请单（transfer_request）\n- 盘点单（stock_check）：账面数量不给时按现存量填\n- 期初结存单（stock_opening）：第二级写入，默认关闭，打开后只限测试账套\n- 期初结存单走 U8 官方 EAI 导入，每行一张单据；日期固定为库存启用日前一天\n- 货位调整单（position_adjust）：表头 cwhcode 是货位管理仓库\n- 货位调整单每行 cinvcode、cbposcode、caposcode、iquantity\n- 其他报检单（qm_other_inspect，无来源）\n- 退货申请单（sale_return_apply）：每行参照已审核的蓝字发货单行\n- 采购结算单（purchase_settle）：手工结算；明细见 lines 的说明\n\n**无来源新增**\n- 发货单（不挂销售订单）、到货单（不挂采购订单）、材料出库单（来源库存）\n- 销售发票（先开票）：U8 另生成发货单，响应另给 dispatch_id\n- 账套打开对应的「必有订单」选项时 409\n- 销售出库单（sale_out，来源库存）：表头必填 cwhcode、ccuscode、cdepcode\n- 无来源销售出库单：账套已启用销售管理或库存选项设为由销售系统生成时 409，须参照发货单生成",
            "enum": [
              "sale_order",
              "other_in",
              "other_out",
              "purchase_order",
              "transfer",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_in",
              "purchase_requisition",
              "production_order",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_check",
              "dispatch",
              "sale_invoice",
              "arrival",
              "material_out",
              "stock_opening",
              "position_adjust",
              "qm_other_inspect",
              "sale_out",
              "sale_return_apply",
              "purchase_settle"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "head",
          "lines"
        ],
        "title": "CoCreateIn",
        "type": "object"
      },
      "CoCreateOut": {
        "properties": {
          "allocates": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单：U8 按标准 BOM 展开的子件总行数。其它类型省略",
            "title": "Allocates"
          },
          "auto_verify_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "其他报检单：保存已成功，但按选项补的自动审核没做（无审核权限）或没成功时的说明，单据为未审核，可用 vouchers/verify 补审。其它类型省略",
            "title": "Auto Verify Error"
          },
          "code": {
            "description": "新单据编号。期初结存单是第一张（docs[0]）",
            "title": "Code",
            "type": "string"
          },
          "components": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoBomComponent"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单：保存后的每行子件（主键、行号、存货、用量分子分母）。其它类型省略",
            "title": "Components"
          },
          "count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初结存单：建成的单据张数（等于明细行数）。其它类型省略",
            "title": "Count"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初结存单：单据日期（库存启用日前一天）。其它类型省略",
            "title": "Date"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoMoCreatedLine"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单：每行的主键、行号、存货、数量、状态和子件行数。其它类型省略",
            "title": "Details"
          },
          "dispatch_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "先开票销售发票：U8 按发票生成的发货单主键。读不到或其它类型省略",
            "title": "Dispatch Id"
          },
          "docs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoOpeningDoc"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初结存单：每行一张单据，按请求行次序。其它类型省略",
            "title": "Docs"
          },
          "id": {
            "description": "新单据主键。期初结存单是第一张（docs[0]）",
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "保存后的明细行数。没有则省略",
            "title": "Lines"
          },
          "ok": {
            "description": "是否已新增",
            "title": "Ok",
            "type": "boolean"
          },
          "settle_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "采购结算单（手工结算）：结算日期（即本次的 U8 登录日期）。其它类型省略",
            "title": "Settle Date"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoDocState"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核状态。收付款单和应收应付单可能不返回"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单：新版本号。其它类型省略",
            "title": "Version"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单：有行没有展开子件时的提示；期初结存单：传入的日期未采用时的提示。没有则省略",
            "title": "Warnings"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code"
        ],
        "title": "CoCreateOut",
        "type": "object"
      },
      "CoDeleteIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647。只删除未审核单据（报检单例外：先弃审再删除）",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "可删除的未审核单据，括号内为另需满足的条件。\n\n- 销售订单、其他入库单、其他出库单、采购订单、调拨单、发货单、到货单、销售出库单\n- 采购入库单、销售发票、采购发票、收款单、付款单、应收单、应付单、供应商退款、客户退款\n- 参照生产订单或产品检验单生成的材料出库单和产成品入库单\n- 采购退货单（未报检、未入库）\n- 退货单（红字发货单，未被销售出库或销售发票引用）\n- 请购单（未审核、未关闭、未被采购订单参照）\n- 生产订单（行状态都未审核、未提交审批、未被材料出库或产成品入库引用）\n- 物料清单（未审核、未进审批流、没有生产订单或委外订单引用）\n- 期初结存单（未审核，存货核算尚未期初记账；第二级写入，默认关闭，打开后只限测试账套）\n- 来料报检单、产品报检单（没有检验单引用；已审核的先弃审再删除，要有弃审权限）\n- 来料检验单、产品检验单（未审核、未提交审批、未被入库或不良品处理引用）\n- 来料不良品处理单、产品不良品处理单（未审核、未被下游单据引用）；删除后 U8 恢复检验单的不良品处理标记\n- 形态转换单、盘点单；调拨申请单（未关闭、未生成调拨单）；货位调整单（未审核）\n- 其他报检单（没有其他检验单引用；已审核的先弃审再删除，要有弃审权限）\n- 其他检验单（未审核、未被入库或不良品处理引用）\n- 采购结算单（存货核算未记账、关联发票未应付审核、结算期间采购未结账）；删除后 U8 清除发票的结算日期\n- 退货申请单（未审核、没有退货单参照）",
            "enum": [
              "sale_order",
              "other_in",
              "other_out",
              "purchase_order",
              "transfer",
              "dispatch",
              "arrival",
              "sale_out",
              "purchase_in",
              "sale_invoice",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "material_out",
              "product_in",
              "purchase_invoice",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "production_order",
              "bom",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "qm_incoming_check",
              "qm_product_check",
              "shape_change",
              "transfer_request",
              "stock_check",
              "stock_opening",
              "qm_incoming_reject",
              "qm_product_reject",
              "position_adjust",
              "qm_other_inspect",
              "qm_other_check",
              "purchase_settle",
              "sale_return_apply"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoDeleteIn",
        "type": "object"
      },
      "CoDeleteOut": {
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "被删单据编号。桥不报则省略",
            "title": "Code"
          },
          "deleted": {
            "description": "删除后表头已不存在则为 true",
            "title": "Deleted",
            "type": "boolean"
          },
          "id": {
            "description": "被删单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "description": "是否已删除",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "unverified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "报检单（含其他报检单）：删除前先弃审了则为 true。其它类型省略",
            "title": "Unverified"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "deleted"
        ],
        "title": "CoDeleteOut",
        "type": "object"
      },
      "CoDocState": {
        "properties": {
          "verified": {
            "description": "是否已审核",
            "title": "Verified",
            "type": "boolean"
          },
          "verified_at": {
            "description": "审核时间",
            "title": "Verified At",
            "type": "string"
          },
          "verifier": {
            "description": "审核人",
            "title": "Verifier",
            "type": "string"
          }
        },
        "required": [
          "verified",
          "verifier",
          "verified_at"
        ],
        "title": "CoDocState",
        "type": "object"
      },
      "CoGenWf": {
        "additionalProperties": true,
        "properties": {
          "controlled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否受审批流控制（IsWfControlled）",
            "title": "Controlled"
          },
          "verify_state_new": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "表头 iVerifyStateNew。0 未提交",
            "title": "Verify State New"
          }
        },
        "title": "CoGenWf",
        "type": "object"
      },
      "CoGenerateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "head": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "items": {
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "目标表头覆盖。\n\n**规则**\n- 值只能是字符串、数字或布尔，不能填主键、单号或审核人；只有检验单的 items 可以是列表\n- 销售出库不能带表头\n- 采购发票只收字符串 cPBVCode（必填，最长 30）、cPBVBillType（01 或 02）\n- 采购发票另收 dPBVDate（yyyy-MM-dd）、cPBVMemo（最长 255）\n- 到货单和采购退货单只收字符串 cWhCode、dDate（yyyy-MM-dd）、cMemo、cDepCode，可省略\n- 参照来料检验单的采购入库必须有 cWhCode\n- 退货单只收 dDate（yyyy-MM-dd）、cMemo、cDepCode、cPersonCode、cDefine1–16，可省略\n- 退货单另可带布尔 invoiced：false 未开票退货，true 已开票退货，省略时按可退数量自动选\n\n**来料报检单、产品报检单**\n- 来料报检单（qm_incoming_inspect）参照已审核的蓝字到货单（id 是到货单 ID）\n- 产品报检单（qm_product_inspect）参照已审核未关闭的生产订单（id 是 MoId）\n- 明细 1 到 200 行，每行 source_line_id（到货单行 Autoid 或 MoDId）、大于 0 的 quantity，可带 cWhCode\n- 表头可省略，只收 dDate、cDepCode、cInspectDepCode、cDefine1–16\n\n**来料检验单、产品检验单**\n- 来料检验单（qm_incoming_check）参照已审核的来料报检单（id 是报检单 ID）\n- 产品检验单（qm_product_check）参照已审核的产品报检单（id 是报检单 ID）\n- 只能 1 行：source_line_id 是报检单表体 AUTOID，quantity 是本次检验数量\n- 行可带 fRegQuantity（合格）、fConQuantiy（让步）、fDisQuantity（不良），三者之和必须等于 quantity\n- 表头必须有 cCheckPersonCode（检验员）\n- 表头可带 cDepCode、project_code（检验方案）、cChkConclusion、fDtQuantity（抽检量，大于 0）\n- 表头可带 dDate、cDefine1–16、chDefine11–16、dYieldDate（核准日期）\n- cYielderCode：让步接收核准人的人员编码，有让步数量时来料 / 产品检验单必填\n- items：1 到 50 个检验项目 {cChkItemCode, cChkGuideCode, cCheckValue?, cTargetQJug?}\n- cTargetQJug 只能是 合格 或 不合格\n\n**来料不良品处理单、产品不良品处理单**\n- 来料不良品处理单（qm_incoming_reject）参照来料检验单，产品不良品处理单（qm_product_reject）参照产品检验单\n- id 是检验单 ID；检验单须已审核、有未处理的不良数量、未生成过不良品处理单\n- 每行一种处理方式：source_line_id 等于 id，quantity 大于 0，各行之和必须等于检验单的不良数量\n- cScrapDisCode（不良品处理方式编码）、cReasonCode（不良原因编码）必填\n- 处理流程为降级时必须有 cDimInvCode（降级存货）；可带 cbWhCode\n- 表头可省略，只收 dDate、cDefine1–16、chDefine11–16（处理单没有备注列）\n\n**其他检验单（qm_other_check）**\n- 参照已审核的其他报检单：id 是其他报检单 ID，source_line_id 是表体 AUTOID，每行只能生成一张\n- 表头表体规则同来料检验单；cDepCode（检验部门）省略时取检验员的所属部门\n\n**质量单据通用**\n- 保存由 U8 自行提交，dry_run 只做校验\n\n**红字销售发票（type=sale_invoice、source_type=sale_return）**\n- 参照已审核、已开票退货（bneedbill=1）的退货单，id 是退货单 DLID\n- 表头只收 cVouchType（26 或 27，省略时同原蓝字发票类型，缺省 26）、dDate、cMemo、cDefine1–16\n- lines 可省略：全部有剩余的退货行按剩余数量生成\n- 给了 lines：每行 source_line_id（退货单行 iDLsID）和正数 quantity，另可带 cMemo、cDefine22–37\n\n**红冲蓝字销售发票（source_type=sale_invoice）**\n- 表头和行同红字销售发票；id 是已复核、非现结的蓝字发票 SBVID\n- cVouchType 省略时同蓝字发票（给了必须相同）\n- source_line_id 是蓝字发票行 AutoID；quantity 不超过该行数量减去已红冲数量\n- lines 省略时全部有剩余的行按剩余数量红冲\n\n**调拨单（source_type=transfer_request，id 是申请单 ID）**\n- 表头只收 dTVDate、cMemo、cODepCode、cIDepCode、cPersonCode、cORdCode、cIRdCode、cDefine1–16\n- 仓库取自申请单\n- 行只收 source_line_id（申请单行 autoID）、quantity、cbMemo\n- 数量不超过核准数量减累计调拨数量\n\n**采购结算单（type=purchase_settle，source_type=purchase_invoice，id 是 PBVID）**\n- 按整张发票自动结算，不能带 lines\n- 表头只收 settle_date（yyyy-MM-dd，可省），它就是这一笔的 U8 登录日期（覆盖 date）\n- settle_date 不能晚于今天，不能早于发票日期和入库日期\n- 所在期间采购未结账，且之前各月采购已结账（U8 判断，否则 409 原文）",
            "title": "Head"
          },
          "id": {
            "description": "来源单据主键，按目标单据取。\n\n- 发货单来自销售订单；销售出库来自发货单；销售发票来自发货单\n- 采购入库来自采购订单、来料检验单或蓝字到货单（ID）\n- 材料出库来自生产订单（MoId）\n- 产成品入库来自产品检验单（检验单 ID）、产品不良品处理单（处理单 ID）或生产订单（MoId）\n- 采购发票来自采购入库单（红字入库单生成红字发票）\n- 到货单来自采购订单（POID）；采购退货单来自蓝字到货单（ID）或采购订单（POID）\n- 退货单（红字发货单）来自已审核的蓝字发货单（DLID）\n- 退货单也可来自已审核的退货申请单（source_type=sale_return_apply，申请单 ID）\n- 红字销售发票（source_type=sale_return）来自已审核的退货单（DLID）\n- 红冲蓝字销售发票（source_type=sale_invoice）来自已复核的蓝字销售发票（SBVID）\n- 来料报检单来自到货单（ID）；产品报检单来自生产订单（MoId）\n- 检验单来自报检单（ID）；其他检验单来自其他报检单（ID）；不良品处理单来自检验单（ID）\n- 调拨单来自已审核的调拨申请单（ID）；采购结算单来自已复核的采购发票（PBVID）",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  "type": "object"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "来源明细，1 到 200 行；每行要有 source_line_id 和大于 0 的 quantity。\n\n**销售出库**\n- 省略 lines 时按整张发货单生成\n- 带 lines 时收 source_line_id（发货单行 iDLsID）、quantity\n- 另可带字符串 cbatch（批号，最长 60）、cposition（货位，最长 20）\n- 同一发货行可以列多次、批号或货位不同（拆行），各次数量之和不超过发货数量减累计出库数量\n- 没列出的发货行不出库\n\n**材料出库、产成品入库**\n- 材料出库的 source_line_id 是子件分配 AllocateId\n- 两者的行另可带 cbatch、cbmemo 和货位 cposition\n- 产成品入库参照产品检验单：非合并检验只能有 1 行，source_line_id 是检验单 ID\n- 合并检验（BMERGECHECKFLAG=1）每个来源一行（1 到 20 行），数量不超过该来源的剩余\n- 合并检验的 source_line_id 是合并来源 AUTOID（vouchers/load 的 merge_sources）\n- 参照产品不良品处理单（qm_product_reject）或生产订单时只能有 1 行\n- 这两种来源的 source_line_id 分别是处理单表体 AUTOID、订单行 MoDId\n\n**采购发票、到货单、采购退货单**\n- 行只能有 source_line_id 和 quantity\n- 到货单的 source_line_id 是 PO_Podetails.ID\n- 采购退货单的 source_line_id 是原到货单行 Autoid 或 PO_Podetails.ID，quantity 填正数（桥写负数）\n- 参照红字入库单的采购发票同样 quantity 填正数，桥写负数、表头 bNegative=1\n\n**采购入库**\n- 参照来料检验单：只能有 1 行，source_line_id 是检验单 ID，可带 cbatch、cbmemo、cposition\n- 参照采购退货单（红字采购入库）：source_line_id 是退货单行 Autoid，quantity 填正数（桥写负数）\n- 参照到货单：source_line_id 是到货单行 Autoid，可带 cbatch、cbmemo、cposition、cWhCode\n- 参照到货单时表头没给仓库，各行 cWhCode 须一致\n- 参照到货单省略 lines 时按各行剩余可入库数量整单生成；需要来料检验的存货 409\n\n**货位 cposition**\n- 采购入库（四种来源）、材料出库、产成品入库的行都可带\n- 仓库启用货位管理时每行必填该仓库的末级货位，否则不能填\n\n**退货单**\n- source_line_id 是原发货单行 iDLsID\n- quantity 填正数（桥写负数，不超过发货数量减累计退货数量）\n- 另可带 cWhCode、cMemo、cDefine22–37\n- 参照退货申请单（source_type=sale_return_apply）时 source_line_id 是申请单行 AutoID\n- 所选申请行须指向同一张蓝字发货单，不超过申请数量减已退数量；没给 cWhCode 时用申请行的仓库",
            "title": "Lines"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "source_type": {
            "anyOf": [
              {
                "enum": [
                  "sale_order",
                  "dispatch",
                  "purchase_order",
                  "qm_incoming_check",
                  "purchase_in",
                  "production_order",
                  "qm_product_check",
                  "qm_product_reject",
                  "arrival",
                  "qm_incoming_inspect",
                  "qm_product_inspect",
                  "purchase_return",
                  "sale_return",
                  "transfer_request",
                  "qm_other_inspect",
                  "purchase_invoice",
                  "sale_invoice",
                  "sale_return_apply"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "来源单据类型，省略时取缺省来源。\n\n| 目标单据 | 可选来源（第一个是缺省） |\n|---|---|\n| 采购入库 | purchase_order、qm_incoming_check、purchase_return（采购退货单，生成红字采购入库）、arrival（蓝字到货单，lines 可省） |\n| 产成品入库 | qm_product_check、qm_product_reject、production_order |\n| 采购发票 | 只能是 purchase_in |\n| 采购退货单 | arrival、purchase_order |\n| 销售发票 | dispatch、sale_return（退货单，生成红字发票）、sale_invoice（蓝字发票，红冲） |\n| 采购结算单 | 只能是 purchase_invoice |\n| 其它目标 | 只能是各自唯一的来源 |",
            "title": "Source Type"
          },
          "type": {
            "description": "参照生单的目标类型。\n\n- 发货单、销售出库单、采购入库单、销售发票、材料出库单、产成品入库单、采购发票、到货单\n- 采购退货单、退货单（红字发货单）\n- 来料报检单、产品报检单、来料检验单、产品检验单、来料不良品处理单、产品不良品处理单\n- 调拨单（参照调拨申请单）\n- 采购结算单（参照采购发票，整张自动结算）",
            "enum": [
              "dispatch",
              "sale_out",
              "purchase_in",
              "sale_invoice",
              "material_out",
              "product_in",
              "purchase_invoice",
              "arrival",
              "purchase_return",
              "sale_return",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "qm_other_check",
              "transfer",
              "purchase_settle"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoGenerateIn",
        "type": "object"
      },
      "CoGenerateOut": {
        "properties": {
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "components": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoBomComponent"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单：保存后的每行子件（主键、行号、存货、用量分子分母）。其它类型省略",
            "title": "Components"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "销售出库按仓库拆成多张时，全部新单据主键",
            "title": "Ids"
          },
          "items": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "检验单：保存后的检验项目行数。其它类型省略",
            "title": "Items"
          },
          "lines": {
            "description": "保存后的明细行数",
            "title": "Lines",
            "type": "integer"
          },
          "ok": {
            "description": "是否已保存",
            "title": "Ok",
            "type": "boolean"
          },
          "settle_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "采购结算单：结算日期（即本次的 U8 登录日期）。其它类型省略",
            "title": "Settle Date"
          },
          "source_id": {
            "description": "来源单据主键",
            "title": "Source Id",
            "type": "integer"
          },
          "source_type": {
            "description": "来源单据类型",
            "title": "Source Type",
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/CoDocState",
            "description": "审核状态"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单：版本号。其它类型省略",
            "title": "Version"
          },
          "wf": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoGenWf"
              },
              {
                "type": "null"
              }
            ],
            "description": "检验单、不良品处理单：新单据的审批流状态（未提交）。其它类型省略"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code",
          "state",
          "lines",
          "source_type",
          "source_id"
        ],
        "title": "CoGenerateOut",
        "type": "object"
      },
      "CoGenerated": {
        "properties": {
          "id": {
            "description": "下游单据主键",
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "审核时生成的下游单据类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "CoGenerated",
        "type": "object"
      },
      "CoHealthOut": {
        "properties": {
          "api_read_only_accounts": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "本服务的只读账套（U8CO_READONLY_ACCOUNTS），这些账套的写路由在访问桥之前 403 account_read_only。没配时省略",
            "title": "Api Read Only Accounts"
          },
          "api_write_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoWritePolicyHealth"
              },
              {
                "type": "null"
              }
            ],
            "description": "本服务自己的写入策略（U8CO_WRITE_POLICY_FILE），形状同 write_policy。没配置时省略"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "U8 许可点数：ok、near（将满）、full（已满）、unknown（读不到）。旧版桥不报则省略",
            "title": "License"
          },
          "license_detail": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "type": "object"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "按子系统（SA、GL 等两位码）的许可点数：used 已用、limit 总数、full_24h 近 24 小时已满次数。没有则省略",
            "title": "License Detail"
          },
          "license_packs": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CoLicensePack"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "按加密包（两位码）的点数：used 已用、limit 总数（桥不知道时省略）、modules 这个包覆盖的子系统两位码。最多 32 个包、每包 16 个子系统。没有则省略",
            "title": "License Packs"
          },
          "license_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "许可点数的来源：leases（按实际占用的租约数）或 tasklog（按任务日志估算）。旧版桥不报则省略",
            "title": "License Source"
          },
          "ok": {
            "description": "桥是否可用",
            "title": "Ok",
            "type": "boolean"
          },
          "read_only_accounts": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省桥的只读账套（桥 config.json 的 readOnlyAccounts），这些账套的写路由一律 403。没配或旧版桥不报则省略",
            "title": "Read Only Accounts"
          },
          "replicated_writes": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "桥的第二级写入总开关（桥 config.json 的 enableReplicatedWrites，缺省 false）：false 时结账、核算、期初等第二级写入一律 403 feature_disabled；true 时仍只对 testAccounts 开放。旧版桥不报则省略",
            "title": "Replicated Writes"
          },
          "routes": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoRouteHealth"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按账套分流的桥（U8CO_BRIDGE_ROUTES_FILE），按文件里的顺序各一项。没配分流时省略。顶层的 ok、version、license* 只描述缺省桥",
            "title": "Routes"
          },
          "version": {
            "description": "桥报告的版本",
            "title": "Version",
            "type": "string"
          },
          "write_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoWritePolicyHealth"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省桥的写入策略（桥 config.json 的 writePolicyFile）：state 为 off（未配置）、ok、invalid（新内容无效，仍按上一份有效策略）、missing（文件不存在，写入全部拒绝）。旧版桥不报则省略"
          }
        },
        "required": [
          "ok",
          "version"
        ],
        "title": "CoHealthOut",
        "type": "object"
      },
      "CoHistoryItem": {
        "properties": {
          "action": {
            "description": "动作编号",
            "title": "Action",
            "type": "integer"
          },
          "action_name": {
            "description": "动作名：submit、agree、disagree、reject、withdraw、return、abandon、resubmit，其它为 other",
            "title": "Action Name",
            "type": "string"
          },
          "at": {
            "description": "时间",
            "title": "At",
            "type": "string"
          },
          "name": {
            "description": "姓名",
            "title": "Name",
            "type": "string"
          },
          "operator": {
            "description": "操作员编码",
            "title": "Operator",
            "type": "string"
          },
          "opinion": {
            "description": "审批意见",
            "title": "Opinion",
            "type": "string"
          },
          "person": {
            "description": "人员编码",
            "title": "Person",
            "type": "string"
          },
          "task": {
            "default": "",
            "description": "任务名称（U8 待办标题）",
            "title": "Task",
            "type": "string"
          }
        },
        "required": [
          "action",
          "action_name",
          "opinion",
          "person",
          "operator",
          "name",
          "at"
        ],
        "title": "CoHistoryItem",
        "type": "object"
      },
      "CoHistoryOut": {
        "properties": {
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "history": {
            "description": "按时间排列的审批记录",
            "items": {
              "$ref": "#/components/schemas/CoHistoryItem"
            },
            "title": "History",
            "type": "array"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "description": "是否读到审批历史",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code",
          "history"
        ],
        "title": "CoHistoryOut",
        "type": "object"
      },
      "CoInstance": {
        "properties": {
          "piid": {
            "description": "流程实例标识",
            "title": "Piid",
            "type": "string"
          },
          "running": {
            "description": "实例是否仍在运行",
            "title": "Running",
            "type": "boolean"
          },
          "started_at": {
            "description": "发起时间",
            "title": "Started At",
            "type": "string"
          },
          "started_by": {
            "description": "发起人人员编码",
            "title": "Started By",
            "type": "string"
          }
        },
        "required": [
          "piid",
          "running",
          "started_by",
          "started_at"
        ],
        "title": "CoInstance",
        "type": "object"
      },
      "CoLicensePack": {
        "properties": {
          "limit": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "总点数；桥不知道时省略",
            "title": "Limit"
          },
          "modules": {
            "description": "这个加密包覆盖的子系统两位码，如 SA、GL",
            "items": {
              "type": "string"
            },
            "title": "Modules",
            "type": "array"
          },
          "used": {
            "description": "已用点数",
            "minimum": 0.0,
            "title": "Used",
            "type": "integer"
          }
        },
        "required": [
          "used",
          "modules"
        ],
        "title": "CoLicensePack",
        "type": "object"
      },
      "CoListFilter": {
        "additionalProperties": false,
        "description": "每个键追加一个条件。该类型没有对应列时桥返回 400。",
        "properties": {
          "closed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 只要已关闭，false 只要未关闭",
            "title": "Closed"
          },
          "code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据编号等于",
            "title": "Code"
          },
          "code_from": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据编号下限，含",
            "title": "Code From"
          },
          "code_to": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据编号上限，含",
            "title": "Code To"
          },
          "cus_code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码",
            "title": "Cus Code"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据日期下限，yyyy-MM-dd，含当天",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据日期上限，yyyy-MM-dd，含当天",
            "title": "Date To"
          },
          "dep_code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码",
            "title": "Dep Code"
          },
          "maker": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单人",
            "title": "Maker"
          },
          "person_code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码",
            "title": "Person Code"
          },
          "red": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 只要红字，false 只要蓝字",
            "title": "Red"
          },
          "ven_code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商编码",
            "title": "Ven Code"
          },
          "verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 只要已审核，false 只要未审核",
            "title": "Verified"
          },
          "wh_code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "仓库编码",
            "title": "Wh Code"
          }
        },
        "title": "CoListFilter",
        "type": "object"
      },
      "CoLoadIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "单据类型。\n\n- 供销：销售订单、发货单、销售发票、采购订单、到货单、采购发票、请购单\n- 出入库：采购入库、其他入库、其他出库、产成品入库、材料出库、销售出库、调拨单\n- 生产与质量：生产订单、来料检验、产品检验、来料不良品处理、产品不良品处理\n- 往来：收款单、付款单、应收单、应付单\n- 供应商退款（ap_refund，应付的收款单 AP48）、客户退款（ar_refund，应收的付款单 AR49）：金额为正\n- 采购退货单（红字到货单）、退货单（红字发货单）\n- 来料报检单、产品报检单：读取、列表、参照生单、删除\n- 物料清单（bom）：只含标准 BOM，id 是 BomId，code 是母件存货编码\n- 形态转换单（shape_change）、调拨申请单（transfer_request）、盘点单（stock_check）\n- 期初结存单（stock_opening）：库存期初，U8 单据类型 34\n- 其他报检单（qm_other_inspect）：可无来源新增、删除；没有审批流\n- 其他检验单（qm_other_check）：参照其他报检单生单、审核、删除；没有审批流\n- 采购结算单（purchase_settle）：id 是 PSVID，没有审核\n- 采购结算单可参照采购发票生单（自动结算）、删除，可手工结算（新增，第一级写入，按写入策略放行）\n- 货位调整单（position_adjust）：U8 单据类型 19，同一仓库内货位之间移库\n- 出入库调整单（ia_adjust）：存货核算的入库 / 出库调整单，只读，verified 表示已记账\n- 存货调价单（inventory_price_adjust）：只读\n- 退货申请单（sale_return_apply）：销售管理卡片 SA31；数量、金额为负数",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_invoice",
              "purchase_order",
              "arrival",
              "purchase_invoice",
              "purchase_in",
              "other_in",
              "other_out",
              "product_in",
              "material_out",
              "sale_out",
              "transfer",
              "production_order",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_check",
              "stock_opening",
              "qm_other_inspect",
              "qm_other_check",
              "purchase_settle",
              "position_adjust",
              "ia_adjust",
              "inventory_price_adjust",
              "sale_return_apply"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoLoadIn",
        "type": "object"
      },
      "CoLoadOut": {
        "properties": {
          "allocations": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单的子件分配。其它类型不返回",
            "title": "Allocations"
          },
          "allocations_truncated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时子件分配超过 500 行，只返回前 500 行",
            "title": "Allocations Truncated"
          },
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "head": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "表头。值是 U8 存成的字符串，空值省略；无权查看的字段为 null（见 masked_fields）",
            "title": "Head",
            "type": "object"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "description": "明细行。值是字符串；无权查看的字段为 null",
            "items": {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "object"
            },
            "title": "Lines",
            "type": "array"
          },
          "lines_truncated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时明细超过 500 行，只返回前 500 行",
            "title": "Lines Truncated"
          },
          "masked_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按 U8 字段权限置为 null 的字段名（排序去重）。操作员对本单据没有受限字段时省略",
            "title": "Masked Fields"
          },
          "merge_sources": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoMergeSource"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "合并检验（BMERGECHECKFLAG=1）的产品检验单：每个合并来源一项，参照生成产成品入库时按来源逐行。其它不返回",
            "title": "Merge Sources"
          },
          "ok": {
            "description": "是否读到单据",
            "title": "Ok",
            "type": "boolean"
          },
          "positions": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "货位调整单的货位台账（InvPosition，审核后每行一出 inbound=0、一入 inbound=1；未审核为空）。其它类型不返回",
            "title": "Positions"
          },
          "positions_truncated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时货位台账超过 1000 行，只返回前 1000 行",
            "title": "Positions Truncated"
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoLoadSource"
              },
              {
                "type": "null"
              }
            ],
            "description": "报检单的来源单据。其它类型不返回"
          },
          "state": {
            "$ref": "#/components/schemas/CoLoadState",
            "description": "审核状态"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "wf": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoWf"
              },
              {
                "type": "null"
              }
            ],
            "description": "检验单和不良品处理单的审批状态。报检单和其它类型不返回"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code",
          "head",
          "lines",
          "state"
        ],
        "title": "CoLoadOut",
        "type": "object"
      },
      "CoLoadSource": {
        "properties": {
          "code": {
            "description": "来源单据编号",
            "title": "Code",
            "type": "string"
          },
          "id": {
            "description": "来源单据主键（到货单 ID / 生产订单 MoId）",
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "来源单据类型：来料报检单是 arrival，产品报检单是 production_order",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "code"
        ],
        "title": "CoLoadSource",
        "type": "object"
      },
      "CoLoadState": {
        "properties": {
          "arap_verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "采购发票、销售发票是否已在应付 / 应收款管理审核。其它类型不返回",
            "title": "Arap Verified"
          },
          "arap_verified_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付 / 应收审核日期。其它类型不返回",
            "title": "Arap Verified At"
          },
          "arap_verifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付 / 应收审核人。其它类型不返回",
            "title": "Arap Verifier"
          },
          "closed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单是否已整单关闭。其它类型不返回",
            "title": "Closed"
          },
          "gl_voucher": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "采购发票、销售发票：应付 / 应收明细是否已制单（布尔）。收付款单、应收应付单：凭证号（字符串）",
            "title": "Gl Voucher"
          },
          "verified": {
            "description": "是否已审核",
            "title": "Verified",
            "type": "boolean"
          },
          "verified_at": {
            "description": "审核时间",
            "title": "Verified At",
            "type": "string"
          },
          "verifier": {
            "description": "审核人",
            "title": "Verifier",
            "type": "string"
          }
        },
        "required": [
          "verified",
          "verifier",
          "verified_at"
        ],
        "title": "CoLoadState",
        "type": "object"
      },
      "CoLockIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "lock 锁定，unlock 解锁",
            "enum": [
              "lock",
              "unlock"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "const": "sale_order",
            "description": "可锁定的单据类型：销售订单（采购订单暂不支持）",
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id",
          "action"
        ],
        "title": "CoLockIn",
        "type": "object"
      },
      "CoLockOut": {
        "properties": {
          "action": {
            "description": "lock 锁定，unlock 解锁",
            "enum": [
              "lock",
              "unlock"
            ],
            "title": "Action",
            "type": "string"
          },
          "already": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本人此前已锁定、这次没有再调用 U8 时为 true。其它情况省略",
            "title": "Already"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "locked": {
            "description": "回读的表头锁定人是否非空",
            "title": "Locked",
            "type": "boolean"
          },
          "locker": {
            "description": "锁定人（操作员姓名）。解锁后为空",
            "title": "Locker",
            "type": "string"
          },
          "ok": {
            "description": "是否已锁定或解锁",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "action",
          "locked",
          "locker"
        ],
        "title": "CoLockOut",
        "type": "object"
      },
      "CoLoginOut": {
        "properties": {
          "ok": {
            "description": "是否登录成功",
            "title": "Ok",
            "type": "boolean"
          },
          "operator": {
            "description": "操作员编码",
            "examples": [
              "op001"
            ],
            "title": "Operator",
            "type": "string"
          },
          "operator_name": {
            "description": "操作员姓名",
            "title": "Operator Name",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "operator",
          "operator_name"
        ],
        "title": "CoLoginOut",
        "type": "object"
      },
      "CoMergeSource": {
        "properties": {
          "concession": {
            "description": "该来源的让步接收数量",
            "title": "Concession",
            "type": "number"
          },
          "done": {
            "description": "U8 是否已把该来源标为入库完毕（BPROINFLAG=1），为 true 时不能再生单",
            "title": "Done",
            "type": "boolean"
          },
          "inspect_code": {
            "description": "来源产品报检单号",
            "title": "Inspect Code",
            "type": "string"
          },
          "mo_code": {
            "description": "来源生产订单号",
            "title": "Mo Code",
            "type": "string"
          },
          "mo_detail_id": {
            "description": "来源生产订单行主键 MoDId",
            "title": "Mo Detail Id",
            "type": "integer"
          },
          "mo_seq": {
            "description": "来源生产订单行号（SortSeq）",
            "title": "Mo Seq",
            "type": "integer"
          },
          "qualified": {
            "description": "该来源的合格数量",
            "title": "Qualified",
            "type": "number"
          },
          "remaining": {
            "description": "剩余可入库数量：合格 + 让步接收 − 累计入库，不小于 0",
            "title": "Remaining",
            "type": "number"
          },
          "source_line_id": {
            "description": "合并来源主键 QMMergeCheckDetail.AUTOID，即参照生单时的 source_line_id",
            "title": "Source Line Id",
            "type": "integer"
          },
          "stocked": {
            "description": "该来源的累计入库数量",
            "title": "Stocked",
            "type": "number"
          }
        },
        "required": [
          "source_line_id",
          "mo_code",
          "mo_seq",
          "mo_detail_id",
          "inspect_code",
          "qualified",
          "concession",
          "stocked",
          "remaining",
          "done"
        ],
        "title": "CoMergeSource",
        "type": "object"
      },
      "CoMetaOut": {
        "additionalProperties": true,
        "properties": {
          "archives": {
            "description": "档案类型",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Archives",
            "type": "array"
          },
          "complete": {
            "description": "档案标签是否全部读到",
            "title": "Complete",
            "type": "boolean"
          },
          "dry_run_routes": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据以外路由的预演模式：路由 → rollback / validate，或按档案类型分的 {类型: 模式, \"*\": 模式}。单据类型各操作的模式见 kinds[].dry_run",
            "title": "Dry Run Routes"
          },
          "features": {
            "additionalProperties": true,
            "description": "运行时自检结果",
            "title": "Features",
            "type": "object"
          },
          "field_refs": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "写字段名（小写）→ 档案类型，如 ccuscode → customer；值可用 archives/resolve 解析",
            "title": "Field Refs"
          },
          "gl": {
            "additionalProperties": true,
            "description": "总账凭证字段",
            "title": "Gl",
            "type": "object"
          },
          "gl_field_refs": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "总账凭证分录字段 → 档案类型，如 account → account、dept → department",
            "title": "Gl Field Refs"
          },
          "kinds": {
            "description": "单据类型",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Kinds",
            "type": "array"
          },
          "list_kinds": {
            "description": "vouchers/list 支持的类型",
            "items": {
              "type": "string"
            },
            "title": "List Kinds",
            "type": "array"
          },
          "ok": {
            "description": "总是 true",
            "title": "Ok",
            "type": "boolean"
          },
          "revision": {
            "description": "除 features 外内容的 SHA-256（十六进制小写）",
            "title": "Revision",
            "type": "string"
          },
          "routes": {
            "description": "桥的路由及请求体允许的字段",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Routes",
            "type": "array"
          },
          "version": {
            "description": "元数据格式版本",
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "version",
          "revision",
          "complete",
          "kinds",
          "archives",
          "gl",
          "list_kinds",
          "routes",
          "features"
        ],
        "title": "CoMetaOut",
        "type": "object"
      },
      "CoMoCreatedLine": {
        "properties": {
          "allocates": {
            "description": "U8 按标准 BOM 展开的子件行数；0 表示没有展开（存货没有有效的标准 BOM）",
            "title": "Allocates",
            "type": "integer"
          },
          "inv_code": {
            "description": "存货编码",
            "title": "Inv Code",
            "type": "string"
          },
          "line_id": {
            "description": "明细主键 MoDId",
            "title": "Line Id",
            "type": "integer"
          },
          "qty": {
            "description": "生产数量",
            "title": "Qty",
            "type": "number"
          },
          "sort_seq": {
            "description": "行号",
            "title": "Sort Seq",
            "type": "integer"
          },
          "status": {
            "description": "行状态：1、2 未审核，3 已审核，4 已关闭。U8API 新增的订单是 2",
            "title": "Status",
            "type": "integer"
          }
        },
        "required": [
          "line_id",
          "sort_seq",
          "inv_code",
          "qty",
          "status",
          "allocates"
        ],
        "title": "CoMoCreatedLine",
        "type": "object"
      },
      "CoNoteCreateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "amount": {
            "description": "票面金额（本位币），最多两位小数",
            "exclusiveMinimum": 0.0,
            "maximum": 1000000000000.0,
            "title": "Amount",
            "type": "number"
          },
          "customer": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "应收票据必填：交票客户编码（票据的 cEndorser，收款单的客户）",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dept": {
            "description": "部门编码（末级）",
            "maxLength": 12,
            "minLength": 1,
            "title": "Dept",
            "type": "string"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；收款单摘要省略为「票据登记」",
            "title": "Digest"
          },
          "drawer": {
            "anyOf": [
              {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "出票人名称；省略为往来单位名称",
            "title": "Drawer"
          },
          "drawer_bank": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "出票人开户银行",
            "title": "Drawer Bank"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "expire_date": {
            "description": "到期日，不早于签发日期",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Expire Date",
            "type": "string"
          },
          "flag": {
            "description": "AR 应收票据、AP 应付票据（第二级写入，默认关闭，打开后只对测试账套开放；应付票据写入只在测试账套上验证过），也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "km": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "收款单（应付票据为付款单）表体科目；省略取基本科目 kzkm",
            "title": "Km"
          },
          "note_km": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据科目（末级）；省略取基本科目 pjkm，应付票据在 pjkm 没有设置时必填",
            "title": "Note Km"
          },
          "note_no": {
            "description": "票据号（cVouchID），不能已存在",
            "maxLength": 60,
            "minLength": 1,
            "title": "Note No",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "person": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码",
            "title": "Person"
          },
          "receipt_date": {
            "description": "收票日期（= 收付款单日期），不晚于登录日期",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Receipt Date",
            "type": "string"
          },
          "receive_account": {
            "anyOf": [
              {
                "maxLength": 50,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "收款人账号",
            "title": "Receive Account"
          },
          "receive_bank": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "收款人开户银行",
            "title": "Receive Bank"
          },
          "receiver": {
            "description": "收款人名称",
            "maxLength": 50,
            "minLength": 1,
            "title": "Receiver",
            "type": "string"
          },
          "settle_code": {
            "description": "结算方式（票据类型），如 301 银行承兑、302 商业承兑",
            "maxLength": 3,
            "minLength": 1,
            "title": "Settle Code",
            "type": "string"
          },
          "sign_date": {
            "description": "签发日期，不晚于登录日期",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Sign Date",
            "type": "string"
          },
          "sub_end": {
            "anyOf": [
              {
                "maximum": 999999999999999.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "子票区间止号，不小于 sub_start；(止号 − 起号 + 1) × 0.01 = amount",
            "title": "Sub End"
          },
          "sub_start": {
            "anyOf": [
              {
                "maximum": 999999999999999.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "分包票据的子票区间起号，与 sub_end 成对；省略为不分包票据",
            "title": "Sub Start"
          },
          "vendor": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付票据必填：收票供应商编码（票据的 cEndorser，付款单的供应商）",
            "title": "Vendor"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "note_no",
          "settle_code",
          "amount",
          "sign_date",
          "receipt_date",
          "expire_date",
          "dept",
          "receiver"
        ],
        "title": "CoNoteCreateIn",
        "type": "object"
      },
      "CoNoteDeleteIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "AR 应收票据、AP 应付票据（第二级写入，默认关闭，打开后只对测试账套开放）",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据主键 AP_Note.Auto_ID；与 note_no 二选一",
            "title": "Id"
          },
          "note_no": {
            "anyOf": [
              {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据号；与 id 二选一",
            "title": "Note No"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag"
        ],
        "title": "CoNoteDeleteIn",
        "type": "object"
      },
      "CoNoteGetIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "code": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据号（cVouchID），1 到 60 个字符；与 id 二选一",
            "title": "Code"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据主键 AP_Note.Auto_ID，1 到 2147483647；与 code 二选一",
            "title": "Id"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "ar_note 应收票据，ap_note 应付票据",
            "enum": [
              "ar_note",
              "ap_note"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type"
        ],
        "title": "CoNoteGetIn",
        "type": "object"
      },
      "CoNoteGetOut": {
        "additionalProperties": true,
        "properties": {
          "head": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "id、code（票据号）、flag、doc_date（签发日期）、receipt_date、expire_date、partner_code（常为空）、dw_name（单位名称）、dep_code、person_code、maker、settle_code、currency、rate、amount、amount_local、remainder、remainder_local、km_code（票据科目）、bank（出票银行）、digest、close_id、opening、sub_package、sub_start、sub_end、created_at、modified_at、ufts。金额和 ufts 是字符串",
            "title": "Head"
          },
          "ok": {
            "description": "是否读到票据",
            "title": "Ok",
            "type": "boolean"
          },
          "subs": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按处理记录主键排序：id、style（9A / 9C / 9D / 9E）、style_name、date、amount、amount_local、interest、expense、discount_rate、bank（结算银行科目或背书对象编码）、km_code、operator、cancel_no、source_type、source_code、gl_ref、sub_start、sub_end",
            "title": "Subs"
          },
          "subs_truncated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理记录超过 500 条时为 true，只给前 500 条",
            "title": "Subs Truncated"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "ar_note 或 ap_note",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoNoteGetOut",
        "type": "object"
      },
      "CoNoteProcIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "amount": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理金额（本位币），最多两位小数；省略时背书取 ap_lines 合计，其余取票据余额",
            "title": "Amount"
          },
          "ap_lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcLineIn"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "背书：要冲的应付单据 1 到 50 项（01 / 02 / P0，写法同 arap/transfer），合计等于背书金额",
            "title": "Ap Lines"
          },
          "bank_code": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "结算银行科目（末级银行科目）：结算、贴现必填",
            "title": "Bank Code"
          },
          "bank_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "银行名称；省略取科目上级的名称",
            "title": "Bank Name"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "expense": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：贴现息、手续费，缺省 0",
            "title": "Expense"
          },
          "flag": {
            "description": "AR 应收票据、AP 应付票据（只收 settle、return，第二级写入，默认关闭，打开后只对测试账套开放），也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "interest": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：票据利息，缺省 0",
            "title": "Interest"
          },
          "note": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "description": "票据号（字符串，最多 120 字）或票据主键 Auto_ID（整数）",
            "title": "Note"
          },
          "op": {
            "description": "settle 托收 / 结算（9A）、discount 贴现（9D）、endorse 背书冲应付（9E）、return 退回（9C，生成应收单；应付票据生成应付单）",
            "enum": [
              "settle",
              "discount",
              "endorse",
              "return"
            ],
            "title": "Op",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "rate": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：贴现率（%），最多六位小数",
            "title": "Rate"
          },
          "sub_end": {
            "anyOf": [
              {
                "maximum": 999999999999999.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "子票区间止号，不小于 sub_start",
            "title": "Sub End"
          },
          "sub_start": {
            "anyOf": [
              {
                "maximum": 999999999999999.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "分包票据的子票区间起号，与 sub_end 成对",
            "title": "Sub Start"
          },
          "vendor": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "背书：被背书的供应商编码，必填",
            "title": "Vendor"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "op",
          "note"
        ],
        "title": "CoNoteProcIn",
        "type": "object"
      },
      "CoNoteProcOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理金额（本位币）",
            "title": "Amount"
          },
          "ap_rows": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ProcRowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "背书：冲掉的应付单据各行（amount、remaining）",
            "title": "Ap Rows"
          },
          "bank_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "结算、贴现：银行科目",
            "title": "Bank Code"
          },
          "bank_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "结算、贴现：银行名称",
            "title": "Bank Name"
          },
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理号（PJJAR… / PJTAR… / PJBAR… / CLAR…，应付票据 PJJAP… / CLAP…），取消、制单要用",
            "title": "Cancel No"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理日期",
            "title": "Date"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "expense": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：贴现息、手续费",
            "title": "Expense"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "interest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：票据利息",
            "title": "Interest"
          },
          "net": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：净额 = 金额 + interest - expense",
            "title": "Net"
          },
          "note": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NoteRefOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理的票据"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "op": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "settle、discount、endorse 或 return",
            "title": "Op"
          },
          "p0_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付票据退回：生成的应付单号（类型 ap_bill）",
            "title": "P0 Code"
          },
          "p0_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "应付票据退回：生成的应付单主键 Ap_Vouch.Auto_ID",
            "title": "P0 Id"
          },
          "r0_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "退回：生成的应收单号（类型 ar_bill）",
            "title": "R0 Code"
          },
          "r0_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "退回：生成的应收单主键 Ap_Vouch.Auto_ID",
            "title": "R0 Id"
          },
          "rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贴现：贴现率（%）",
            "title": "Rate"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理后的票据余额",
            "title": "Remaining"
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理方式：9A 结算、9D 贴现、9E 背书、9C 退回",
            "title": "Style"
          },
          "sub_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "子票区间止号",
            "title": "Sub End"
          },
          "sub_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "子票区间起号；不是分包票据为 null",
            "title": "Sub Start"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "背书：被背书的供应商",
            "title": "Vendor"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoNoteProcOut",
        "type": "object"
      },
      "CoNoteRegOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记：票面金额",
            "title": "Amount"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记（应收票据）：客户编码",
            "title": "Customer"
          },
          "deleted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删除：true",
            "title": "Deleted"
          },
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "note_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据主键 AP_Note.Auto_ID",
            "title": "Note Id"
          },
          "note_km": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记：票据科目",
            "title": "Note Km"
          },
          "note_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据号",
            "title": "Note No"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "receipt_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "收款单号（应付票据为付款单号）",
            "title": "Receipt Code"
          },
          "receipt_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "收款单（应付票据为付款单）主键 Ap_CloseBill.iID；删除时是被删的单据，没有为 null",
            "title": "Receipt Id"
          },
          "receipt_verified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记：收付款单是否已审核（总是 false）",
            "title": "Receipt Verified"
          },
          "settle_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记：结算方式",
            "title": "Settle Code"
          },
          "sub_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记：子票区间止号；不是分包票据为 null",
            "title": "Sub End"
          },
          "sub_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记：子票区间起号；不是分包票据为 null",
            "title": "Sub Start"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记（应付票据）：供应商编码",
            "title": "Vendor"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoNoteRegOut",
        "type": "object"
      },
      "CoOpeningDoc": {
        "properties": {
          "code": {
            "description": "新单据编号（U8 自编）",
            "title": "Code",
            "type": "string"
          },
          "id": {
            "description": "新单据主键",
            "title": "Id",
            "type": "integer"
          },
          "inv": {
            "description": "存货编码",
            "title": "Inv",
            "type": "string"
          },
          "line": {
            "description": "对应请求 lines 的下标，从 0 开始",
            "title": "Line",
            "type": "integer"
          },
          "qty": {
            "description": "数量",
            "title": "Qty",
            "type": "number"
          },
          "wh": {
            "description": "仓库编码",
            "title": "Wh",
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "line",
          "wh",
          "inv",
          "qty"
        ],
        "title": "CoOpeningDoc",
        "type": "object"
      },
      "CoPending": {
        "properties": {
          "activity_id": {
            "description": "节点标识",
            "title": "Activity Id",
            "type": "string"
          },
          "operator": {
            "description": "操作员编码",
            "title": "Operator",
            "type": "string"
          },
          "person": {
            "description": "人员编码",
            "title": "Person",
            "type": "string"
          },
          "task_id": {
            "description": "待办标识",
            "title": "Task Id",
            "type": "string"
          },
          "task_type": {
            "description": "任务类型。1 审批，4 弃审后重审，5 退回后重提",
            "title": "Task Type",
            "type": "integer"
          }
        },
        "required": [
          "task_id",
          "activity_id",
          "person",
          "operator",
          "task_type"
        ],
        "title": "CoPending",
        "type": "object"
      },
      "CoRouteHealth": {
        "properties": {
          "accounts": {
            "description": "这个桥服务的账套号",
            "items": {
              "type": "string"
            },
            "title": "Accounts",
            "type": "array"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "不可用时的错误码（如 unavailable）；可用时省略",
            "title": "Error"
          },
          "ok": {
            "description": "这个桥是否可用",
            "title": "Ok",
            "type": "boolean"
          },
          "replicated_writes": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "这个桥的第二级写入总开关，含义同顶层 replicated_writes",
            "title": "Replicated Writes"
          },
          "route": {
            "description": "路由名：routes[序号]，序号从 0 起，与审计行的 bridge 字段一致",
            "title": "Route",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "桥报告的版本；不可用时省略",
            "title": "Version"
          },
          "write_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoWritePolicyHealth"
              },
              {
                "type": "null"
              }
            ],
            "description": "这个桥的写入策略，形状同顶层 write_policy"
          }
        },
        "required": [
          "route",
          "accounts",
          "ok"
        ],
        "title": "CoRouteHealth",
        "type": "object"
      },
      "CoStateOut": {
        "properties": {
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "description": "是否读到审批状态",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "wf": {
            "$ref": "#/components/schemas/CoWf",
            "description": "审批状态"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code",
          "wf"
        ],
        "title": "CoStateOut",
        "type": "object"
      },
      "CoStockIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next（CurrentStock.AutoID）",
            "title": "After"
          },
          "batch": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "批号",
            "title": "Batch"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "inv": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码",
            "title": "Inv"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 500.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 500，缺省 100",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "wh": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "仓库编码",
            "title": "Wh"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "CoStockIn",
        "type": "object"
      },
      "CoStockOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按 CurrentStock.AutoID 排序：id、wh_code、wh_name、inv_code、inv_name、batch、qty、qty_frozen、qty_pending_in、qty_pending_out、qty_trans_in、qty_trans_out、qty_available、ufts 等。qty_available = 现存量 − 冻结量 − 待出库量 − 调拨待出量 + 待入库量 + 调拨待入量（iQuantity − fStopQuantity − fOutQuantity − fTransOutQuantity + fInQuantity + fTransInQuantity），未按 U8 的可用量控制选项调整",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页省略",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到现存量",
            "title": "Ok",
            "type": "boolean"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "读这一页之前的 MIN_ACTIVE_ROWVERSION()-1。整轮读完后，把第一页的 watermark 作为下一轮的 changed_since",
            "title": "Watermark"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoStockOut",
        "type": "object"
      },
      "CoTaskItem": {
        "properties": {
          "activity_id": {
            "description": "节点标识",
            "title": "Activity Id",
            "type": "string"
          },
          "biz": {
            "description": "U8 业务对象，例如 QM04",
            "title": "Biz",
            "type": "string"
          },
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "created_at": {
            "description": "创建时间（待办到达时间）",
            "title": "Created At",
            "type": "string"
          },
          "from": {
            "description": "上一处理人",
            "title": "From",
            "type": "string"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "piid": {
            "default": "",
            "description": "流程实例标识，同 wf.instance.piid",
            "title": "Piid",
            "type": "string"
          },
          "task_id": {
            "description": "待办标识",
            "title": "Task Id",
            "type": "string"
          },
          "task_type": {
            "description": "任务类型。1 审批，4 弃审后重审，5 退回后重提",
            "title": "Task Type",
            "type": "integer"
          },
          "title": {
            "default": "",
            "description": "待办标题，即 U8 消息中心显示的那一句",
            "title": "Title",
            "type": "string"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "type",
          "biz",
          "id",
          "code",
          "task_type",
          "activity_id",
          "from",
          "created_at"
        ],
        "title": "CoTaskItem",
        "type": "object"
      },
      "CoTasksIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "anyOf": [
              {
                "enum": [
                  "qm_incoming_check",
                  "qm_product_check",
                  "qm_incoming_reject",
                  "qm_product_reject"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "可选。质量单据：来料检验单、产品检验单、来料不良品处理单、产品不良品处理单",
            "title": "Type"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "CoTasksIn",
        "type": "object"
      },
      "CoTasksOut": {
        "properties": {
          "ok": {
            "description": "是否读到待办",
            "title": "Ok",
            "type": "boolean"
          },
          "operator": {
            "description": "操作员编码",
            "title": "Operator",
            "type": "string"
          },
          "other_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务对象无法映射到已知单据类型的待办条数",
            "title": "Other Count"
          },
          "person": {
            "description": "操作员对应的人员编码",
            "title": "Person",
            "type": "string"
          },
          "tasks": {
            "description": "该人员尚未处理的待办",
            "items": {
              "$ref": "#/components/schemas/CoTaskItem"
            },
            "title": "Tasks",
            "type": "array"
          }
        },
        "required": [
          "ok",
          "operator",
          "person",
          "tasks"
        ],
        "title": "CoTasksOut",
        "type": "object"
      },
      "CoUpdateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "head": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "items": {
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "要改的表头，只改列出的字段。\n\n**规则**\n- 值只能是字符串、数字或布尔，不能填主键、单号或审核人\n- 检验单的 items 是检验项目列表\n\n**来料检验单、产品检验单、其他检验单（只收 head、不收 lines）**\n- 可改 dDate、cCheckPersonCode、cChkConclusion、cReasonCode、cDefine1–16、chDefine11–16\n- 可改 fRegQuantity / fConQuantiy / fDisQuantity：三者之和必须等于单据上已有的检验数量\n- 送了其中任一个时，没送的让步、不良按 0，合格按检验数量减二者\n- 只送 fDisQuantity 会把让步数量清零；没送结论时按不良数量重写结论\n- cReasonCode 是让步接收原因：有让步数量时必填；其他检验单没有让步数量时不收\n- cYielderCode：让步接收核准人的人员编码，来料 / 产品检验单有让步数量时必填，单据上已有的算数\n- dYieldDate：核准日期，缺省 dDate 或登录日期\n- items：按 cChkItemCode + cChkGuideCode 覆盖已有检验项目的 cCheckValue、cTargetQJug，不增删行\n- 检验数量、存货、仓库、检验方案不能改\n\n**其他报检单**\n- 只改 dDate、cInspectDepCode、cDefine1–16、chDefine11–16\n\n**质量单据通用**\n- 只改未提交审批、未审核、没有下游的单据（已审核的其他报检单、其他检验单先弃审）\n- 保存由 U8 自行提交，dry_run 只做校验",
            "title": "Head"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  },
                  "type": "object"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "明细变更，0 到 200 行。\n\n**规则**\n- op 为 add、update 或 delete\n- add 不能带 line_id；update 和 delete 要有不重复的 line_id\n- delete 只能有 op 和 line_id；update 至少再改一个字段\n- 生单来的单据不能 add（发货单、来源为库存的销售出库单除外）\n- 生单来的单据不能删光明细，数量只能减少（退货单、采购退货单填正数）\n\n**发货单可以 add**\n- source_line_id 是本单来源销售订单的行 iSOsID（同一张订单、同一客户、未关闭、可发数量够）\n- 必须有大于 0 的 iQuantity 和 cWhCode，另可带 cBatch、cMemo、cFree1–10、cDefine22–37\n- 不能带 line_id；同一订单行只能 add 一次\n\n**物料清单（bom）**\n- 只改未审核的标准 BOM；表头只收 version_desc、eff_date、parent_scrap\n- 明细按 sort_seq 定位（不用 line_id）\n- update 改 base_qty_n、base_qty_d、comp_scrap、wip_type、wh_code、remark、op_seq，不能改 inv_code\n- delete 只带 op 和 sort_seq；add 同新增的行\n\n**生产订单（production_order，id 是 MoId）**\n- 只改全部行未关闭（未审核或已审核；已关闭的先打开）、未提交审批、未报检、没有产成品入库的订单\n- 已审核的照 U8 客户端变更直接改，状态保持已审核\n- 已领料的改后子件需求不能少于已领数量（409）；材料出库单行的子件关联由桥改到 U8 重插后的新子件\n- 表头只收 remark（作为本次没单独给备注的各行备注）\n- 明细 0 到 50 行，op 只能是 update，按 line_id（MoDId）定位\n- 可改 qty、due_date、remark、define22–25、define28–33（文本）；inv_code 只能送当前值\n- remark 和自定义项不能清空\n- start_date 暂不支持修改（U8 重建子件时不重算需求日期）\n- 有产出品子件的行不能改 due_date（桥 409）\n- 子件被材料出库以外的单据或计划引用（含替代料、领料申请、调拨）的订单不能改\n- 改了数量的行，桥按 U8 的算法重算每个子件（固定用量、损耗率、返工订单），其余子件原样重送\n- U8 重插子件后桥写回丢掉的关联列；回读子件数、数量或关联列对不上时 504 outcome_unknown\n\n**退货申请单**\n- 只改已有行（op=update，line_id 是 AutoID）：iQuantity 填正数、cMemo、cReasonCode、cDefine22–37\n- 表头只收 dDate、cMemo、cDefine1–16\n- 只改未审核、没有退货单的申请单",
            "title": "Lines"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "可修改的单据类型。\n\n- 销售订单、采购订单、其他入库单、其他出库单、调拨单、采购入库单（无来源）、请购单\n- 形态转换单、调拨申请单；收款单、付款单、应收单、应付单\n- 生单来的：发货单、退货单、销售发票、销售出库单、产成品入库单、材料出库单\n- 生单来的：采购入库单（参照生成）、到货单、采购退货单、采购发票\n- 生单来的类型不能新增行；发货单、来源为库存的销售出库单除外，可增删行、不能换仓库\n- 物料清单、生产订单、退货申请单\n- 来料检验单、产品检验单、其他检验单、其他报检单",
            "enum": [
              "sale_order",
              "purchase_order",
              "other_in",
              "other_out",
              "transfer",
              "purchase_in",
              "purchase_requisition",
              "dispatch",
              "sale_return",
              "sale_invoice",
              "sale_out",
              "product_in",
              "material_out",
              "arrival",
              "purchase_return",
              "purchase_invoice",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "bom",
              "production_order",
              "shape_change",
              "transfer_request",
              "sale_return_apply",
              "qm_incoming_check",
              "qm_product_check",
              "qm_other_check",
              "qm_other_inspect"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoUpdateIn",
        "type": "object"
      },
      "CoUpdateOut": {
        "description": "修改响应。生产订单另有 allocates、details、changed，其它类型省略。",
        "properties": {
          "allocates": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单修改：保存后全部行的子件总行数。其它类型省略",
            "title": "Allocates"
          },
          "changed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单修改：本次改动的行数（0 表示请求与现值相同，没有调用 U8）。其它类型省略",
            "title": "Changed"
          },
          "code": {
            "description": "单据编号",
            "title": "Code",
            "type": "string"
          },
          "components": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoBomComponent"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单：保存后的每行子件（主键、行号、存货、用量分子分母）。其它类型省略",
            "title": "Components"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoMoCreatedLine"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "生产订单修改：每行的主键、行号、存货、数量、状态和子件行数。其它类型省略",
            "title": "Details"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "lines": {
            "description": "保存后的明细行数",
            "title": "Lines",
            "type": "integer"
          },
          "ok": {
            "description": "是否已保存",
            "title": "Ok",
            "type": "boolean"
          },
          "state": {
            "$ref": "#/components/schemas/CoDocState",
            "description": "审核状态"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单：版本号。其它类型省略",
            "title": "Version"
          }
        },
        "required": [
          "ok",
          "type",
          "id",
          "code",
          "state",
          "lines"
        ],
        "title": "CoUpdateOut",
        "type": "object"
      },
      "CoVerifyIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "action": "verify",
            "id": 1,
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "verify 审核，unverify 弃审",
            "enum": [
              "verify",
              "unverify"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "id": {
            "description": "单据主键，1 到 2147483647。销售订单是 SO_SOMain.ID，发货单是 DispatchList.DLID",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "id",
          "action"
        ],
        "title": "CoVerifyIn",
        "type": "object"
      },
      "CoVerifyOut": {
        "properties": {
          "acc": {
            "description": "账套号",
            "examples": [
              "801"
            ],
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "verify 审核，unverify 弃审",
            "enum": [
              "verify",
              "unverify"
            ],
            "title": "Action",
            "type": "string"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ok": {
            "description": "是否已完成审核或弃审",
            "title": "Ok",
            "type": "boolean"
          },
          "verified_at": {
            "description": "审核时间",
            "title": "Verified At",
            "type": "string"
          },
          "verified_by": {
            "description": "审核人",
            "title": "Verified By",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "acc",
          "id",
          "action",
          "verified_by",
          "verified_at"
        ],
        "title": "CoVerifyOut",
        "type": "object"
      },
      "CoVerifyState": {
        "additionalProperties": true,
        "properties": {
          "verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已审核。生产订单为全部明细都已审核",
            "title": "Verified"
          }
        },
        "title": "CoVerifyState",
        "type": "object"
      },
      "CoVoucherListIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next（最后一个主键），按主键续读",
            "title": "After"
          },
          "changed_since": {
            "anyOf": [
              {
                "description": "rowversion 的十进制字符串",
                "pattern": "^\\d{1,19}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只返回表头或明细 ufts 大于该值的单据。用上一轮第一页的 watermark",
            "title": "Changed Since"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "filter": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoListFilter"
              },
              {
                "type": "null"
              }
            ],
            "description": "过滤条件，全部可省略"
          },
          "keys_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时每行只返回 id、code 和 ufts，便于比对删除",
            "title": "Keys Only"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 500.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 500，缺省 100",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "单据类型，与 /v1/co/vouchers/load 相同。总账凭证用 /v1/co/gl/vouchers/list。另收 ar_note / ap_note（应收 / 应付票据，只读，单张用 /v1/co/notes/get）",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_invoice",
              "purchase_order",
              "arrival",
              "purchase_invoice",
              "purchase_in",
              "other_in",
              "other_out",
              "product_in",
              "material_out",
              "sale_out",
              "transfer",
              "production_order",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_check",
              "stock_opening",
              "qm_other_inspect",
              "qm_other_check",
              "purchase_settle",
              "position_adjust",
              "ia_adjust",
              "inventory_price_adjust",
              "sale_return_apply",
              "ar_note",
              "ap_note"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type"
        ],
        "title": "CoVoucherListIn",
        "type": "object"
      },
      "CoVoucherListOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按主键排序的单据表头：id、code、doc_date、往来单位、部门、业务员、maker、verifier、verified_at、verified、closed、red、ufts 等。检验单和不良品处理单另有 wf、wf_state（iVerifyStateNew：0 未提交，1 审批中，2 通过，-1 不通过）和 current_auditor（当前审核人姓名）；报检单没有这三列，另有 source、source_code、source_id、inspect_dep_code 等。票据（ar_note / ap_note）另有 settle_code、amount、remainder、close_id、opening、expire_date、dw_name、currency，closed 表示余额为 0。采购结算单（purchase_settle）verified 恒为 false，另有 settle_type、bus_type、pt_code、opening、memo、line_count、accounted_lines、invoice_lines、receipt_count、first_invoice_code、first_in_code、quantity、amount。出入库调整单（ia_adjust）verified 表示表体每行都已记账，另有 vouch_type（20 入库调整、21 出库调整等）、rd_flag、rd_code、auto、bus_type、unit_code、vendor_code、handler、memo、line_count、posted_lines、amount、created_at、modified_at；存货调价单（inventory_price_adjust）另有 memo。退货申请单（sale_return_apply）另有 sale_type、bus_type、wf、verify_state、currency、memo、line_count、quantity、amount、created_at、modified_at（数量、金额为负数）。keys_only 时只有 id、code、ufts。ufts 和金额是字符串",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页省略",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到列表",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型",
            "title": "Type"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "读这一页之前的 MIN_ACTIVE_ROWVERSION()-1。整轮读完后，把第一页的 watermark 作为下一轮的 changed_since",
            "title": "Watermark"
          }
        },
        "required": [
          "ok"
        ],
        "title": "CoVoucherListOut",
        "type": "object"
      },
      "CoVoucherVerifyIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "verify 审核，unverify 弃审。\n\n- 采购发票、销售发票另有 arap_verify：应付款管理 / 应收款管理的审核\n- arap_verify 写 cPBVVerifier / cVerifier 和应付 / 应收明细；arap_unverify 取消该审核\n- 其余类型送这两个值返回 400",
            "enum": [
              "verify",
              "unverify",
              "arap_verify",
              "arap_unverify"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "可直接审核的单据类型。\n\n- 供销：销售订单、发货单、销售发票、采购订单、到货单\n- 出入库：采购入库、其他入库、其他出库、产成品入库、材料出库、销售出库、调拨单\n- 生产订单；收款单、付款单、应收单、应付单、供应商退款（ap_refund）、客户退款（ar_refund）\n\n**规则**\n- 采购发票的 verify 是采购复核（取消复核）\n- 应付款管理的审核用 action=arap_verify / arap_unverify（销售发票同理，应收审核）\n- 采购退货单（红字到货单）同到货单；退货单（红字发货单）同发货单；请购单同采购订单\n- 物料清单（bom）：审核只收未审核的版本，弃审只收已审核的版本\n- 形态转换单审核时生成其他出入库单（见 generated）；调拨申请单审核不生单\n- 不良品处理单未受审批流控制时可直接审核、弃审；受控时返回 409，请用 workflow/*\n- 期初结存单（stock_opening）只有审核、弃审（第二级写入，默认关闭，打开后只限测试账套），没有记账\n- 期初结存单审核日期写成单据日期；存货核算期初记账后不能弃审\n- 货位调整单（position_adjust）审核时 U8 写货位台账（每行一出一入），弃审退回\n- 货位调整单审核、弃审的响应另有 ledger_rows、bin_moves\n- 其他检验单（qm_other_check）不受审批流控制，可直接审核、弃审（弃审要求没有入库、不良品处理）\n- 其他报检单（qm_other_inspect）可审核、弃审：新增后桥按选项补审核，没成功时用它补审；弃审要求还没有其他检验单\n- 退货申请单（sale_return_apply）可审核、弃审（弃审要求还没有退货单参照它）\n\n**限制**\n- 检验单不能直接审核，请用 workflow/*\n- 来料报检单不支持单独审核、弃审（保存时由 U8 按选项自动审核；删除时桥会先弃审）\n- 产品报检单（qm_product_inspect）只支持弃审（action=unverify，要求还没有检验单），不能审核、不能修改\n- 盘点单暂不支持审核（请到 U8 客户端审核）",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_invoice",
              "purchase_order",
              "arrival",
              "purchase_invoice",
              "purchase_in",
              "other_in",
              "other_out",
              "product_in",
              "material_out",
              "sale_out",
              "transfer",
              "production_order",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_opening",
              "qm_incoming_reject",
              "qm_product_reject",
              "position_adjust",
              "qm_other_inspect",
              "qm_other_check",
              "qm_product_inspect",
              "sale_return_apply"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id",
          "action"
        ],
        "title": "CoVoucherVerifyIn",
        "type": "object"
      },
      "CoVoucherVerifyOut": {
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号。收付款单、应收应付单和生产订单可能不返回",
            "title": "Acc"
          },
          "action": {
            "description": "verify 审核，unverify 弃审。\n\n- 采购发票、销售发票另有 arap_verify：应付款管理 / 应收款管理的审核\n- arap_verify 写 cPBVVerifier / cVerifier 和应付 / 应收明细；arap_unverify 取消该审核\n- 其余类型送这两个值返回 400",
            "enum": [
              "verify",
              "unverify",
              "arap_verify",
              "arap_unverify"
            ],
            "title": "Action",
            "type": "string"
          },
          "ar_verifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "销售发票的应收审核人。没有则省略",
            "title": "Ar Verifier"
          },
          "bin_moves": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "货位调整单：涉及的每个货位结存（wh、pos、inv、batch）审核或弃审前后的数量 before、after。其它类型省略",
            "title": "Bin Moves"
          },
          "generated": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CoGenerated"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "调拨单、形态转换单、盘点单审核时生成的其他出库单和其他入库单。没有则省略",
            "title": "Generated"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "ledger_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "货位调整单：提交前核对过的本单货位台账行数（审核后是行数的 2 倍，弃审后 0）。其它类型省略",
            "title": "Ledger Rows"
          },
          "ok": {
            "description": "是否已完成审核或弃审",
            "title": "Ok",
            "type": "boolean"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoVerifyState"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核后重新读到的状态。收付款单、应收应付单和生产订单返回；采购发票、销售发票的 arap_verify / arap_unverify 返回 arap_verified、arap_verifier、arap_verified_at、gl_voucher；不良品处理单（qm_incoming_reject、qm_product_reject）可能返回，审核人、审核时间另在顶层 verified_by、verified_at；其它类型省略"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核时间。没有则省略",
            "title": "Verified At"
          },
          "verified_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核人。没有则省略",
            "title": "Verified By"
          }
        },
        "required": [
          "ok",
          "id",
          "action",
          "type"
        ],
        "title": "CoVoucherVerifyOut",
        "type": "object"
      },
      "CoWf": {
        "properties": {
          "controlled": {
            "description": "是否受审批流控制",
            "title": "Controlled",
            "type": "boolean"
          },
          "current_auditor": {
            "default": "",
            "description": "当前审核人姓名",
            "title": "Current Auditor",
            "type": "string"
          },
          "instance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoInstance"
              },
              {
                "type": "null"
              }
            ],
            "description": "流程实例；未提交或已撤销时为空"
          },
          "pending": {
            "description": "待办任务",
            "items": {
              "$ref": "#/components/schemas/CoPending"
            },
            "title": "Pending",
            "type": "array"
          },
          "return_count": {
            "default": 0,
            "description": "退回次数",
            "title": "Return Count",
            "type": "integer"
          },
          "status": {
            "description": "审批状态：not_submitted 未提交，in_approval 审批中，approved 已通过，not_approved 不通过，returned 已退回，not_controlled 未启用审批流",
            "title": "Status",
            "type": "string"
          },
          "verified_at": {
            "default": "",
            "description": "终审日期",
            "title": "Verified At",
            "type": "string"
          },
          "verifier": {
            "default": "",
            "description": "终审人",
            "title": "Verifier",
            "type": "string"
          },
          "verify_state": {
            "description": "表头 IVERIFYSTATE",
            "title": "Verify State",
            "type": "integer"
          },
          "verify_state_new": {
            "description": "表头 iVerifyStateNew。0 未提交，1 审批中，2 已通过，-1 不通过",
            "title": "Verify State New",
            "type": "integer"
          }
        },
        "required": [
          "controlled",
          "status",
          "verify_state",
          "verify_state_new"
        ],
        "title": "CoWf",
        "type": "object"
      },
      "CoWfActIn": {
        "additionalProperties": false,
        "description": "提交、撤销、重新提交等写操作：多一个 dry_run（读状态、历史用 CoWfIn，不收）。",
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "质量单据：来料检验单、产品检验单、来料不良品处理单、产品不良品处理单",
            "enum": [
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoWfActIn",
        "type": "object"
      },
      "CoWfIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "质量单据：来料检验单、产品检验单、来料不良品处理单、产品不良品处理单",
            "enum": [
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoWfIn",
        "type": "object"
      },
      "CoWfMustIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "opinion": {
            "description": "审批意见，必填，最长 500 字",
            "maxLength": 500,
            "minLength": 1,
            "title": "Opinion",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "质量单据：来料检验单、产品检验单、来料不良品处理单、产品不良品处理单",
            "enum": [
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id",
          "opinion"
        ],
        "title": "CoWfMustIn",
        "type": "object"
      },
      "CoWfNoteIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "id": {
            "description": "单据主键，1 到 2147483647",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "opinion": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "审批意见，可省略，最长 500 字",
            "title": "Opinion"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "质量单据：来料检验单、产品检验单、来料不良品处理单、产品不良品处理单",
            "enum": [
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "CoWfNoteIn",
        "type": "object"
      },
      "CoWritePolicyFreeze": {
        "properties": {
          "accounts": {
            "description": "冻结的账套号",
            "items": {
              "type": "string"
            },
            "title": "Accounts",
            "type": "array"
          },
          "global": {
            "default": false,
            "description": "是否冻结全部账套",
            "title": "Global",
            "type": "boolean"
          }
        },
        "title": "CoWritePolicyFreeze",
        "type": "object"
      },
      "CoWritePolicyHealth": {
        "properties": {
          "freeze": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CoWritePolicyFreeze"
              },
              {
                "type": "null"
              }
            ],
            "description": "冻结情况"
          },
          "loaded_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "当前有效策略的加载时间（UTC，ISO 8601）",
            "title": "Loaded At"
          },
          "state": {
            "description": "off、ok、invalid、missing；读不到时 unknown",
            "title": "State",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "当前有效策略的 version；没有有效策略时为 null",
            "title": "Version"
          },
          "window_open": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "此刻是否在允许写入的时段内（含 denyDates）",
            "title": "Window Open"
          }
        },
        "required": [
          "state"
        ],
        "title": "CoWritePolicyHealth",
        "type": "object"
      },
      "CoWriteoffAutoIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据日期上限，缺省登录日期",
            "title": "Date To"
          },
          "dry_run": {
            "default": false,
            "description": "true 只返回计划，不写",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "include_prepay": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 时预收 / 预付行（bPrePay=1）也参加，缺省不参加",
            "title": "Include Prepay"
          },
          "max_amount": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次核销合计上限（原币累计），最多两位小数",
            "title": "Max Amount"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "description": "客户（AR）或供应商（AP）编码 cDwCode",
            "maxLength": 20,
            "minLength": 1,
            "title": "Partner",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutoReceiptIn"
              },
              {
                "type": "null"
              }
            ],
            "description": "只用这张收付款单"
          },
          "targets": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AutoTargetIn"
                },
                "maxItems": 200,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "只核销这些单据，1 到 200 项",
            "title": "Targets"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "partner"
        ],
        "title": "CoWriteoffAutoIn",
        "type": "object"
      },
      "CoWriteoffAutoOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "batches": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AutoBatchOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "已核销的批（执行时）",
            "title": "Batches"
          },
          "dry_run": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "试算时为 true",
            "title": "Dry Run"
          },
          "flag": {
            "description": "AR 或 AP",
            "title": "Flag",
            "type": "string"
          },
          "ok": {
            "description": "是否成功（计划为空也是 true）",
            "title": "Ok",
            "type": "boolean"
          },
          "partner": {
            "description": "往来单位编码",
            "title": "Partner",
            "type": "string"
          },
          "plan": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AutoPlanOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "计划（dry_run 时）",
            "title": "Plan"
          },
          "total": {
            "description": "核销（或计划）合计",
            "title": "Total",
            "type": "number"
          }
        },
        "required": [
          "ok",
          "flag",
          "partner",
          "total"
        ],
        "title": "CoWriteoffAutoOut",
        "type": "object"
      },
      "CoWriteoffCancelIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "cancel_no": {
            "description": "核销号（HXAR… / HXAP…），前缀须与 flag 一致",
            "pattern": "^HX(AR|AP)[0-9]{1,20}$",
            "title": "Cancel No",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag",
          "cancel_no"
        ],
        "title": "CoWriteoffCancelIn",
        "type": "object"
      },
      "CoWriteoffCancelOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "cancel_no": {
            "description": "已取消的核销号",
            "title": "Cancel No",
            "type": "string"
          },
          "flag": {
            "description": "AR 或 AP",
            "title": "Flag",
            "type": "string"
          },
          "items": {
            "description": "被核销单据的行：amount 是加回的金额，remaining 是取消后的未核销余额",
            "items": {
              "$ref": "#/components/schemas/WriteoffItemOut"
            },
            "title": "Items",
            "type": "array"
          },
          "ok": {
            "description": "是否已取消",
            "title": "Ok",
            "type": "boolean"
          },
          "receipt": {
            "$ref": "#/components/schemas/CancelReceiptOut"
          }
        },
        "required": [
          "ok",
          "cancel_no",
          "flag",
          "receipt",
          "items"
        ],
        "title": "CoWriteoffCancelOut",
        "type": "object"
      },
      "CoWriteoffIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "items": {
            "description": "被核销的单据行，1 到 50 项",
            "items": {
              "$ref": "#/components/schemas/WriteoffItemIn"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Items",
            "type": "array"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "receipt": {
            "$ref": "#/components/schemas/WriteoffReceiptIn",
            "description": "收付款单及其一行"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "receipt",
          "items"
        ],
        "title": "CoWriteoffIn",
        "type": "object"
      },
      "CoWriteoffOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "cancel_no": {
            "description": "U8 核销号（Ar_Detail / Ap_Detail.cCancelNo，HXAR… / HXAP…）",
            "title": "Cancel No",
            "type": "string"
          },
          "date": {
            "description": "核销日期（登录日期）",
            "title": "Date",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/WriteoffItemOut"
            },
            "title": "Items",
            "type": "array"
          },
          "ok": {
            "description": "是否已核销",
            "title": "Ok",
            "type": "boolean"
          },
          "receipt": {
            "$ref": "#/components/schemas/WriteoffReceiptOut"
          }
        },
        "required": [
          "ok",
          "cancel_no",
          "date",
          "receipt",
          "items"
        ],
        "title": "CoWriteoffOut",
        "type": "object"
      },
      "DryRunDoc": {
        "additionalProperties": true,
        "description": "预演时事务里的一张单据映像（回滚前在同一连接上读出）。",
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "单据号",
            "title": "Code"
          },
          "head": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "表头：列名小写，空值省略；deleted 时省略",
            "title": "Head"
          },
          "id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "单据主键",
            "title": "Id"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "明细，最多 200 行；deleted 时省略",
            "title": "Lines"
          },
          "lines_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "明细的实际行数",
            "title": "Lines Total"
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "exists（新增、修改、审核等之后仍在）或 deleted（事务里已删除）",
            "title": "State"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "单据类型",
            "title": "Type"
          }
        },
        "title": "DryRunDoc",
        "type": "object"
      },
      "DryRunOut": {
        "additionalProperties": true,
        "description": "预演成功的响应（HTTP 200）。什么都没有写入。",
        "properties": {
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "操作",
            "title": "Action"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "各操作自己的补充信息",
            "title": "Detail"
          },
          "docs": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DryRunDoc"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "受影响的单据映像，最多 10 张",
            "title": "Docs"
          },
          "dry_run": {
            "const": true,
            "description": "总是 true，表示这是预演结果",
            "title": "Dry Run",
            "type": "boolean"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "中文说明",
            "title": "Message"
          },
          "mode": {
            "description": "rollback：真实执行后回滚（U8 自己的校验、编号、金额都跑过）；validate：只做了 U8 组件之前的检查",
            "title": "Mode",
            "type": "string"
          },
          "ok": {
            "description": "总是 true",
            "title": "Ok",
            "type": "boolean"
          },
          "route": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "桥路由，如 vouchers/create",
            "title": "Route"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "单据类型",
            "title": "Type"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "提醒码：number_may_skip（预演占用的单号 U8 可能不退回）、validate_only（U8 保存时的检查没有跑）、locks_held（预演期间持有与正式写入相同的锁）",
            "title": "Warnings"
          }
        },
        "required": [
          "ok",
          "dry_run",
          "mode"
        ],
        "title": "DryRunOut",
        "type": "object"
      },
      "ErrorBody": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail",
            "description": "错误"
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorBody",
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "错误码",
            "title": "Code",
            "type": "string"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "桥给的结构化补充，只用于 4xx（401 除外），没有时省略。例如存货核算记账 409 时的 uncosted（[{wh, inv, batch}]，最多 20 项）和 uncosted_total；写入策略 403 write_not_allowed 的 type、op，400 write_limit 的 max、actual",
            "title": "Detail"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "出错的请求字段路径，点分、下标从 0 起，如 lines.0.cinvcode。只用于 400，未知时省略",
            "title": "Field"
          },
          "hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "简短的中文修正提示。401、500 和没有提示时省略",
            "title": "Hint"
          },
          "message": {
            "description": "中文说明",
            "title": "Message",
            "type": "string"
          },
          "retryable": {
            "description": "能否原样稍后重试（busy、busy_timeout、stopping、u8_license_full、ia_timeout、rate_limited、unavailable、store_unavailable，以及写入策略的 write_policy_unavailable、write_frozen、write_window、write_quota、u8_license_hold 为 true；outcome_unknown、write_not_allowed、operator_not_allowed、write_limit 等其余为 false）",
            "title": "Retryable",
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "title": "ErrorDetail",
        "type": "object"
      },
      "ExGainBatchOut": {
        "additionalProperties": true,
        "properties": {
          "cancel_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理号（SYRAR… / SYPAP…）",
            "title": "Cancel No"
          },
          "diff": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本币差额（借正贷负）",
            "title": "Diff"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Id"
          },
          "lines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "该处理号的明细行数",
            "title": "Lines"
          },
          "partner": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "往来单位",
            "title": "Partner"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "U8 单据类型代码",
            "title": "Type"
          }
        },
        "title": "ExGainBatchOut",
        "type": "object"
      },
      "GetManyIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "archive": {
            "description": "档案名。\n\n- `customer` 客户、`vendor` 供应商、`inventory` 存货、`department` 部门、`person` 人员、`warehouse` 仓库\n- `customer_class` 客户分类、`vendor_class` 供应商分类、`inventory_class` 存货分类、`reason` 原因码\n\n**按表列名读取**\n- 只读（不能新增、修改、删除）：account、trade_class、customer_address、operator、role\n- `account` 科目：按登录日期的年份\n- `unit` 计量单位、`unit_group` 计量单位组、`settle_style` 结算方式、`voucher_sign` 凭证类别\n- `currency` 币种：编码是币种名称\n- `bank` 本单位开户银行、`rd_style` 收发类别、`purchase_type` 采购类型、`sale_type` 销售类型\n- `district_class` 地区分类、`trade_class` 行业分类、`aa_bank` 银行档案（所属银行）\n- `project` 项目：编码 `<项目大类>:<项目编码>`\n- `position` 货位：class_code 是仓库\n- `customer_address` 客户收货地址：编码 `<客户编码>:<地址编码>`\n- `user_define` 自定义项档案：编码 `<自定义项号>:<档案值>`\n- `customer_inventory` 客户存货对照：编码 `<客户编码>:<存货编码>`\n- `exchange_rate` 汇率：编码 `<币种>:<年度>:<期间>[:<日>]`\n- `exchange_rate` 的 get 另收 `<币种>:<yyyy-mm-dd>`，取该日期单据会用的汇率\n- `fa_card` 固定资产卡片：编码是卡片编号，按登录日期所在月的月末取卡片当时的版本和累计折旧\n- `fa_card` 列表缺省不含已减少的卡片，可按 type_code、dept_code 过滤\n- `equipment` 设备台账：编码是设备编码，支持 changed_since\n- `operator` U8 操作员：编码是操作员编码；返回姓名、部门、停用标志、所属角色 roles、关联人员 person_code，不含口令\n- `role` 角色：返回成员 members\n- `customer_bank`、`vendor_bank` 客户、供应商银行账户：编码 `<客户或供应商编码>:<银行账号>`，class_code 是客户或供应商编码\n- `customer_contact`、`vendor_contact` 客户、供应商联系人：编码 `<客户或供应商编码>:<联系人编码>`\n\n**权限**\n- operator、role 只列在本账套有授权的，只有账套主管能读\n- aa_bank 银行档案也只有账套主管能读",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "account",
              "unit",
              "unit_group",
              "settle_style",
              "voucher_sign",
              "currency",
              "bank",
              "project",
              "position",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "trade_class",
              "aa_bank",
              "customer_address",
              "user_define",
              "customer_inventory",
              "exchange_rate",
              "fa_card",
              "operator",
              "role",
              "customer_bank",
              "vendor_bank",
              "customer_contact",
              "vendor_contact",
              "reason",
              "equipment"
            ],
            "title": "Archive",
            "type": "string"
          },
          "codes": {
            "description": "档案编码，1 到 20 个，不区分大小写不能重复，写法同 archives/get 的 code",
            "items": {
              "description": "档案编码，首尾不能有空白，不含控制字符。\n\n**用法**\n- project：`<项目大类>:<项目编码>`，大类 1 到 2 位字母数字，项目编码 1 到 60 个字符\n- customer_address：`<客户编码>:<地址编码>`，两段最长 20、30\n- user_define：`<自定义项号>:<档案值>`，两段最长 10、400\n- customer_inventory：`<客户编码>:<存货编码>`，两段最长 20、60\n- exchange_rate：`<币种>:<年度>:<期间>[:<日>]`；get 也可以写 `<币种>:<yyyy-mm-dd>`\n\n**限制**\n- 一般最长 30 个字符\n- account 40；unit、unit_group 35；position、operator、role 20\n- rd_style、aa_bank 5；purchase_type、sale_type 2；district_class、trade_class 12\n- settle_style 3，currency 8，reason 10",
              "maxLength": 411,
              "pattern": "^[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF](?:[^\\x00-\\x1f\\x7f\\uFFFE\\uFFFF]*[^\\s\\x00-\\x1f\\x7f\\uFFFE\\uFFFF])?$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Codes",
            "type": "array"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "archive",
          "codes"
        ],
        "title": "GetManyIn",
        "type": "object"
      },
      "GetManyOut": {
        "additionalProperties": true,
        "properties": {
          "archive": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案",
            "title": "Archive"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按请求顺序：archives/get 的响应体，或 {code, error: {code, message}}",
            "title": "Items"
          },
          "ok": {
            "description": "请求是否完成（单条失败不影响）",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GetManyOut",
        "type": "object"
      },
      "GlAttachOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按上传顺序：id（附件行号）、name（原文件名）、file_id（文件服务器上的文件标识）、submitted_at（yyyy-MM-dd HH:mm:ss）、source（来源模块）。没有电子附件时为空数组",
            "title": "Items"
          },
          "ok": {
            "description": "是否读到凭证",
            "title": "Ok",
            "type": "boolean"
          },
          "truncated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "超过 500 个附件时为 true，只列前 500 个",
            "title": "Truncated"
          },
          "voucher": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "period、sign、no，以及 attachments（凭证上的附单据数，只是张数，不是文件）",
            "title": "Voucher"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlAttachOut",
        "type": "object"
      },
      "GlCashFlowIn": {
        "additionalProperties": false,
        "properties": {
          "credit": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": -1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "流出金额。与 debit 二选一，不能为 0",
            "title": "Credit"
          },
          "debit": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": -1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "流入金额。与 credit 二选一，不能为 0",
            "title": "Debit"
          },
          "item": {
            "description": "现金流量项目编码，例如 07",
            "maxLength": 20,
            "minLength": 1,
            "title": "Item",
            "type": "string"
          }
        },
        "required": [
          "item"
        ],
        "title": "GlCashFlowIn",
        "type": "object"
      },
      "GlCashFlowOut": {
        "additionalProperties": true,
        "properties": {
          "credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "流出金额",
            "title": "Credit"
          },
          "debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "流入金额",
            "title": "Debit"
          },
          "item": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "现金流量项目编码",
            "title": "Item"
          }
        },
        "title": "GlCashFlowOut",
        "type": "object"
      },
      "GlCreateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "head": {
            "$ref": "#/components/schemas/GlHeadIn",
            "description": "表头"
          },
          "lines": {
            "description": "分录，2 到 200 行。借方合计必须等于贷方合计且大于 0",
            "items": {
              "$ref": "#/components/schemas/GlLineIn"
            },
            "maxItems": 200,
            "minItems": 2,
            "title": "Lines",
            "type": "array"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "head",
          "lines"
        ],
        "title": "GlCreateIn",
        "type": "object"
      },
      "GlDigestIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[0-9]{1,10}\\.[0-9]{1,10}\\.[0-9]{1,10}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "closed_periods": {
            "anyOf": [
              {
                "maximum": 12.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "periods 省略时另扫最近几个已结账期间，0 到 12，缺省 1。不能与 periods 同时给",
            "title": "Closed Periods"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 9999.0,
                "minimum": 1900.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度。缺省为登录日期（date）的年份；year 是账套库年度，不参与判断",
            "title": "Fiscal Year"
          },
          "keys_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时每张凭证只返回 period、sign、no、fingerprint",
            "title": "Keys Only"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 500.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 500，缺省 200",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "periods": {
            "anyOf": [
              {
                "items": {
                  "maximum": 12.0,
                  "minimum": 1.0,
                  "type": "integer"
                },
                "maxItems": 12,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "要扫描的期间，1 到 12 个，不能重复。省略时由桥按结账状态取",
            "title": "Periods"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "GlDigestIn",
        "type": "object"
      },
      "GlDigestItem": {
        "additionalProperties": true,
        "properties": {
          "bookkeeper": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "记账人",
            "title": "Bookkeeper"
          },
          "cashier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "出纳签字人",
            "title": "Cashier"
          },
          "checker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核人",
            "title": "Checker"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期",
            "title": "Date"
          },
          "debit_total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方合计",
            "title": "Debit Total"
          },
          "fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证指纹，小写十六进制 SHA-256",
            "title": "Fingerprint"
          },
          "lines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分录行数",
            "title": "Lines"
          },
          "maker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单人",
            "title": "Maker"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "posted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已记账",
            "title": "Posted"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          },
          "void": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已作废",
            "title": "Void"
          }
        },
        "title": "GlDigestItem",
        "type": "object"
      },
      "GlDigestOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "ident": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "GL_accvouch 的 IDENT_CURRENT，十进制字符串；变小说明账套被还原",
            "title": "Ident"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlDigestItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按期间、类别、凭证号排序的凭证",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页游标，原样放进 after。最后一页为空",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到摘要",
            "title": "Ok",
            "type": "boolean"
          },
          "periods": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "实际扫描的期间，升序。翻页时原样放进请求的 periods",
            "title": "Periods"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "所扫期间的 MAX(i_id)，十进制字符串，在读这一页之前取",
            "title": "Watermark"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlDigestOut",
        "type": "object"
      },
      "GlHeadIn": {
        "additionalProperties": false,
        "properties": {
          "attachments": {
            "anyOf": [
              {
                "maximum": 32767.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "附单据数",
            "title": "Attachments"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期，yyyy-MM-dd。缺省为登录日期；期间取该日期的月份，年份必须等于登录日期的年份",
            "title": "Date"
          },
          "sign": {
            "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
            "pattern": "^\\S{1,2}$",
            "title": "Sign",
            "type": "string"
          }
        },
        "required": [
          "sign"
        ],
        "title": "GlHeadIn",
        "type": "object"
      },
      "GlKeyActIn": {
        "additionalProperties": false,
        "description": "作废、审核、签字、删除等写操作：多一个 dry_run（读取、附件列表用 GlKeyIn，不收）。",
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "no": {
            "description": "凭证号（ino_id），1 到 32767",
            "maximum": 32767.0,
            "minimum": 1.0,
            "title": "No",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "sign": {
            "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
            "pattern": "^\\S{1,2}$",
            "title": "Sign",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period",
          "sign",
          "no"
        ],
        "title": "GlKeyActIn",
        "type": "object"
      },
      "GlKeyIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "no": {
            "description": "凭证号（ino_id），1 到 32767",
            "maximum": 32767.0,
            "minimum": 1.0,
            "title": "No",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "sign": {
            "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
            "pattern": "^\\S{1,2}$",
            "title": "Sign",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period",
          "sign",
          "no"
        ],
        "title": "GlKeyIn",
        "type": "object"
      },
      "GlKeyOut": {
        "additionalProperties": true,
        "properties": {
          "deleted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删除成功时为 true",
            "title": "Deleted"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "操作后重新读到的状态（审核、出纳签字、作废等）。新增、修改和删除不返回",
            "title": "State"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlKeyOut",
        "type": "object"
      },
      "GlLineIn": {
        "additionalProperties": false,
        "properties": {
          "account": {
            "description": "科目编码，必须是末级科目",
            "maxLength": 40,
            "minLength": 1,
            "title": "Account",
            "type": "string"
          },
          "cash_flow": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlCashFlowIn"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "现金流量。现金或银行科目必须给出，1 到 50 项",
            "title": "Cash Flow"
          },
          "credit": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": -1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "贷方金额（本币）。与 debit 二选一，不能为 0；红字用负数",
            "title": "Credit"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 8,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "外币名称。省略为本币",
            "title": "Currency"
          },
          "customer": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码（辅助核算）",
            "title": "Customer"
          },
          "debit": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": -1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方金额（本币）。与 credit 二选一，不能为 0；红字用负数",
            "title": "Debit"
          },
          "dept": {
            "anyOf": [
              {
                "maxLength": 12,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码（辅助核算）",
            "title": "Dept"
          },
          "digest": {
            "description": "摘要，最长 120 字",
            "maxLength": 120,
            "minLength": 1,
            "title": "Digest",
            "type": "string"
          },
          "doc_date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据日期，yyyy-MM-dd",
            "title": "Doc Date"
          },
          "doc_no": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "票号",
            "title": "Doc No"
          },
          "item": {
            "anyOf": [
              {
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目编码",
            "title": "Item"
          },
          "item_class": {
            "anyOf": [
              {
                "maxLength": 2,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目大类编码",
            "title": "Item Class"
          },
          "person": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "人员编码（辅助核算）",
            "title": "Person"
          },
          "qty": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": -1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "数量，记在金额所在的一方",
            "title": "Qty"
          },
          "rate": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "汇率",
            "title": "Rate"
          },
          "settle": {
            "anyOf": [
              {
                "maxLength": 3,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "结算方式编码",
            "title": "Settle"
          },
          "supplier": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商编码（辅助核算）",
            "title": "Supplier"
          }
        },
        "required": [
          "account",
          "digest"
        ],
        "title": "GlLineIn",
        "type": "object"
      },
      "GlLineOut": {
        "additionalProperties": true,
        "properties": {
          "account": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目编码",
            "title": "Account"
          },
          "account_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目名称",
            "title": "Account Name"
          },
          "cash_flow": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlCashFlowOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "现金流量",
            "title": "Cash Flow"
          },
          "credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贷方金额（本币）",
            "title": "Credit"
          },
          "credit_fc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贷方外币金额",
            "title": "Credit Fc"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外币名称",
            "title": "Currency"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码",
            "title": "Customer"
          },
          "debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方金额（本币）",
            "title": "Debit"
          },
          "debit_fc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方外币金额",
            "title": "Debit Fc"
          },
          "dept": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码",
            "title": "Dept"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "doc_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据日期",
            "title": "Doc Date"
          },
          "doc_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票号",
            "title": "Doc No"
          },
          "entry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分录行号",
            "title": "Entry"
          },
          "item": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目编码",
            "title": "Item"
          },
          "item_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目大类",
            "title": "Item Class"
          },
          "person": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "人员编码",
            "title": "Person"
          },
          "qty_credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贷方数量",
            "title": "Qty Credit"
          },
          "qty_debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方数量",
            "title": "Qty Debit"
          },
          "rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "汇率",
            "title": "Rate"
          },
          "settle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "结算方式",
            "title": "Settle"
          },
          "supplier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商编码",
            "title": "Supplier"
          }
        },
        "title": "GlLineOut",
        "type": "object"
      },
      "GlListIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期下限，yyyy-MM-dd，含当天",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期上限，yyyy-MM-dd，含当天",
            "title": "Date To"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 200.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 200，缺省 50",
            "title": "Limit"
          },
          "maker": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单人姓名",
            "title": "Maker"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          },
          "sign": {
            "anyOf": [
              {
                "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
                "pattern": "^\\S{1,2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sign"
          },
          "state": {
            "anyOf": [
              {
                "enum": [
                  "all",
                  "unaudited",
                  "audited",
                  "posted",
                  "void"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "all 全部（缺省），unaudited 未审核，audited 已审核，posted 已记账，void 已作废",
            "title": "State"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period_from",
          "period_to"
        ],
        "title": "GlListIn",
        "type": "object"
      },
      "GlListItem": {
        "additionalProperties": true,
        "properties": {
          "cashier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "出纳签字人",
            "title": "Cashier"
          },
          "checker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核人",
            "title": "Checker"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期",
            "title": "Date"
          },
          "debit_total": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方合计",
            "title": "Debit Total"
          },
          "lines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分录行数",
            "title": "Lines"
          },
          "maker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单人",
            "title": "Maker"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "posted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已记账",
            "title": "Posted"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          },
          "void": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已作废",
            "title": "Void"
          }
        },
        "title": "GlListItem",
        "type": "object"
      },
      "GlListOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlListItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按期间、类别、凭证号排序的凭证",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页游标，原样放进 after。最后一页省略",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到列表",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlListOut",
        "type": "object"
      },
      "GlLoadOut": {
        "additionalProperties": true,
        "properties": {
          "lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlLineOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "分录",
            "title": "Lines"
          },
          "ok": {
            "description": "是否读到凭证",
            "title": "Ok",
            "type": "boolean"
          },
          "voucher": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GlVoucherOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证表头和状态"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlLoadOut",
        "type": "object"
      },
      "GlPostIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 9999.0,
                "minimum": 1900.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度。缺省为登录日期（date）的年份；year 是账套库年度，不参与判断",
            "title": "Fiscal Year"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12，必须是该年度第一个未结账的期间",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "vouchers": {
            "description": "要记账的凭证，1 到 200 张，不能重复",
            "items": {
              "$ref": "#/components/schemas/GlPostVoucherIn"
            },
            "maxItems": 200,
            "minItems": 1,
            "title": "Vouchers",
            "type": "array"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period",
          "vouchers"
        ],
        "title": "GlPostIn",
        "type": "object"
      },
      "GlPostOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "local_txn": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "记账事务是本地事务（提交前已核对没有升级 MSDTC），成功时为 true",
            "title": "Local Txn"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "posted": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlPostedOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "已记账的凭证，顺序同请求",
            "title": "Posted"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlPostOut",
        "type": "object"
      },
      "GlPostVoucherIn": {
        "additionalProperties": false,
        "properties": {
          "no": {
            "description": "凭证号（ino_id），1 到 32767",
            "maximum": 32767.0,
            "minimum": 1.0,
            "title": "No",
            "type": "integer"
          },
          "sign": {
            "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
            "pattern": "^\\S{1,2}$",
            "title": "Sign",
            "type": "string"
          }
        },
        "required": [
          "sign",
          "no"
        ],
        "title": "GlPostVoucherIn",
        "type": "object"
      },
      "GlPostedOut": {
        "additionalProperties": true,
        "properties": {
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "记账后重新读到的状态：posted 为 true，poster 是记账人（操作员姓名），另有审核、出纳签字、作废等",
            "title": "State"
          }
        },
        "title": "GlPostedOut",
        "type": "object"
      },
      "GlReverseIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 9999.0,
                "minimum": 1900.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证的会计年度。缺省为登录日期（date）的年份；不能晚于它",
            "title": "Fiscal Year"
          },
          "no": {
            "description": "凭证号（ino_id），1 到 32767",
            "maximum": 32767.0,
            "minimum": 1.0,
            "title": "No",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "sign": {
            "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
            "pattern": "^\\S{1,2}$",
            "title": "Sign",
            "type": "string"
          },
          "voucher_date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证日期，yyyy-MM-dd。缺省为登录日期；必须在登录年度内，不早于原凭证日期",
            "title": "Voucher Date"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period",
          "sign",
          "no"
        ],
        "title": "GlReverseIn",
        "type": "object"
      },
      "GlReverseOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证的会计年度",
            "title": "Fiscal Year"
          },
          "lines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证的分录行数",
            "title": "Lines"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证号",
            "title": "No"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "out_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证的外部业务号",
            "title": "Out No"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证的会计期间",
            "title": "Period"
          },
          "reversal_of": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GlReversedOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "被冲销的原凭证"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证的类别字",
            "title": "Sign"
          },
          "voucher_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字凭证日期",
            "title": "Voucher Date"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlReverseOut",
        "type": "object"
      },
      "GlReversedOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证的会计年度",
            "title": "Fiscal Year"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证号",
            "title": "No"
          },
          "out_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证的外部业务号（coutno_id），红字凭证的 cblueoutno_id 指向它",
            "title": "Out No"
          },
          "out_no_assigned": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证原来没有外部业务号、本次照 U8 取号补上时为 true",
            "title": "Out No Assigned"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证的会计期间",
            "title": "Period"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "原凭证的类别字",
            "title": "Sign"
          }
        },
        "title": "GlReversedOut",
        "type": "object"
      },
      "GlTransferCustomIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "exclude_existing": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true：核对模式，余额里去掉本期已生成的同类结转凭证（只能和 dry_run 一起用）",
            "title": "Exclude Existing"
          },
          "fiscal_year": {
            "description": "会计年度，必须是登录日期（date）的年份",
            "maximum": 9999.0,
            "minimum": 1900.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "tran_id": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z]{1,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只生成这一个自定义转账序号（U8 的转账序号，如 0001）；缺省生成全部",
            "title": "Tran Id"
          },
          "voucher_date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证日期 yyyy-MM-dd，缺省取该期间最后一天；必须在该期间内",
            "title": "Voucher Date"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "fiscal_year",
          "period"
        ],
        "title": "GlTransferCustomIn",
        "type": "object"
      },
      "GlTransferOut": {
        "additionalProperties": true,
        "properties": {
          "count": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "生成的凭证张数",
            "title": "Count"
          },
          "existing": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "期间损益补生成时本期已有的期间损益凭证：[{sign, no, pack}]",
            "title": "Existing"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "pnl（期间损益结转）或 custom（自定义转账）",
            "title": "Kind"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "out_sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证上的外部业务类型（coutsign）：期间损益 或 自定义转账",
            "title": "Out Sign"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "skipped": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "跳过的定义：[{tran_id, account, reason}]",
            "title": "Skipped"
          },
          "voucher_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证日期",
            "title": "Voucher Date"
          },
          "vouchers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlTransferVoucherOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "生成的凭证",
            "title": "Vouchers"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlTransferOut",
        "type": "object"
      },
      "GlTransferPnlIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "exclude_existing": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true：核对模式，余额里去掉本期已生成的同类结转凭证（只能和 dry_run 一起用）",
            "title": "Exclude Existing"
          },
          "fiscal_year": {
            "description": "会计年度，必须是登录日期（date）的年份",
            "maximum": 9999.0,
            "minimum": 1900.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "voucher_date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证日期 yyyy-MM-dd，缺省取该期间最后一天；必须在该期间内",
            "title": "Voucher Date"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "fiscal_year",
          "period"
        ],
        "title": "GlTransferPnlIn",
        "type": "object"
      },
      "GlTransferVoucherOut": {
        "additionalProperties": true,
        "properties": {
          "credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贷方合计",
            "title": "Credit"
          },
          "debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方合计",
            "title": "Debit"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "lines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分录行数",
            "title": "Lines"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "out_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外部业务号（coutno_id）",
            "title": "Out No"
          },
          "pack": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期间损益：income（收入）或 expense（费用）",
            "title": "Pack"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          },
          "tran_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "自定义转账的转账序号",
            "title": "Tran Id"
          }
        },
        "title": "GlTransferVoucherOut",
        "type": "object"
      },
      "GlUnpostIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 9999.0,
                "minimum": 1900.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度。缺省为登录日期（date）的年份；year 是账套库年度，不参与判断",
            "title": "Fiscal Year"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "anyOf": [
              {
                "maximum": 12.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "核对用：最近一次记账的会计期间；给 vouchers 时必填",
            "title": "Period"
          },
          "vouchers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlPostVoucherIn"
                },
                "maxItems": 500,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "核对用：最近一次记账的全部凭证，1 到 500 张，不能重复；与范围不一致时 409",
            "title": "Vouchers"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "GlUnpostIn",
        "type": "object"
      },
      "GlUnpostOut": {
        "additionalProperties": true,
        "properties": {
          "count": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "改回未记账的凭证张数",
            "title": "Count"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "被恢复的记账所在的会计期间",
            "title": "Period"
          },
          "vouchers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/GlUnpostedOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "改回未记账的凭证",
            "title": "Vouchers"
          }
        },
        "required": [
          "ok"
        ],
        "title": "GlUnpostOut",
        "type": "object"
      },
      "GlUnpostedOut": {
        "additionalProperties": true,
        "properties": {
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          }
        },
        "title": "GlUnpostedOut",
        "type": "object"
      },
      "GlUpdateIn": {
        "additionalProperties": false,
        "description": "整张替换：表头和全部分录重新提交。",
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "head": {
            "$ref": "#/components/schemas/GlHeadIn",
            "description": "表头"
          },
          "lines": {
            "description": "分录，2 到 200 行。借方合计必须等于贷方合计且大于 0",
            "items": {
              "$ref": "#/components/schemas/GlLineIn"
            },
            "maxItems": 200,
            "minItems": 2,
            "title": "Lines",
            "type": "array"
          },
          "no": {
            "description": "凭证号（ino_id），1 到 32767",
            "maximum": 32767.0,
            "minimum": 1.0,
            "title": "No",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "会计期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "sign": {
            "description": "凭证类别字（csign），1 到 2 个字符，例如 转",
            "pattern": "^\\S{1,2}$",
            "title": "Sign",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period",
          "sign",
          "no",
          "head",
          "lines"
        ],
        "title": "GlUpdateIn",
        "type": "object"
      },
      "GlVoucherOut": {
        "additionalProperties": true,
        "properties": {
          "attachments": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "附单据数",
            "title": "Attachments"
          },
          "audit_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核日期",
            "title": "Audit Date"
          },
          "blue_out_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "红字冲销凭证：被冲销的原凭证的外部业务号（cblueoutno_id）；不是红字冲销凭证时为空串",
            "title": "Blue Out No"
          },
          "cashier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "出纳签字人",
            "title": "Cashier"
          },
          "checker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核人",
            "title": "Checker"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期",
            "title": "Date"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否为错误凭证",
            "title": "Error"
          },
          "maker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单人",
            "title": "Maker"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "out_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外部单据号",
            "title": "Out No"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "posted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已记账",
            "title": "Posted"
          },
          "poster": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "记账人",
            "title": "Poster"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别字",
            "title": "Sign"
          },
          "source_no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外部凭证号（coutno_id）",
            "title": "Source No"
          },
          "source_sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "外部凭证类别（coutsign）",
            "title": "Source Sign"
          },
          "source_system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "来源系统（coutsysname）。GL 或空为总账手工凭证",
            "title": "Source System"
          },
          "void": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否已作废",
            "title": "Void"
          }
        },
        "title": "GlVoucherOut",
        "type": "object"
      },
      "IaOut": {
        "additionalProperties": true,
        "properties": {
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "post、unpost、run 或 cancel",
            "title": "Action"
          },
          "counts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "诊断计数：名称 → 行数（如 area 本次记账行数、restore_rows 本次恢复行数、subsidiary_month 该月明细账行数）",
            "title": "Counts"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "中文说明，例如没有需要记账（恢复）的单据",
            "title": "Message"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期间",
            "title": "Period"
          }
        },
        "required": [
          "ok"
        ],
        "title": "IaOut",
        "type": "object"
      },
      "IaPeriodEndIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "run 期末处理，cancel 取消期末处理",
            "enum": [
              "run",
              "cancel"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fiscal_year": {
            "description": "会计年度，4 位",
            "maximum": 9999.0,
            "minimum": 1000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "期间（月份），1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "fiscal_year",
          "period",
          "action"
        ],
        "title": "IaPeriodEndIn",
        "type": "object"
      },
      "IaPostIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "post 正常单据记账，unpost 恢复记账",
            "enum": [
              "post",
              "unpost"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fiscal_year": {
            "description": "会计年度，4 位",
            "maximum": 9999.0,
            "minimum": 1000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "on_uncosted": {
            "anyOf": [
              {
                "enum": [
                  "refuse",
                  "skip"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只和 post 一起用。refuse（缺省）：有 U8 无法确定成本的存货就整笔拒绝 409；skip：这些存货不记账，其余照常记账",
            "title": "On Uncosted"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "期间（月份），1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "fiscal_year",
          "period",
          "action"
        ],
        "title": "IaPostIn",
        "type": "object"
      },
      "IcAggregateIn": {
        "additionalProperties": false,
        "properties": {
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          },
          "params": {
            "additionalProperties": true,
            "description": "传给每个账套的内层报表参数，规则同该报表（如 arap_balance 的 side、as_of）。不能含 acc、operator、password、year、date、after、limit",
            "title": "Params",
            "type": "object"
          },
          "report": {
            "description": "内层报表：stock_current 现存量、arap_balance 往来余额、arap_aging 账龄分析、gl_balance 科目余额表",
            "enum": [
              "stock_current",
              "arap_balance",
              "arap_aging",
              "gl_balance"
            ],
            "title": "Report",
            "type": "string"
          }
        },
        "required": [
          "report",
          "logins"
        ],
        "title": "IcAggregateIn",
        "type": "object"
      },
      "IcAggregateOut": {
        "additionalProperties": true,
        "properties": {
          "by_account": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号 → 成功时 {ok:true, items}（全部页的 items，字段同内层报表），失败时 {ok:false, status, error}",
            "title": "By Account"
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "公司组 id",
            "title": "Group"
          },
          "ok": {
            "description": "至少一个账套读到",
            "title": "Ok",
            "type": "boolean"
          },
          "report": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "内层报表",
            "title": "Report"
          },
          "totals": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按对照的合计。stock_current：inventory（对照 id）、codes、qty、qty_available、by_account；arap_*：company（往来单位代表的账套）、name、side、debit、credit、balance（账龄另有 aging、prepaid、overdue）、by_account（partner 和该账套的金额）；gl_balance：logical、codes、open_dir、open_debit、open_credit、period_debit、period_credit、ytd_debit、ytd_credit、close_dir、close_debit、close_credit、by_account。期初、期末按借减贷的净额合计后再拆方向",
            "title": "Totals"
          },
          "unmapped": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "每个账套没进合计的部分：acc、kind（inventory 存货、partner 往来单位、subject 末级科目）、count、codes（最多 50 个），往来另有 balance（这些往来单位的余额合计）",
            "title": "Unmapped"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "提醒，如失败的账套、不能按公司合计的分组",
            "title": "Warnings"
          }
        },
        "required": [
          "ok"
        ],
        "title": "IcAggregateOut",
        "type": "object"
      },
      "IcBuyerSide": {
        "additionalProperties": false,
        "properties": {
          "acc": {
            "description": "买方账套号",
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "type": {
            "description": "买方单据：purchase_in 采购入库，arrival 到货单，purchase_invoice 采购发票",
            "enum": [
              "purchase_in",
              "arrival",
              "purchase_invoice"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "acc",
          "type"
        ],
        "title": "IcBuyerSide",
        "type": "object"
      },
      "IcConsolidationIn": {
        "additionalProperties": false,
        "properties": {
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "logins": {
            "description": "2 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 2,
            "title": "Logins",
            "type": "array"
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "fiscal_year",
          "period_from",
          "period_to"
        ],
        "title": "IcConsolidationIn",
        "type": "object"
      },
      "IcConsolidationOut": {
        "additionalProperties": true,
        "properties": {
          "by_account": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号 → 成功时 {ok:true}，失败时 {ok:false, status, error}",
            "title": "By Account"
          },
          "complete": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "全部账套都读到时为 true",
            "title": "Complete"
          },
          "consolidated": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按逻辑科目：logical、codes、by_account（账套 → 期末净额）、period_debit、period_credit、close_net（各账套之和）、elim_debit、elim_credit、after_net、close_dir、close_debit、close_credit（抵销后）",
            "title": "Consolidated"
          },
          "eliminations": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "抵销：rule、ar（acc、logical、code、partner、balance 借减贷）、ap（同，balance 贷减借）、amount、difference（应收减应付）、entries（logical、debit、credit），不能抵销时另有 skipped",
            "title": "Eliminations"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "公司组 id",
            "title": "Group"
          },
          "notes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "口径说明（没有做的抵销）",
            "title": "Notes"
          },
          "ok": {
            "description": "至少一个账套读到",
            "title": "Ok",
            "type": "boolean"
          },
          "period_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始期间",
            "title": "Period From"
          },
          "period_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止期间",
            "title": "Period To"
          },
          "trial": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "每个账套：acc、name、balanced（末级科目期末借贷是否相等）、close_debit、close_credit（末级合计）、items（对照里的逻辑科目：logical、code、name、period_debit、period_credit、close_net 借减贷）",
            "title": "Trial"
          },
          "unmapped": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "没进对照的末级科目：acc、kind、count、codes",
            "title": "Unmapped"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "提醒，如失败的账套、方向相反没有抵销的往来",
            "title": "Warnings"
          }
        },
        "required": [
          "ok"
        ],
        "title": "IcConsolidationOut",
        "type": "object"
      },
      "IcGenLine": {
        "additionalProperties": false,
        "properties": {
          "inv_code": {
            "description": "卖方账套的存货编码（按对照换成买方编码）",
            "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
            "title": "Inv Code",
            "type": "string"
          },
          "quantity": {
            "description": "数量，大于 0",
            "exclusiveMinimum": 0.0,
            "maximum": 1000000000000.0,
            "title": "Quantity",
            "type": "number"
          },
          "seller_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "卖方单据 id（只用于计划和审计）",
            "title": "Seller Id"
          }
        },
        "required": [
          "inv_code",
          "quantity"
        ],
        "title": "IcGenLine",
        "type": "object"
      },
      "IcGenerateIn": {
        "additionalProperties": false,
        "properties": {
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方单据日期 yyyy-MM-dd（写进表头 dDate），省略时由 U8 取登录日期",
            "title": "Date"
          },
          "dry_run": {
            "default": true,
            "description": "缺省 true 只预演；false 时正式生成，必须带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "head": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方表头覆盖，规则同 vouchers/generate（到货单只收 cWhCode、dDate、cMemo、cDepCode）",
            "title": "Head"
          },
          "lines": {
            "description": "卖方明细，1 到 200 行",
            "items": {
              "$ref": "#/components/schemas/IcGenLine"
            },
            "maxItems": 200,
            "minItems": 1,
            "title": "Lines",
            "type": "array"
          },
          "login": {
            "$ref": "#/components/schemas/IcLogin",
            "description": "买方账套的登录"
          },
          "po_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "参照的采购订单 POID；省略时自动挑选",
            "title": "Po Id"
          },
          "seller_acc": {
            "description": "卖方账套号，与买方同在一个公司组",
            "pattern": "^\\d{3}$",
            "title": "Seller Acc",
            "type": "string"
          },
          "type": {
            "description": "买方单据：purchase_in 采购入库，arrival 到货单（other_in 不允许）",
            "enum": [
              "purchase_in",
              "arrival",
              "other_in"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "login",
          "seller_acc",
          "type",
          "lines"
        ],
        "title": "IcGenerateIn",
        "type": "object"
      },
      "IcGenerateOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方单据编号",
            "title": "Code"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方单据主键",
            "title": "Id"
          },
          "lines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "保存后的明细行数",
            "title": "Lines"
          },
          "ok": {
            "description": "是否已生成",
            "title": "Ok",
            "type": "boolean"
          },
          "plan": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "生成计划：buyer_acc、seller_acc、vendor（供应商编码）、po_id、po_code、lines（buyer_inv_code、seller_inv_codes、quantity、source_line_id）",
            "title": "Plan"
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核状态",
            "title": "State"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方单据类型",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "IcGenerateOut",
        "type": "object"
      },
      "IcLogin": {
        "additionalProperties": false,
        "description": "一个账套的登录：acc、operator、password，year、date 可省略（同单账套调用）。",
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "IcLogin",
        "type": "object"
      },
      "IcMatchIn": {
        "additionalProperties": false,
        "properties": {
          "buyer": {
            "$ref": "#/components/schemas/IcBuyerSide",
            "description": "买方账套和单据类型"
          },
          "date_from": {
            "description": "单据日期下限 yyyy-MM-dd（含）",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Date From",
            "type": "string"
          },
          "date_to": {
            "description": "单据日期上限 yyyy-MM-dd（含），与 date_from 最多相隔 93 天",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Date To",
            "type": "string"
          },
          "invoice_mode": {
            "anyOf": [
              {
                "enum": [
                  "line",
                  "month"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "两边都是发票时：month 按月比较价税合计（缺省），line 逐行配对。其它类型不能给",
            "title": "Invoice Mode"
          },
          "logins": {
            "description": "2 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 2,
            "title": "Logins",
            "type": "array"
          },
          "seller": {
            "$ref": "#/components/schemas/IcSellerSide",
            "description": "卖方账套和单据类型"
          },
          "window_days": {
            "default": 1,
            "description": "第二轮配对允许的日期差（天），0 到 7，缺省 1",
            "maximum": 7.0,
            "minimum": 0.0,
            "title": "Window Days",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "seller",
          "buyer",
          "date_from",
          "date_to"
        ],
        "title": "IcMatchIn",
        "type": "object"
      },
      "IcMatchOut": {
        "additionalProperties": true,
        "properties": {
          "buyer": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方：acc、type、partner（卖方公司在买方账套里的供应商编码）",
            "title": "Buyer"
          },
          "clip_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "只比对到这一天（两边最后一笔日期中较早的）；有一边没有数据时为 null",
            "title": "Clip Date"
          },
          "clipped": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "seller、buyer：晚于 clip_date、没参与比对的条数",
            "title": "Clipped"
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "公司组 id",
            "title": "Group"
          },
          "matched": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "配上的：逐行时 seller、buyer（acc、type、id、code、date、line_id、inv_code、qty、amount）、inv_id、qty、pass（exact 或 window）、days（买方日期减卖方日期）；按月时 month、seller_amount、buyer_amount、diff、seller_docs、buyer_docs",
            "title": "Matched"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "line 逐行配对，month 按月比较金额",
            "title": "Mode"
          },
          "ok": {
            "description": "是否完成对账",
            "title": "Ok",
            "type": "boolean"
          },
          "rates": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "seller、buyer：配上的条数除以该方 clip_date 前的条数，没有数据为 null",
            "title": "Rates"
          },
          "seller": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "卖方：acc、type、partner（买方公司在卖方账套里的客户编码）",
            "title": "Seller"
          },
          "unmatched_buyer": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "买方没配上的明细或月份，键同 unmatched_seller",
            "title": "Unmatched Buyer"
          },
          "unmatched_seller": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "卖方没配上的明细（逐行，另有 inv_id、reason：unmapped 或 no_counterpart）或月份（按月）",
            "title": "Unmatched Seller"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "提醒，如存货没有对照、读取失败的单据",
            "title": "Warnings"
          },
          "window_days": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "第二轮配对的日期差",
            "title": "Window Days"
          }
        },
        "required": [
          "ok"
        ],
        "title": "IcMatchOut",
        "type": "object"
      },
      "IcSellerSide": {
        "additionalProperties": false,
        "properties": {
          "acc": {
            "description": "卖方账套号",
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "type": {
            "description": "卖方单据：sale_out 销售出库，dispatch 发货单，sale_invoice 销售发票",
            "enum": [
              "sale_out",
              "dispatch",
              "sale_invoice"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "acc",
          "type"
        ],
        "title": "IcSellerSide",
        "type": "object"
      },
      "IdemGetIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "key": {
            "description": "原请求的 Idempotency-Key，1 到 128 个可见 ASCII 字符",
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[\\x21-\\x7e]+$",
            "title": "Key",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "path": {
            "description": "原请求的路径（任一写路由，如 /v1/co/vouchers/verify）",
            "enum": [
              "/v1/co/arap/bad_debt",
              "/v1/co/arap/exchange_gain",
              "/v1/co/arap/exchange_gain/cancel",
              "/v1/co/arap/merge",
              "/v1/co/arap/process/cancel",
              "/v1/co/arap/process/voucher",
              "/v1/co/arap/red_offset",
              "/v1/co/arap/transfer",
              "/v1/co/arap/voucher",
              "/v1/co/arap/voucher/delete",
              "/v1/co/arap/writeoff",
              "/v1/co/arap/writeoff/auto",
              "/v1/co/arap/writeoff/cancel",
              "/v1/co/archives/create",
              "/v1/co/archives/delete",
              "/v1/co/archives/update",
              "/v1/co/dispatches/verify",
              "/v1/co/gl/transfer/custom",
              "/v1/co/gl/transfer/pnl",
              "/v1/co/gl/vouchers/create",
              "/v1/co/gl/vouchers/delete",
              "/v1/co/gl/vouchers/post",
              "/v1/co/gl/vouchers/reverse",
              "/v1/co/gl/vouchers/sign",
              "/v1/co/gl/vouchers/unpost",
              "/v1/co/gl/vouchers/unsign",
              "/v1/co/gl/vouchers/unverify",
              "/v1/co/gl/vouchers/unvoid",
              "/v1/co/gl/vouchers/update",
              "/v1/co/gl/vouchers/verify",
              "/v1/co/gl/vouchers/void",
              "/v1/co/ia/period_end",
              "/v1/co/ia/post",
              "/v1/co/intercompany/generate_buyer",
              "/v1/co/notes/create",
              "/v1/co/notes/delete",
              "/v1/co/notes/process",
              "/v1/co/openings/arap",
              "/v1/co/openings/post",
              "/v1/co/periods/close",
              "/v1/co/sale-orders/verify",
              "/v1/co/vouchers/close",
              "/v1/co/vouchers/create",
              "/v1/co/vouchers/delete",
              "/v1/co/vouchers/generate",
              "/v1/co/vouchers/lock",
              "/v1/co/vouchers/update",
              "/v1/co/vouchers/verify",
              "/v1/co/workflow/abandon",
              "/v1/co/workflow/approve",
              "/v1/co/workflow/disagree",
              "/v1/co/workflow/resubmit",
              "/v1/co/workflow/return",
              "/v1/co/workflow/submit",
              "/v1/co/workflow/withdraw"
            ],
            "title": "Path",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "path",
          "key"
        ],
        "title": "IdemGetIn",
        "type": "object"
      },
      "IdemGetOut": {
        "additionalProperties": true,
        "properties": {
          "created_utc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "记录创建时间（UTC）",
            "title": "Created Utc"
          },
          "found": {
            "description": "是否有这条记录（过期的算没有）",
            "title": "Found",
            "type": "boolean"
          },
          "ok": {
            "description": "总是 true",
            "title": "Ok",
            "type": "boolean"
          },
          "response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "当时的响应：成功是原响应体，失败是 {\"error\": {...}}；in_flight 时省略",
            "title": "Response"
          },
          "state": {
            "anyOf": [
              {
                "enum": [
                  "ok",
                  "outcome_unknown",
                  "in_flight"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "记录状态；没找到时省略",
            "title": "State"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "原请求本服务返回（或会返回）的 HTTP 状态",
            "title": "Status"
          }
        },
        "required": [
          "ok",
          "found"
        ],
        "title": "IdemGetOut",
        "type": "object"
      },
      "LoadManyIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "ids": {
            "description": "单据主键，1 到 20 个，不能重复（U8 组件读取的类型最多 5 个）",
            "items": {
              "exclusiveMinimum": 0.0,
              "maximum": 2147483647.0,
              "type": "integer"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Ids",
            "type": "array"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "单据类型，与 vouchers/load 相同",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_invoice",
              "purchase_order",
              "arrival",
              "purchase_invoice",
              "purchase_in",
              "other_in",
              "other_out",
              "product_in",
              "material_out",
              "sale_out",
              "transfer",
              "production_order",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_check",
              "stock_opening",
              "qm_other_inspect",
              "qm_other_check",
              "purchase_settle",
              "position_adjust",
              "ia_adjust",
              "inventory_price_adjust",
              "sale_return_apply"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "ids"
        ],
        "title": "LoadManyIn",
        "type": "object"
      },
      "LoadManyOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按请求顺序：vouchers/load 的响应体，或 {id, error: {code, message}}",
            "title": "Items"
          },
          "masked_fields": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "各项 masked_fields 的并集（字段权限）。没有被遮蔽的字段时省略",
            "title": "Masked Fields"
          },
          "ok": {
            "description": "请求是否完成（单张失败不影响）",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "LoadManyOut",
        "type": "object"
      },
      "MergeLineIn": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次并入的金额（原币）；省略并入该单据（行）在 from 名下的全部余额",
            "title": "Amount"
          },
          "id": {
            "description": "单据号",
            "maxLength": 30,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "line_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票表体行（= 往来明细 iBVid）；省略时按行主键从小到大依次分摊。应收单、应付单按整单，不能带",
            "title": "Line Id"
          },
          "type": {
            "description": "U8 单据类型代码（26 / 27 / R0、01 / 02 / P0）",
            "maxLength": 2,
            "minLength": 2,
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "MergeLineIn",
        "type": "object"
      },
      "MergeRowOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次金额（原币）",
            "title": "Amount"
          },
          "amount_native": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次金额（本币）",
            "title": "Amount Native"
          },
          "doc_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键",
            "title": "Doc Id"
          },
          "from_remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并账后 from 名下的余额（原币）",
            "title": "From Remaining"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Id"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票行；整单时省略",
            "title": "Line Id"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理后的余额（原币）",
            "title": "Remaining"
          },
          "to_remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "并账后 to 名下的余额（原币）",
            "title": "To Remaining"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "U8 单据类型代码",
            "title": "Type"
          }
        },
        "title": "MergeRowOut",
        "type": "object"
      },
      "MetaFieldsIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "archive": {
            "anyOf": [
              {
                "enum": [
                  "customer",
                  "vendor",
                  "inventory",
                  "department",
                  "person",
                  "warehouse",
                  "customer_class",
                  "vendor_class",
                  "inventory_class",
                  "account",
                  "unit",
                  "unit_group",
                  "settle_style",
                  "voucher_sign",
                  "currency",
                  "bank",
                  "project",
                  "position",
                  "rd_style",
                  "purchase_type",
                  "sale_type",
                  "district_class",
                  "trade_class",
                  "aa_bank",
                  "customer_address",
                  "user_define",
                  "customer_inventory",
                  "exchange_rate",
                  "fa_card",
                  "operator",
                  "role",
                  "customer_bank",
                  "vendor_bank",
                  "customer_contact",
                  "vendor_contact",
                  "reason",
                  "equipment"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案类型。与 type、gl 三选一",
            "title": "Archive"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "gl": {
            "anyOf": [
              {
                "const": true,
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 表示总账凭证。与 type、archive 三选一",
            "title": "Gl"
          },
          "op": {
            "anyOf": [
              {
                "enum": [
                  "create",
                  "update",
                  "generate"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据的操作：create（缺省）、update 或 generate。只能和 type 一起给",
            "title": "Op"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "source": {
            "anyOf": [
              {
                "enum": [
                  "sale_order",
                  "dispatch",
                  "purchase_order",
                  "qm_incoming_check",
                  "purchase_in",
                  "production_order",
                  "qm_product_check",
                  "qm_product_reject",
                  "arrival",
                  "qm_incoming_inspect",
                  "qm_product_inspect",
                  "purchase_return",
                  "sale_return",
                  "transfer_request",
                  "qm_other_inspect",
                  "purchase_invoice",
                  "sale_invoice",
                  "sale_return_apply"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "来源单据类型。op 为 generate 时必填，其它情况不能给",
            "title": "Source"
          },
          "type": {
            "anyOf": [
              {
                "enum": [
                  "sale_order",
                  "dispatch",
                  "sale_invoice",
                  "purchase_order",
                  "arrival",
                  "purchase_invoice",
                  "purchase_in",
                  "other_in",
                  "other_out",
                  "product_in",
                  "material_out",
                  "sale_out",
                  "transfer",
                  "production_order",
                  "qm_incoming_check",
                  "qm_product_check",
                  "qm_incoming_reject",
                  "qm_product_reject",
                  "ar_receipt",
                  "ap_payment",
                  "ar_bill",
                  "ap_bill",
                  "ap_refund",
                  "ar_refund",
                  "purchase_return",
                  "sale_return",
                  "purchase_requisition",
                  "qm_incoming_inspect",
                  "qm_product_inspect",
                  "bom",
                  "shape_change",
                  "transfer_request",
                  "stock_check",
                  "stock_opening",
                  "qm_other_inspect",
                  "qm_other_check",
                  "purchase_settle",
                  "position_adjust",
                  "ia_adjust",
                  "inventory_price_adjust",
                  "sale_return_apply"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型（与 vouchers/load 相同）。与 archive、gl 三选一",
            "title": "Type"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "MetaFieldsIn",
        "type": "object"
      },
      "MetaFieldsOut": {
        "additionalProperties": true,
        "properties": {
          "archive": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案类型（按档案查时）",
            "title": "Archive"
          },
          "card": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据：单据模板的卡片号",
            "title": "Card"
          },
          "cash_flow": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "总账凭证的现金流量字段，键同 head",
            "title": "Cash Flow"
          },
          "fields": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "档案的字段：name、label、type（总是 null）、required",
            "title": "Fields"
          },
          "fields_revision": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "返回的字段列表的 SHA-256（十六进制）",
            "title": "Fields Revision"
          },
          "gl": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "总账凭证时为 true",
            "title": "Gl"
          },
          "head": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据、总账凭证的表头字段：name、label、type、required，另可有 max_length、enum（code、name）",
            "title": "Head"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据、总账凭证的明细字段，键同 head",
            "title": "Lines"
          },
          "ok": {
            "description": "是否读到字段",
            "title": "Ok",
            "type": "boolean"
          },
          "op": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据的操作",
            "title": "Op"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "来源单据类型（generate）",
            "title": "Source"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型（按单据查时）",
            "title": "Type"
          },
          "vt_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据：取标签用的单据模板号；没有模板时省略",
            "title": "Vt Id"
          },
          "vt_source": {
            "anyOf": [
              {
                "enum": [
                  "fixed",
                  "user_default",
                  "card_default",
                  "none"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据：模板从哪里来。fixed 桥写死的模板，user_default 操作员的缺省模板，card_default 该卡片的系统缺省模板（vouchers.DEF_ID），none 没有模板（label、type 都为 null）",
            "title": "Vt Source"
          }
        },
        "required": [
          "ok"
        ],
        "title": "MetaFieldsOut",
        "type": "object"
      },
      "MgmtArapIn": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd（含当天），缺省为 period_to 的自然月末（晚于今天时取今天）",
            "title": "As Of"
          },
          "buckets": {
            "description": "账龄分段的天数上限，严格递增，缺省 [30, 60, 90, 180]",
            "items": {
              "type": "integer"
            },
            "maxItems": 8,
            "minItems": 1,
            "title": "Buckets",
            "type": "array"
          },
          "consolidate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否合并。缺省在 2 个以上账套时为 true；只有 1 个账套时不合并",
            "title": "Consolidate"
          },
          "default_credit_days": {
            "anyOf": [
              {
                "maximum": 3650.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据没有信用期时按几天算到期日，缺省同 arap_aging（0）",
            "title": "Default Credit Days"
          },
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          },
          "side": {
            "default": "both",
            "description": "ar 应收、ap 应付、both 两边（缺省）",
            "enum": [
              "ar",
              "ap",
              "both"
            ],
            "title": "Side",
            "type": "string"
          },
          "top": {
            "default": 200,
            "description": "每个账套按余额绝对值取前几个往来单位，1 到 500，缺省 200",
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Top",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "fiscal_year",
          "period_from",
          "period_to"
        ],
        "title": "MgmtArapIn",
        "type": "object"
      },
      "MgmtCashStockIn": {
        "additionalProperties": false,
        "description": "资金与存货按 period_to 一个期间出具（桥的 mgmt/cash_stock 只按一个期间）；period_from 只为与其他报表同形。",
        "properties": {
          "consolidate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否合并。缺省在 2 个以上账套时为 true；只有 1 个账套时不合并",
            "title": "Consolidate"
          },
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "include_unverified": {
            "default": false,
            "description": "为 true 时产成品入库、采购入库含未审核单据",
            "title": "Include Unverified",
            "type": "boolean"
          },
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          },
          "purchase_source": {
            "default": "auto",
            "description": "采购取数：auto（有采购发票时取发票，否则取采购入库，缺省）、invoice 发票、receipt 采购入库",
            "enum": [
              "auto",
              "invoice",
              "receipt"
            ],
            "title": "Purchase Source",
            "type": "string"
          },
          "top": {
            "default": 200,
            "description": "产量、采购排行每个账套取前几个，1 到 500，缺省 200",
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Top",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "fiscal_year",
          "period_from",
          "period_to"
        ],
        "title": "MgmtCashStockIn",
        "type": "object"
      },
      "MgmtMetaIn": {
        "additionalProperties": false,
        "properties": {
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          }
        },
        "required": [
          "logins",
          "fiscal_year"
        ],
        "title": "MgmtMetaIn",
        "type": "object"
      },
      "MgmtOut": {
        "additionalProperties": true,
        "description": "经营管理查询的响应信封。",
        "properties": {
          "accounts": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "每个账套：acc、name（公司间对照里的名称，没有时为账套号）、close（所选期间的结账状态，字段同 mgmt/meta 的 periods；该账套读取失败时为 null）",
            "title": "Accounts"
          },
          "by_account": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号 → 成功时 {ok:true, ...该报表的数据}，失败时 {ok:false, status, error}",
            "title": "By Account"
          },
          "cache": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "hit（是否命中缓存）、age_s（缓存结果的秒数）",
            "title": "Cache"
          },
          "complete": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "全部账套都读到时为 true",
            "title": "Complete"
          },
          "consolidated": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "合并数（字段同 by_account 里的数据）；不合并或有账套失败时为 null",
            "title": "Consolidated"
          },
          "eliminations": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "合并时做的抵销",
            "title": "Eliminations"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "notes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "口径说明，如没有抵销的未实现内部利润",
            "title": "Notes"
          },
          "ok": {
            "description": "至少一个账套读到",
            "title": "Ok",
            "type": "boolean"
          },
          "period_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始期间",
            "title": "Period From"
          },
          "period_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止期间",
            "title": "Period To"
          },
          "report": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "报表：meta、pnl、sales、arap、cash_stock、overview",
            "title": "Report"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "提醒，如失败的账套、没有对照的科目",
            "title": "Warnings"
          }
        },
        "required": [
          "ok"
        ],
        "title": "MgmtOut",
        "type": "object"
      },
      "MgmtOverviewIn": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "往来余额、账龄的截止日期 yyyy-MM-dd，缺省为 period_to 的自然月末（晚于今天时取今天）",
            "title": "As Of"
          },
          "consolidate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否合并。缺省在 2 个以上账套时为 true；只有 1 个账套时不合并",
            "title": "Consolidate"
          },
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "fiscal_year",
          "period_from",
          "period_to"
        ],
        "title": "MgmtOverviewIn",
        "type": "object"
      },
      "MgmtPnlIn": {
        "additionalProperties": false,
        "properties": {
          "consolidate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否合并。缺省在 2 个以上账套时为 true；只有 1 个账套时不合并",
            "title": "Consolidate"
          },
          "dims": {
            "description": "另按一个维度拆分各行：dept 部门、item 项目。缺省不拆",
            "items": {
              "enum": [
                "dept",
                "item"
              ],
              "type": "string"
            },
            "maxItems": 1,
            "title": "Dims",
            "type": "array"
          },
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "include_unposted": {
            "default": false,
            "description": "为 true 时含未记账凭证（不含作废）",
            "title": "Include Unposted",
            "type": "boolean"
          },
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "fiscal_year",
          "period_from",
          "period_to"
        ],
        "title": "MgmtPnlIn",
        "type": "object"
      },
      "MgmtSalesIn": {
        "additionalProperties": false,
        "properties": {
          "consolidate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否合并。缺省在 2 个以上账套时为 true；只有 1 个账套时不合并",
            "title": "Consolidate"
          },
          "fiscal_year": {
            "description": "会计年度，2000 到 2099",
            "maximum": 2099.0,
            "minimum": 2000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "group_by": {
            "description": "分组维度（不重复）：period 期间、customer 客户、inventory 存货、person 业务员、department 部门；缺省按客户，空数组只出合计",
            "items": {
              "enum": [
                "period",
                "customer",
                "inventory",
                "person",
                "department"
              ],
              "type": "string"
            },
            "maxItems": 5,
            "title": "Group By",
            "type": "array"
          },
          "include_unverified": {
            "default": false,
            "description": "为 true 时含未复核的销售发票",
            "title": "Include Unverified",
            "type": "boolean"
          },
          "logins": {
            "description": "1 到 3 个账套的登录，账套不能重复",
            "items": {
              "$ref": "#/components/schemas/IcLogin"
            },
            "maxItems": 3,
            "minItems": 1,
            "title": "Logins",
            "type": "array"
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          },
          "top": {
            "default": 200,
            "description": "每个账套按收入从高到低取前几组，1 到 500，缺省 200，其余并成 others",
            "maximum": 500.0,
            "minimum": 1.0,
            "title": "Top",
            "type": "integer"
          }
        },
        "required": [
          "logins",
          "fiscal_year",
          "period_from",
          "period_to"
        ],
        "title": "MgmtSalesIn",
        "type": "object"
      },
      "NoteRefOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据号",
            "title": "Code"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据主键 AP_Note.Auto_ID",
            "title": "Id"
          },
          "partner": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "票据的往来单位编码",
            "title": "Partner"
          },
          "partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "往来单位名称",
            "title": "Partner Name"
          }
        },
        "title": "NoteRefOut",
        "type": "object"
      },
      "OpeningsArapIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "account": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "create 必填：科目编码，须为启用年度本系统受控的末级科目",
            "title": "Account"
          },
          "action": {
            "description": "create 新增，delete 删除，verify 审核，unverify 弃审",
            "enum": [
              "create",
              "delete",
              "verify",
              "unverify"
            ],
            "title": "Action",
            "type": "string"
          },
          "amount": {
            "anyOf": [
              {
                "maximum": 1000000000000.0,
                "minimum": -1000000000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "create 必填：原币金额，非 0、最多两位小数；负数表示反方向余额（预收 / 预付）",
            "title": "Amount"
          },
          "currency": {
            "anyOf": [
              {
                "maxLength": 8,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "币种名称；省略为本位币",
            "title": "Currency"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "department": {
            "anyOf": [
              {
                "maxLength": 12,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码（末级）",
            "title": "Department"
          },
          "digest": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要；省略时为「期初应收」或「期初应付」",
            "title": "Digest"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "exch_rate": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 1000000.0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "汇率：本位币只能省略或为 1，外币必须给；本币金额 = round(amount 绝对值 × 汇率, 2)",
            "title": "Exch Rate"
          },
          "id": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初单据主键（Ap_Vouch.Auto_ID）。delete、verify、unverify 必填，create 不收",
            "title": "Id"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "create 必填：客户编码（ar）或供应商编码（ap）",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "person": {
            "anyOf": [
              {
                "maxLength": 20,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码",
            "title": "Person"
          },
          "side": {
            "description": "ar 应收，ap 应付（也是登录子系统）",
            "enum": [
              "ar",
              "ap"
            ],
            "title": "Side",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "side",
          "action"
        ],
        "title": "OpeningsArapIn",
        "type": "object"
      },
      "OpeningsArapOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据编号",
            "title": "Code"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "新增：单据日期（启用日期前一天），yyyy-MM-dd",
            "title": "Date"
          },
          "deleted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删除：表头已不存在则为 true",
            "title": "Deleted"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初单据主键（Ap_Vouch.Auto_ID）",
            "title": "Id"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "opening": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初单据，总是 true",
            "title": "Opening"
          },
          "side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "ar 或 ap",
            "title": "Side"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "新增：模块启用日期，yyyy-MM-dd",
            "title": "Start Date"
          },
          "state": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "审核状态（verified、verifier、verified_at）。删除时没有",
            "title": "State"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "ar_bill（应收单）或 ap_bill（应付单）",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "OpeningsArapOut",
        "type": "object"
      },
      "OpeningsPostIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "post 期初记账，unpost 取消期初记账",
            "enum": [
              "post",
              "unpost"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "module": {
            "description": "模块：pu 采购管理，ia 存货核算（也是登录子系统）",
            "enum": [
              "pu",
              "ia"
            ],
            "title": "Module",
            "type": "string"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "module",
          "action"
        ],
        "title": "OpeningsPostIn",
        "type": "object"
      },
      "OpeningsPostOut": {
        "additionalProperties": true,
        "properties": {
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "post 或 unpost",
            "title": "Action"
          },
          "counts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货核算：脚本的诊断计数。记账有 st34_verified（取数的期初结存单行数）、subsidiary_m0_34、summary_m0、fifo_lines_qcass_skipped、gl_mend_p0、gl_mend_lt_start；取消有 summary_m0_deleted、subsidiary_m0_deleted、summary_item_m0_deleted、summary_m0_left、gl_mend_p0、bQCInput_true。采购没有",
            "title": "Counts"
          },
          "module": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "模块，pu 或 ia",
            "title": "Module"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "opening_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初年度（该模块的启用年度）",
            "title": "Opening Year"
          },
          "posted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "操作后的期初记账状态：记账后为 true，取消后为 false",
            "title": "Posted"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "该模块的启用日期，yyyy-MM-dd",
            "title": "Start Date"
          }
        },
        "required": [
          "ok"
        ],
        "title": "OpeningsPostOut",
        "type": "object"
      },
      "PeriodsCloseIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "action": {
            "description": "close 结账，reopen 取消结账",
            "enum": [
              "close",
              "reopen"
            ],
            "title": "Action",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dry_run": {
            "default": false,
            "description": "true 时只预演，不写入（照常登录、加锁、校验）。\n\n- 成功返回 DryRunOut（模式见其 mode），失败返回与正式写入相同的错误\n- 不能同时带 Idempotency-Key",
            "title": "Dry Run",
            "type": "boolean"
          },
          "fiscal_year": {
            "description": "会计年度，4 位",
            "maximum": 9999.0,
            "minimum": 1000.0,
            "title": "Fiscal Year",
            "type": "integer"
          },
          "module": {
            "anyOf": [
              {
                "enum": [
                  "pu",
                  "sa",
                  "st",
                  "ia",
                  "ar",
                  "ap",
                  "gl"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "模块：pu 采购、sa 销售、st 库存、ia 存货核算、ar 应收、ap 应付、gl 总账。through 为 true 时可省略",
            "title": "Module"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "description": "期间（月份），1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period",
            "type": "integer"
          },
          "through": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true：各已启用模块从最早的年度起逐月结账到 fiscal_year 年 period 期（只和 close 一起用）",
            "title": "Through"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "fiscal_year",
          "period",
          "action"
        ],
        "title": "PeriodsCloseIn",
        "type": "object"
      },
      "PeriodsCloseOut": {
        "additionalProperties": true,
        "properties": {
          "action": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "close 或 reopen",
            "title": "Action"
          },
          "closed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "操作后的结账状态：结账后为 true，取消结账后为 false（through 时没有）",
            "title": "Closed"
          },
          "count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "through 时结了账的期间数，没有需要结账的期间时为 0",
            "title": "Count"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度（through 时没有）",
            "title": "Fiscal Year"
          },
          "ia_counts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货核算有数据的月份：月末结账（取消结账）脚本的诊断计数，名称 → 行数。through 时在各项里",
            "title": "Ia Counts"
          },
          "module": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "模块（through 时没有）",
            "title": "Module"
          },
          "ok": {
            "description": "是否已完成",
            "title": "Ok",
            "type": "boolean"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期间（through 时没有）",
            "title": "Period"
          },
          "through": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "through 时结了账的期间，按执行顺序：[{module, fiscal_year, period}]",
            "title": "Through"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "提示，以提示码开头（目前只有 ia_opening_not_posted：存货核算未做期初记账仍结了账）。没有则省略",
            "title": "Warnings"
          }
        },
        "required": [
          "ok"
        ],
        "title": "PeriodsCloseOut",
        "type": "object"
      },
      "PermEvaluateIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "subject": {
            "description": "要查询的 U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op002"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Subject",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "subject"
        ],
        "title": "PermEvaluateIn",
        "type": "object"
      },
      "PermEvaluateOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "acct_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "权限所取的账套年度",
            "title": "Acct Year"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "各对象的数据权限：all、codes（可带 live）或 pairs",
            "title": "Data"
          },
          "data_admin": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "作为数据权限管理员不受限的对象",
            "title": "Data Admin"
          },
          "fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "权限指纹（SHA-256 十六进制），权限不变时不变",
            "title": "Fingerprint"
          },
          "functions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "功能权限编码",
            "title": "Functions"
          },
          "gl_subj_ctl": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否启用了科目数据权限控制",
            "title": "Gl Subj Ctl"
          },
          "objects_on": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "启用了数据权限控制的对象",
            "title": "Objects On"
          },
          "ok": {
            "description": "总是 true",
            "title": "Ok",
            "type": "boolean"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "权限所属的操作员编码（perm/evaluate 时是 subject）",
            "title": "Operator"
          },
          "roles": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "所属角色",
            "title": "Roles"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "被查询的操作员编码",
            "title": "Subject"
          },
          "supervisor": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否账套主管（功能、数据权限都不受限）",
            "title": "Supervisor"
          },
          "ttl_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "桥上权限缓存的秒数",
            "title": "Ttl S"
          },
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录年度",
            "title": "Year"
          }
        },
        "required": [
          "ok"
        ],
        "title": "PermEvaluateOut",
        "type": "object"
      },
      "PermSnapshotOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "acct_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "权限所取的账套年度",
            "title": "Acct Year"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "各对象的数据权限：all、codes（可带 live）或 pairs",
            "title": "Data"
          },
          "data_admin": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "作为数据权限管理员不受限的对象",
            "title": "Data Admin"
          },
          "fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "权限指纹（SHA-256 十六进制），权限不变时不变",
            "title": "Fingerprint"
          },
          "functions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "功能权限编码",
            "title": "Functions"
          },
          "gl_subj_ctl": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否启用了科目数据权限控制",
            "title": "Gl Subj Ctl"
          },
          "objects_on": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "启用了数据权限控制的对象",
            "title": "Objects On"
          },
          "ok": {
            "description": "总是 true",
            "title": "Ok",
            "type": "boolean"
          },
          "operator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "权限所属的操作员编码（perm/evaluate 时是 subject）",
            "title": "Operator"
          },
          "roles": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "所属角色",
            "title": "Roles"
          },
          "supervisor": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否账套主管（功能、数据权限都不受限）",
            "title": "Supervisor"
          },
          "ttl_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "桥上权限缓存的秒数",
            "title": "Ttl S"
          },
          "year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录年度",
            "title": "Year"
          }
        },
        "required": [
          "ok"
        ],
        "title": "PermSnapshotOut",
        "type": "object"
      },
      "ProcCancelItemOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Code"
          },
          "credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删掉的处理行贷方（原币）",
            "title": "Credit"
          },
          "debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "删掉的处理行借方（原币）",
            "title": "Debit"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键",
            "title": "Id"
          },
          "ledger": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "往来明细所在的账：AR 或 AP",
            "title": "Ledger"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票行（iBVid）；整单时省略",
            "title": "Line Id"
          },
          "partner": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "往来单位",
            "title": "Partner"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型",
            "title": "Type"
          }
        },
        "title": "ProcCancelItemOut",
        "type": "object"
      },
      "ProcLineIn": {
        "additionalProperties": false,
        "description": "一张单据（或它的一行）及本次金额。",
        "properties": {
          "amount": {
            "description": "本次金额（原币），最多两位小数",
            "exclusiveMinimum": 0.0,
            "maximum": 1000000000000.0,
            "title": "Amount",
            "type": "number"
          },
          "id": {
            "description": "单据号",
            "maxLength": 30,
            "minLength": 1,
            "title": "Id",
            "type": "string"
          },
          "line_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票表体行（= 往来明细 iBVid）；省略时按行主键从小到大依次分摊。应收单、应付单按整单，不能带",
            "title": "Line Id"
          },
          "type": {
            "description": "U8 单据类型代码（26 / 27 / R0、01 / 02 / P0）",
            "maxLength": 2,
            "minLength": 2,
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "amount"
        ],
        "title": "ProcLineIn",
        "type": "object"
      },
      "ProcPeriodOut": {
        "additionalProperties": true,
        "properties": {
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Year"
          }
        },
        "title": "ProcPeriodOut",
        "type": "object"
      },
      "ProcRestoredOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "加回的金额",
            "title": "Amount"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Code"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键",
            "title": "Id"
          },
          "ledger": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Ledger"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "收付款单行；应收应付单省略",
            "title": "Line Id"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "取消后的余额",
            "title": "Remaining"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型",
            "title": "Type"
          }
        },
        "title": "ProcRestoredOut",
        "type": "object"
      },
      "ProcRowOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次金额（原币）",
            "title": "Amount"
          },
          "amount_native": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本次金额（本币）",
            "title": "Amount Native"
          },
          "doc_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键",
            "title": "Doc Id"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Id"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票行；整单时省略",
            "title": "Line Id"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "处理后的余额（原币）",
            "title": "Remaining"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "U8 单据类型代码",
            "title": "Type"
          }
        },
        "title": "ProcRowOut",
        "type": "object"
      },
      "ProcVoucherKeyOut": {
        "additionalProperties": true,
        "properties": {
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单日期",
            "title": "Date"
          },
          "no": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号",
            "title": "No"
          },
          "num": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证号文本，如 转-0172",
            "title": "Num"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间",
            "title": "Period"
          },
          "sign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "凭证类别",
            "title": "Sign"
          },
          "year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Year"
          }
        },
        "title": "ProcVoucherKeyOut",
        "type": "object"
      },
      "ProcVoucherLineOut": {
        "additionalProperties": true,
        "properties": {
          "account": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目编码",
            "title": "Account"
          },
          "bill_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "该行的来源单据号（凭证行 coutid）",
            "title": "Bill Code"
          },
          "credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "贷方金额",
            "title": "Credit"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户",
            "title": "Customer"
          },
          "debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "借方金额",
            "title": "Debit"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "摘要",
            "title": "Digest"
          },
          "entry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分录号",
            "title": "Entry"
          },
          "supplier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商",
            "title": "Supplier"
          }
        },
        "title": "ProcVoucherLineOut",
        "type": "object"
      },
      "ReportAgingIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "accounts": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                  "type": "string"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "控制科目编码前缀，1 到 20 个。缺省应收 1122，应付 2202",
            "title": "Accounts"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd，按登记日期含当天。缺省为 date",
            "title": "As Of"
          },
          "basis": {
            "anyOf": [
              {
                "enum": [
                  "document",
                  "due"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "账龄起算：document 单据日期（缺省）；due 到期日（收款日期；否则信用期不为 0 时信用起算日加信用期，没有信用起算日取单据日期；信用期为 0 或空时信用起算日或单据日期加 default_credit_days）",
            "title": "Basis"
          },
          "buckets": {
            "anyOf": [
              {
                "items": {
                  "maximum": 3650.0,
                  "minimum": 1.0,
                  "type": "integer"
                },
                "maxItems": 10,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "账龄区间的上限天数，1 到 10 个严格递增的整数，每个 1 到 3650。缺省 [30,60,90,180,365]",
            "title": "Buckets"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "default_credit_days": {
            "anyOf": [
              {
                "maximum": 3650.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省信用天数，0 到 3650，只能和 basis=due 一起用。\n\n- 单据没有收款日期、信用期为 0 或空时：到期日 = 信用起算日 + 本值\n- 信用期不为 0 的单据仍按信用期：到期日 = 信用起算日 + 信用期\n- 没有信用起算日时取单据日期\n- 省略或为 0 时不加天数",
            "examples": [
              30
            ],
            "title": "Default Credit Days"
          },
          "exclude_accounts": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "要排除的科目编码前缀，最多 20 个",
            "title": "Exclude Accounts"
          },
          "group_by": {
            "anyOf": [
              {
                "enum": [
                  "partner",
                  "person",
                  "partner_person"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "分组：partner 往来单位（缺省）；person 业务员；partner_person 往来单位 + 业务员。业务员取单据上的业务员，单据没有时取客户或供应商档案的专管业务员",
            "title": "Group By"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：去掉余额为 0 的往来单位",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "overdue_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时只留逾期金额（overdue）大于 0 且余额（balance）大于 0 的行。只能和 basis=due 一起用",
            "title": "Overdue Only"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户或供应商编码等于",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "person": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 20,
                  "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                  "type": "string"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码，1 到 20 个，按解析后的业务员（单据，其次档案）过滤。任何分组都可用",
            "title": "Person"
          },
          "side": {
            "description": "ar 应收（按客户），ap 应付（按供应商）",
            "enum": [
              "ar",
              "ap"
            ],
            "title": "Side",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "side"
        ],
        "title": "ReportAgingIn",
        "type": "object"
      },
      "ReportAgingOut": {
        "additionalProperties": true,
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期",
            "title": "As Of"
          },
          "basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账龄起算：document 或 due",
            "title": "Basis"
          },
          "buckets": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "账龄区间：key、from、to（天）。第一项是 not_due（未到期，账龄 ≤ 0），最后一项没有上限",
            "title": "Buckets"
          },
          "default_credit_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "请求给了 default_credit_days 时原样返回",
            "title": "Default Credit Days"
          },
          "group_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "分组：partner、person 或 partner_person",
            "title": "Group By"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按分组键排序（往来单位编码、业务员编码）。partner 分组：partner、name；person 分组：person_code、person_name、person_source（document 单据、customer / vendor 档案专管业务员、mixed 两者都有；没有业务员时 person_code 等三项为 null）；partner_person 两组都有。之后是 balance、aging（与 buckets 一一对应）、prepaid（未核销的预收或预付，正数），basis=due 时另有 overdue（已逾期金额 = aging 除 not_due 外的合计）。balance = aging 合计 − prepaid。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "ar 或 ap",
            "title": "Side"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportAgingOut",
        "type": "object"
      },
      "ReportArapDetailIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "accounts": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                  "type": "string"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "控制科目编码前缀，1 到 20 个。缺省应收 1122，应付 2202",
            "title": "Accounts"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "basis": {
            "anyOf": [
              {
                "const": "register",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "日期口径：register 登记日期（缺省，与 arap_balance 的 as_of 相同）。单据日期口径暂不开放",
            "title": "Basis"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "description": "起始日期 yyyy-MM-dd（含），期初是这一天之前的累计",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Date From",
            "type": "string"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd（含），缺省为 date",
            "title": "Date To"
          },
          "dept": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码等于（明细行上的部门）。期初也只算这个部门的行",
            "title": "Dept"
          },
          "exclude_accounts": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "要排除的科目编码前缀，最多 20 个",
            "title": "Exclude Accounts"
          },
          "include_writeoff": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时在 items 里列出核销行（cProcStyle=9P），缺省 false。只影响输出哪些行：期初、区间借贷、期末和滚动余额一律含核销行，开关前后相同",
            "title": "Include Writeoff"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "items": {
                  "maxLength": 60,
                  "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                  "type": "string"
                },
                "type": "array"
              }
            ],
            "description": "往来单位编码，或 1 到 20 个编码的数组。按编码排序，每个单位各自从期初滚动余额",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "person": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码等于（明细行上的业务员）。期初也只算这个业务员的行",
            "title": "Person"
          },
          "side": {
            "description": "ar 应收（按客户），ap 应付（按供应商）",
            "enum": [
              "ar",
              "ap"
            ],
            "title": "Side",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "side",
          "partner",
          "date_from"
        ],
        "title": "ReportArapDetailIn",
        "type": "object"
      },
      "ReportArapDetailOut": {
        "additionalProperties": true,
        "properties": {
          "basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "日期口径：register 或 document",
            "title": "Basis"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始日期",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期",
            "title": "Date To"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按往来单位、日期、登记顺序排序，一行是同一天同一单据（同一处理方式、对方单据）的合计：partner、date（口径日期）、reg_date、doc_date、doc_type、doc_type_name、doc_code、proc_style、co_doc_type、co_doc_code、digest、account（多个科目时为 null）、dept、person、debit、credit、balance（本单位的滚动余额，应收借减贷，应付贷减借）。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "partners": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按编码排序的往来单位汇总：partner、name、opening（date_from 之前的余额）、debit、credit（区间合计）、closing。没有任何记录的单位不列。每页都给全部单位。金额为数字（本币，两位小数）",
            "title": "Partners"
          },
          "side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "ar 或 ap",
            "title": "Side"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportArapDetailOut",
        "type": "object"
      },
      "ReportArapIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "accounts": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                  "type": "string"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "控制科目编码前缀，1 到 20 个。缺省应收 1122，应付 2202",
            "title": "Accounts"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd，按登记日期含当天。缺省为 date",
            "title": "As Of"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "exclude_accounts": {
            "anyOf": [
              {
                "items": {
                  "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                  "type": "string"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "要排除的科目编码前缀，最多 20 个",
            "title": "Exclude Accounts"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：去掉余额为 0 的往来单位",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户或供应商编码等于",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "side": {
            "description": "ar 应收（按客户），ap 应付（按供应商）",
            "enum": [
              "ar",
              "ap"
            ],
            "title": "Side",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "side"
        ],
        "title": "ReportArapIn",
        "type": "object"
      },
      "ReportArapOut": {
        "additionalProperties": true,
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期",
            "title": "As Of"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按往来单位编码排序：partner、name、debit、credit、balance。应收 balance = 借 − 贷，应付 balance = 贷 − 借。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "ar 或 ap",
            "title": "Side"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportArapOut",
        "type": "object"
      },
      "ReportBatchStockIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "batch": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "批号等于",
            "title": "Batch"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "expiring_before": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "只要失效日期（valid_until）不晚于这一天的批次 yyyy-MM-dd，用于保质期预警。没有失效日期的批次不列",
            "title": "Expiring Before"
          },
          "inv": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码等于",
            "title": "Inv"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：去掉数量为 0 的行",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "wh": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "仓库编码等于",
            "title": "Wh"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportBatchStockIn",
        "type": "object"
      },
      "ReportBatchStockOut": {
        "additionalProperties": true,
        "properties": {
          "expiring_before": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "失效日期上限，没给时为 null",
            "title": "Expiring Before"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按仓库、存货、批号排序：wh_code、wh_name、inv_code、inv_name、inv_std、batch、qty、qty_aux、qty_frozen、made_date、valid_until、expires（多行时取最早）、rows（合并的现存量行数）。数量为数字（六位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportBatchStockOut",
        "type": "object"
      },
      "ReportBomIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "生效日期 yyyy-MM-dd。取当天有效的已审核版本（同时有效时取最高版本）和当天有效的子件。缺省为 date",
            "title": "As Of"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "levels": {
            "anyOf": [
              {
                "maximum": 10.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "展开层数，1 到 10，缺省 1（单层）",
            "title": "Levels"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 5000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "最多返回的行数，1 到 5000，缺省 1000。超出时 truncated 为 true",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "parent": {
            "description": "母件存货编码，1 到 60 个字符",
            "maxLength": 60,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
            "title": "Parent",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "parent"
        ],
        "title": "ReportBomIn",
        "type": "object"
      },
      "ReportBomOut": {
        "additionalProperties": true,
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "生效日期",
            "title": "As Of"
          },
          "bom_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单主键（bom_bom.BomId）",
            "title": "Bom Id"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按层级、母件、序号、子件排序：level、parent、component、name、spec、sort、qty_n、qty_d、qty、path。qty 是每 1 个根母件累计需要的数量；成环的子件不再展开",
            "title": "Items"
          },
          "levels": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "展开层数",
            "title": "Levels"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "parent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "母件存货编码",
            "title": "Parent"
          },
          "truncated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "行数超过 limit 时为 true（物料清单不分页）",
            "title": "Truncated"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "物料清单版本号",
            "title": "Version"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportBomOut",
        "type": "object"
      },
      "ReportCloseStatusIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度，2000 到 2099。缺省为登录日期（date）的年份；year 是账套库年度，不参与判断",
            "title": "Fiscal Year"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportCloseStatusIn",
        "type": "object"
      },
      "ReportCloseStatusOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "modules": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "模块代码：SA 销售、PU 采购、ST 库存、IA 存货核算、GL 总账、AR 应收、AP 应付、CA 成本、FA 固定资产",
            "title": "Modules"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "periods": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "该年度已建立的期间 1 到 12，升序：period 和 closed（模块代码 → 是否已结账）。年度未建立时为空数组",
            "title": "Periods"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportCloseStatusOut",
        "type": "object"
      },
      "ReportCustomerCreditIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "controlled_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时只列档案上勾了信用额度控制的客户",
            "title": "Controlled Only"
          },
          "customer": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 60,
                  "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                  "type": "string"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码，1 到 20 个。缺省全部客户（按编码翻页）",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 200.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 200，缺省 100",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportCustomerCreditIn",
        "type": "object"
      },
      "ReportCustomerCreditOut": {
        "additionalProperties": true,
        "properties": {
          "ar_enabled": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "应收款管理是否已启用（应收余额只在启用时计入 used）",
            "title": "Ar Enabled"
          },
          "balance_table": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "销售选项：信用余额控制用余额表",
            "title": "Balance Table"
          },
          "check_point": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "信用检查点：save 保存（含未审核单据）或 verify 审核",
            "title": "Check Point"
          },
          "credit_control": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "销售选项：是否有客户信用额度控制",
            "title": "Credit Control"
          },
          "formula": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "额度检查公式里各项是否打开（order、dispatch、invoice、ar、expense 等）",
            "title": "Formula"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按客户编码排序：code、name、controlled、credit_line、credit_days、credit_days_controlled、credit_grade、credit_company、order、dispatch、invoice、ar、expense、used、available（受控客户 = credit_line − used，否则 null）。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "unsupported": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "公式里打开了、本报表不计算的项（合同结算单、出口单据）",
            "title": "Unsupported"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportCustomerCreditOut",
        "type": "object"
      },
      "ReportDocTraceIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "depth": {
            "anyOf": [
              {
                "maximum": 3.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每个方向最多找几跳，1 到 3，缺省 3",
            "title": "Depth"
          },
          "direction": {
            "anyOf": [
              {
                "enum": [
                  "both",
                  "up",
                  "down"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "both 上下游都找（缺省）；up 只找上游（来源）；down 只找下游（去向）",
            "title": "Direction"
          },
          "id": {
            "description": "起点单据 id（表头主键）",
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Id",
            "type": "integer"
          },
          "max_nodes": {
            "anyOf": [
              {
                "maximum": 200.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "最多返回的节点数（含起点），1 到 200，缺省 200。超出时 truncated 为 true",
            "title": "Max Nodes"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "起点单据类型",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_return",
              "sale_return_apply",
              "sale_out",
              "sale_invoice",
              "ar_receipt",
              "purchase_requisition",
              "purchase_order",
              "arrival",
              "purchase_return",
              "purchase_in",
              "purchase_invoice",
              "ap_payment",
              "ap_refund",
              "ar_refund",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "qm_other_inspect",
              "qm_other_check",
              "production_order",
              "material_out",
              "product_in",
              "bom"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "ReportDocTraceIn",
        "type": "object"
      },
      "ReportDocTraceOut": {
        "additionalProperties": true,
        "properties": {
          "depth": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "每个方向的跳数",
            "title": "Depth"
          },
          "direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "both、up 或 down",
            "title": "Direction"
          },
          "edges": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "边（上游 → 下游）：from_type、from_id、to_type、to_id、lines（关联的明细行数，收付款为核销记录数）",
            "title": "Edges"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起点单据 id",
            "title": "Id"
          },
          "nodes": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "节点：type、id、code、date、state（unverified 未审核、verified 已审核、closed 已关闭）、level（起点 0，下游为正、上游为负的跳数）。起点在第一项",
            "title": "Nodes"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "omitted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "因没有数据权限而没有列出的单据数（这些单据也不再往下找）",
            "title": "Omitted"
          },
          "truncated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "节点数到 max_nodes 或关联行过多而停止时为 true",
            "title": "Truncated"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起点单据类型",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportDocTraceOut",
        "type": "object"
      },
      "ReportFaChangesIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "card": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "卡片编号（fa_card 的 code）",
            "title": "Card"
          },
          "change_type": {
            "anyOf": [
              {
                "maximum": 99.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "变动单类型（U8 的 iVoucherType，如 1 原值增加、11 计提减值准备），名称见响应的 change_name",
            "title": "Change Type"
          },
          "code": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,10}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "变动单号",
            "title": "Code"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度，2000 到 2099，指固定资产业务年度（折旧年度、变动日期的年份），不是账套库年份 year。缺省为登录日期（date）的年份",
            "title": "Fiscal Year"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "anyOf": [
              {
                "maximum": 12.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间 1 到 12，缺省全年",
            "title": "Period"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportFaChangesIn",
        "type": "object"
      },
      "ReportFaChangesOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按变动单号排序：code（变动单号）、card_code、asset_name（变动后版本的资产名称）、opt_id（变动后卡片版本）、pre_opt_id（变动前版本）、change_type、change_name、before_value、after_value、reason、change_date、period、operator、currency、exchange_rate、site_after、keeper_after、effective（当期生效）、gl_sign、gl_num，depts（dept_code、dept_name、before_value、after_value）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportFaChangesOut",
        "type": "object"
      },
      "ReportFaDepreciationIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "card": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "卡片编号（fa_card 的 code）",
            "title": "Card"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度，2000 到 2099，指固定资产业务年度（折旧年度、变动日期的年份），不是账套库年份 year。缺省为登录日期（date）的年份",
            "title": "Fiscal Year"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时去掉当月折旧为 0 的行。缺省 false",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period": {
            "anyOf": [
              {
                "maximum": 12.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计期间 1 到 12，缺省全年",
            "title": "Period"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportFaDepreciationIn",
        "type": "object"
      },
      "ReportFaDepreciationOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按卡片编号、期间排序，只含已计提期间：card_code、asset_num、asset_name、period、depr_date、amount（当月折旧）、accumulated（当月末累计折旧）、rate（月折旧率）、month_value（月初原值）、depr_months、used_months",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "posted_periods": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "该年度已计提折旧的期间；没出现在这里的期间没有折旧行",
            "title": "Posted Periods"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportFaDepreciationOut",
        "type": "object"
      },
      "ReportGlAuxIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "code_prefix": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目编码前缀，规则同 gl_balance",
            "title": "Code Prefix"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dim": {
            "description": "辅助核算维度：customer 客户、vendor 供应商、dept 部门、person 个人、project 项目",
            "enum": [
              "customer",
              "vendor",
              "dept",
              "person",
              "project"
            ],
            "title": "Dim",
            "type": "string"
          },
          "dim_code": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "维度编码等于，1 到 60 个字符",
            "title": "Dim Code"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度，2000 到 2099。缺省为登录日期（date）的年份；year 是账套库年度，不参与判断",
            "title": "Fiscal Year"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时去掉期初、本期、累计、期末全为 0 的行",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          },
          "project_class": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z]{1,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目大类编码，只能和 dim=project 一起用",
            "title": "Project Class"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "dim",
          "period_from",
          "period_to"
        ],
        "title": "ReportGlAuxIn",
        "type": "object"
      },
      "ReportGlAuxOut": {
        "additionalProperties": true,
        "properties": {
          "dim": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "辅助核算维度",
            "title": "Dim"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按科目、项目大类、维度编码排序：code、name、dim_code、dim_name、project_class，以及与 gl_balance 相同的期初、本期、累计、期末列。项目的 dim_name 为 null。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "period_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始期间",
            "title": "Period From"
          },
          "period_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止期间",
            "title": "Period To"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportGlAuxOut",
        "type": "object"
      },
      "ReportGlBalanceIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "code_prefix": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目编码前缀，1 到 40 位数字、字母、点或短横",
            "title": "Code Prefix"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度，2000 到 2099。缺省为登录日期（date）的年份；year 是账套库年度，不参与判断",
            "title": "Fiscal Year"
          },
          "grade_from": {
            "anyOf": [
              {
                "maximum": 9.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目级次下限，1 到 9，缺省 1",
            "title": "Grade From"
          },
          "grade_to": {
            "anyOf": [
              {
                "maximum": 9.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目级次上限，1 到 9，缺省 9，不小于 grade_from",
            "title": "Grade To"
          },
          "include_unposted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时含未记账凭证（不含作废），汇总到上级科目：period_from 之前的计入期初，period_from 到 period_to 的计入本期，累计和期末都含。只有未记账凭证的科目也列出",
            "title": "Include Unposted"
          },
          "leaf_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时只要末级科目",
            "title": "Leaf Only"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时去掉期初、本期、累计、期末全为 0 的行",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period_from": {
            "description": "起始期间，1 到 12",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period From",
            "type": "integer"
          },
          "period_to": {
            "description": "截止期间，1 到 12，不小于 period_from",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "Period To",
            "type": "integer"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "period_from",
          "period_to"
        ],
        "title": "ReportGlBalanceIn",
        "type": "object"
      },
      "ReportGlBalanceOut": {
        "additionalProperties": true,
        "properties": {
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "include_unposted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否含未记账凭证",
            "title": "Include Unposted"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按科目编码排序：code、name、grade、leaf、class、natural_dir、open_dir、open_debit、open_credit、period_debit、period_credit、ytd_debit、ytd_credit、close_dir、close_debit、close_credit。上级科目已含下级，不要跨级相加。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "period_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始期间",
            "title": "Period From"
          },
          "period_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止期间",
            "title": "Period To"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportGlBalanceOut",
        "type": "object"
      },
      "ReportGlDetailIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "code": {
            "description": "科目编码，1 到 40 位数字、字母、点或短横",
            "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
            "title": "Code",
            "type": "string"
          },
          "customer": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码等于（辅助核算）",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始日期 yyyy-MM-dd（含）。与期间二选一",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd（含），与 date_from 同一年",
            "title": "Date To"
          },
          "dept": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码等于（辅助核算）",
            "title": "Dept"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度。按期间查询时缺省为登录日期（date）的年份；按日期查询时取日期的年份，给了就必须一致",
            "title": "Fiscal Year"
          },
          "include_sub": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：含下级科目（编码以 code 开头的末级科目）；false 只查 code 本身（只对末级科目有意义）",
            "title": "Include Sub"
          },
          "include_unposted": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时含未记账凭证（不含作废）：起始期间之前的计入期初，区间内的列为明细（posted 为 false）",
            "title": "Include Unposted"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "period_from": {
            "anyOf": [
              {
                "maximum": 12.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始期间，1 到 12。与日期二选一",
            "title": "Period From"
          },
          "period_to": {
            "anyOf": [
              {
                "maximum": 12.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止期间，1 到 12，不小于 period_from",
            "title": "Period To"
          },
          "person": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "个人编码等于（辅助核算）",
            "title": "Person"
          },
          "project": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目编码等于（辅助核算）",
            "title": "Project"
          },
          "project_class": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "项目大类编码，只能和 project 一起用",
            "title": "Project Class"
          },
          "vendor": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商编码等于（辅助核算）",
            "title": "Vendor"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "code"
        ],
        "title": "ReportGlDetailIn",
        "type": "object"
      },
      "ReportGlDetailOut": {
        "additionalProperties": true,
        "properties": {
          "close_credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期末贷方余额",
            "title": "Close Credit"
          },
          "close_debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期末借方余额",
            "title": "Close Debit"
          },
          "close_dir": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期末方向",
            "title": "Close Dir"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目编码",
            "title": "Code"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始日期，按期间查询时为 null",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期，按期间查询时为 null",
            "title": "Date To"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "会计年度",
            "title": "Fiscal Year"
          },
          "include_sub": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否含下级科目",
            "title": "Include Sub"
          },
          "include_unposted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否含未记账凭证",
            "title": "Include Unposted"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按期间、日期、凭证类别、凭证号、分录号排序：period、date、sign、no、entry、digest、account、account_name、debit、credit、posted、dept、person、customer、supplier、item_class、item，以及滚动余额 dir（借、贷、平）和 balance（绝对值）。金额为数字（本币，两位小数）",
            "title": "Items"
          },
          "leaf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否末级科目",
            "title": "Leaf"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "科目名称",
            "title": "Name"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "open_credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初贷方余额",
            "title": "Open Credit"
          },
          "open_debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初借方余额",
            "title": "Open Debit"
          },
          "open_dir": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初方向：借、贷、平。期初、合计、期末是整个区间的，每页相同",
            "title": "Open Dir"
          },
          "period_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始期间（按日期查询时是 date_from 的月份）",
            "title": "Period From"
          },
          "period_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止期间",
            "title": "Period To"
          },
          "total_credit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "区间贷方合计",
            "title": "Total Credit"
          },
          "total_debit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "区间借方合计",
            "title": "Total Debit"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportGlDetailOut",
        "type": "object"
      },
      "ReportOpeningIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "batch": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=stock：批号等于",
            "title": "Batch"
          },
          "code_prefix": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=arap 或 gl：科目编码前缀",
            "title": "Code Prefix"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "dim": {
            "anyOf": [
              {
                "enum": [
                  "customer",
                  "vendor",
                  "dept",
                  "person",
                  "project"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=gl：按辅助项列期初（customer、vendor、dept、person、project）。缺省按科目",
            "title": "Dim"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "maximum": 2099.0,
                "minimum": 2000.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "只用于 module=gl：会计年度，缺省为登录日期（date）的年份，不能早于总账启用年度",
            "title": "Fiscal Year"
          },
          "inv": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=stock：存货编码等于",
            "title": "Inv"
          },
          "leaf_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=gl：为 true 时只要末级科目",
            "title": "Leaf Only"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "module": {
            "description": "stock 库存期初（按仓库、存货、批号），arap 应收或应付期初（按往来单位、科目），gl 总账期初余额（按科目或辅助项）",
            "enum": [
              "stock",
              "arap",
              "gl"
            ],
            "title": "Module",
            "type": "string"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：去掉期初为 0 的行",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=arap：客户或供应商编码等于",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "side": {
            "anyOf": [
              {
                "enum": [
                  "ar",
                  "ap"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=arap 时必填：ar 应收，ap 应付",
            "title": "Side"
          },
          "wh": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=stock：仓库编码等于",
            "title": "Wh"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "module"
        ],
        "title": "ReportOpeningIn",
        "type": "object"
      },
      "ReportOpeningOut": {
        "additionalProperties": true,
        "properties": {
          "dim": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=gl：辅助项维度，按科目时为 null",
            "title": "Dim"
          },
          "fiscal_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=gl：会计年度",
            "title": "Fiscal Year"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "stock：按仓库、存货、批号排序：wh_code、wh_name、inv_code、inv_name、inv_std、batch、qty、qty_aux、amount、lines、unverified_lines。arap：按往来单位、科目排序：partner_code、partner_name、account、account_name、debit、credit、balance_dir、balance_debit、balance_credit、docs、unverified_docs。gl 按科目：code、name、grade、leaf、natural_dir、open_dir、open_debit、open_credit、pre_debit、pre_credit（启用前累计）；gl 按辅助项：code、name、dim_code、dim_name、project_class、open_dir、open_debit、open_credit",
            "title": "Items"
          },
          "module": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "stock、arap 或 gl",
            "title": "Module"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "opening_year": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初所在年度：库存、往来是启用年度，总账是 fiscal_year",
            "title": "Opening Year"
          },
          "period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=gl：取期初的期间（启用年度为启用月份，其余为 1）",
            "title": "Period"
          },
          "posted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "期初是否已记账（GL_mend 第 0 期的该模块标志）。已记账的期初在 U8 里不能再改",
            "title": "Posted"
          },
          "side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=arap 时的 ar / ap，其余为 null",
            "title": "Side"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "该模块的启用日期 yyyy-MM-dd；模块没有启用时为 null",
            "title": "Start Date"
          },
          "trial": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "module=gl 按科目的第一页：末级科目期初试算 debit、credit、difference、balanced；其余情况为 null",
            "title": "Trial"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportOpeningOut",
        "type": "object"
      },
      "ReportOrderExecIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "code": {
            "anyOf": [
              {
                "maxLength": 30,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "订单号等于，1 到 30 个字符",
            "title": "Code"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "订单日期起 yyyy-MM-dd（含）",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "订单日期止 yyyy-MM-dd（含）",
            "title": "Date To"
          },
          "ids": {
            "anyOf": [
              {
                "items": {
                  "maximum": 2147483647.0,
                  "minimum": 1.0,
                  "type": "integer"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "订单 id，1 到 100 个。不能和 code、date_from、date_to、partner 一起用",
            "title": "Ids"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页行数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "only_open": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时只要未执行完且未关闭的行：订单和行都没关闭，且销售的发货、出库、开票（采购的入库、开票）有一项未到订单数量",
            "title": "Only Open"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 20,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户（销售）或供应商（采购）编码等于",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "sale_order 销售订单，purchase_order 采购订单",
            "enum": [
              "sale_order",
              "purchase_order"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type"
        ],
        "title": "ReportOrderExecIn",
        "type": "object"
      },
      "ReportOrderExecOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按订单 id、行 id 排序，每行一项：id、code、date、partner、partner_name、currency、verified、closed、open、line_id、row_no、inv_code、inv_name、inv_std、due_date、qty、amount、nat_amount、invoiced_qty、invoiced_amount、returned_qty；销售另有 shipped_qty、shipped_amount、out_qty、received_amount、received_nat_amount，采购另有 arrived_qty、arrived_amount、in_qty、paid_amount、paid_nat_amount。执行数取 U8 订单行上的累计列",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "only_open": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否只列未执行完的行",
            "title": "Only Open"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "sale_order 或 purchase_order",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportOrderExecOut",
        "type": "object"
      },
      "ReportPositionStockIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "batch": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "批号等于",
            "title": "Batch"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "inv": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码等于",
            "title": "Inv"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：去掉数量为 0 的行",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "position": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "货位编码前缀（含下级货位）",
            "title": "Position"
          },
          "wh": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "仓库编码等于",
            "title": "Wh"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportPositionStockIn",
        "type": "object"
      },
      "ReportPositionStockOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按货位存量主键排序：id、wh_code、wh_name、position、position_name、inv_code、inv_name、inv_std、batch、free1 到 free10、qty、qty_aux、made_date、valid_until、expires。只含已指定货位的数量。数量为数字（六位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportPositionStockOut",
        "type": "object"
      },
      "ReportPriceListIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "all_dates": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时不按日期过滤（含已过期、未生效、已失效的行）",
            "title": "All Dates"
          },
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "生效日期 yyyy-MM-dd：只列这一天有效、未失效的价格。缺省为 date",
            "title": "As Of"
          },
          "customer": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户编码，只能和 kind=customer 一起用。连同该客户所属分类的价格",
            "title": "Customer"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "inv": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码等于",
            "title": "Inv"
          },
          "kind": {
            "description": "customer 客户价格表、inventory 存货价格表（销售）、vendor 供应商存货价格表（采购）",
            "enum": [
              "customer",
              "inventory",
              "vendor"
            ],
            "title": "Kind",
            "type": "string"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "vendor": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "供应商编码，只能和 kind=vendor 一起用",
            "title": "Vendor"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "kind"
        ],
        "title": "ReportPriceListIn",
        "type": "object"
      },
      "ReportPriceListOut": {
        "additionalProperties": true,
        "properties": {
          "as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "生效日期；all_dates 时为 null",
            "title": "As Of"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按价格表主键排序：id、inv_code、inv_name、inv_std、currency、start_date、end_date、min_qty、tax_included、promotion、memo；customer 另有 customer、customer_class、invalid、quote、discount_rate、price、min_price；inventory 另有 invalid、levels（level、price、tax_price）；vendor 另有 vendor、max_qty、price、tax_price、tax_rate、supply_type",
            "title": "Items"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "价格表种类",
            "title": "Kind"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportPriceListOut",
        "type": "object"
      },
      "ReportReadinessIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "as_of": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "检查年度和工作日历用的日期 yyyy-MM-dd，缺省为登录日期（date）。另外总会按服务器当天再查一次",
            "title": "As Of"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password"
        ],
        "title": "ReportReadinessIn",
        "type": "object"
      },
      "ReportReadinessOut": {
        "additionalProperties": true,
        "properties": {
          "acc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "账套号",
            "title": "Acc"
          },
          "as_of": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "检查用的日期 yyyy-MM-dd",
            "title": "As Of"
          },
          "checks": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "检查项：id、title、status（ok、warn、fail、unknown）、detail（计数、日期、缺的编码）、fix_hint（怎么修）、docs_anchor（getting-started.md 里的小节）、safe（检查本身只读，总为 true）。id 有 patches、years、calendar、yearly_config、pu_opening、vendor_extradefine、modules、prior_gl_close、workflow、defaults",
            "title": "Checks"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "overall": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "各项中最差的状态：fail 比 unknown 差，unknown 比 warn 差，warn 比 ok 差",
            "title": "Overall"
          },
          "server_today": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "数据库服务器当天 yyyy-MM-dd",
            "title": "Server Today"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportReadinessOut",
        "type": "object"
      },
      "ReportStockLedgerIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "batch": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "批号等于",
            "title": "Batch"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "description": "起始日期 yyyy-MM-dd（含），期初是这一天之前的累计",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Date From",
            "type": "string"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd（含），缺省为 date",
            "title": "Date To"
          },
          "include_unverified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时连未审核的收发记录一起算（期初也含）。缺省只含已审核，与现存量一致",
            "title": "Include Unverified"
          },
          "inv": {
            "description": "存货编码，1 到 60 个字符",
            "maxLength": 60,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
            "title": "Inv",
            "type": "string"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "wh": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "仓库编码等于。缺省全部仓库合在一起滚动结存",
            "title": "Wh"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "date_from",
          "inv"
        ],
        "title": "ReportStockLedgerIn",
        "type": "object"
      },
      "ReportStockLedgerOut": {
        "additionalProperties": true,
        "properties": {
          "carry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "本页第一行之前的结存。第一页等于 opening",
            "title": "Carry"
          },
          "closing": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "date_to 的结存；只在最后一页给出，其余页为 null",
            "title": "Closing"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始日期",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期",
            "title": "Date To"
          },
          "inv": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码",
            "title": "Inv"
          },
          "inv_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货名称",
            "title": "Inv Name"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按日期、表体行号排序：date、type（purchase_in、other_in、other_out、product_in、material_out、sale_out、stock_opening）、id、line_id、code、wh_code、wh_name、batch、rd_code、source、verified、in_qty、out_qty、balance（本行之后的结存）。数量为数字（六位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          },
          "opening": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "date_from 之前的结存（期初）",
            "title": "Opening"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportStockLedgerOut",
        "type": "object"
      },
      "ReportStockSummaryIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "by_wh": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：按存货 + 仓库分行；false 时每个存货一行（仓库合计）",
            "title": "By Wh"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "description": "起始日期 yyyy-MM-dd（含），期初是这一天之前的累计",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "title": "Date From",
            "type": "string"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期 yyyy-MM-dd（含），缺省为 date",
            "title": "Date To"
          },
          "include_unverified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "为 true 时连未审核的收发记录一起算（期初也含）。缺省只含已审核，与现存量一致",
            "title": "Include Unverified"
          },
          "inv": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码等于",
            "title": "Inv"
          },
          "inv_class": {
            "anyOf": [
              {
                "pattern": "^[0-9A-Za-z.\\-]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货分类编码前缀（含下级），1 到 40 位数字、字母、点或短横",
            "title": "Inv Class"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 1000.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 1000，缺省 200",
            "title": "Limit"
          },
          "nonzero": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "缺省 true：去掉期初、入库、出库都为 0 的行",
            "title": "Nonzero"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "wh": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "仓库编码等于",
            "title": "Wh"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "date_from"
        ],
        "title": "ReportStockSummaryIn",
        "type": "object"
      },
      "ReportStockSummaryOut": {
        "additionalProperties": true,
        "properties": {
          "by_wh": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "是否按仓库分行",
            "title": "By Wh"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "起始日期",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "截止日期",
            "title": "Date To"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按存货、仓库编码排序：inv_code、inv_name、inv_std、inv_class、wh_code、wh_name（by_wh=false 时为 null）、opening、in_qty、out_qty、closing。只有数量，没有金额。数量为数字（六位小数）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportStockSummaryOut",
        "type": "object"
      },
      "ReportWriteoffsIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "pattern": "^[\\x21-\\x7e]{1,512}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next，原样传回",
            "title": "After"
          },
          "cancel_no": {
            "anyOf": [
              {
                "pattern": "^HX(AR|AP)[0-9]{1,20}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "核销号（HXAR… / HXAP…），前缀须与 flag 一致",
            "title": "Cancel No"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记日期下限 yyyy-MM-dd（含）",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登记日期上限 yyyy-MM-dd（含）",
            "title": "Date To"
          },
          "flag": {
            "description": "应收 AR 或应付 AP，也是登录子系统",
            "enum": [
              "AR",
              "AP"
            ],
            "title": "Flag",
            "type": "string"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 200.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页批数，1 到 200，缺省 50",
            "title": "Limit"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户或供应商编码等于",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WriteoffReceiptRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "只看这张收付款单的核销；与 receipt_code 二选一"
          },
          "receipt_code": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "收付款单号等于；与 receipt 二选一",
            "title": "Receipt Code"
          },
          "target": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WriteoffTargetRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "只看核销了这张单据的批次；与 target_code 二选一"
          },
          "target_code": {
            "anyOf": [
              {
                "maxLength": 60,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f][^\\x00-\\x1f\\x7f-\\x9f]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "被核销单据的单号等于；与 target 二选一",
            "title": "Target Code"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "flag"
        ],
        "title": "ReportWriteoffsIn",
        "type": "object"
      },
      "ReportWriteoffsOut": {
        "additionalProperties": true,
        "properties": {
          "flag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "AR 或 AP",
            "title": "Flag"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "每批一项：cancel_no、flag、date（登记日期）、year、period（U8 会计期间）、partner、currency、operator、receipt（type：ar_receipt / ap_payment，退款方向为 null；vouch_type、id、line_id（只涉及一行时）、line_ids、code）、targets（每个被核销单据行：type、vouch_type、id、line_id（发票行，应收应付单为 null）、code、amount）、amount（targets 合计）、gl_voucher、voucher（已制单时 {id, sign, no, date}，否则 null）、cancellable、reason（cancellable 为 false 时的原因，否则 null）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页为 null",
            "title": "Next"
          },
          "ok": {
            "description": "是否读到",
            "title": "Ok",
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "ReportWriteoffsOut",
        "type": "object"
      },
      "ResolveCandidate": {
        "additionalProperties": true,
        "properties": {
          "abbr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "简称（客户、供应商）",
            "title": "Abbr"
          },
          "class_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "分类编码",
            "title": "Class Code"
          },
          "code": {
            "description": "档案编码（项目是 <项目大类>:<项目编码>）",
            "title": "Code",
            "type": "string"
          },
          "disabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "已停用或已关闭（只在 include_disabled 时出现）",
            "title": "Disabled"
          },
          "match": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "命中的层级：code、name、abbr、mnemonic、add_code、contains",
            "title": "Match"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "名称",
            "title": "Name"
          },
          "spec": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "规格型号（存货）",
            "title": "Spec"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "主计量单位编码（存货）",
            "title": "Unit"
          }
        },
        "required": [
          "code"
        ],
        "title": "ResolveCandidate",
        "type": "object"
      },
      "ResolveIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "include_disabled": {
            "default": false,
            "description": "true 时也返回已停用、已关闭的档案（标 disabled）",
            "title": "Include Disabled",
            "type": "boolean"
          },
          "items": {
            "description": "要解析的项，1 到 20 项",
            "items": {
              "$ref": "#/components/schemas/ResolveItemIn"
            },
            "maxItems": 20,
            "minItems": 1,
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "default": 5,
            "description": "每项最多返回的候选数，1 到 20，缺省 5",
            "maximum": 20.0,
            "minimum": 1.0,
            "title": "Limit",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "items"
        ],
        "title": "ResolveIn",
        "type": "object"
      },
      "ResolveItemIn": {
        "additionalProperties": false,
        "properties": {
          "archive": {
            "description": "档案类型（两列主键的档案、汇率、固定资产卡片、设备台账除外）",
            "enum": [
              "customer",
              "vendor",
              "inventory",
              "department",
              "person",
              "warehouse",
              "customer_class",
              "vendor_class",
              "inventory_class",
              "account",
              "unit",
              "unit_group",
              "settle_style",
              "voucher_sign",
              "currency",
              "bank",
              "project",
              "position",
              "rd_style",
              "purchase_type",
              "sale_type",
              "district_class",
              "trade_class",
              "aa_bank",
              "operator",
              "role",
              "reason"
            ],
            "title": "Archive",
            "type": "string"
          },
          "q": {
            "description": "要解析的名称、简称、助记码或编码，去掉首尾空白后 1 到 100 个字符",
            "maxLength": 200,
            "minLength": 1,
            "title": "Q",
            "type": "string"
          }
        },
        "required": [
          "archive",
          "q"
        ],
        "title": "ResolveItemIn",
        "type": "object"
      },
      "ResolveOut": {
        "additionalProperties": true,
        "properties": {
          "ok": {
            "description": "总是 true",
            "title": "Ok",
            "type": "boolean"
          },
          "results": {
            "description": "与 items 一一对应",
            "items": {
              "$ref": "#/components/schemas/ResolveResult"
            },
            "title": "Results",
            "type": "array"
          }
        },
        "required": [
          "ok",
          "results"
        ],
        "title": "ResolveOut",
        "type": "object"
      },
      "ResolveResult": {
        "additionalProperties": true,
        "properties": {
          "archive": {
            "description": "档案类型（原样）",
            "title": "Archive",
            "type": "string"
          },
          "candidates": {
            "description": "胜出层级的候选，最多 limit 条",
            "items": {
              "$ref": "#/components/schemas/ResolveCandidate"
            },
            "title": "Candidates",
            "type": "array"
          },
          "match": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResolveCandidate"
              },
              {
                "type": "null"
              }
            ],
            "description": "唯一命中（exact、partial）"
          },
          "more": {
            "default": false,
            "description": "胜出层级的命中多于 limit 条",
            "title": "More",
            "type": "boolean"
          },
          "q": {
            "description": "查询词（去掉首尾空白）",
            "title": "Q",
            "type": "string"
          },
          "status": {
            "description": "解析结果",
            "enum": [
              "exact",
              "ambiguous",
              "partial",
              "none"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "archive",
          "q",
          "status"
        ],
        "title": "ResolveResult",
        "type": "object"
      },
      "VoucherAttachIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "id": {
            "description": "单据主键，1 到 2147483647，同 vouchers/load",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "type": {
            "description": "单据类型，同 vouchers/load",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_invoice",
              "purchase_order",
              "arrival",
              "purchase_invoice",
              "purchase_in",
              "other_in",
              "other_out",
              "product_in",
              "material_out",
              "sale_out",
              "transfer",
              "production_order",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_check",
              "stock_opening",
              "qm_other_inspect",
              "qm_other_check",
              "purchase_settle",
              "position_adjust",
              "ia_adjust",
              "inventory_price_adjust",
              "sale_return_apply"
            ],
            "title": "Type",
            "type": "string"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type",
          "id"
        ],
        "title": "VoucherAttachIn",
        "type": "object"
      },
      "VoucherAttachOut": {
        "additionalProperties": true,
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据主键",
            "title": "Id"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按文件名排序：card（U8 卡片号）、file_id、name、memo、size（存在库里时的字节数，否则 null）、stored（database 内容存在 U8 库里，file_server 只登记了文件服务器上的文件标识）。没有附件时为空数组",
            "title": "Items"
          },
          "ok": {
            "description": "是否读到单据",
            "title": "Ok",
            "type": "boolean"
          },
          "truncated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "超过 500 个附件时为 true，只列前 500 个",
            "title": "Truncated"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "VoucherAttachOut",
        "type": "object"
      },
      "VoucherSearchIn": {
        "additionalProperties": false,
        "examples": [
          {
            "acc": "801",
            "operator": "op001"
          }
        ],
        "properties": {
          "acc": {
            "description": "账套号，三位数字",
            "examples": [
              "801"
            ],
            "pattern": "^\\d{3}$",
            "title": "Acc",
            "type": "string"
          },
          "after": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "上一页响应的 next（最后一个主键），按主键续读",
            "title": "After"
          },
          "closed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 只要已关闭，false 只要未关闭",
            "title": "Closed"
          },
          "code_like": {
            "anyOf": [
              {
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,40}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据编号包含这段文字，1 到 40 个字符",
            "title": "Code Like"
          },
          "date": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "登录日期，yyyy-MM-dd。缺省为 U8CO_TIMEZONE 时区的今天",
            "title": "Date"
          },
          "date_from": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据日期下限，yyyy-MM-dd，含当天",
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据日期上限，yyyy-MM-dd，含当天",
            "title": "Date To"
          },
          "defines": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "additionalProperties": true,
                      "type": "object"
                    }
                  ]
                },
                "maxProperties": 4,
                "minProperties": 1,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "表头自定义项条件，1 到 4 个键。\n\n- 键：define1、define2、define3、define8、define9、define10、define11、define12、define13、define14\n- 值：字符串（规整后相等）或 {eq | like | prefix: 字符串}，1 到 120 个字符\n- 键由桥核对，不认识的键 400（field 为 defines.<键>）",
            "examples": [
              {
                "define1": "HT202609039"
              },
              {
                "define1": {
                  "prefix": "HT2026"
                },
                "define10": {
                  "like": "框架"
                }
              }
            ],
            "title": "Defines"
          },
          "dept": {
            "anyOf": [
              {
                "description": "1 到 60 个字符，不含控制字符",
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "部门编码",
            "title": "Dept"
          },
          "inventory": {
            "anyOf": [
              {
                "description": "1 到 60 个字符，不含控制字符",
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "存货编码：明细里有这个存货的单据",
            "title": "Inventory"
          },
          "limit": {
            "anyOf": [
              {
                "maximum": 200.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "每页条数，1 到 200，缺省 50",
            "title": "Limit"
          },
          "maker": {
            "anyOf": [
              {
                "description": "1 到 60 个字符，不含控制字符",
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "制单人",
            "title": "Maker"
          },
          "operator": {
            "description": "U8 操作员编码，1 到 20 个字符，不含空白、引号或分号",
            "examples": [
              "op001"
            ],
            "maxLength": 20,
            "minLength": 1,
            "title": "Operator",
            "type": "string"
          },
          "partner": {
            "anyOf": [
              {
                "description": "1 到 60 个字符，不含控制字符",
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "客户或供应商编码（收付款单、应收应付单是往来单位）",
            "title": "Partner"
          },
          "password": {
            "description": "U8 操作员口令。每次请求单独提交，服务不保存",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password",
            "type": "string",
            "writeOnly": true
          },
          "person": {
            "anyOf": [
              {
                "description": "1 到 60 个字符，不含控制字符",
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "业务员编码",
            "title": "Person"
          },
          "type": {
            "description": "单据类型，与 vouchers/list 相同",
            "enum": [
              "sale_order",
              "dispatch",
              "sale_invoice",
              "purchase_order",
              "arrival",
              "purchase_invoice",
              "purchase_in",
              "other_in",
              "other_out",
              "product_in",
              "material_out",
              "sale_out",
              "transfer",
              "production_order",
              "qm_incoming_check",
              "qm_product_check",
              "qm_incoming_reject",
              "qm_product_reject",
              "ar_receipt",
              "ap_payment",
              "ar_bill",
              "ap_bill",
              "ap_refund",
              "ar_refund",
              "purchase_return",
              "sale_return",
              "purchase_requisition",
              "qm_incoming_inspect",
              "qm_product_inspect",
              "bom",
              "shape_change",
              "transfer_request",
              "stock_check",
              "stock_opening",
              "qm_other_inspect",
              "qm_other_check",
              "purchase_settle",
              "position_adjust",
              "ia_adjust",
              "inventory_price_adjust",
              "sale_return_apply"
            ],
            "title": "Type",
            "type": "string"
          },
          "verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "true 只要已审核，false 只要未审核",
            "title": "Verified"
          },
          "warehouse": {
            "anyOf": [
              {
                "description": "1 到 60 个字符，不含控制字符",
                "pattern": "^[^\\x00-\\x1f\\x7f]{1,60}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "表头仓库编码",
            "title": "Warehouse"
          },
          "year": {
            "anyOf": [
              {
                "pattern": "^\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "四位会计年度。缺省为登录日期的年份",
            "title": "Year"
          }
        },
        "required": [
          "acc",
          "operator",
          "password",
          "type"
        ],
        "title": "VoucherSearchIn",
        "type": "object"
      },
      "VoucherSearchOut": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "按主键排序的单据表头，与 vouchers/list 的条目相同；有往来单位列的类型另有 partner_name；请求给了 defines 时另有 defines（请求里各键的表头值，规整后，空为 null）",
            "title": "Items"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "下一页的 after。最后一页省略",
            "title": "Next"
          },
          "ok": {
            "description": "是否查到列表",
            "title": "Ok",
            "type": "boolean"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据类型",
            "title": "Type"
          }
        },
        "required": [
          "ok"
        ],
        "title": "VoucherSearchOut",
        "type": "object"
      },
      "WriteoffItemIn": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "description": "本次核销金额（原币，即收付款单的币种），最多两位小数",
            "exclusiveMinimum": 0.0,
            "maximum": 1000000000000.0,
            "title": "Amount",
            "type": "number"
          },
          "id": {
            "description": "单据主键（SBVID、PBVID 或 Ap_Vouch.Auto_ID）",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "line_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "发票表体行；只有一行有余额时可省略。应收单、应付单不能带",
            "title": "Line Id"
          },
          "type": {
            "description": "被核销单据：sale_invoice、ar_bill（应收）或 purchase_invoice、ap_bill（应付）",
            "enum": [
              "sale_invoice",
              "ar_bill",
              "purchase_invoice",
              "ap_bill"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "amount"
        ],
        "title": "WriteoffItemIn",
        "type": "object"
      },
      "WriteoffItemOut": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "description": "本次核销金额",
            "title": "Amount",
            "type": "number"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "单据号",
            "title": "Code"
          },
          "id": {
            "description": "单据主键",
            "title": "Id",
            "type": "integer"
          },
          "line_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "实际核销的发票行；应收单、应付单省略",
            "title": "Line Id"
          },
          "remaining": {
            "description": "该行核销后的未核销余额",
            "title": "Remaining",
            "type": "number"
          },
          "type": {
            "description": "单据类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "amount",
          "remaining"
        ],
        "title": "WriteoffItemOut",
        "type": "object"
      },
      "WriteoffReceiptIn": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "收付款单主键 Ap_CloseBill.iID",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "line_id": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "maximum": 2147483647.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "收付款单表体行 Ap_CloseBills.ID；只有一行有未核销余额时可省略",
            "title": "Line Id"
          },
          "type": {
            "description": "收款单 ar_receipt 或付款单 ap_payment",
            "enum": [
              "ar_receipt",
              "ap_payment"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "WriteoffReceiptIn",
        "type": "object"
      },
      "WriteoffReceiptOut": {
        "additionalProperties": true,
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "收付款单号",
            "title": "Code"
          },
          "id": {
            "description": "Ap_CloseBill.iID",
            "title": "Id",
            "type": "integer"
          },
          "line_id": {
            "description": "实际核销的行 Ap_CloseBills.ID",
            "title": "Line Id",
            "type": "integer"
          },
          "remaining": {
            "description": "该行核销后的未核销余额",
            "title": "Remaining",
            "type": "number"
          },
          "type": {
            "description": "收付款单类型",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "line_id",
          "remaining"
        ],
        "title": "WriteoffReceiptOut",
        "type": "object"
      },
      "WriteoffReceiptRef": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "收付款单主键 Ap_CloseBill.iID",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "flag=AR 时 ar_receipt，AP 时 ap_payment",
            "enum": [
              "ar_receipt",
              "ap_payment"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "WriteoffReceiptRef",
        "type": "object"
      },
      "WriteoffTargetRef": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "单据主键（SBVID、PBVID 或 Ap_Vouch.Auto_ID）",
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Id",
            "type": "integer"
          },
          "type": {
            "description": "flag=AR 时 sale_invoice / ar_bill，AP 时 purchase_invoice / ap_bill",
            "enum": [
              "sale_invoice",
              "ar_bill",
              "purchase_invoice",
              "ap_bill"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "title": "WriteoffTargetRef",
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "通过 HTTP 调用用友 U8 的业务组件（/v1/co）：单据、凭证、档案和报表的读写与审核。\n\n## 认证与权限\n\n- 每个请求带 `Authorization: Bearer <JWT>`。\n- 请求体带账套、操作员编码和口令；口令只用于本次请求，服务不保存、不写入审计。\n- 权限声明须为布尔值 true（字符串不算），也可按信任项配置的 scope 授予。\n\n| 权限 | 可调用路径 |\n|---|---|\n| 读（缺省声明 `u8co_read`） | 只读路径：读取单据、单据列表、现存量、总账凭证读取和列表、档案读取和列表、报表、审批状态、审批历史、待办、登录校验、健康检查、档案名称解析、幂等结果查询、字段标签、单据查询、批量读取单据和档案 |\n| 写（缺省声明 `u8co_write`） | 全部路径（经营管理路径另需下一行的权限） |\n| 经营管理（信任项的 `mgmt_claim` 或 `mgmt_scope`） | `/v1/co/mgmt/*`，以及多账套汇总、合并报表、公司间对账（reports/aggregate、consolidation、intercompany_match）；读、写权限都不代替它 |\n| 权限评估（信任项写了 `perm_evaluate: true`） | `/v1/co/perm/evaluate`（查别的操作员的权限）；令牌还要有读或写权限 |\n\n- 只有读权限时调用写路径：403 `forbidden`，不会访问桥。\n- 缺经营管理权限：403 `mgmt_forbidden`。\n- 每个操作的说明末尾写明所需权限；操作上的 `x-u8co-access` 标为 read、write、mgmt 或 perm_evaluate。\n\n## 账套\n\n- 允许的账套以部署配置为准（环境变量 U8CO_ACCOUNTS）；名单为空时所有业务调用都返回 403。\n- 不在名单里：403 `account_not_allowed`。\n- 信任项配置了账套声明时，令牌还必须列出该账套。\n\n## 错误体\n\n`{\"error\":{\"code\",\"message\",\"retryable\",\"field\",\"hint\",\"detail\"}}`\n\n| 字段 | 说明 |\n|---|---|\n| code | 错误码，见下表 |\n| message | 错误说明 |\n| retryable | 总是有；为 true 时可以原样稍后重试 |\n| field | 出错的请求字段路径，只用于 400，如 `lines.0.cinvcode` |\n| hint | 简短的修正提示 |\n| detail | 桥给的结构化补充，只用于 4xx，如存货核算记账 409 时的 `uncosted`、`uncosted_total` |\n\n### 常见错误码\n\n| 类别 | 错误码 |\n|---|---|\n| 请求与认证 | bad_request、unauthorized、forbidden、account_not_allowed、login_failed |\n| 功能开关 | feature_disabled、test_account_only |\n| 单据与业务 | not_found、state_mismatch、u8_rejected、stock_shortage（库存不足） |\n| 审批流 | workflow_enabled、workflow_unknown、workflow_disabled（单据未启用审批流） |\n| 审批动作 | already_submitted（已经提交）、not_submitted（未提交或没有在途实例）、not_current_approver（当前操作员不是待办人） |\n| 繁忙与限流 | busy、rate_limited、busy_timeout、stopping |\n| 桥与 U8 | unavailable、com_unavailable、u8_unavailable（U8 的服务没有运行，例如生产制造服务 U8MPool）、u8_license_full、ia_timeout |\n| 结果不确定 | bad_response、outcome_unknown |\n\n## 重试与 outcome_unknown\n\n| 状态与错误码 | 含义 | 处理 |\n|---|---|---|\n| 504 `outcome_unknown` | 请求已经送出，或桥返回了无法解析的 2xx；审核等写入可能已经执行 | 先核对，不要盲目重试 |\n| 502 `bad_response` | 桥的 3xx、4xx 或 5xx 不是可解析的 JSON，错误响应超过 64KiB，或发生了重定向 | — |\n| 429 `busy` | 桥的队列满了 | 按 Retry-After（5 秒）重试 |\n| 429 `rate_limited` | 本服务的并发或频率限制 | 稍后重试 |\n| 503 `busy_timeout`、`stopping` | 桥排队超时，或正在停止 | 按 Retry-After（5 秒）重试 |\n| 503 `u8_license_full` | U8 许可点数已满，桥已自己重试过 | 按 Retry-After（60 秒）重试 |\n| 503 `ia_timeout` | 存货核算脚本超时，桥已回滚、没有写入 | 按 Retry-After（60 秒）重试 |\n\n- 成功响应最多 8MiB，超过按无法解析的 2xx 处理（504 `outcome_unknown`）。\n- 总账凭证新增、修改由 U8 自己提交，外层事务管不到：先用 `/v1/co/gl/vouchers/list` 或 load 核对，再决定是否重试。\n- 档案的新增、修改、删除同理，先用 `/v1/co/archives/get` 核对。\n- U8CO_ENABLED 关闭时这些路径返回 404；已打开但桥未配置时 503 `unavailable`。\n- 健康检查失败一律 503 `unavailable`；健康检查不计入每个调用方的频率。\n\n## 写入分级、预演、幂等\n\n- **写入分级**：结账、存货核算、期初等第二级写入缺省关闭（403 `feature_disabled`），打开后只对测试账套开放（403 `test_account_only`），见 [期初记账](#tag/期初记账)、[月末结账](#tag/月末结账)、[存货核算](#tag/存货核算)。\n- **预演**：写路由的请求体带 `dry_run: true`，照常校验但什么都不写入，见 [单据新增删除](#tag/单据新增删除)。\n- **幂等**：写路径带 `Idempotency-Key` 头，重试原样返回第一次的结果，见 [U8 业务操作](#tag/u8-业务操作) 的幂等结果查询。\n\n### 写入策略\n\n写入策略（U8CO_WRITE_POLICY_FILE，桥上同一份文件）只管写路径，都在登录 U8 之前拒绝，没有写入。\n\n| 状态与错误码 | 含义 | 可重试 |\n|---|---|---|\n| 503 `write_policy_unavailable` | 策略文件缺失或无效 | 按 Retry-After |\n| 503 `write_frozen` | 已冻结 | 按 Retry-After |\n| 503 `write_window` | 不在允许写入的时段 | 按 Retry-After |\n| 403 `write_not_allowed` | 策略没有放行该账套的这类写入，detail 给出 type、op | 否 |\n| 403 `operator_not_allowed` | 操作员不能在此账套写入 | 否 |\n| 400 `write_limit` | 行数或金额超过上限，detail 给出 max、actual | 否 |\n| 429 `write_quota`（桥） | 账套写入限额 | 是，Retry-After 按窗口算 |\n| 503 `u8_license_hold`（桥） | 接口登录已达上限 | 是 |\n\n### 预演\n\n- 写路由的请求体可带 `dry_run: true`：照常登录、加锁、校验，成功返回 DryRunOut（mode 为 rollback 或 validate）。\n- 不支持：旧路由 sale-orders/verify、dispatches/verify。\n- arap/writeoff/auto 的 dry_run 仍是只算计划。\n- 预演不能带 Idempotency-Key（arap/writeoff/auto 只算计划时同样不能带）。\n- 支持预演的操作标了 `x-u8co-dry-run`。\n\n### 幂等\n\n- 适用于所有写路径：新增、修改、删除、审核、关闭、锁定、审批、总账凭证各操作、记账、期初记账、档案写入、核销、制单。\n- 同一调用方、账套、路径和键只执行一次；重试原样返回第一次的结果，含 504 `outcome_unknown`。\n- 4xx 不占用键，可以改正后再用。\n- 同一个键换了请求内容：409 `idempotency_mismatch`。\n- 桥上的幂等记录读写失败：503 `store_unavailable`。\n- 用 `/v1/co/idempotency/get` 按路径和键查回当时的结果。\n\n## 裁剪响应与名称解析\n\n- 每条 POST 路径都收查询参数 `fields`（只返回列出的键）和 `compact`（去掉空值）。\n- 只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines。\n- 出参是带必填字段的类型化明细的路径（vouchers/close、核销、应收应付制单）不支持，返回 400。\n- `/v1/co/archives/resolve` 把名称、简称、助记码解析成档案编码。\n",
    "title": "u8co-api",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/co/arap/bad_debt": {
      "post": {
        "description": "U8 应收款管理「坏账处理」：坏账发生、坏账收回、计提坏账准备。\n\n**用法**\n\n| action | 处理 | 处理方式 | 功能权限 |\n| --- | --- | --- | --- |\n| occur | 坏账发生 | 9G | AR050602 |\n| recover | 坏账收回 | 9H | AR050603 |\n| provision | 计提坏账准备 | 9F | AR050601 |\n\n- 处理号都是 HZAR + 13 位数字（U8 的 Ap_CancelNo 编号 HZ）\n- 只做应收（登录子系统 AR）；provision 不带业务字段\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 处理日期就是登录日期 date：须在 U8 会计期间里、不早于应收启用日期、应收该月未结账\n- 须已设置该会计年度的坏账准备参数（应收款管理 › 设置 › 坏账准备）\n- U8 按最后一行参数记坏账准备余额；该行年度与 date 不符时 409，不改别的年度\n- 坏账发生（occur）：\n  - 单据须已审核、属于该客户和币种；外币各单据汇率须相同\n  - amount 不超过该单据（行）的正余额\n  - 每张单据行写一行贷方往来明细，冲减单据余额；坏账准备余额减去本币合计\n- 坏账收回（recover）：\n  - 收款单须属于该客户、只有一行应收款；amount 须等于它的全部余额（U8 整张一起消耗）\n  - 用 U8 的审核组件审核收款单（审核行贷方），再在收款单上记一行 9H 借方往来明细（科目同收款单行）\n  - 两者相抵，客户应收余额不变；坏账准备余额加上本币金额\n  - 9H 制单时一并回写收款单的审核行和表头凭证号\n- 计提（provision）：\n  - 按参数里的计提方法算应计坏账准备：1 应收余额百分比、2 账龄分析、3 销售收入百分比\n  - 销售收入取 date 所在年度 1 月 1 日到 date 已审核、非期初、未作废销售发票的本币价税合计\n  - U8 的取数窗口以界面为准\n  - 本次计提 = 应计 − 当前余额\n  - 只更新该年度的参数行（余额、累计计提、计提日期、处理号），不写往来明细\n  - 同一年度多次计提时 U8 只记最后一个处理号，只有最后一次能单独取消\n\n**限制**\n- 外币坏账发生暂不能用 arap/process/voucher 制单\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：见上表\n- 数据权限：按客户、部门、业务员\n\n**错误**\n- 404 not_found：客户、单据或收款单不存在\n- 409 state_mismatch：应收该月已结账、未设置坏账准备参数、不支持的计提方法\n- 409 state_mismatch：单据未审核或余额不足、币种或汇率不符\n- 409 state_mismatch：收款单已审核、已核销或金额不等\n- 409 state_mismatch：本次计提金额为 0\n- 409 u8_rejected：核对不符，已回滚\n\n**相关**\n- 取消：arap/process/cancel\n- 制单：arap/process/voucher\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapBadDebt",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapBadDebtIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapBadDebtOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收坏账发生 / 收回 / 计提",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/exchange_gain": {
      "post": {
        "description": "按外币余额和调整汇率计算本币差额，登记汇兑损益（U8 应收（应付）款管理，处理方式 9M）。\n\n**用法**\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 每个（往来单位、单据）一个处理号：SYRAR…（AR）/ SYPAP…（AP）\n- 写往来明细；发票累计核销经 U8 的回写组件\n- 登记日期就是登录日期 date，须在本系统未结账的期间内\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：AR0507 / AP0507\n- 数据权限：按往来单位\n\n**错误**\n- 409「本期没有调整汇率」：未给 rate，该期外币设置里也没有调整汇率\n- 409 state_mismatch：币种不存在或是本位币、日期不在会计期间或早于启用日期\n- 409 state_mismatch：期间已结账、批次过多\n- 409 u8_rejected：核对不符，已回滚\n\n**相关**\n- 撤销：arap/exchange_gain/cancel\n- 制单：arap/process/voucher（须给 pl_code）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapExchangeGain",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapExGainIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapExGainOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收 / 应付汇兑损益",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/exchange_gain/cancel": {
      "post": {
        "description": "取消汇兑损益，对应 U8「取消操作」里的汇兑损益。\n\n**用法**\n- cancel_nos：SYRAR… 用 flag AR，SYPAP… 用 AP\n- 省略 cancel_nos：取消登记日期为登录日期 date 的全部未制单汇兑损益，响应带 by_date\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 桥按 U8 界面执行的取消 SQL 写（实测核对）\n- 在一个事务里加回余额、删掉明细行并核对\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：取消操作 AR0807 / AP0807\n\n**错误**\n- 404 not_found：处理号不存在，或该日没有汇兑损益\n- 409 state_mismatch：已制单，先用 arap/voucher/delete 删凭证\n- 409 state_mismatch：期间已结账、之后还有其他处理\n- 409 u8_rejected：核对不符，已回滚\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapExchangeGainCancel",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapExGainCancelIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapExGainCancelOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消应收 / 应付汇兑损益",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/merge": {
      "post": {
        "description": "把若干单据在往来单位 from 名下的余额并到 to 名下，对应 U8「转账」里的并账（处理方式 BZ，处理号 BZAR… / BZAP…）。\n\n**用法**\n- flag AR：lines 收 26 / 27 销售发票、R0 应收单\n- flag AP：lines 收 01 / 02 采购发票、P0 应付单\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 每张单据（行）写一对 ± 处理行，单据本身不改\n- 并账日期就是登录日期 date，须在本系统未结账的期间内\n\n**权限**\n- 功能权限：AR050504 / AP050504（上级 AR0505 / AP0505）\n- 数据权限：按各单据和 from、to 两个往来单位\n\n**错误**\n- 404 not_found：单据不存在\n- 409 workflow_enabled：单据受审批流控制\n- 409 state_mismatch：单据未审核、不属于 from、余额不足\n- 409 state_mismatch：日期早于单据日期或系统启用日期、期间已结账、一次超过 500 行\n- 409 u8_rejected：核对不符，已回滚\n\n**相关**\n- 撤销：arap/process/cancel\n- 制单：arap/process/voucher\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapMerge",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapMergeIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapMergeOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收 / 应付并账",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/process/cancel": {
      "post": {
        "description": "按处理号整批取消一次应收应付处理，相当于 U8 应收（应付）款管理「其他处理 → 取消操作」。\n\n**用法**\n\n| 处理号 | 处理 | flag |\n| --- | --- | --- |\n| YCFAP… | 应收冲应付 | AR |\n| FCYAR… | 应付冲应收 | AP |\n| BZAR… / BZAP… | 并账 | 跟号 |\n| HRAR… / HPAP… | 红票对冲 | 跟号 |\n| PJJAR… / PJTAR… / PJBAR… / CLAR… | 应收票据结算 / 贴现 / 背书 / 退回 | AR |\n| PJJAP… / CLAP… | 应付票据结算 / 退回 | AP |\n| HZAR… | 坏账发生 / 收回 / 计提 | AR |\n\n- cancel_no 前缀须与 flag 一致，否则 400\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 加回收付款单行、应收应付单和发票累计核销的余额\n- 删掉该处理号在涉及的往来明细里的行；并账成对 ± 行净额为 0，只删行\n- 提交前核对每个余额都精确回到处理前\n- U8 这一步没有可调用的组件，桥按 U8 界面执行的 SQL 写（实测核对）\n- 票据：加回票据余额和分包票据的可用子票区间，删票据处理行\n- 票据背书：另加回被背书供应商的应付单据余额\n- 票据退回：另删它生成的应收单（应付票据删应付单）\n- 坏账发生（9G）：加回单据余额和坏账准备余额\n- 坏账收回（9H）：收款单恢复为未审核、余额复原，坏账准备余额减回\n- 计提（9F）：该年度坏账准备参数行的余额减去累计计提，清空计提日期\n- 计提只能取消该年度最后一次；同一年度多次计提的累计数合在一起，前面的不能单独取消\n\n**限制**\n- 适用于应付票据（PJJAP、CLAP）和坏账（HZAR）\n- 应付票据（flag AP）是第二级写入，只在测试账套上验证过\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：取消操作 AR0807 / AP0807\n- 数据权限：按处理行的往来单位、部门、业务员\n\n**错误**\n- 404 not_found：处理号不存在\n- 409 state_mismatch：「已制单，请先取消制单」，先用 arap/voucher/delete 删凭证\n- 409 state_mismatch：处理所在期间已结账（应收冲应付、应付冲应收两边都查）\n- 409 state_mismatch：单据在这次处理之后还有核销、汇兑损益等处理，先取消后面的\n- 409 state_mismatch：应收一侧有未审核的收款单\n- 409 state_mismatch：记录不完整，或涉及合同、代理进口、本接口不支持的单据类型（请在 U8 客户端取消）\n- 409 u8_rejected：核对不符，已回滚\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapProcessCancel",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapProcCancelIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapProcCancelOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消应收应付处理",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/process/list": {
      "post": {
        "description": "列出应收或应付往来明细里的处理行，可用作事件源。只读，只查数据库，不调用 U8 组件。\n\n**用法**\n\n| 用法 | 分页与增量 | 每项内容 |\n| --- | --- | --- |\n| 明细（缺省） | 按 Auto_ID 升序；changed_since 传上一轮 watermark，after 传本轮上一页 next | 一条处理行 |\n| 摘要（digest=true） | after 传上一页 next（不透明字符串） | 一个批次 |\n\n- 摘要每项：flag、style、code、min_id、max_id、pz（未制单为 null）、sum_d_f、sum_c_f、rows、partners\n- 摘要的 periods：省略取该侧全部未结账期间（给了 fiscal_year 只取该年度），给了就取 fiscal_year 的这些期间\n- 两种用法都返回 open_periods 和 last_closed\n\n**规则**\n- 包括核销、应收冲应付、应付冲应收、并账、红票对冲、汇兑损益、票据等，不含单据本身的审核行\n- 本服务做的和 U8 客户端做的都列\n- 往来明细没有 rowversion：在途事务可能先拿到较小的号、后提交\n- 因此下一轮要从 watermark 往回退 max(滞后量, ident − watermark) 重读（ident 是 IDENT_CURRENT）\n- 制单（pz_id）和取消（删除）在明细里看不出来，用摘要比对\n- 归期间用 fiscal_year 和 period，不要用 reg_date 的年份\n- fiscal_year 是处理所在的会计年度：期间小于登记月份时为登记年份加 1\n\n**权限**\n- 功能权限：应收取消操作 AR0807 或应收核销明细表 AR060107；应付 AP0807 / AP060107\n- 数据权限：按往来单位、部门、业务员；过滤后批次可能不完整\n- 被过滤的批次与已取消的看不出区别，用作事件源时操作员必须有全部数据权限\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coArapProcessList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapProcListIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoArapProcListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收应付处理记录",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/arap/process/voucher": {
      "post": {
        "description": "把同一类处理的 1 到 50 个处理号合成一张总账转账凭证，对应 U8「制单处理」。\n\n**用法**\n\n| 处理 | 处理号 |\n| --- | --- |\n| 应收冲应付 / 应付冲应收 | YCFAP… / FCYAR… |\n| 并账 | BZAR… / BZAP… |\n| 红票对冲 | HRAR… / HPAP… |\n| 汇兑损益 | SYRAR… / SYPAP… |\n| 应收票据结算 / 贴现 / 背书 / 退回 | PJJAR… / PJTAR… / PJBAR… / CLAR… |\n| 应付票据结算 / 退回 | PJJAP… / CLAP… |\n| 坏账 | HZAR… |\n\n- 前缀须与 flag 一致：YCFAP、BZAR、HRAR、SYRAR、PJJAR 等用 AR，其余用 AP\n- 一次只能给同一类处理；坏账一次只能是同一种（发生、收回或计提）\n- 汇兑损益须给 pl_code（U8 在制单界面选，桥不猜），其他处理不收\n- 票据贴现（PJTAR…）可给 expense_code，其他处理不收\n- 票据处理、坏账收回的凭证按「现金流量项目数据来源」给对方分录挂现金流量项目\n- 推不出项目时 409，可用 cash_items（{科目编码: 项目编码}）指定\n- 其他处理的凭证不挂项目，给了 cash_items 400\n- dry_run 为 true（validate 模式）：算好凭证、在保存前停下，计划凭证在 detail.voucher，不写入，返回 DryRunOut\n\n**规则**\n- 凭证来源 coutsign：转账 ZZ、并账 BZ、汇兑损益 SY、票据 PJ、坏账 JT\n- 分录由桥照 U8 的规则按处理明细拼：往来科目取明细上的科目，带客户 / 供应商辅助项\n- 经凭证导入 U8PzInsert 保存（它自己提交）\n- 再按 U8 界面的回写（实测核对），给这些批次在两张往来明细里的全部行写 cPZid / cGLSign / iGLno_id / dPZDate\n- voucher_date 不能早于处理日期，须在登录年度内且总账未结账\n- 只做本币批次\n- 应付票据结算：借应付票据、贷银行，缺省凭证类别「付」\n- 应付票据退回：借应付票据、贷应付账款，即应收退回换方向取负\n- 坏账计提：借坏账准备参数里的对方科目，贷坏账准备科目\n- 坏账发生：借坏账准备，贷单据的应收科目（带客户）\n- 坏账收回：借收款单的结算科目，贷坏账准备\n- 坏账的科目须是登录年度的末级科目，否则 409\n\n**限制**\n- 适用于应付票据（PJJAP、CLAP）、坏账（HZAR）和汇兑损益（SYRAR、SYPAP）的制单\n- 应付票据（flag AP）是第二级写入，只在测试账套上验证过\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限同 arap/voucher（AR0508 / AP0508）\n\n**错误**\n- 409 state_mismatch：批次已制单、处理类型不符、外币批次\n- 409 state_mismatch：科目缺失、借贷不平、期间已结账、凭证类别不存在\n- 409 u8_rejected：U8 拒绝保存凭证（带回原文）\n- 回写失败：桥删掉刚生成的凭证并返回 409，删不掉返回 504\n- 504 outcome_unknown：先在总账里按外部业务号（pz_id）核对，不要直接重试\n\n**相关**\n- 响应同 arap/voucher，另带 proc_style、out_sign、cancel_nos、rows\n- 取消制单：arap/voucher/delete\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapProcessVoucher",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapProcVoucherIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapProcVoucherOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收应付处理制单",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/red_offset": {
      "post": {
        "description": "用同一往来单位的红字单据冲抵蓝字单据，对应 U8「转账」里的红票对冲（处理方式 9N，处理号 HRAR… / HPAP…）。\n\n**用法**\n- flag AR：red、blue 收 26 / 27 销售发票、R0 应收单\n- flag AP：red、blue 收 01 / 02 采购发票、P0 应付单\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 同一单据不能同时出现在两侧；各单据须同币种\n- 对冲日期就是登录日期 date，须在本系统未结账的期间内\n- 在桥的事务里调用 U8 对冲组件 U8ApCancel.cLsCancel.AP_JZ_Red\n- 发票累计核销由 U8 一并回写\n\n**权限**\n- 功能权限：AR050503 / AP050503（上级 AR0505 / AP0505）\n- 数据权限：按往来单位、部门、业务员\n\n**错误**\n- 404 not_found：单据不存在\n- 409 workflow_enabled：单据受审批流控制\n- 409 state_mismatch：单据未审核、红蓝方向不对、往来单位或币种不符\n- 409 state_mismatch：余额不足、期间已结账\n- 409 u8_rejected：U8 拒绝（带回 U8 原文），或核对不符，均已回滚\n\n**相关**\n- 撤销：arap/process/cancel\n- 制单：arap/process/voucher\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapRedOffset",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapRedOffsetIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapRedOffsetOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收 / 应付红票对冲",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/transfer": {
      "post": {
        "description": "用同一往来对象的应收余额抵应付余额，对应 U8「转账」里的应收冲应付、应付冲应收。\n\n**用法**\n\n| flag | 处理 | 处理方式 | 处理号 |\n| --- | --- | --- | --- |\n| AR | 应收冲应付 | 9I | YCFAP… |\n| AP | 应付冲应收 | 9J | FCYAR… |\n\n- ar_lines 收 26 / 27 销售发票、R0 应收单；ap_lines 收 01 / 02 采购发票、P0 应付单\n- 收付款单不参与转账，请用核销\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n\n**规则**\n- 各单据须同币种\n- 同一单据行不能重复，同一单据不能既按行又按整单\n- 处理日期就是登录日期 date（缺省今天），须在应收、应付都未结账的期间内\n- 两边各写一组处理行（往来明细两张表），发票累计核销经 U8 的回写组件\n\n**权限**\n- 功能权限：AR050502 / AP050502（上级 AR0505 / AP0505）\n- 数据权限：按两侧单据的往来单位、部门、业务员\n\n**错误**\n- 404 not_found：单据不存在\n- 409 workflow_enabled：单据受审批流控制\n- 409 state_mismatch：单据未审核、往来单位或币种不符、余额不足\n- 409 state_mismatch：日期早于单据日期或系统启用日期、期间已结账\n- 409 state_mismatch：外币两侧折合本币不等\n- 409 u8_rejected：核对不符，已回滚\n\n**相关**\n- 撤销：arap/process/cancel\n- 制单：arap/process/voucher\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapTransfer",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapTransferIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapTransferOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收冲应付 / 应付冲应收",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/voucher": {
      "post": {
        "description": "一张已审核的单据（id）生成一张总账凭证；也可用 ids 把同类型的 2 到 20 张单据合并成一张凭证（U8 的合并制单，每张单据各拼各的分录、只在本单内合并，凭证行的 coutid 是该行来源单据的单号，附单据数 = 张数，省略 voucher_date 时取最晚的单据日期；任一张不合格整笔 409，消息带「ids 第 i 张」）。支持：销售发票（26 / 27，须已应收审核）、采购发票（01 / 02，须已应付审核）、收款单 48、付款单 49、应收单 R0、应付单 P0（须已审核），另有客户退款 ar_refund（AR49）、供应商退款 ap_refund（AP48）：U8 审核时把退款登记成负数，凭证是同一方的红字往来行加正数结算行（供应商退款借 应付 负数、借 银行；客户退款贷 应收 负数、贷 银行），缺省摘要「收<供应商>退款」/「付<客户>退款」。flag 是 AR 或 AP（也是登录子系统），type 须与 flag 同侧，id 是单据主键。U8 没有无界面的制单组件，桥照 U8 的规则拼分录：往来科目取审核时登记在往来明细上的科目；销售发票的收入、销项税科目，采购发票的采购、进项税科目，应收应付单的税金科目按对方科目设置（AP_OppCodeSet）找最具体的一行，没有再用基本科目设置；收付款单的结算科目取往来明细的结算行；应收应付单的对方科目取表体科目。同科目同辅助项合并（应收应付选项 bYPzKMHB / bSPzKMHB），借方在前；辅助核算只按科目要求填，值取自单据，缺了 409；现金流量按总账的现金流量项目数据来源取。凭证经 U8 的凭证导入 U8PzInsert 保存（它自己提交），带外部来源（制单系统 AR / AP、外部业务号 pz_id、原始单据类型和单号），外部业务号照 U8 从 Ap_CancelNo 取；之后桥按 U8 界面的回写（实测核对）写：往来明细 cPZid / dPZDate / cGLSign / iGLno_id，发票表体线索号、凭证号，收付款单、应收应付单表头凭证号。回写失败时桥删掉刚生成的凭证并返回 409；删不掉返回 504，消息里有凭证号和外部业务号。sign 是凭证类别，省略时有现金、银行科目的借方「收」、贷方「付」，其余「转」；voucher_date 是制单日期（yyyy-MM-dd），省略取单据日期，不能早于单据日期、必须在登录年度内（请求里的 date 是登录日期）、总账和应收应付该月未结账，并受制单序时控制；digest 是摘要，省略取往来明细上的摘要。cash_items 指定现金流量项目，见该字段说明。只做本币、蓝字单据（退款单除外）。409 state_mismatch：未审核、已制单（「凭证已生成，不能重复制单。」）、外币或红字、期间已结账、科目未设置或不是末级、辅助项缺值、现金流量项目无法按数据来源确定（用 cash_items 指定）、凭证类别不存在、收款单已用于坏账收回（请对坏账收回制单）；409 u8_rejected：U8 拒绝保存凭证（原文带回）。合并制单的凭证用 arap/voucher/delete 一次取消，全部单据一起清掉凭证号。收到 504 outcome_unknown 时先按单据编号（凭证的 coutid）或外部业务号在总账里核对，不要直接重试：总账里已有这张单据未被引用的凭证时重试 409。现结发票、科目或辅助项档案不合格（部门、人员、客户、供应商、结算方式、现金流量项目）也是 409。取消制单用 arap/voucher/delete。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapVoucher",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapVoucherIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapVoucherOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收 / 应付制单",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/voucher/delete": {
      "post": {
        "description": "按外部业务号 pz_id（单据往来明细的 cPZid = 凭证的 coutno_id，AR… / AP…，前缀须与 flag 一致）删除应收（应付）生成的凭证，并按 U8 界面执行的清除 SQL（实测核对）清掉单据上的凭证号。只收销售发票、采购发票、收付款单（含退款单）、应收应付单原始行生成的凭证，以及 arap/process/voucher 生成的处理凭证（应收冲应付、应付冲应收、并账、汇兑损益整批；汇兑损益凭证属第二级写入（默认关闭，打开后只对测试账套开放）；坏账发生、收回、计提的凭证同样，计提凭证清坏账准备参数行上的凭证号）；核销等其他处理生成的凭证 409。404 not_found：没有这张凭证。409 state_mismatch：此凭证已记账 / 已审核 / 已经出纳签字，不能删除；此凭证所在期间已结账；已做银行对账或往来两清；被红字冲销；正被别人编辑；不是本系统生成的；应收（应付）已结账。在一个事务里完成，提交后回读确认。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapVoucherDelete",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoArapVoucherDeleteIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoArapVoucherDeleteOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消应收 / 应付制单",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/writeoff": {
      "post": {
        "description": "收款单（付款单）的一行对销售发票、应收单（采购发票、应付单）核销，走 U8 应收应付的核销组件 U8ApCancel.cLsCancel.Save，在桥的事务里。receipt.type 为 ar_receipt 时 items 只能是 sale_invoice / ar_bill，为 ap_payment 时只能是 purchase_invoice / ap_bill，否则 400。receipt.id 是 Ap_CloseBill.iID，receipt.line_id 是 Ap_CloseBills.ID，收付款单只有一行有未核销余额时可省略；发票的 line_id 是表体行（销售发票 SaleBillVouchs.AutoID、采购发票 PurBillVouchs.ID），只有一行有余额时可省略；应收单、应付单按整单核销，不能带 line_id。items 1 到 50 项，同一单据行不能重复；amount 大于 0、最多两位小数。核销日期就是登录日期 date（缺省今天）。400 bad_request：字段、类型、数量、金额不合法（同上）；line_id 不属于该单据「明细行不存在」；没给 receipt.line_id 而收付款单有多行未核销余额，或没给发票 line_id 而发票有多行未核销余额（请指定 line_id）。外币：各单据须与收付款单同币种，否则 409 state_mismatch「币种与收付款单不一致」；单据汇率可以不同，同 U8 一律按收付款单的汇率核销，汇兑差额留给期末汇兑损益（本接口不做）；amount 是原币，本币按收付款单汇率折算（四舍五入到分，尾差并到第一项）。预收 / 预付行（bPrePay=1）同样可以核销，U8 若另插收付款单行，核对时一并计入。桥在事务里带锁检查：收付款单存在且已审核、该行有未核销余额；各单据已应收（应付）审核、往来单位与收付款单相同、该行未核销余额不小于 amount；amount 合计不超过收付款单该行余额；核销日期不早于收付款单和各单据的日期、不早于应收（应付）系统启用日期；核销日期所在的 U8 会计期间（UA_Period，不一定是自然月）应收（应付）未结账；采购发票没有被网络锁定。单据不存在 404；受审批流控制的收付款单或单据 409 workflow_enabled；其余拒绝 409 state_mismatch；U8 拒绝时 409 u8_rejected，带回 U8 原文。成功后在同一事务里核对余额和新核销号，提交后在新连接上回读本核销号的核销行：不符 409 state_mismatch（已提交，不要重投），回读失败 504 outcome_unknown（先用 reports/arap_detail 或读取单据核对，不要盲目重试）；事务被数据库回滚（如死锁）503 u8_unavailable（未写入，可以重试）。功能权限：手工核销 AR050201 / AP050201，或选择收款 AR0503 / 选择付款 AP0503；数据权限按收付款单和每张单据的往来单位、部门、业务员。撤销用 arap/writeoff/cancel。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapWriteoff",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWriteoffIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoWriteoffOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收 / 应付核销",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/arap/writeoff/auto": {
      "post": {
        "description": "对一个往来单位（partner，必填，不做整个账套）按 U8 在核销规则 iHxRule=0 时的规则自动配对核销：有未核销余额的收款单（付款单）行按单据日期、主键、行先后排，有余额的销售发票、应收单（采购发票、应付单）行按单据日期、单号、行先后排，先进先出，每次取两边余额的较小者，一边用完换下一行，直到任一边用完或到 max_amount。只取已审核、不受审批流控制、没有网络锁、单据日期不晚于 date_to（缺省登录日期，不能晚于它）的单据；外币只在同币种的收付款单行和单据行之间配对（单据汇率不比，按收付款单汇率核销，汇兑差额留给期末汇兑损益），max_amount 按原币累计。预收 / 预付行缺省不参加，include_prepay 为 true 时参加。receipt 限定一张收付款单（可带 line_id），targets 限定若干张单据（1 到 200 项，只带 type、id），类型须与 flag 一致，否则 400。每行收付款单一批，走与 arap/writeoff 相同的 U8 核销组件 Save（一个 close 下挂若干 vouch）和同一道闸门，全部批在一个事务里，任何一批失败整体回滚、返回 U8 原文或闸门的 409；提交后逐批回读，不符 409 state_mismatch、回读失败 504 outcome_unknown。不调用 U8 的 cLsCancel.AutoCancel（直接调用返回成功却什么都不写）。账套设置了按规则核销（iHxRule 不为 0 或 bAPAutoCancelWithHxRule）时 409「自动核销暂不支持」。一次最多 20 行收付款单、200 行单据，超出 409，请用 receipt、targets 或 date_to 缩小范围。dry_run 为 true 时只返回计划 plan（每批的收付款单行和分到的单据行、金额），不写；计划为空时 200，batches 为空、total 为 0。每批的核销号可用 arap/writeoff/cancel 逐个取消。功能权限：自动核销 AR050202 / AP050202；数据权限同 arap/writeoff。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapWriteoffAuto",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWriteoffAutoIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoWriteoffAutoOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收 / 应付自动核销",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write"
      }
    },
    "/v1/co/arap/writeoff/cancel": {
      "post": {
        "description": "按核销号（arap/writeoff 返回的 cancel_no，或 U8 里做的核销的 Ar_Detail / Ap_Detail.cCancelNo）整批取消一次核销，相当于 U8 应收（应付）款管理「其他处理 → 取消操作」里取消一条核销。U8 这一步没有可调用的组件（界面自己跑 SQL），桥按 U8 界面执行的 SQL 写（实测核对），在一个事务里做：加回收付款单行余额、应收单 / 应付单余额、发票累计核销（销售发票经 U8 的回写组件），收付款单全部回到未核销时清核销人，删掉该核销号的核销行；提交前核对每个余额都精确回到核销前。flag 为 AR 或 AP（也是登录子系统），cancel_no 为 HXAR / HXAP 后接数字，前缀须与 flag 一致，否则 400。核销号不存在 404。外币核销可以取消（整批同一币种、同一汇率，即收付款单的汇率）。409 state_mismatch：核销已制单（请先删除凭证）；该核销号不是一张收付款单对发票、应收应付单的本侧核销（涉及合同、收付款单之间对冲、其他单据类型、跨期间、币种或汇率不一致），请在 U8 客户端取消；核销所在期间应收（应付）已结账；收付款单或单据在本次核销之后还有核销、汇兑损益、坏账等处理（先取消后面的）；应收一侧账套里有未审核的收款单（U8 同样不让取消）；采购发票被网络锁定。核对不符回滚、409 u8_rejected；提交后在新连接上确认核销行已不在，读不出 504 outcome_unknown，仍在 409 state_mismatch（已提交，不要重投）。功能权限：取消操作 AR0807 / AP0807；数据权限同核销。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArapWriteoffCancel",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWriteoffCancelIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoWriteoffCancelOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消应收 / 应付核销",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/archives/create": {
      "post": {
        "description": "通过 U8 EAI 新增一条档案（项目走受控 SQL）。\n\n**用法**\n- inventory 存货：必须给 template（已有存货编码）\n- customer、vendor：要给 tax_reg_code\n- bank 本单位开户银行：须给 name、account、cbankcode、ccurrencyname\n- position 货位须给 warehouse_code；unit 计量单位须给 group_code\n- customer_inventory 须给 ccusinvname；unit_group 须给 type；rd_style 一级须给 rsflag\n- currency 币种：编码是币种名称，fields 的 code 是币种符号（必填）\n- 各档案的编码和 fields 见 archive、code 字段说明\n\n**规则**\n- 走 U8 EAI：客户、供应商、存货、部门、人员、仓库和分类\n- 也走 EAI：开户银行、货位、计量单位、自定义项档案（user_define）、客户存货对照\n- 也走 EAI：计量单位组、结算方式、收发类别、采购类型、销售类型、地区分类、银行档案\n- project 走受控 SQL：fields 只收 name、bclose、citemccode（末级分类），桥自己提交后回读\n- user_define、customer_inventory 的编码写成 `<第一段>:<第二段>`，不收 template\n- 分级的档案按编码方案校验上级\n- fa_card 固定资产卡片：走 U8 官方 EAI 导入原始卡片，code 是资产编号\n- fa_card 响应的 code 是 U8 编的卡片编号，另有 asset_num、card_id\n- fa_card：登录日期须在固定资产当前未结账的期间，开始使用日期早于该期间\n- equipment 设备台账：走 U8 官方 EAI 导入，只能新增\n- U8 自己提交\n\n**错误**\n- 504 outcome_unknown：U8 自己提交，结果不明；先 get 核对再重试\n\n**相关**\n- fa_card 新增后用 archives/get 读\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArchiveCreate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArcCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcWriteOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "新增档案",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/archives/delete": {
      "post": {
        "description": "删除一条档案。\n\n**规则**\n- project 走受控 SQL，删除后回读确认\n- fa_card（code 是卡片编号）只撤销本期新增、只有一个版本（没有变动单、未减少）的卡片\n- 撤销 fa_card 不是资产减少；资产减少请在 U8 客户端处理\n- U8 自己提交\n\n**错误**\n- 409 u8_rejected：档案已被单据使用，U8 拒绝\n- 409 state_mismatch：project 被凭证、单据或其他档案引用（桥先拒绝）\n- 409 state_mismatch：货位有下级或存货记录，计量单位已被存货使用（桥先拒绝）\n- 409 state_mismatch：计量单位组、结算方式、收发类别、采购类型、销售类型、币种、地区分类、银行档案有下级、被主要档案或单据引用，或是本位币（桥先拒绝）\n- 409 state_mismatch：fa_card 不是本期新增，或已有变动单、已减少\n- 504 outcome_unknown：U8 自己提交，结果不明；先 get 核对再重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArchiveDelete",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArcKeyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcWriteOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "删除档案",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/archives/get": {
      "post": {
        "description": "按编码读取一条档案。\n\n**规则**\n- 可写档案按 EAI 标签名返回全部有值的标签（含银行账号、联系方式），只去掉口令类列\n- 只读档案（科目、计量单位、结算方式、凭证类别、币种、项目、货位等，见 archive）按表列名返回\n- customer_address、user_define、customer_inventory 的编码写成 `<第一段>:<第二段>`\n- exchange_rate 的编码写成 `<币种>:<年度>:<期间>[:<日>]`\n- exchange_rate 写成 `<币种>:<yyyy-mm-dd>` 时，返回该日期单据会用的汇率\n- 按日期取汇率同 U8：固定汇率取当月记账汇率，浮动汇率取当日汇率\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coArchiveGet",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArcGetIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArcGetOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "读取档案",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/archives/get_many": {
      "post": {
        "description": "按编码批量读取同一档案的 1 到 20 条。\n\n**用法**\n- 编码写法与 archives/get 相同；不区分大小写，不能重复\n- fields / compact 只裁剪 items 每一项的顶层键（id、code、ok、error 总是保留），不裁剪 items[].fields\n\n**规则**\n- items 按请求顺序；成功的项与 archives/get 的响应体相同\n- 失败的项是 {code, error: {code, message}}（not_found、no_permission 等）\n- 单条失败不影响其它\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coArchiveGetMany",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetManyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetManyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "批量读取档案",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/archives/list": {
      "post": {
        "description": "按编码排序列出档案。\n\n**用法**\n- 可按编码前缀 code_prefix、名称 name_like 和 changed_since 过滤\n- 翻页：next 原样放进 after 读下一页\n- project 可用 project_class 只列一个项目大类\n- exchange_rate 可用 currency、fiscal_year（缺省登录年份）过滤\n- fa_card 可用 type_code、dept_code、include_disposed（缺省不含已减少）过滤\n\n**规则**\n- customer_address、user_define、customer_inventory 的编码是 `<第一段>:<第二段>`\n- 上述两段编码的档案：code_prefix 按整串匹配，class_code 是第一段\n- exchange_rate 每行是一个币种一个期间（浮动汇率是一天）的 rate 和 adjust_rate\n- fa_card 取登录月末的卡片版本\n\n**限制**\n- 没有 ufts、不支持 changed_since：voucher_sign、project、customer_address、fa_card、operator、role\n- 客户、供应商银行账户（customer_bank、vendor_bank）也没有 ufts\n\n**权限**\n- operator 操作员、role 角色只列本账套有授权的，只有账套主管能读\n- aa_bank 银行档案也只有账套主管能读\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coArchiveList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArcListIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArcListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "档案列表",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/archives/resolve": {
      "post": {
        "description": "把名称、简称、助记码或编码解析成档案编码。\n\n**用法**\n- 一次最多 20 项\n- include_disabled 为 true 时也返回已停用的档案，并标 disabled\n\n**规则**\n- 按层级匹配，第一个有结果的层级胜出\n- 层级依次为 code 编码完全相同、name 名称完全相同、abbr 简称完全相同（客户、供应商）\n- 其后是 mnemonic 助记码（存货另有 add_code 代码）、contains 名称包含\n- contains：客户、供应商也查简称；存货按「名称 + 规格」查\n- 例：「示例存货X1」能找到名称示例存货、规格 X1\n- status：exact 前四层恰好一条；ambiguous 胜出层级不止一条\n- status：partial 只有包含匹配且恰好一条；none 没有\n- match 只在 exact、partial 时给出；candidates 最多 limit 条，more 表示还有更多\n- 已停用的档案缺省不返回\n- 停用：客户、供应商、存货、部门、仓库的停用日期不晚于登录日期；科目、项目已关闭；操作员已停用\n- 科目只返回末级\n\n**权限**\n- 同各档案的 list（含记录级数据权限）\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coArchiveResolve",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "按名称解析档案编码",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/archives/update": {
      "post": {
        "description": "修改档案：只改 fields 里列出的标签。\n\n**规则**\n- 不能改编码\n- project 只能改 name、bclose、citemccode\n- currency 不能改名称和币种符号\n- U8 自己提交\n\n**错误**\n- 504 outcome_unknown：U8 自己提交，结果不明；先 get 核对再重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coArchiveUpdate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArcUpdateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcWriteOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "修改档案",
        "tags": [
          "基础档案"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/dispatches/verify": {
      "post": {
        "description": "审核或弃审发货单。\n\n**用法**\n- id 是 DispatchList.DLID。\n\n**限制**\n- 只处理蓝字发货单。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coDispatchesVerify",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoVerifyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoVerifyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "审核或弃审发货单",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write"
      }
    },
    "/v1/co/gl/transfer/custom": {
      "post": {
        "description": "按 U8 的自定义转账定义（总账「自定义转账」）生成凭证，每个转账序号一张。\n\n**用法**\n- dry_run：算完、校验完停在凭证导入之前（validate 模式），返回 DryRunOut\n- 预演要生成的凭证在 detail.transfer.vouchers：sign、digest、debit、credit、lines、tran_id\n- 定义之间有取数依赖时，用 tran_id 逐个生成、审核、记账\n- 跳过的定义在 detail.transfer.skipped\n- exclude_existing（只和 dry_run 一起用）：余额里去掉本期已生成的同类结转凭证及其后的结转凭证\n- exclude_existing 不查结账、未记账、重复三道闸门，用来与 U8 已生成的凭证逐行核对\n- exclude_existing 去掉的凭证在 detail.transfer.excluded\n- 生成的凭证未审核、未记账：之后用 gl/vouchers/verify、gl/vouchers/post 审核、记账\n- 要重做时作废后删除：gl/vouchers/void、gl/vouchers/delete\n\n**规则**\n- 行的科目、方向取定义，金额按公式计算\n- 支持 QM(科目, 月|年, [借|贷], [辅助项])：已记账的期末余额，非末级科目按下级合计\n- 支持 CE()（借贷差额）、数字和 + - * / 括号\n- 金额为 0 的行不写；按年取数（QM 年）的定义只在第 12 期生成\n- 跳过（skipped）：本期已生成（同期、外部业务类型「自定义转账」、摘要相同的未作废凭证）\n- 跳过：科目不存在或不是末级、行科目要辅助核算而定义和公式都给不出、算出来全为 0\n- 取数只取已记账的期末余额（同 U8）\n- 凭证照 U8 自动转账标记：外部业务类型（coutsign）、外部业务号（coutno_id，GL 加 13 位）\n- 附单据数 -1，制单系统为空\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放（含预演）；其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限同填制凭证（GL0201）\n- 数据权限同总账查询：科目（开了「明细账查询权限控制到科目」时）、部门、人员、客户、供应商、项目\n- 取数和入账涉及的科目、辅助项有一个没有查询权限就 403 no_permission（预演同样，不返回金额）\n\n**错误**\n- 400 bad_request：用了别的函数（FS、JE、QC 等），写明函数名，不猜\n- 409：全部定义都被跳过\n- 409：不给 tran_id 时，后面定义 QM 取数的科目与前面定义本次生成的分录科目重叠（U8 按序号逐个结转、记账后再取数）\n- 409 state_mismatch：该期间总账已结账，或本期有未作废的未记账凭证\n- 504 outcome_unknown：U8 保存后已自己提交，先用 gl/vouchers/list 核对再决定是否重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlTransferCustom",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlTransferCustomIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlTransferOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "自定义转账",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/transfer/pnl": {
      "post": {
        "description": "按 U8 的期间损益结转定义（总账「期间损益」）把损益类末级科目结平，差额转入本年利润科目。\n\n**用法**\n- dry_run：算完、校验完停在凭证导入之前（validate 模式），返回 DryRunOut\n- 预演要生成的凭证在 detail.transfer.vouchers：sign、digest、debit、credit、lines、pack\n- 跳过的定义在 detail.transfer.skipped\n- exclude_existing（只和 dry_run 一起用）：余额里去掉本期已生成的同类结转凭证及其后的结转凭证\n- exclude_existing 不查结账、未记账、重复三道闸门，用来与 U8 已生成的凭证逐行核对\n- exclude_existing 去掉的凭证在 detail.transfer.excluded\n- 生成的凭证未审核、未记账：之后用 gl/vouchers/verify、gl/vouchers/post 审核、记账\n- 要重做时作废后删除：gl/vouchers/void、gl/vouchers/delete\n\n**规则**\n- 结平已记账的期末余额；带辅助核算的科目按辅助项结转\n- 收入（贷方性质）一张凭证、费用（借方性质）一张，摘要「期间损益结转」\n- 凭证类别取定义上的类别；反方向余额写成同一边的负数\n- 定义里的科目不存在或不是末级时跳过该定义（skipped）\n- 本期只存了收入或费用一张时：先审核、记账它，再调用只补生成缺的那张\n- 补生成时响应的 existing 列出已有的凭证\n- 取数只取已记账的期末余额（同 U8）\n- 凭证照 U8 自动转账标记：外部业务类型（coutsign）、外部业务号（coutno_id，GL 加 13 位）\n- 附单据数 -1，制单系统为空\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放（含预演）；其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限同填制凭证（GL0201）\n- 数据权限同总账查询：科目（开了「明细账查询权限控制到科目」时）、部门、人员、客户、供应商、项目\n- 取数和入账涉及的科目、辅助项有一个没有查询权限就 403 no_permission（预演同样，不返回金额）\n\n**错误**\n- 409：本期已做过期间损益结转（有未作废的结转凭证），只存一张的补生成除外\n- 409 state_mismatch：该期间总账已结账，或本期有未作废的未记账凭证\n- 504 outcome_unknown：U8 保存后已自己提交，先用 gl/vouchers/list 核对再决定是否重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlTransferPnl",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlTransferPnlIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlTransferOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "期间损益结转",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/attachments/list": {
      "post": {
        "description": "列出凭证上挂的电子附件（U8 凭证的「附件」）。\n\n**规则**\n- 只查数据库，不调用 U8 组件\n- 只列附件清单，不提供文件下载（文件在 U8 文件服务器上）\n- 凭证用 period、sign、no 定位，年度取登录日期的年份\n- 权限同读取凭证\n\n**错误**\n- 404 not_found：凭证不存在\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coGlVoucherAttachmentsList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlAttachOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "总账凭证附件列表",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/gl/vouchers/create": {
      "post": {
        "description": "通过 U8 凭证导入新增手工凭证。\n\n**规则**\n- 凭证号由 U8 按期间和类别自动编号\n- 期间取 head.date 的月份\n- head.date 的年份必须等于登录日期（date）的年份；year 是账套库年度，不参与判断\n\n**错误**\n- 504 outcome_unknown：U8 保存后已自己提交，先 load 或 list 核对再重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherCreate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "新增总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/delete": {
      "post": {
        "description": "删除一张凭证，不重排凭证号。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只删除已作废、未记账的凭证\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherDelete",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "删除总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/digest": {
      "post": {
        "description": "按会计期间列出每张凭证的指纹，供事件服务发现凭证变化。\n\n**用法**\n- 可发现新增、删除、审核、出纳签字、记账、作废和修改（GL_accvouch 没有 rowversion）\n- 翻页：next 放进 after，响应的 periods 原样放进请求\n\n**规则**\n- periods 省略时取该年度全部未结账期间（GL_mend.bflag=0，1 到 12 期）\n- 另加最近 closed_periods 个已结账期间（缺省 1）\n- 只在一个年度里取：上年仍未结账的期间、跨年的上年 12 月要显式给 fiscal_year 和 periods\n- fingerprint 是 SHA-256，取 SUM(md)、SUM(mc)、行数、MAX(i_id)、制单人、审核人、出纳、记账人、记账标志、作废标志\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coGlVoucherDigest",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlDigestIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlDigestOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "总账凭证摘要",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/gl/vouchers/list": {
      "post": {
        "description": "按期间范围列出凭证，可按类别、日期、制单人和状态过滤。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coGlVoucherList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlListIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "总账凭证列表",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/gl/vouchers/load": {
      "post": {
        "description": "读取一张凭证的表头、状态和全部分录（含辅助核算和现金流量）。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coGlVoucherLoad",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlLoadOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "读取总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/gl/vouchers/post": {
      "post": {
        "description": "调用 U8 自己的总账记账组件记账（同 U8 界面「记账」），把这些凭证记入科目总账和辅助账。\n\n**规则**\n- 凭证须已审核、不是错误凭证、未记账\n- 总账选项要求出纳签字、主管签字时还须已签\n- 作废凭证照 U8 也记账：只打记账标志，不计入科目总账\n- 年度首张凭证记账前照 U8 做期初对账和期初试算\n- 全部凭证在一个事务里记账，任何一张不合格都不记\n\n**错误**\n- 409：有人正在 U8 里记账（已汇总范围未记完）\n- 503 u8_unavailable：死锁、锁等待或执行超时、事务被中止，已回滚，可以稍后重试\n- 504 outcome_unknown：先用 gl/vouchers/load 核对 posted 再决定是否重试\n\n**相关**\n- 取消记账（恢复最近一次记账）：gl/vouchers/unpost（第二级写入，默认关闭，打开后只对测试账套开放）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherPost",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlPostIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlPostOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "记账",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/reverse": {
      "post": {
        "description": "把一张已记账的总账手工凭证复制成一张红字凭证（同 U8 界面「冲销凭证」）。\n\n**规则**\n- 金额、外币金额、数量和现金流量取负\n- 科目、辅助核算、结算方式、票号、币种、汇率原样带过来\n- 摘要前加「[冲销yyyy.mm.dd 类别-NNNN号凭证]」\n- 凭证类别同原凭证，凭证号由 U8 按红字凭证的期间编号\n- 红字凭证记下原凭证的外部业务号（load 的 voucher.blue_out_no），同一张原凭证不能再冲销\n- 原凭证用 fiscal_year、period、sign、no 定位；可以是上一年度（跨年冲销）\n- voucher_date 所在期间不能已结账\n- 红字凭证未审核、未记账：可以审核、记账，也可以作废后删除，但不能修改\n\n**错误**\n- 409：原凭证未记账、已作废、已被冲销、本身是红字冲销凭证、其它模块生成或带自定义项\n- 504 outcome_unknown：U8 保存后已自己提交，先 load 或 list 核对再重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherReverse",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlReverseIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlReverseOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "红字冲销总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/sign": {
      "post": {
        "description": "对凭证做出纳签字。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只处理含现金或银行科目的凭证\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherSign",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "出纳签字",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/unpost": {
      "post": {
        "description": "撤销本年度最近一次记账（同 U8 客户端「恢复记账前状态 → 最近一次记账」），凭证改回未记账。\n\n**规则**\n- 按 U8 记账的汇总口径冲回科目总账、辅助总账和多辅助总账，在一个事务里完成\n- 范围是 U8 记录的最近一次记账（桥记账和 U8 客户端记账都会留下），不能挑选单张凭证\n- 给了 period、vouchers 时必须与这次记账的范围完全一致\n- 冲回后与已记账凭证重新汇总核对，不一致整笔回滚\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置为测试账套的账套开放，其余 403 test_account_only\n\n**错误**\n- 409（不写入）：period、vouchers 与这次记账的范围不一致，或冲回后核对不一致\n- 409：期间或后续期间已结账、凭证已做银行对账或往来两清\n- 409：凭证已被红字冲销、正被人编辑，或本年度没有可恢复的记账\n- 504 outcome_unknown：先用 gl/vouchers/load 核对 posted 再决定是否重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherUnpost",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlUnpostIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlUnpostOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消记账",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/unsign": {
      "post": {
        "description": "取消凭证的出纳签字。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只处理已签字、未记账的凭证\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherUnsign",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消出纳签字",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/unverify": {
      "post": {
        "description": "取消凭证的审核。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只处理已审核、未记账的凭证\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherUnverify",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消审核",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/unvoid": {
      "post": {
        "description": "取消凭证的作废标志。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只处理已作废的凭证\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherUnvoid",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "取消作废",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/update": {
      "post": {
        "description": "整张替换凭证的表头和分录，凭证号不变。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只改未审核、未出纳签字、未作废、未记账的凭证\n\n**错误**\n- 504 outcome_unknown：U8 保存后已自己提交，先 load 或 list 核对再重试\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherUpdate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlUpdateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "修改总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/verify": {
      "post": {
        "description": "审核一张凭证。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 不能审核已作废或已审核的凭证\n- 账套不允许制单人审核时，本人制单返回 409\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherVerify",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "审核总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/gl/vouchers/void": {
      "post": {
        "description": "作废一张凭证。\n\n**规则**\n- 凭证用 period、sign、no 定位\n- 只处理总账手工凭证，其它模块生成的凭证返回 409\n- 只作废未审核、未签字、未记账的凭证\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coGlVoucherVoid",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlKeyActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/GlKeyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "作废总账凭证",
        "tags": [
          "总账凭证"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/health": {
      "get": {
        "description": "检查 CO 桥是否可达。\n\n**错误**\n- 桥不可达：503 `unavailable`。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coHealth",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoHealthOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "CO 桥健康检查",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/ia/period_end": {
      "post": {
        "description": "存货核算的期末处理或取消期末处理（U8「期末处理」「取消期末处理」）。\n\n**用法**\n- run：按全月平均计算该月出库成本、写出库调整，汇总表标记为已期末处理\n- cancel：取消期末处理\n- 响应带 counts（脚本诊断计数）\n- dry_run：事务里执行后回滚（rollback 模式），返回 DryRunOut，诊断计数在 detail.counts\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n- 执行前检查四项选项，不符时 409「接口暂不支持」\n- 四项：按仓库核算、每个仓库全月平均法、暂估单到回冲、销售成本按发出商品或销售出库单\n- 标准成本、委外等未实测，也不检查\n\n**权限**\n- 功能权限：期末处理、取消期末处理 IA2006\n\n**错误**\n- 409 state_mismatch：该月已结账、该月还没有记账数据（先 ia/post）等\n- 409 u8_rejected：U8 存储过程自己的拒绝\n- 503 ia_timeout：脚本超过 iaCommandSeconds，已回滚\n\n**相关**\n- 存货核算月末结账：periods/close（module=ia）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coIaPeriodEnd",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IaPeriodEndIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/IaOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "存货核算期末处理",
        "tags": [
          "存货核算"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/ia/post": {
      "post": {
        "description": "存货核算的正常单据记账或恢复记账（U8「正常单据记账」「恢复记账」）。\n\n**用法**\n- post：把该月已审核、未记账的出入库单据记入存货明细账\n- 销售成本按发出商品时，post 连同已复核的销售发票一起记账\n- unpost：恢复该月的记账\n- 无法确定成本的存货：U8 界面会要求手工输入单价；skip 同 U8 界面取消勾选\n- 没有要处理的单据时 counts 为 0，带 message\n- dry_run：事务里执行后回滚（rollback 模式），返回 DryRunOut，诊断计数在 detail.counts\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n- 执行前检查四项选项，不符时 409「接口暂不支持」\n- 四项：按仓库核算、每个仓库全月平均法、暂估单到回冲、销售成本按发出商品或销售出库单\n- 标准成本、委外等未实测，也不检查\n\n**权限**\n- 功能权限：正常单据记账 IA2004、恢复记账 IA2005\n\n**错误**\n- 409 state_mismatch，常见原因：\n  - 存货核算未启用、该月已结账\n  - 恢复记账前已做期末处理\n  - 发出商品的销售发票不在本次恢复范围\n  - 直接供应的材料出库接口暂不支持（事务回滚）\n  - 有 U8 无法确定成本的存货（on_uncosted=refuse），error.detail 带 uncosted、uncosted_total\n- 409 u8_rejected「U8 拒绝：…」：U8 存储过程自己的拒绝\n- 503 ia_timeout：脚本超过 iaCommandSeconds，已回滚\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coIaPost",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IaPostIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/IaOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "存货核算记账",
        "tags": [
          "存货核算"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/idempotency/get": {
      "post": {
        "description": "按原请求的路径和 Idempotency-Key 查桥上的幂等记录。\n\n**用法**\n- 收到 504 outcome_unknown 后先用本接口核对，再决定是否重试。\n- status 是原请求本服务会返回的 HTTP 状态。\n\n| state | 含义 | response |\n|---|---|---|\n| ok | 已成功 | 当时的成功响应 |\n| outcome_unknown | 结果不明 | 当时的错误，按本服务的错误格式 |\n| in_flight | 还在执行 | 没有 |\n\n**规则**\n- 调用方和账套与原请求相同才查得到。\n- found 为 false：没有记录或已过期。\n- 成功的记录保留 24 小时，结果不明的保留 72 小时。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coIdempotencyGet",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdemGetIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdemGetOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "查询幂等键的结果",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/intercompany/generate_buyer": {
      "post": {
        "description": "把卖方（seller_acc）的一组出库明细换成买方账套的存货，在买方账套参照采购订单生成采购入库单或到货单。\n\n**用法**\n- 按公司间对照换存货，参照买方账套里卖方公司（供应商）未执行完的采购订单。\n- 生单走 vouchers/generate，source_type=purchase_order。\n- 给了 po_id 就用这张订单；否则取能覆盖全部存货和数量的、id 最小的未执行完订单。\n- 同一存货的多行合并后按订单行顺序分配数量。\n- dry_run 缺省为 true（预演，返回 DryRunOut，另有 plan）。\n- 正式生成时 dry_run 必须写 false，并且必须带 Idempotency-Key（按买方账套记录）。\n\n**规则**\n- 正式生成同样经过买方账套的写入策略。\n\n**限制**\n- type 不能是 other_in（400）：公司间采购要走采购订单。\n\n**错误**\n- 没有可用的未执行完订单：409 ic_no_open_po。\n- 存货没有对照：409 ic_inventory_unmapped（detail.codes 列出）。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coIntercompanyGenerateBuyer",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IcGenerateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/IcGenerateOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "按卖方单据生成买方单据",
        "tags": [
          "参照生单"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/login-check": {
      "post": {
        "description": "校验操作员能否登录。口令随请求提交，服务不保存。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coLoginCheck",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoAuth"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoLoginOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "校验 U8 操作员登录",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/meta": {
      "get": {
        "description": "返回桥上的字段元数据，供调用方生成请求和校验字段。\n\n**用法**\n- 返回单据类型与支持的操作、必填字段、生单来源。\n- 可写字段：exact 逐个列出，spans 为 cdefine / cfree 编号区间。\n- 档案标签、总账凭证字段、列表类型和桥的路由表。\n- 写字段到档案的对照 field_refs、gl_field_refs。\n- 预演模式：kinds[].dry_run、dry_run_routes。\n\n**规则**\n- 不需要账套和口令，桥不登录 U8。\n- revision 是除 features 之外内容的 SHA-256，内容变了 revision 才变。\n- features 是运行时自检结果，可能随时变化。\n- 本服务在进程内缓存 60 秒。\n- complete 为 false：有档案的 RsXml 没有读到（该档案 tags 为 null，带 tags_error）。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coMeta",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoMetaOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "字段元数据",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/meta/fields": {
      "post": {
        "description": "返回单据、档案或总账凭证的可写字段及其标签，要登录（每个账套的单据模板不同）。\n\n**用法**\n- type（单据类型）、archive（档案）、gl（总账凭证，true）三选一。\n- fields_revision 是返回的字段列表的 SHA-256，可用来判断模板有没有变。\n\n| 对象 | 字段位置 | 说明 |\n|---|---|---|\n| 单据 | head、lines | 字段名恰好是桥对该类型、该操作接受的可写字段，与 /v1/co/meta 的 kinds[].writable 相同，自定义项、自由项已展开 |\n| 档案 | fields | 字段名是 meta archives[].writable 的标签；label 取自 U8 的列字典，取不到为 null；type 为 null，没有 enum |\n| 总账凭证 | head、lines、cash_flow | 标签是固定的 |\n\n**规则**\n- 单据的 op 为 create（缺省）、update 或 generate；generate 必须给 source（来源单据类型）。\n- 单据的 label、type、required、max_length、enum 取自本账套该类型的单据模板。\n- vt_source：fixed 桥写死的模板，user_default 操作员的缺省模板，card_default 系统缺省模板，none 没有模板。\n- 模板里没有的字段 label、type 为 null。\n- type 为 bool、string、int、decimal、date 或 enum（enum 另有 code、name 列表）。\n- required 为模板设为必输或桥自己要求。\n\n**错误**\n- 类型或档案不认识：400（field 为 type / archive）。\n- 该类型不支持这个操作：400（field 为 op）。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coMetaFields",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetaFieldsIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetaFieldsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "字段标签",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/mgmt/arap": {
      "post": {
        "description": "按往来单位列出截至 as_of 的余额、账龄与逾期和账期指标（只读）。\n\n**用法**\n- as_of 缺省为 period_to 的自然月末，晚于今天时取今天\n- logins 给 1 到 3 个账套的登录\n- 多个账套缺省合并；不要合并时写 consolidate=false\n\n**规则**\n- 给出余额、预收付、按到期日的账龄与逾期、未结票据\n- 近 12 个月单据的信用期分布、实际回款（付款）天数（金额加权的平均数与中位数）\n- 每个账套按余额绝对值取前 top 个单位，其余并成 others\n- aging、overdue 是毛额；未核销的收款、付款单列在 prepaid\n- aging_net、overdue_net：按单位把 prepaid 按先进先出冲抵最老账龄段后的净额（分段同 aging）\n- 逾期以净额为准；合计的净额是各单位净额之和\n- 预收付超过账龄合计 10% 的账套见 warnings\n- DSO（应收）/ DPO（应付）= 期末余额 ÷（近 12 个月单据金额 ÷ 天数），余额 ≤ 0 时为 null\n- 没有启用应收（应付）款管理的账套 partners 为空（见 warnings）\n- 合并时去掉往来单位是本次所选其他公司（按对照的 as_customer / as_vendor）的余额与单据金额\n- 内部往来抵销含净额账龄；DSO、DPO 按抵销后的余额和外部单据金额重算；明细见 eliminations\n- 合并要求各账套在公司间对照（U8CO_IC_MAP_FILE）的同一组里\n- 先读各账套的月结状态和数据水位（mgmt/meta），结果按水位缓存\n- 所选期间各账套都已总账结账时缓存 6 小时，否则 60 秒；响应的 cache 给出 hit、age_s\n- 部分账套失败仍返回 200：失败的账套写进 warnings，complete 为 false，consolidated 为 null\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：合并时没配置对照\n- 400 ic_group_mismatch：合并时账套不在同一组\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coMgmtArap",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MgmtArapIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MgmtOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "经营管理：应收应付与账期",
        "tags": [
          "经营管理"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/mgmt/cash_stock": {
      "post": {
        "description": "按 period_to 一个会计期间出具资金、票据、存货、产量和采购（只读）。\n\n**用法**\n- logins 给 1 到 3 个账套的登录\n- 多个账套缺省合并；不要合并时写 consolidate=false\n\n**规则**\n- period_from 不参与取数\n- 货币资金：末级科目期末余额，只含已记账\n- 应收票据：科目余额和当前未处理票据\n- 存货：存货核算的期末结存数量与金额\n- 产成品入库按存货的数量排行；采购按供应商的金额排行\n- 合并时资金、票据、存货金额按账套相加\n- 合并的存货金额含期末存货中未实现的内部利润，未抵销（见 notes）\n- 合并时产量只按公司间对照里的存货相加，没有对照的列在 unmapped\n- 合并时采购去掉供应商是本次所选其他公司（as_vendor）的部分，明细见 eliminations\n- 合并要求各账套在公司间对照（U8CO_IC_MAP_FILE）的同一组里\n- 先读各账套的月结状态和数据水位（mgmt/meta），结果按水位缓存\n- 所选期间各账套都已总账结账时缓存 6 小时，否则 60 秒；响应的 cache 给出 hit、age_s\n- 部分账套失败仍返回 200：失败的账套写进 warnings，complete 为 false，consolidated 为 null\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：合并时没配置对照\n- 400 ic_group_mismatch：合并时账套不在同一组\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coMgmtCashStock",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MgmtCashStockIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MgmtOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "经营管理：资金与存货",
        "tags": [
          "经营管理"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/mgmt/meta": {
      "post": {
        "description": "按账套列出会计年度各期间的结账状态和数据水位，用来判断数据是否已定稿（只读）。\n\n**用法**\n- logins 给 1 到 3 个账套的登录\n\n**规则**\n- 结账状态覆盖总账、销售、采购、库存、存货核算、应收、应付\n- 另给未记账凭证数、各模块是否启用\n- 数据水位：最近的凭证、单据\n- 不缓存，不合并；各账套的结果列在 by_account\n- 部分账套失败仍返回 200：失败的账套写进 warnings，complete 为 false\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coMgmtMeta",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MgmtMetaIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MgmtOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "经营管理：月结状态与数据水位",
        "tags": [
          "经营管理"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/mgmt/overview": {
      "post": {
        "description": "一次给出所选期间的关键指标（只读）。\n\n**用法**\n- as_of 缺省为 period_to 的自然月末\n- logins 给 1 到 3 个账套的登录\n- 多个账套缺省合并；不要合并时写 consolidate=false\n\n**规则**\n- 营业收入、毛利与毛利率、净利润：同 mgmt/pnl\n- 期末货币资金、存货金额：同 mgmt/cash_stock，取 period_to\n- 应收、应付余额与逾期应收、逾期应付（冲抵未核销预收付后的净额）、DSO、DPO：同 mgmt/arap\n- by_account、consolidated 里是 kpis\n- 合并口径同各报表：内部收入成本、内部往来抵销，未实现内部利润不抵销\n- 某一部分读取失败时该账套的指标不完整（missing），见 warnings\n- 合并要求各账套在公司间对照（U8CO_IC_MAP_FILE）的同一组里\n- 先读各账套的月结状态和数据水位（mgmt/meta），结果按水位缓存\n- 所选期间各账套都已总账结账时缓存 6 小时，否则 60 秒；响应的 cache 给出 hit、age_s\n- 部分账套失败仍返回 200：失败的账套写进 warnings，complete 为 false，consolidated 为 null\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：合并时没配置对照\n- 400 ic_group_mismatch：合并时账套不在同一组\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coMgmtOverview",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MgmtOverviewIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MgmtOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "经营管理：关键指标",
        "tags": [
          "经营管理"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/mgmt/pnl": {
      "post": {
        "description": "按账套和期间汇总损益科目，出具利润表（只读）。\n\n**用法**\n- logins 给 1 到 3 个账套的登录\n- 多个账套缺省合并；不要合并时写 consolidate=false\n\n**规则**\n- 缺省只含已记账凭证；不含作废凭证和期末结转本年利润的凭证\n- 按利润表行定义取数：缺省为新会计准则一级科目，部署时可用 U8CO_MGMT_LINES_FILE 改\n- 行：营业收入、营业成本、各项费用，派生毛利、营业利润、利润总额、净利润\n- 收入类为贷减借，费用类为借减贷\n- 行定义之外的损益科目列在各账套的 unmapped（code、name、net 贷减借）\n- lines 每行：id、name、kind（line 取数行、derived 派生行）、sign（income、expense，派生行没有）\n- lines 每行另有 total（期间合计）、periods（期间 → 金额）；拆维度时取数行另有 by_dim\n- ratios：gross_margin_pct、net_margin_pct（百分比）\n- 合并时各行按账套相加，再按公司间对照的 rev_cogs 抵销内部收入和成本\n- 合并时毛利率、净利率按合并数重算；期末存货中未实现的内部利润不抵销（见 notes）\n- 合并要求各账套在公司间对照（U8CO_IC_MAP_FILE）的同一组里\n- 先读各账套的月结状态和数据水位（mgmt/meta），结果按水位缓存\n- 所选期间各账套都已总账结账时缓存 6 小时，否则 60 秒；响应的 cache 给出 hit、age_s\n- 部分账套失败仍返回 200：失败的账套写进 warnings，complete 为 false，consolidated 为 null\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：合并时没配置对照\n- 400 ic_group_mismatch：合并时账套不在同一组\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coMgmtPnl",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MgmtPnlIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MgmtOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "经营管理：利润表",
        "tags": [
          "经营管理"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/mgmt/sales": {
      "post": {
        "description": "按销售发票汇总所选期间的销售数量、收入和销售成本，算毛利和毛利率（只读）。\n\n**用法**\n- logins 给 1 到 3 个账套的登录\n- 多个账套缺省合并；不要合并时写 consolidate=false\n\n**规则**\n- 发票缺省只含已复核；收入给出不含税和价税合计，成本取存货核算\n- 按 group_by 分组；每个账套按收入取前 top 组，其余并成 others\n- totals 是全部组的合计\n- 收入以发票为准，与总账收入可能有期间、口径差；利润以 mgmt/pnl 为准\n- 没有启用销售管理的账套 rows 为空、sa_enabled 为 false（见 warnings）\n- 合并时合计减去公司间内部销售：客户是本次所选的其他公司（按对照的 as_customer）\n- 抵销明细见 eliminations；毛利率按合并数重算\n- 合并且按存货分组时，只按对照里的存货相加（编码相同不等于同一存货），没有对照的列在 unmapped\n- 合并但不按存货分组时，rows 是各账套去掉内部客户后的行（带 acc）\n- 客户、业务员、部门编码不跨账套合并\n- 合并要求各账套在公司间对照（U8CO_IC_MAP_FILE）的同一组里\n- 先读各账套的月结状态和数据水位（mgmt/meta），结果按水位缓存\n- 所选期间各账套都已总账结账时缓存 6 小时，否则 60 秒；响应的 cache 给出 hit、age_s\n- 部分账套失败仍返回 200：失败的账套写进 warnings，complete 为 false，consolidated 为 null\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：合并时没配置对照\n- 400 ic_group_mismatch：合并时账套不在同一组\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coMgmtSales",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MgmtSalesIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MgmtOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "经营管理：销售与毛利",
        "tags": [
          "经营管理"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/notes/create": {
      "post": {
        "description": "登记一张应收（应付）票据并生成对应的收款单（付款单），对应 U8 应收（应付）款管理「票据管理」的登记。\n\n**用法**\n- 应收票据给 customer（交票客户），应付票据给 vendor，另一个不收\n- sub_start / sub_end 成对给出时登记分包票据，区间张数 × 0.01 须等于票面 amount；不给为不分包票据\n- dry_run 为 true：真实写入、核对后回滚（rollback 模式）\n\n**规则**\n- 桥在一个事务里照 U8 登记的结果写票据（AP_Note）和收款单，核对后提交；任何一步失败整笔回滚\n- 不调用 U8 的票据组件 NoteManageAR（无界面时会挂起），不建条码档案\n- 收款单（48）：结算方式 = 票据类型，表头科目 = 票据科目，表体一行应收款\n- 收款单标成票据来源（cSrcFlag C、来源 50、票据号），票据回写收款单主键\n- 签发、收票日期不晚于登录日期 date；到期日、收票日期不早于签发日期\n- 收票日期所在期间应收未结账\n- 生成的收款单未审核（receipt_verified 为 false），票据处理（notes/process）前先审核\n- 分包票据：标成分包，写子票区间和一行可用区间（Ap_Note_AvailRange）\n- 分包票据的收款单票据号写成「票据号-起号-止号」\n- 应付票据生成付款单（49），表体一行应付款，科目缺省取应付科目 kzkm；响应的 receipt_id / receipt_code 是付款单\n- 应付票据：票据 cFlag AP、cLink AP50+票据号；pjkm 未设置时必须给 note_km（如 2201 的末级）\n\n**限制**\n- 应付票据（flag AP）是第二级写入，只在测试账套上验证过\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 应收票据：功能权限 AR0504；数据权限按客户、部门、业务员\n- 应付票据：功能权限 AP0504；数据权限按供应商\n\n**错误**\n- 409 state_mismatch：票据号已存在、期间已结账、没有设置票据科目等\n\n**相关**\n- 审核收款单：vouchers/verify（type ar_receipt）\n- 票据处理：notes/process\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coNoteCreate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoNoteCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoNoteRegOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "票据登记",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/notes/delete": {
      "post": {
        "description": "删除一张登记后还没有处理的票据，连同登记生成的收款单（应付票据为付款单）。\n\n**用法**\n- dry_run 为 true：真实删除、核对后回滚（rollback 模式）\n\n**规则**\n- 票据须不是期初、没有结算 / 贴现 / 背书等处理记录、没换过票、余额等于票面\n- 登记生成的收款单须未审核、未制单、未核销\n- 分包票据须可用区间仍是登记时的整段，连同可用区间一起删\n- 桥照 U8 DeletePJ 的做法，在一个事务里删除收款单、保证金、付款申请明细和票据\n- 核对后提交，任何一步失败整笔回滚\n\n**限制**\n- 应付票据（flag AP）是第二级写入，只在测试账套上验证过\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：应收票据 AR2403，应付票据 AP2403\n\n**错误**\n- 404 not_found：票据不存在\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coNoteDelete",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoNoteDeleteIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoNoteRegOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "删除票据",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/notes/get": {
      "post": {
        "description": "只读，只查数据库，不调用 U8 组件。按 id（AP_Note.Auto_ID，即 vouchers/list 的 id）或 code（票据号）读一张应收票据（ar_note）或应付票据（ap_note），二者给且只给一个。head 是票据表头：金额 amount、余额 remainder（结算、贴现、背书、退回后减少）、结算方式 settle_code、到期日 expire_date、期初 opening、收款单 close_id、ufts 等；subs 是处理记录（9A 结算、9C 退回、9D 贴现、9E 背书），带处理号 cancel_no 和凭证号 gl_ref。权限同票据列表；票据不存在返回 404 not_found，越权返回 403 no_permission。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coNoteGet",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoNoteGetIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoNoteGetOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "票据读取",
        "tags": [
          "单据读取"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/notes/process": {
      "post": {
        "description": "应收（应付）票据的结算、贴现、背书、退回，对应 U8 应收（应付）款管理「票据管理」里的票据处理。\n\n**用法**\n\n| op | 处理 | 处理方式 | 应收票据处理号 | 应付票据处理号 |\n| --- | --- | --- | --- | --- |\n| settle | 托收 / 结算 | 9A | PJJAR… | PJJAP… |\n| discount | 贴现 | 9D | PJTAR… | 不支持（400） |\n| endorse | 背书冲应付 | 9E | PJBAR… | 不支持（400） |\n| return | 退回 | 9C | CLAR… | CLAP… |\n\n- amount 可小于余额（部分处理）；分包票据省略时取第一段可用区间\n- sub_start / sub_end 每个号 0.01 元，同时给 amount 时须一致\n- 各 op 只收自己的字段：退回不收 bank_*、贴现、背书的字段\n- 贴现净额 = 金额 + interest - expense，须大于 0\n- dry_run 为 true：在事务里执行后回滚（rollback 模式），不写入，返回 DryRunOut\n- 预演退回时 U8 取过的应收单号不退，真做时会跳号\n\n**规则**\n- 处理日期就是登录日期 date：须在应收（背书另查应付）未结账的期间内，不早于签发、收票日期\n- U8 的处理窗体没有可调用的组件，桥按该窗体执行的 SQL 写（实测核对）\n- 一个事务里写票据处理行 AP_Note_Sub、票据余额、往来明细、分包票据的可用子票区间，提交前后核对\n- 背书：同时冲被背书供应商的应付单据\n- 退回（return）：\n  - 把票据或分包票据的全部可用子票区间退还客户\n  - 经 U8 应收单组件另生成一张应收单 R0 重新挂应收，主键、单号由 U8 分配（响应 r0_id、r0_code）\n  - 应收单的往来单位是票据的客户，科目是登记收款单的应收控制科目\n  - 保存后补写处理标记、余额 0 和审核人；没有审核行，不能经 vouchers/verify 审核、弃审\n  - 缺省摘要「退回{客户名称}电子承兑」；登记时的收款单不动\n- 应付票据结算（PJJAP…）：往来明细记借方，银行在贷方\n- 应付票据退回（CLAP…）：退还供应商，另生成应付单 P0（响应 p0_id、p0_code），科目是登记付款单的应付控制科目\n\n**限制**\n- 应付票据只收 settle、return；discount、endorse 400\n- 应付票据写入是第二级写入，只在测试账套上验证过\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n\n| 操作 | 应收票据 | 应付票据 |\n| --- | --- | --- |\n| 结算 | AR240203 / AR240201 | AP240203 / AP240201 |\n| 贴现 | AR240205 | — |\n| 背书 | AR240206 | — |\n| 退回 | 「票据退票」AR240207 或「票据转出」AR240202 | 「票据转出」AP240202 |\n\n- 都另收票据录入 AR0504（应付票据 AP0504）\n- 数据权限：应收票据按票据的客户、部门、业务员，背书另按每张应付单据；应付票据按供应商\n\n**错误**\n- 404 not_found：票据、科目或供应商不存在\n- 409 state_mismatch：外币票据、已换票、已退回、余额为 0 或不足\n- 409 state_mismatch：不是分包票据却给了子票区间、区间不可用\n- 409 state_mismatch：登记生成的收款单未审核（先 vouchers/verify）\n- 409 state_mismatch：退回日期早于票据已有的处理、分包票据没有退回全部可用区间\n- 409 state_mismatch：取不到应收控制科目或应收单模板、科目不是末级银行科目\n- 409 state_mismatch：期间已结账、票据在 U8 客户端被占用等\n- 409 u8_rejected：核对不符，已回滚\n- 504 outcome_unknown：提交后回读不符；先按处理号核对，不要直接重试\n\n**相关**\n- 撤销：arap/process/cancel（按处理号；退回的应收单已被核销等引用时 409）\n- 制单：arap/process/voucher（贴现可给 expense_code）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coNoteProcess",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoNoteProcIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoNoteProcOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "票据处理",
        "tags": [
          "应收应付处理"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/openings/arap": {
      "post": {
        "description": "新增、删除、审核、弃审应收 / 应付期初单据（U8 应收款管理、应付款管理「期初余额」）。\n\n**用法**\n- create 收 partner、amount、account，可选 department、person、digest、currency、exch_rate\n- delete、verify、unverify 只收 id\n- 响应同应收单 / 应付单的新增、审核（type 为 ar_bill / ap_bill），另带 side、opening=true\n- 新增响应还带 start_date（启用日期）和 date（单据日期）\n- dry_run：事务里执行后回滚（rollback 模式），什么都不写入，返回 DryRunOut\n\n**规则**\n- 期初单据是只有表头的应收单 / 应付单（bStartFlag=1）\n- 单据日期固定为该模块启用日期的前一天，不收日期字段\n- amount 为负数时照 U8 存为正数并取反借贷方向\n- 审核照 U8 期初形态写往来明细：第 0 期，登记、审核日期为启用日前一天\n- 普通的 ar_bill / ap_bill 路由不处理期初单据\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：应收 AR0306，应付 AP0306\n\n**错误**\n- 400：字段组合不对，不访问 U8\n- 404 not_found：单据不存在\n- 409 state_mismatch：\n  - 模块启用的第一个月已经结账，不能修改期初单据\n  - 模块未启用，或不是期初单据\n  - 单据已审核，或单据未审核\n  - 单据已生成凭证、已核销或已有往来明细（不能弃审 / 删除）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coOpeningsArap",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpeningsArapIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/OpeningsArapOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "应收应付期初单据",
        "tags": [
          "期初记账"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/openings/post": {
      "post": {
        "description": "采购管理或存货核算的期初记账、取消期初记账。\n\n**用法**\n- module=pu：采购管理「期初记账」\n- module=ia：存货核算「期初余额」的记账 / 恢复\n- 期初年度取该模块的启用年度\n- dry_run：事务里执行后回滚（rollback 模式），什么都不写入，返回 DryRunOut\n- 预演的 action 为 opening_post 或 opening_unpost\n- 预演的操作后状态在 detail.opening：module、posted、opening_year、start_date，存货核算另有 counts\n\n**规则**\n- 存货核算记账从已审核的库存期初结存单取数\n- 写第 0 期期初明细和汇总（IA_Subsidiary / IA_Summary iMonth=0），置启用年度第 0 期 bflag_IA\n- 存货核算取消只删第 0 期的期初数据、清标志（不是 U8 的取消开账）\n- 存货核算的登录日期须在启用年度（建议就用启用日期），否则 400\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n- 功能权限：采购 PU0206，存货核算 ASM3102\n\n**错误**\n- 400：module 或 action 不对，不访问 U8\n- 采购 409 state_mismatch：\n  - 期初已记账（再记）、期初未记账（取消）\n  - 已有月份结账、采购管理未启用\n  - 已有采购发票，或存货核算已期初记账，不能取消\n- 存货核算 409 state_mismatch：\n  - 存货核算未启用、期初已记账、期初未记账\n  - 已有月份结账或已有日常数据（不能取消）\n  - 库存与存货核算启用日期不一致\n  - 有先进先出 / 后进先出计价的期初行（接口暂不支持）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coOpeningsPost",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpeningsPostIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/OpeningsPostOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "采购 / 存货核算期初记账",
        "tags": [
          "期初记账"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/periods/close": {
      "post": {
        "description": "U8 各模块的月末结账或取消结账（U8「月末结账」）。\n\n**用法**\n- reopen 只能取消最后一个已结账的期间\n- through 时全部在一个事务里，按 U8 顺序：采购、销售 → 库存 → 存货核算 → 应收、应付 → 总账\n- 库存结账照 U8 写月末结存快照（ST_MonthAccount 等五张表），取消结账删除该月快照\n- 库存结账的响应和预演 detail 带 stock_rows\n- 存货核算有数据的月份照 U8 结账（取消结账），先用 ia/post、ia/period_end 记账并做期末处理\n- dry_run：事务里执行后回滚（rollback 模式），返回 DryRunOut，会结账的期间在 detail.periods\n\n**限制**\n- 默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled\n- 打开后只对桥配置的测试账套（testAccounts）开放，其他账套 403 test_account_only，不登录 U8\n\n**权限**\n\n| 模块 | 功能权限 |\n| --- | --- |\n| 采购 | PU0207 |\n| 销售 | SA020901 |\n| 库存 | ST0304 |\n| 存货核算 | IA2007 |\n| 应收 | AR0509 |\n| 应付 | AP0509 |\n| 总账 | 结账 GL1512，反结账 GL1520 |\n\n- through 要所涉每个模块的结账权限\n\n**错误**\n- 409 state_mismatch，常见原因：\n  - 上一期间还没结账、该期间已结账、同期前置模块还没结账\n  - 有未审核 / 未复核的单据、有未记账的凭证\n  - 请先做期间损益结转\n  - 存货核算该月未做期末处理或有未记账的单据\n  - 库存或存货核算的选项接口暂不支持\n  - 采购未做期初记账\n  - 总账结账前固定资产 / 薪资 / 成本还没结账（桥不结这几个模块）\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coPeriodsClose",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PeriodsCloseIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PeriodsCloseOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "月末结账",
        "tags": [
          "月末结账"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/perm/evaluate": {
      "post": {
        "description": "用登录操作员的身份查询 subject 操作员的有效权限，不需要 subject 的口令。\n\n**用法**\n- 字段同 perm/snapshot，另带 subject。\n\n**权限**\n- 登录操作员要在桥的 permEvaluateOperators 名单里（账套主管也不例外），否则 403。\n\n**错误**\n- subject 不存在：404。\n\n**令牌权限：权限评估**（信任项写了 perm_evaluate: true，且有读或写权限）；否则 403 forbidden。",
        "operationId": "coPermEvaluate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PermEvaluateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PermEvaluateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "查询指定操作员的有效权限",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "perm_evaluate"
      }
    },
    "/v1/co/perm/snapshot": {
      "post": {
        "description": "返回登录操作员自己在该账套、年度的有效权限。\n\n**用法**\n- 内容：是否账套主管、功能权限编码、启用了数据权限控制的对象、各对象的数据权限和指纹。\n- 数据权限：all 为不受控；codes 为受控时可见的编码，空数组表示一条都看不到。\n- fitem 是项目大类与编码的 pairs。\n- 指纹：权限不变时指纹不变，可作缓存键。\n\n**规则**\n- 与桥过滤读接口时用的是同一份权限，桥上缓存 ttl_s 秒。\n- 不含口令、名称和金额。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coPermSnapshot",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoAuth"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PermSnapshotOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "当前操作员的有效权限",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/account_readiness": {
      "post": {
        "description": "检查账套能否跑回归，每项给出结论和修复提示。\n\n**规则**\n- 检查补丁、年度、工作日历、年度配置、采购期初、供应商自定义项表\n- 检查模块启用、以前年度总账结账、审批流和默认档案\n- 每项给 ok、warn、fail 或 unknown，附修复提示和 getting-started.md 的小节\n- 检查 UFSystem 的项读不到时记 unknown\n- 问题放在 checks 里，HTTP 仍是 200\n- 只查数据库，不调用 U8 组件\n\n**错误**\n- 422：登录日期（date）不在已建立的年度里，登录失败\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportAccountReadiness",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportReadinessIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportReadinessOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "账套体检",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/aggregate": {
      "post": {
        "description": "对 1 到 3 个账套各调一次同一张报表，并按公司间对照合计（只读）。\n\n**用法**\n- report：stock_current 现存量、arap_balance 往来余额、arap_aging 账龄分析、gl_balance 科目余额表\n- params 按该报表的入参校验，不含登录字段和 after、limit\n- 本接口自动读完全部页\n\n**规则**\n- 各账套须在同一个公司组\n- by_account 按账套给出读到的 items，或该账套的 error\n- totals 只按公司间对照（U8CO_IC_MAP_FILE）合计\n- 现存量按对照里的存货 id 合计\n- 往来按往来单位所代表的公司（as_customer / as_vendor）合计\n- 科目余额按对照里的逻辑科目合计\n- 对照之外的存货、往来单位和末级科目不相加，计数列在 unmapped\n- 部分账套失败仍返回 200：失败的账套不计入合计，写进 warnings\n\n**限制**\n- 每个账套最多 2 万行\n\n**错误**\n- 422 ic_too_many_rows：某账套超过 2 万行，记在该账套\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：没配置对照\n- 400 ic_group_mismatch：账套不在同一组\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coReportAggregate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IcAggregateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IcAggregateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "多账套汇总",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/reports/arap_aging": {
      "post": {
        "description": "按客户或供应商把截至 as_of 的余额分到账龄区间。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 未核销的预收、预付单列\n- 应收先把核销分摊回原单据，再算账龄\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportArapAging",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportAgingIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportAgingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "账龄分析",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/arap_balance": {
      "post": {
        "description": "按客户（应收）或供应商（应付）列出截至 as_of 的借方、贷方累计和余额。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 不含应收票据和现金类记录\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportArapBalance",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportArapIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportArapOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "往来余额",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/arap_detail": {
      "post": {
        "description": "按客户（应收）或供应商（应付）列出往来明细和滚动余额。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- 核销行缺省不列\n\n**规则**\n- 先列 date_from 的期初，再逐张列出区间内单据的借方、贷方\n- 口径同往来余额：不含应收票据和现金类记录\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportArapDetail",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportArapDetailIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportArapDetailOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "往来明细账",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/arap_writeoffs": {
      "post": {
        "description": "列出应收（flag=AR）或应付（flag=AP）的核销批次。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- 过滤：往来单位 partner、核销号 cancel_no、登记日期 date_from / date_to（含两端）\n- 收付款单：receipt {type, id} 或 receipt_code 单号，二选一\n- 被核销单据：target {type, id} 或 target_code 单号，二选一\n\n**规则**\n- 按核销号（Ar_Detail / Ap_Detail.cCancelNo，cProcStyle=9P）分批\n- 本服务 arap/writeoff 做的和 U8 客户端做的都列\n- 按登记日期降序、核销号降序\n- 每批给出日期、会计年度和期间、往来单位、币种、操作员和合计 amount\n- 收付款单：type、id、line_id、code\n- targets：被核销单据行的 type、id、line_id、code、amount\n- gl_voucher、voucher：是否已制单及凭证\n- cancellable：按取消核销（arap/writeoff/cancel）同一套规则只读判断\n- cancellable 为 false 时，reason 是取消核销会返回的原因\n- 常见原因：已制单、期间已结账、之后还有其他处理、外币、不是一张收付款单对单据的核销\n- 判断不加锁，只是查询时刻的快照\n- 只查数据库，不调用 U8 组件\n\n**权限**\n- 功能权限（任一）：应收核销明细表 AR060107、手工核销 AR050201、取消操作 AR0807\n- 应付对应 AP060107 / AP050201 / AP0807\n- 数据权限按客户或供应商\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportArapWriteoffs",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportWriteoffsIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportWriteoffsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "核销记录",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/batch_stock": {
      "post": {
        "description": "按仓库、存货、批号汇总现存量，带生产日期和失效日期。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- expiring_before 用于保质期预警\n\n**规则**\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportBatchStock",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportBatchStockIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportBatchStockOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "批次存量",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/bom": {
      "post": {
        "description": "按生效日期读取母件的已审核物料清单。\n\n**用法**\n- levels 大于 1 时多层展开\n- qty 是每 1 个母件的累计用量\n\n**规则**\n- 只查数据库，不调用 U8 组件\n\n**限制**\n- 不分页；超过 limit 时 truncated 为 true\n\n**错误**\n- 404 not_found：该日期没有已审核的物料清单\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportBom",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportBomIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportBomOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "物料清单",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/close_status": {
      "post": {
        "description": "按期间列出各模块是否已结账。\n\n**用法**\n- 会计年度缺省取登录日期（date）的年份，可用 fiscal_year 指定；year 是账套库年度\n\n**规则**\n- 模块：销售、采购、库存、存货核算、总账、应收、应付、成本、固定资产\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportCloseStatus",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCloseStatusIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCloseStatusOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "月结状态",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/consolidation": {
      "post": {
        "description": "对 2 到 3 个账套出映射试算，并按公司间对照做往来抵销（只读）。\n\n**规则**\n- 各账套须在同一个公司组\n- 科目余额表只取已记账凭证、非零行\n- trial：按对照的逻辑科目（gl）列出各账套的映射试算\n- 抵销对（elim，rule=ar_ap）读辅助核算余额表：应收方按客户，应付方按供应商\n- 抵销对的科目取逻辑科目在该账套的编码\n- 抵销额 = 应收、应付期末余额绝对值中较小的一个，差额另列\n- 两边方向相反时不抵销，并提醒\n- consolidated：按逻辑科目给出各账套期末净额之和、抵销分录和抵销后的余额\n- 对照之外的末级科目不相加，计数列在 unmapped\n- 未实现内部利润、收入成本没有抵销（见 notes）\n- 部分账套失败仍返回 200：complete 为 false，consolidated 为 null，涉及失败账套的抵销对跳过\n\n**错误**\n- 503：全部账套失败\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coReportConsolidation",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IcConsolidationIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IcConsolidationOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "合并报表（往来抵销）",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/reports/customer_credit": {
      "post": {
        "description": "列出客户的信用额度、信用期限、信用等级和信用占用。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 占用按 U8 信用余额表口径：订单、发货单、发票、应收余额、代垫费用\n- used 按销售选项的额度检查公式合计\n- 受控客户另给可用额度 available\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportCustomerCredit",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCustomerCreditIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCustomerCreditOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "客户信用",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/doc_trace": {
      "post": {
        "description": "从一张单据出发，列出上游（来源）和下游（去向）的关联单据和关联行数。\n\n**规则**\n- 覆盖销售、采购（含质检）、生产和收付款核销\n- 没有数据权限的单据不列出、也不再往下找，只计入 omitted\n- 只查数据库，不调用 U8 组件\n\n**限制**\n- 每个方向最多 3 跳，共最多 200 个节点\n\n**错误**\n- 404 not_found：起点单据不存在\n- 403 no_permission：越权\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportDocTrace",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportDocTraceIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDocTraceOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "单据追溯",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/fa_changes": {
      "post": {
        "description": "列出固定资产变动单（原值增减、计提减值准备、部门转移等），每张另带部门明细。\n\n**用法**\n- 会计年度缺省取登录日期（date）的年份，可用 fiscal_year 指定；year 是账套库年度\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- 按变动日期的年份和变动期间过滤\n- 可按卡片、单号、类型过滤\n\n**规则**\n- U8 每做一次变动，卡片就多一个版本；opt_id 是变动后版本\n- 只查数据库，不调用 U8 组件\n\n**相关**\n- 卡片当时的状态：archives/get 的 fa_card\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportFaChanges",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportFaChangesIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportFaChangesOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "固定资产变动单",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/fa_depreciation": {
      "post": {
        "description": "按卡片和期间列出已计提的折旧。\n\n**用法**\n- 会计年度缺省取登录日期（date）的年份，可用 fiscal_year 指定；year 是账套库年度\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 给出当月折旧、月末累计折旧、月折旧率和月初原值\n- 只含该年度已计提的期间（posted_periods）\n- 只查数据库，不调用 U8 组件\n\n**相关**\n- 累计折旧与 fa_card 在同一期间的 accumulated_depreciation 一致\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportFaDepreciation",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportFaDepreciationIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportFaDepreciationOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "固定资产折旧",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/gl_aux_balance": {
      "post": {
        "description": "按科目和辅助项列出期初、本期、累计、期末。\n\n**用法**\n- 会计年度缺省取登录日期（date）的年份，可用 fiscal_year 指定；year 是账套库年度\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 辅助项：客户、供应商、部门、个人或项目\n- 只含已记账凭证\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportGlAuxBalance",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportGlAuxIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportGlAuxOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "辅助核算余额表",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/gl_balance": {
      "post": {
        "description": "发生额及余额表：按科目列出期初、本期、本年累计、期末。\n\n**用法**\n- 会计年度缺省取登录日期（date）的年份，可用 fiscal_year 指定；year 是账套库年度\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- include_unposted 为 true 时，未记账凭证计入本期、累计和期末\n\n**规则**\n- 缺省只含已记账凭证\n- 余额按方向拆成借方和贷方\n- 上级科目已含下级\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportGlBalance",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportGlBalanceIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportGlBalanceOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "科目余额表",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/gl_detail": {
      "post": {
        "description": "按期间或日期列出科目的期初、逐条凭证分录和滚动余额。\n\n**用法**\n- 会计年度缺省取登录日期（date）的年份，可用 fiscal_year 指定；year 是账套库年度\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- 科目缺省含下级\n- 可按客户、供应商、部门、个人、项目过滤\n\n**规则**\n- 期初规则同科目余额表\n- 缺省只含已记账凭证\n- 只查数据库，不调用 U8 组件\n\n**错误**\n- 404 not_found：科目在该年度不存在\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportGlDetail",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportGlDetailIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportGlDetailOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "科目明细账",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/intercompany_match": {
      "post": {
        "description": "把卖方账套的销售单据和买方账套的采购单据逐行配对（只读）。\n\n**用法**\n- logins 给 2 到 3 个账套的登录，必须含 seller.acc 和 buyer.acc\n- 两边都是发票时缺省按月（invoice_mode=month）比较价税合计\n\n**规则**\n- 按公司间对照（U8CO_IC_MAP_FILE）配对，各账套须在同一个公司组\n- 卖方单据按「买方公司在卖方账套里的客户编码」查\n- 买方单据按「卖方公司在买方账套里的供应商编码」查\n- 存货按对照换成同一个存货 id；没有对照的不配对，列在未配对里（reason 为 unmapped）\n- match=code：先按日期、存货、数量完全相同配对，再在 window_days 天内配对\n- match=qty_date：只按数量和当天配对\n- 销售出库、采购入库的明细取自库存台账，只比对对照里的存货\n- 发货单、到货单和发票逐张读取\n- 按月比较发票时，差额不超过 0.05 算配上\n- 只比对到 clip_date（两边最后一笔日期中较早的那天），之后的明细计入 clipped\n\n**限制**\n- 日期区间最多 93 天\n\n**错误**\n- 403 account_not_allowed：令牌不能用其中某个账套\n- 404 ic_not_configured：没配置对照\n- 400 ic_group_mismatch：账套不在同一组\n- 409 ic_party_unmapped：对照里缺往来单位编码\n\n**令牌权限：经营管理**（信任项的 mgmt_claim / mgmt_scope，读、写权限不能代替）；没有时 403 mgmt_forbidden。",
        "operationId": "coReportIntercompanyMatch",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IcMatchIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IcMatchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "公司间对账",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "mgmt"
      }
    },
    "/v1/co/reports/opening_balance": {
      "post": {
        "description": "按模块列出期初余额。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- module=stock：库存期初，期初单据按仓库、存货、批号汇总数量和金额\n- module=arap：应收或应付期初单，按往来单位、科目\n- module=gl：总账期初余额，按科目带试算平衡，或按辅助项\n\n**规则**\n- 都带模块启用日期和期初是否已记账（posted）\n- 只读：期初的录入和修改不经本接口\n- 只查数据库，不调用 U8 组件\n\n**权限**\n- 数据权限同对应的余额表\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportOpeningBalance",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportOpeningIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportOpeningOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "期初余额",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/order_execution": {
      "post": {
        "description": "逐行列出销售订单或采购订单的数量、金额和累计执行数。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- 可按 id、单号、日期、往来单位过滤\n- only_open 只要未执行完且未关闭的行\n\n**规则**\n- 执行数取自 U8 订单行上的累计数\n- 销售：发货、出库、开票、退货、收款\n- 采购：到货、入库、开票、退货、付款\n- 只查数据库，不调用 U8 组件\n\n**权限**\n- 数据权限同该订单类型的列表\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportOrderExecution",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportOrderExecIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportOrderExecOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "订单执行",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/position_stock": {
      "post": {
        "description": "按货位列出存货、批次的结存数量。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 只含已指定货位的部分\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportPositionStock",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportPositionStockIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportPositionStockOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "货位存量",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/price_list": {
      "post": {
        "description": "列出客户价格表、存货价格表或供应商存货价格表。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n- 缺省只列 as_of 当天有效的价格\n\n**规则**\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportPriceList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportPriceListIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportPriceListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "价格表",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/stock_ledger": {
      "post": {
        "description": "列出一个存货在日期区间内的每一行收发，带期初和逐行结存。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 单据：采购入库、其他入库、其他出库、产成品入库、材料出库、销售出库、库存期初\n- 缺省只含已审核单据\n- 只查数据库，不调用 U8 组件\n\n**错误**\n- 404 not_found：存货不存在\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportStockLedger",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportStockLedgerIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportStockLedgerOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "库存台账",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/reports/stock_summary": {
      "post": {
        "description": "按存货（缺省再按仓库）汇总日期区间的期初、入库、出库、结存数量。\n\n**用法**\n- 按 next 翻页：原样放进 after 读下一页，最后一页 next 为 null\n\n**规则**\n- 只有数量，没有金额\n- 缺省只含已审核单据\n- 只查数据库，不调用 U8 组件\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coReportStockSummary",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportStockSummaryIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportStockSummaryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "收发存汇总表",
        "tags": [
          "报表"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/sale-orders/verify": {
      "post": {
        "description": "审核或弃审销售订单。\n\n**用法**\n- id 是 SO_SOMain.ID。\n- action 为 verify 或 unverify。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coSaleOrdersVerify",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoVerifyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoVerifyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "审核或弃审销售订单",
        "tags": [
          "U8 业务操作"
        ],
        "x-u8co-access": "write"
      }
    },
    "/v1/co/stock/current": {
      "post": {
        "description": "按 CurrentStock 主键列出现存量。\n\n**用法**\n- 可按仓库、存货、批号过滤。\n- qty_available 的算法见响应说明。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coStockCurrent",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoStockIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoStockOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "现存量",
        "tags": [
          "现存量"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/vouchers/attachments/list": {
      "post": {
        "description": "按类型和主键列出单据卡片上的附件（U8 通用附件表）。\n\n**规则**\n- 只查数据库，不调用 U8 组件。\n- 只列附件清单，不提供文件下载（文件在 U8 文件服务器上）。\n- 权限同读取该单据。\n\n**错误**\n- 单据不存在：404 not_found。\n- 越权：403 no_permission。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coVoucherAttachmentsList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoucherAttachIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoucherAttachOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "单据附件列表",
        "tags": [
          "单据读取"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/vouchers/close": {
      "post": {
        "description": "关闭或打开单据，整单或按行。\n\n**用法**\n- 类型见 type：销售订单、采购订单、请购单、生产订单和到货单。\n- action 为 close 或 open。\n- line_ids 省略时处理整张单据。\n- 生产订单的 id 是 MoId、line_ids 是 MoDId。\n- 生产订单省略 line_ids 时处理全部状态相符的行：关闭取已审核行，打开取已关闭行。\n\n**限制**\n- 请购单只能整单关闭或打开，不能带 line_ids。\n- 生产订单：本月已做成本计算、还有在制品、审批流控制的行都拒绝。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherClose",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoCloseIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoCloseOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "关闭或打开单据",
        "tags": [
          "单据新增删除"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/vouchers/create": {
      "post": {
        "description": "新增单据。\n\n**用法**\n- 常用类型：销售订单、采购订单、其他入库单、其他出库单、调拨单、收款单、付款单、应收单和应付单。\n- 全部类型见 type。\n- 表头和明细的值不能嵌套。\n- 收款单、付款单、应收单、应付单：表头用 U8 列名，必须有 cDwCode；每行 iAmt 必须大于 0。\n- 收款单、付款单：表头还要 cSSCode 和 cCode。\n- 供应商退款（ap_refund，AP48，往来单位是供应商）、客户退款（ar_refund，AR49，往来单位是客户）同收付款单。\n- 退款金额填正数，审核时 U8 在往来明细里记负数。\n- 请购单（purchase_requisition）：明细必须有 cinvcode 和大于 0 的 fquantity；单价只收 ioricost 或 ioritaxcost。\n- 形态转换单（shape_change）：每行要有 cwhcode、bavtype（转换前 / 转换后）和大于 0 的 iavquantity。\n- 形态转换单按 igroupno 成组。\n- 调拨申请单（transfer_request）：表头要有 cowhcode、ciwhcode。\n- 盘点单（stock_check）：表头要有 cwhcode；每行要有 icvcquantity（实盘，可为 0）。\n- 盘点单的账面数量 icvquantity 不给时按现存量填。\n- 生产订单（production_order）走 U8API MOrderAdd，字段见 lines 的说明。\n- 生产订单由 U8 自动编号并按标准 BOM 展开子件；响应另有 allocates、details 和 warnings。\n- 物料清单（bom）走 U8API BomAdd，建母件的一个标准 BOM 新版本；响应另有 version 和 components。\n- 采购结算单（purchase_settle）是手工结算，按 U8 手工结算界面执行的 SQL 写（实测核对）。\n- 采购结算单明细 1 到 400 行：入库行、发票行配对，或红蓝入库对冲、红蓝发票对冲。\n- 采购结算单响应另有 settle_date；删除走 vouchers/delete。\n- 期初结存单（stock_opening，U8 单据类型 34）：\n  - 走 U8 官方 EAI 导入（storeqc），每行建成一张单据。\n  - 响应 docs 逐张列出 id、code、line、wh、inv、qty；顶层 id、code 是第一张，另有 count、date。\n  - 字段名单见 docs/api-reference.md；行上的 cwhcode 覆盖表头。\n  - 日期固定为库存启用日前一天（传入的不用，见 warnings）。\n  - 预演只做调用前的检查（validate），不导入。\n\n**限制**\n- 期初结存单默认关闭：桥未开 enableReplicatedWrites 时 403 feature_disabled。\n- 期初结存单打开后只对 CO 桥配置为测试账套的账套开放，其他账套 403 test_account_only。\n- 期初结存单不能修改，请删除后重新录入。\n- 采购结算单不只限测试账套，按写入策略放行。\n\n**错误**\n- 期初结存单：存货核算已期初记账 409 state_mismatch；库存启用月已月结时 U8 拒绝 409 u8_rejected。\n- 生产订单：U8 拒绝 409 u8_rejected；生产制造服务未运行 503 u8_unavailable。\n- 生产订单：调用异常且回读不到新订单 504 outcome_unknown（不要重投，先按单号或列表核对）。\n- 物料清单：版本号或生效日期与已有版本重复 409 state_mismatch；其余结果码同生产订单。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherCreate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoCreateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoCreateOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "新增单据",
        "tags": [
          "单据新增删除"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/vouchers/delete": {
      "post": {
        "description": "删除未审核的单据。\n\n**用法**\n- 包括销售订单、其他入库单、其他出库单、采购订单、调拨单、发货单、到货单、销售出库单。\n- 包括采购入库单、销售发票、采购发票、收款单、付款单、应收单和应付单。\n- 生产订单（id 是 MoId）走 U8API MOrderDelete。\n- 物料清单（id 是 BomId）走 U8API BomDelete。\n\n**限制**\n- 材料出库单、产成品入库单：只删除参照生产订单或产品检验单生成的未审核单据。\n- 已生成凭证或已核销的收付款单和应收应付单不能删除。\n- 请购单：只删除未审核、未关闭、未被采购订单参照的单据。\n- 生产订单：只删除全部行未审核、未提交审批、未被材料出库或产成品入库引用的订单。\n- 物料清单：只删除未审核、未进审批流且没有被引用的版本。\n- 物料清单的引用方：生产订单、委外订单、组装 / 拆卸 / 形态转换单、配比出库单、调拨单。\n- 来料报检单、产品报检单：只删除没有检验单引用的单据；已审核的先弃审再删除。\n- 来料检验单、产品检验单：只删除未审核、未提交审批的单据。\n- 检验单被采购入库 / 产成品入库或不良品处理单引用时不能删除。\n\n**错误**\n- 删除已审核的报检单要有弃审权限，否则 409。\n- 报检单、检验单的删除由 U8 自己提交：调用异常且回读不清时 504 outcome_unknown。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherDelete",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoDeleteIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoDeleteOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "删除单据",
        "tags": [
          "单据新增删除"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/vouchers/generate": {
      "post": {
        "description": "按来源单据参照生成下游单据，新单据保持未审核。\n\n**用法**\n\n| 目标单据 | 来源单据 | 要求 |\n|---|---|---|\n| 发货单 | 销售订单 | — |\n| 销售出库 | 发货单 | 不能带表头；不带 lines 整张生成，带 lines 按行部分生成 |\n| 采购入库 | 采购订单 | — |\n| 采购入库 | 来料检验单（source_type=qm_incoming_check） | 只能 1 行，表头必须有 cWhCode |\n| 红字采购入库 | 采购退货单（source_type=purchase_return） | 表头必须有 cWhCode |\n| 销售发票 | 发货单 | — |\n| 采购发票 | 采购入库单 | 表头 cPBVCode 必填；红字入库单生成红字发票 |\n| 到货单 | 采购订单（id 是 POID） | 表头只收 cWhCode、dDate、cMemo、cDepCode |\n| 材料出库 | 生产订单 | 表头必须有 cWhCode |\n| 产成品入库 | 产品检验单 | 只能 1 行，表头必须有 cWhCode |\n| 来料报检单 | 已审核的蓝字到货单 | U8 保存时按设置自动审核，响应 state 为回读结果 |\n| 产品报检单 | 已审核的生产订单 | 同来料报检单 |\n| 来料检验单、产品检验单 | 已审核的报检单 | 只能 1 行，表头必须有 cCheckPersonCode |\n| 调拨单 | 已审核的调拨申请单（source_type=transfer_request） | 仓库取自申请单 |\n\n**规则**\n- 检验单的检验方案 project_code 省略时取该存货最近一张检验单的方案，都没有时 400。\n- 新检验单未提交审批，响应另有 wf。\n- 调拨单数量不超过核准数量减累计调拨数量；U8 回写申请单行累计调拨数量。\n\n**错误**\n- U8 单据模板设为必输而请求没给、桥也推不出的字段：400 bad_request，一次列出全部。\n- 检验单的新增由 U8 自己提交：调用异常且回读不到新单 504 outcome_unknown。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherGenerate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoGenerateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoGenerateOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "参照生单",
        "tags": [
          "参照生单"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/vouchers/list": {
      "post": {
        "description": "按主键列出某类单据的表头。\n\n**用法**\n- 可过滤、增量（changed_since）并按主键续读（after）。\n- keys_only 只返回 id、code、ufts，用来发现删除。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coVoucherList",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoVoucherListIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoVoucherListOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "单据列表",
        "tags": [
          "单据读取"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/vouchers/load": {
      "post": {
        "description": "按类型和主键读取单据的表头、明细和审核状态。\n\n**用法**\n- 含调拨单、销售发票、采购发票、生产订单、收款单、付款单、应收单和应付单。\n- 检验单和不良品处理单另附审批状态。\n- 来料报检单、产品报检单另附来源单据 source（到货单或生产订单）。\n- 物料清单（bom）：id 是 BomId，code 是母件存货编码。\n- 物料清单的 head / lines 的键是小写下划线。\n\n**限制**\n- 物料清单只读标准 BOM。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coVoucherLoad",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoLoadIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoLoadOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "读取单据",
        "tags": [
          "单据读取"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/vouchers/load_many": {
      "post": {
        "description": "一次读同一类型的 1 到 20 张单据，整个请求只登录一次。\n\n**用法**\n- 主键不能重复。\n- items 按请求顺序：成功的项与 vouchers/load 的响应体相同。\n- 失败的项是 `{id, error: {code, message}}`（not_found、no_permission 等），单张失败不影响其它。\n- fields / compact 只裁剪 items 每一项的顶层键（id、code、ok、error、masked_fields 总是保留）。\n- fields / compact 不裁剪 items[].head、items[].lines。\n- 字段权限：无权查看的字段值为 null，该项另带 masked_fields，信封上是各项的并集。\n\n**限制**\n- U8 组件读取的类型（销售、采购、库存、应收应付的单据）一次最多 5 张。\n- 按 SQL 读取的类型（采购发票、生产订单、物料清单、报检单、检验单、不良品处理单）最多 20 张。\n\n**错误**\n- U8 组件读取的类型超过 5 张：400（field 为 ids）。\n- 登录失败、许可满、繁忙等请求级错误照常返回错误。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coVoucherLoadMany",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoadManyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoadManyOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "批量读取单据",
        "tags": [
          "单据读取"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/vouchers/lock": {
      "post": {
        "description": "锁定或解锁销售订单，整单锁定，不按行。\n\n**用法**\n- id 是 SO_SOMain.ID；action 为 lock 或 unlock。\n- 锁定人写在表头 cLocker（操作员姓名），即读取表头的 clocker、列表的 locker。\n- 本人已锁定再锁定返回 200 且 already 为 true，锁定 504 后可以直接重试。\n\n**规则**\n- 只有锁定人本人能解锁。\n- 单据被别的操作员锁定时，修改、删除、审核、弃审都返回 409 state_mismatch「单据已被 X 锁定」。\n- 锁定人本人不受影响。\n\n**限制**\n- 采购订单锁定暂不支持（U8 采购组件 DoLock 实测一律拒绝），type=purchase_order 返回 400。\n- U8 客户端锁定的采购订单仍按上面的规则挡住别的操作员。\n\n**权限**\n- 要有 U8 的锁定 / 解锁按钮权限（销售订单 SA03010108 / SA03010109），否则 403。\n\n**错误**\n- 已审核的销售订单不能锁定：409 state_mismatch。\n- 别人已锁定再锁定、未锁定去解锁：409 state_mismatch。\n- 别人解锁：409 state_mismatch「单据由 X 锁定」。\n- U8 拒绝：409 u8_rejected，带回 U8 原文。\n- 已提交但回读锁定状态失败或不符：504 outcome_unknown，先用 load 核对。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherLock",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoLockIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoLockOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "锁定或解锁单据",
        "tags": [
          "单据新增删除"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/vouchers/search": {
      "post": {
        "description": "按条件查某类单据的表头。\n\n**用法**\n- 与 vouchers/list 同一套取数：相同的条目、记录级数据权限、按主键续读。\n- code_like：单据编号包含。\n- partner：客户或供应商（收付款单、应收应付单是往来单位 cDwCode）；有往来单位列的类型每条另有 partner_name。\n- warehouse：表头仓库。\n- inventory：明细含该存货（表头有存货列的类型按表头）。\n- defines：按表头自定义项找单据，如表头自定义项 1 里的纸质合同号。\n- next 原样放进 after 读下一页。\n\n**规则**\n- defines 的键是 define1–3、define8–14（表头的文本自定义项），最多 4 个键，条件之间是 AND。\n- defines 的值是字符串（规整后相等）或 `{eq | like | prefix: 字符串}`（相等、包含、开头是）。\n- 规整：全角空格、不换行空格当半角空格，去两端空格。\n- 给了 defines 时每条另有 defines：请求里各键的表头值（规整后，空为 null）。\n\n**错误**\n- 该类型没有往来单位列、仓库列、存货列或关闭状态时，对应的 partner、warehouse、inventory、closed 返回 400。\n- defines 的其他键 400（field 为 `defines.<键>`）；日期、数字自定义项 define4–7、define15–16 也不收。\n- 生产订单、物料清单没有表头自定义项：400（field 为 defines）。\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coVoucherSearch",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoucherSearchIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoucherSearchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "单据查询",
        "tags": [
          "单据读取"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/vouchers/update": {
      "post": {
        "description": "修改未审核、未关闭且没有下游的单据。\n\n**用法**\n- head 与 lines 至少给一个非空。\n- lines 的 op 为 add、update 或 delete。\n- 生产订单（id 是 MoId）走 U8API MOrderLoad + MOrderUpdate，行按 line_id 定位。\n- 生产订单：桥把加载出的子件全部重送，改了数量的行按 U8 的算法重算子件数量。\n- 生产订单：桥写回 U8 重插时丢掉的关联列；响应另有 allocates、details、changed。\n- 物料清单（bom）：明细按 sort_seq 定位，桥读出全部行、叠上修改后整套送 U8API BomUpdate。\n\n**限制**\n- 生产订单只改未审核、无下游的订单；不能增删行、换存货。\n- 物料清单只改未审核的标准 BOM。\n\n**错误**\n- 生产订单修改后回读子件对不上：504 outcome_unknown（不要重投，先读取核对）。\n- 物料清单行上有替代料、定位符等接口带不回去的内容：409 state_mismatch。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherUpdate",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoUpdateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoUpdateOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "修改单据",
        "tags": [
          "单据新增删除"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/vouchers/verify": {
      "post": {
        "description": "按单据类型审核或弃审单据。\n\n**用法**\n- 采购发票的 verify 是采购复核（取消复核），销售发票的 verify 是销售复核。\n- 调拨单审核可以返回生成的其他出入库单。\n- 收款单、付款单、应收单和应付单走应收应付模块的审核。\n- 生产订单审核即 U8 的审核（下达），id 是 MoId；全部明细审核后 state.verified 为 true。\n- 请购单审核、弃审走采购的 ConfirmApp / CancelconfirmApp。\n- 物料清单（bom，id 是 BomId）走 U8API BomAuditing / BomUnauditing。\n- 采购发票、销售发票的 action 另可送 arap_verify / arap_unverify：应付款管理（采购发票）或应收款管理（销售发票）的审核、弃审。\n- 应收应付审核、弃审要求已复核、未启用审批流、登录日期所在期间未结账。\n- 应收应付弃审另要求未制单、未核销。\n- 应收应付审核的响应：verified_by / verified_at 是应付（应收）审核人和日期。\n- 应收应付审核的 state 带 arap_verified、arap_verifier、arap_verified_at、gl_voucher。\n\n**限制**\n- 检验单和不良品处理单不能直接审核，请用 workflow/*。\n- 来料报检单不支持单独审核、弃审：U8 保存时按选项自动审核，删除时桥会先弃审。\n- 产品报检单只支持弃审（action=unverify）。\n- 已被采购订单参照的请购单不能弃审。\n\n**错误**\n- 物料清单版本受审批流控制：409 workflow_enabled。\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coVoucherVerify",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoVoucherVerifyIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoVoucherVerifyOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "审核或弃审",
        "tags": [
          "单据审核"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/abandon": {
      "post": {
        "description": "撤销本人最近一次同意。\n\n**用法**\n- opinion 可省略，最长 500 字\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowAbandon",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfNoteIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "弃审",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/approve": {
      "post": {
        "description": "审批同意。\n\n**用法**\n- opinion 可省略，最长 500 字\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowApprove",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfNoteIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "同意",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/disagree": {
      "post": {
        "description": "不同意，并继续往后流转。\n\n**用法**\n- opinion 必填，最长 500 字\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowDisagree",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfMustIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "不同意并继续",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/history": {
      "post": {
        "description": "按时间返回审批记录。\n\n**限制**\n- 只接受四张质量单据（见 type）\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coWorkflowHistory",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoHistoryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "查询审批历史",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/workflow/resubmit": {
      "post": {
        "description": "退回提交人之后重新提交。\n\n**限制**\n- 不能带 opinion\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowResubmit",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "退回后重新提交",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/return": {
      "post": {
        "description": "把单据退回提交人。\n\n**用法**\n- opinion 必填，最长 500 字\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowReturn",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfMustIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "退回提交人",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/state": {
      "post": {
        "description": "查询审批状态：是否受控、当前节点和待办。\n\n**限制**\n- 只接受四张质量单据（见 type）\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coWorkflowState",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoStateOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "查询审批状态",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/workflow/submit": {
      "post": {
        "description": "把质量单据提交到审批流。\n\n**限制**\n- 不能带 opinion\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowSubmit",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "提交审批",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    },
    "/v1/co/workflow/tasks": {
      "post": {
        "description": "返回当前操作员的待办。\n\n**用法**\n- type 可省略；给出时只接受四张质量单据\n\n**令牌权限：只读**（读或写权限均可，缺省声明 u8co_read / u8co_write）。",
        "operationId": "coWorkflowTasks",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoTasksIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoTasksOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "查询待办",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "read"
      }
    },
    "/v1/co/workflow/withdraw": {
      "post": {
        "description": "撤回尚未审完的提交。\n\n**限制**\n- 不能带 opinion\n\n**令牌权限：写**（缺省声明 u8co_write）；只有读权限返回 403。",
        "operationId": "coWorkflowWithdraw",
        "parameters": [
          {
            "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 4000,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "只返回这些键（逗号分隔，最多 100 项，大小写不敏感）。只裁剪 head、lines、items、fields 和预演的 docs[].head、docs[].lines，信封里的键不动。可带前缀 head. lines. items. fields. docs.head. docs.lines. 只作用于那个容器。",
              "title": "Fields"
            }
          },
          {
            "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
            "in": "query",
            "name": "compact",
            "required": false,
            "schema": {
              "default": false,
              "description": "true 时在上述容器里去掉值为 null、空串、[] 或 {} 的键（0 和 false 保留）。",
              "title": "Compact",
              "type": "boolean"
            }
          },
          {
            "description": "幂等键，1 到 128 个可见 ASCII 字符。同一调用方、账套、路径和键在 24 小时内只执行一次：已完成的原样重放，还在执行的等待同一结果，内容不同返回 409 idempotency_mismatch。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[\\x21-\\x7e]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoWfActIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CoActionOut"
                    },
                    {
                      "$ref": "#/components/schemas/DryRunOut"
                    }
                  ]
                }
              }
            },
            "description": "Successful Response。dry_run 为 true 时返回预演结果 DryRunOut（什么都没有写入）。"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "撤销提交",
        "tags": [
          "审批流"
        ],
        "x-u8co-access": "write",
        "x-u8co-dry-run": true
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "示例地址，换成你的部署地址",
      "url": "https://u8co.example.com"
    }
  ],
  "tags": [
    {
      "description": "登录检查、健康检查、字段元数据与字段标签、幂等结果查询、有效权限；销售订单和发货单的专用审核；应收应付核销与制单。",
      "name": "U8 业务操作"
    },
    {
      "description": "读取单据、批量读取、单据列表与查询、附件列表、票据读取。只读。",
      "name": "单据读取"
    },
    {
      "description": "按单据类型审核或弃审（vouchers/verify）。",
      "name": "单据审核"
    },
    {
      "description": "新增、修改、删除、关闭、打开和锁定单据。",
      "name": "单据新增删除"
    },
    {
      "description": "按来源单据参照生成下游单据；公司间按卖方单据生成买方单据。",
      "name": "参照生单"
    },
    {
      "description": "审批流：状态、历史、待办、提交、撤销、同意、不同意、退回、弃审、重新提交。",
      "name": "审批流"
    },
    {
      "description": "总账凭证的读取、列表、新增、修改、作废、审核、签字和删除。",
      "name": "总账凭证"
    },
    {
      "description": "基础档案的读取、列表、名称解析、新增、修改和删除。",
      "name": "基础档案"
    },
    {
      "description": "现存量查询。只读。",
      "name": "现存量"
    },
    {
      "description": "月结状态、科目余额、往来余额、账龄、物料清单等只读报表。",
      "name": "报表"
    },
    {
      "description": "采购、存货核算期初记账和取消期初记账；应收、应付期初单据。\n\n第二级写入：默认关闭，打开后只对测试账套开放。",
      "name": "期初记账"
    },
    {
      "description": "各模块的月末结账、取消结账和逐月结账。\n\n第二级写入：默认关闭，打开后只对测试账套开放。",
      "name": "月末结账"
    },
    {
      "description": "存货核算的正常单据记账、恢复记账、期末处理和取消期末处理。\n\n第二级写入：默认关闭，打开后只对测试账套开放。",
      "name": "存货核算"
    },
    {
      "description": "应收冲应付、应付冲应收、并账、红票对冲、汇兑损益，及其取消和制单。\n\n第二级写入：默认关闭，打开后只对测试账套开放。",
      "name": "应收应付处理"
    },
    {
      "description": "多账套的月结状态、利润表、销售毛利、往来账期、资金存货和概览，可合并抵销。\n\n另需经营管理权限。",
      "name": "经营管理"
    }
  ]
}
