{"openapi":"3.0.3","info":{"title":"大马小杨记账 API","version":"1","description":"记账业务接口。正式免费版只读，商业版支持读写；Demo支持隔离的完整体验，令牌随会话失效。系统管理不开放。"},"servers":[{"url":"/api/v1","description":"当前安装的API根路径"}],"security":[{"BearerToken":[]}],"tags":[{"name":"账本"},{"name":"账户"},{"name":"分类"},{"name":"记账成员"},{"name":"流水"},{"name":"转账"},{"name":"预算"},{"name":"周期记账"},{"name":"报表"},{"name":"日历"},{"name":"附件"}],"paths":{"/ledgers":{"get":{"summary":"查询账本列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers","tags":["账本"],"parameters":[{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Ledgers"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建账本","description":"仅管理员可创建、修改、删除账本。商业版读写令牌或Demo读写令牌必需。","operationId":"post__ledgers","tags":["账本"],"parameters":[],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Ledgers"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgersCreate"}}}}}},"/ledgers/{id}":{"get":{"summary":"查询账本详情","description":"","operationId":"get__ledgers_id","tags":["账本"],"parameters":[{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Ledgers"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改账本","description":"仅管理员可创建、修改、删除账本。商业版读写令牌或Demo读写令牌必需。提交version和要修改的字段。省略或空字符串保留原值，因此不能用空字符串清空备注等字段。","operationId":"patch__ledgers_id","tags":["账本"],"parameters":[{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Ledgers"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgersUpdate"}}}}},"delete":{"summary":"删除账本","description":"仅管理员可创建、修改、删除账本。商业版读写令牌或Demo读写令牌必需。删除账本会连带删除所属资料和流水。删除分类或账户会停用关联周期任务并移除对应流水的关联；删除转账会同时删除两侧流水，附件按规则清理。","operationId":"delete__ledgers_id","tags":["账本"],"parameters":[{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/accounts":{"get":{"summary":"查询账户列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers_ledger_id_accounts","tags":["账户"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Accounts"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建账户","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。","operationId":"post__ledgers_ledger_id_accounts","tags":["账户"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Accounts"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountsCreate"}}}}}},"/ledgers/{ledger_id}/accounts/{id}":{"get":{"summary":"查询账户详情","description":"","operationId":"get__ledgers_ledger_id_accounts_id","tags":["账户"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Accounts"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改账户","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。提交version和要修改的字段。省略或空字符串保留原值，因此不能用空字符串清空备注等字段。","operationId":"patch__ledgers_ledger_id_accounts_id","tags":["账户"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Accounts"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountsUpdate"}}}}},"delete":{"summary":"删除账户","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_accounts_id","tags":["账户"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/categories":{"get":{"summary":"查询分类列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers_ledger_id_categories","tags":["分类"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Categories"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建分类","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。","operationId":"post__ledgers_ledger_id_categories","tags":["分类"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Categories"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoriesCreate"}}}}}},"/ledgers/{ledger_id}/categories/{id}":{"get":{"summary":"查询分类详情","description":"","operationId":"get__ledgers_ledger_id_categories_id","tags":["分类"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Categories"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改分类","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。提交version和要修改的字段。省略或空字符串保留原值，因此不能用空字符串清空备注等字段。","operationId":"patch__ledgers_ledger_id_categories_id","tags":["分类"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Categories"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoriesUpdate"}}}}},"delete":{"summary":"删除分类","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_categories_id","tags":["分类"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/members":{"get":{"summary":"查询记账成员列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers_ledger_id_members","tags":["记账成员"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, name；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Members"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建记账成员","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。","operationId":"post__ledgers_ledger_id_members","tags":["记账成员"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Members"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersCreate"}}}}}},"/ledgers/{ledger_id}/members/{id}":{"get":{"summary":"查询记账成员详情","description":"","operationId":"get__ledgers_ledger_id_members_id","tags":["记账成员"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Members"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改记账成员","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。提交version和要修改的字段。省略或空字符串保留原值，因此不能用空字符串清空备注等字段。","operationId":"patch__ledgers_ledger_id_members_id","tags":["记账成员"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Members"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersUpdate"}}}}},"delete":{"summary":"删除记账成员","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_members_id","tags":["记账成员"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/transactions":{"get":{"summary":"查询流水列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers_ledger_id_transactions","tags":["流水"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, date, amount；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, date, amount；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}},{"name":"kind","in":"query","required":false,"description":"收支类型。all或省略表示全部；type为兼容别名，kind优先。","schema":{"type":"string","description":"收支类型。all或省略表示全部；type为兼容别名，kind优先。","enum":["all","expense","income","transfer"],"example":"expense"}},{"name":"type","in":"query","required":false,"description":"kind的别名；建议只使用kind。","schema":{"type":"string","description":"kind的别名；建议只使用kind。","example":"expense"}},{"name":"date_from","in":"query","required":false,"description":"起始日期，包含当日。","schema":{"type":"string","description":"起始日期，包含当日。","format":"date","example":"2026-11-04"}},{"name":"date_to","in":"query","required":false,"description":"结束日期，包含当日。","schema":{"type":"string","description":"结束日期，包含当日。","format":"date","example":"2026-11-04"}},{"name":"month","in":"query","required":false,"description":"月份，YYYY-MM，与日期条件同时使用时取交集。","schema":{"type":"string","description":"月份，YYYY-MM，与日期条件同时使用时取交集。","pattern":"^[0-9]{4}-[0-9]{2}$","example":"2026-11"}},{"name":"category_id","in":"query","required":false,"description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","schema":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"account_id","in":"query","required":false,"description":"流水列表按任一侧账户筛选仍合并显示转账；转账专用列表按转出侧筛选。","schema":{"type":"string","description":"流水列表按任一侧账户筛选仍合并显示转账；转账专用列表按转出侧筛选。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"member_id","in":"query","required":false,"description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","schema":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"amount_min","in":"query","required":false,"description":"最低金额，包含，允许0。","schema":{"type":"string","description":"最低金额，包含，允许0。","example":"12.34"}},{"name":"amount_max","in":"query","required":false,"description":"最高金额，包含，允许0。","schema":{"type":"string","description":"最高金额，包含，允许0。","example":"12.34"}},{"name":"search","in":"query","required":false,"description":"备注包含查询，忽略大小写；SQL通配符%和_保留通配含义。","schema":{"type":"string","description":"备注包含查询，忽略大小写；SQL通配符%和_保留通配含义。","example":"采购"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TransactionView"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建流水","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。","operationId":"post__ledgers_ledger_id_transactions","tags":["流水"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"可选，最长128字节。相同令牌、路径、键及请求体重放返回原201结果；内容不同返回409。网络重试需复用相同请求体字节和键。","schema":{"type":"string","description":"可选，最长128字节。相同令牌、路径、键及请求体重放返回原201结果；内容不同返回409。网络重试需复用相同请求体字节和键。","maxLength":128,"example":"expense-example-001"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transactions"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsCreate"}}}}}},"/ledgers/{ledger_id}/transactions/{id}":{"get":{"summary":"查询流水详情","description":"流水详情和写入响应使用kind；流水列表使用type，字段结构不同。","operationId":"get__ledgers_ledger_id_transactions_id","tags":["流水"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transactions"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改流水","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。提交完整业务字段和version。省略的可选字段会恢复默认值；attachment_ids只追加关联。","operationId":"patch__ledgers_ledger_id_transactions_id","tags":["流水"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transactions"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsUpdate"}}}}},"delete":{"summary":"删除流水","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_transactions_id","tags":["流水"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/transfers":{"get":{"summary":"查询转账列表","description":"仅返回当前用户可访问的数据。转账固定按日期、流水ID倒序，sort参数不生效。","operationId":"get__ledgers_ledger_id_transfers","tags":["转账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"kind","in":"query","required":false,"description":"收支类型。all或省略表示全部；type为兼容别名，kind优先。","schema":{"type":"string","description":"收支类型。all或省略表示全部；type为兼容别名，kind优先。","enum":["all","expense","income","transfer"],"example":"expense"}},{"name":"type","in":"query","required":false,"description":"kind的别名；建议只使用kind。","schema":{"type":"string","description":"kind的别名；建议只使用kind。","example":"expense"}},{"name":"date_from","in":"query","required":false,"description":"起始日期，包含当日。","schema":{"type":"string","description":"起始日期，包含当日。","format":"date","example":"2026-11-04"}},{"name":"date_to","in":"query","required":false,"description":"结束日期，包含当日。","schema":{"type":"string","description":"结束日期，包含当日。","format":"date","example":"2026-11-04"}},{"name":"month","in":"query","required":false,"description":"月份，YYYY-MM，与日期条件同时使用时取交集。","schema":{"type":"string","description":"月份，YYYY-MM，与日期条件同时使用时取交集。","pattern":"^[0-9]{4}-[0-9]{2}$","example":"2026-11"}},{"name":"category_id","in":"query","required":false,"description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","schema":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"account_id","in":"query","required":false,"description":"流水列表按任一侧账户筛选仍合并显示转账；转账专用列表按转出侧筛选。","schema":{"type":"string","description":"流水列表按任一侧账户筛选仍合并显示转账；转账专用列表按转出侧筛选。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"member_id","in":"query","required":false,"description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","schema":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"amount_min","in":"query","required":false,"description":"最低金额，包含，允许0。","schema":{"type":"string","description":"最低金额，包含，允许0。","example":"12.34"}},{"name":"amount_max","in":"query","required":false,"description":"最高金额，包含，允许0。","schema":{"type":"string","description":"最高金额，包含，允许0。","example":"12.34"}},{"name":"search","in":"query","required":false,"description":"备注包含查询，忽略大小写；SQL通配符%和_保留通配含义。","schema":{"type":"string","description":"备注包含查询，忽略大小写；SQL通配符%和_保留通配含义。","example":"采购"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TransferView"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建转账","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。转账只支持创建和删除；修改请删除后重新创建。","operationId":"post__ledgers_ledger_id_transfers","tags":["转账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"可选，最长128字节。相同令牌、路径、键及请求体重放返回原201结果；内容不同返回409。网络重试需复用相同请求体字节和键。","schema":{"type":"string","description":"可选，最长128字节。相同令牌、路径、键及请求体重放返回原201结果；内容不同返回409。网络重试需复用相同请求体字节和键。","maxLength":128,"example":"expense-example-001"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TransferCreated"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransfersCreate"}}}}}},"/ledgers/{ledger_id}/transfers/{id}":{"get":{"summary":"查询转账详情","description":"","operationId":"get__ledgers_ledger_id_transfers_id","tags":["转账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TransferView"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"delete":{"summary":"删除转账","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。转账只支持创建和删除；修改请删除后重新创建。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_transfers_id","tags":["转账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/budgets":{"get":{"summary":"查询预算列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers_ledger_id_budgets","tags":["预算"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, amount, year, month；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, amount, year, month；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Budgets"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建预算","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。分类、年、月共同唯一；更新时这三个字段必须与原预算一致。POST新预算不传version；若更新已存在预算须传当前version。","operationId":"post__ledgers_ledger_id_budgets","tags":["预算"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Budgets"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetsCreate"}}}}}},"/ledgers/{ledger_id}/budgets/{id}":{"get":{"summary":"查询预算详情","description":"","operationId":"get__ledgers_ledger_id_budgets_id","tags":["预算"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Budgets"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改预算","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。分类、年、月共同唯一；更新时这三个字段必须与原预算一致。POST新预算不传version；若更新已存在预算须传当前version。提交完整业务字段和version。省略的可选字段会恢复默认值；attachment_ids只追加关联。","operationId":"patch__ledgers_ledger_id_budgets_id","tags":["预算"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Budgets"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetsUpdate"}}}}},"delete":{"summary":"删除预算","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。分类、年、月共同唯一；更新时这三个字段必须与原预算一致。POST新预算不传version；若更新已存在预算须传当前version。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_budgets_id","tags":["预算"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/recurring":{"get":{"summary":"查询周期记账列表","description":"仅返回当前用户可访问的数据。","operationId":"get__ledgers_ledger_id_recurring","tags":["周期记账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"page","in":"query","required":false,"description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","schema":{"type":"integer","description":"页码，默认1。流水列表超过末页时返回末页，其他列表超界返回空数组。","default":1,"minimum":1,"example":1}},{"name":"page_size","in":"query","required":false,"description":"每页数量，默认20，限制为1–100。","schema":{"type":"integer","description":"每页数量，默认20，限制为1–100。","default":20,"minimum":1,"maximum":100,"example":20}},{"name":"sort","in":"query","required":false,"description":"排序字段：id, created_at, amount, next_date；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","schema":{"type":"string","description":"排序字段：id, created_at, amount, next_date；加前缀-表示倒序。默认流水为日期倒序，其他为ID倒序。","example":"-id"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Recurring"},"description":""},"page":{"type":"integer","description":"实际页码。","example":1},"page_size":{"type":"integer","description":"实际每页数量。","example":20},"total":{"type":"integer","description":"符合条件的总条数；转账合并计一条。","example":1}},"required":["data","page","page_size","total"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"创建周期记账","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。仅支持收入和支出；不支持转账。GET不会生成到期流水，网页访问周期记账及程序维护任务负责生成。","operationId":"post__ledgers_ledger_id_recurring","tags":["周期记账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Recurring"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringCreate"}}}}}},"/ledgers/{ledger_id}/recurring/{id}":{"get":{"summary":"查询周期记账详情","description":"","operationId":"get__ledgers_ledger_id_recurring_id","tags":["周期记账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Recurring"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"patch":{"summary":"修改周期记账","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。仅支持收入和支出；不支持转账。GET不会生成到期流水，网页访问周期记账及程序维护任务负责生成。提交完整业务字段和version。省略的可选字段会恢复默认值；attachment_ids只追加关联。","operationId":"patch__ledgers_ledger_id_recurring_id","tags":["周期记账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Recurring"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringUpdate"}}}}},"delete":{"summary":"删除周期记账","description":"需要读写令牌、可用的商业授权（Demo豁免）及当前账本editor以上权限。仅支持收入和支出；不支持转账。GET不会生成到期流水，网页访问周期记账及程序维护任务负责生成。请求体必须携带version。关联附件和内部转账两侧流水由服务统一处理。","operationId":"delete__ledgers_ledger_id_recurring_id","tags":["周期记账"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}},"/ledgers/{ledger_id}/reports":{"get":{"summary":"查询报表","description":"不分页；不计转账。months为所选年份的月度汇总；days按所选月份的日序号汇总，month=0时为空数组；分类/账户/成员为所选月或全年汇总。其他流水筛选参数不作用于报表。","operationId":"get__ledgers_ledger_id_reports","tags":["报表"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"year","in":"query","required":false,"description":"年份，默认服务器时区当前年份。","schema":{"type":"integer","description":"年份，默认服务器时区当前年份。","minimum":1,"maximum":9999,"example":2026}},{"name":"month","in":"query","required":false,"description":"月份，默认当前月份；0表示全年。与流水筛选month的YYYY-MM格式不同。","schema":{"type":"integer","description":"月份，默认当前月份；0表示全年。与流水筛选month的YYYY-MM格式不同。","minimum":0,"maximum":12,"example":11}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Report"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}}},"/ledgers/{ledger_id}/calendar":{"get":{"summary":"查询日历汇总","description":"不分页；按日期升序，仅返回有非转账收支的日期。不存在的日期不会补零；不应用报表year/month参数。","operationId":"get__ledgers_ledger_id_calendar","tags":["日历"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"start","in":"query","required":false,"description":"起始日，包含；省略表示不限制。","schema":{"type":"string","description":"起始日，包含；省略表示不限制。","format":"date","example":"2026-11-04"}},{"name":"end","in":"query","required":false,"description":"结束日，不包含；省略表示不限制。","schema":{"type":"string","description":"结束日，不包含；省略表示不限制。","format":"date","example":"2026-11-04"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CalendarDay"},"description":""}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}}},"/ledgers/{ledger_id}/attachments":{"post":{"summary":"上传一个附件","description":"需商业版读写令牌或Demo读写令牌及账本编辑权限。每个请求只传一个file，可多次上传，附件数量不限。单文件1–10485760字节，整个multipart请求最多11MiB。上传后尚未关联流水，临时附件两小时后清理。支持照片、PDF、Office、OpenDocument、RTF、TXT、CSV；拒绝空文件、可执行文件、HTML、SVG及与扩展名不符的内容。","operationId":"post__ledgers_ledger_id_attachments","tags":["附件"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"201":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttachmentUpload"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"实际文件内容，不是服务器文件路径。","format":"binary"}},"required":["file"]}}}}}},"/attachments/{id}":{"get":{"summary":"查询附件元信息","description":"临时附件仅上传者可见；已关联附件遵守账本可读权限。","operationId":"get__attachments_id","tags":["附件"],"parameters":[{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Attachment"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"delete":{"summary":"删除附件","description":"需要读写令牌及对应权限。临时附件仅上传者可删；不要求version。转账共享附件，删除同时影响两侧。","operationId":"delete__attachments_id","tags":["附件"],"parameters":[{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Deleted"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}}},"/attachments/{id}/download":{"get":{"summary":"下载附件","description":"返回文件原始字节，Content-Disposition为attachment，Content-Type为application/octet-stream；不是JSON。需Bearer认证，支持正式免费版。","operationId":"get__attachments_id_download","tags":["附件"],"parameters":[{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"文件内容","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"attachment; filename=..."}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}}},"/ledgers/{ledger_id}/transactions/{id}/attachments":{"get":{"summary":"查询流水附件","description":"id为流水ID，不是转账ID。转账使用其任一侧流水ID，读取共享附件。","operationId":"get__ledgers_ledger_id_transactions_id_attachments","tags":["附件"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentLink"},"description":""}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}}},"post":{"summary":"向已有流水追加附件","description":"需读写令牌及账本编辑权限。只追加，不移除旧附件，不要求version。转账使用任一侧流水ID共享关联；附件必须属于当前用户和账本。","operationId":"post__ledgers_ledger_id_transactions_id_attachments","tags":["附件"],"parameters":[{"name":"ledger_id","in":"path","required":true,"description":"账本ID。","schema":{"type":"string","description":"账本ID。","pattern":"^[1-9][0-9]*$","example":"1"}},{"name":"id","in":"path","required":true,"description":"此资源的ID。","schema":{"type":"string","description":"此资源的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Attached"}},"required":["data"]}}}},"400":{"description":"字段、关联关系、金额、日期、枚举或文件格式不合法。检查请求字段；未知JSON字段同样被拒绝。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request"}}}}},"401":{"description":"缺少Bearer令牌、令牌无效/已撤销/已到期，或登录用户不可用。Demo重置和退出后也是此错误。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized"}}}}},"403":{"description":"角色或账本权限不足。commercial_required表示正式安装需要商业授权；token_read_only表示令牌仅可查询。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden"}}}}},"404":{"description":"路径、资源不存在或不可见；系统管理接口不开放。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found"}}}}},"409":{"description":"version缺失/过期、预算键冲突，或同一幂等键提交不同请求内容。重新查询并确认后再提交。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"version_conflict"}}}}},"413":{"description":"附件最大10MiB（10485760字节）；request_too_large表示JSON请求超过1MiB。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"attachment_too_large"}}}}},"429":{"description":"达到操作配额，或Demo当前访客累计请求超过2000次。等待额度恢复或重置Demo，不要无限重试。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited"}}}}},"500":{"description":"服务器异常。记录时间、路径及已脱敏的请求内容联系维护人员。","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentAssociation"}}}}}}},"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","description":"在“设置 → API令牌”创建。仅展示一次，切勿放入URL或公开网页。"}},"schemas":{"Version":{"type":"object","properties":{"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["version"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"稳定的机器可读错误码。","example":"invalid_request"}},"required":["code"]}},"required":["error"]},"Deleted":{"type":"object","properties":{"deleted":{"type":"boolean","description":"删除成功时为true。","example":true}},"required":["deleted"]},"Attached":{"type":"object","properties":{"attached":{"type":"boolean","description":"关联成功时为true。","example":true}},"required":["attached"]},"LedgersCreate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"currency":{"type":"string","description":"受支持的货币代码，例如CNY、USD；不进行自动汇率转换。","example":"CNY"},"template_id":{"type":"string","description":"可选场景模板。none表示不使用模板；与省略或空字符串一样，仅创建空白账本，不添加分类、账户或记账成员；模板只创建分类、账户及本人记账成员，不创建流水、预算、周期记账或登录用户。名称和货币仍使用请求值；未知值返回400。已有账本更新不接受非空template_id。","enum":["","none","family","personal","office","group","shop","project","travel"],"default":"","example":"office"}},"required":["name","currency"]},"LedgersUpdate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"currency":{"type":"string","description":"受支持的货币代码，例如CNY、USD；不进行自动汇率转换。","example":"CNY"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["version"]},"Ledgers":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"currency":{"type":"string","description":"受支持的货币代码，例如CNY、USD；不进行自动汇率转换。","example":"CNY"},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"user_id":{"type":"string","description":"账本所有者登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"AccountsCreate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"icon":{"type":"string","description":"图标名称，可省略，最多50字节。","maxLength":50,"example":"bank"}},"required":["name","kind"]},"AccountsUpdate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"icon":{"type":"string","description":"图标名称，可省略，最多50字节。","maxLength":50,"example":"bank"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["version"]},"Accounts":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"icon":{"type":"string","description":"图标名称，可省略，最多50字节。","maxLength":50,"example":"bank"},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"CategoriesCreate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"icon":{"type":"string","description":"图标名称，可省略，最多50字节。","maxLength":50,"example":"shopping-cart"}},"required":["name","kind"]},"CategoriesUpdate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"icon":{"type":"string","description":"图标名称，可省略，最多50字节。","maxLength":50,"example":"shopping-cart"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["version"]},"Categories":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"icon":{"type":"string","description":"图标名称，可省略，最多50字节。","maxLength":50,"example":"shopping-cart"},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"MembersCreate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"relation":{"type":"string","description":"关系标记，默认other，最多32字节；仅为记账信息，不分配登录权限。","default":"other","maxLength":32,"example":"other"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"}},"required":["name"]},"MembersUpdate":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"relation":{"type":"string","description":"关系标记，默认other，最多32字节；仅为记账信息，不分配登录权限。","default":"other","maxLength":32,"example":"other"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["version"]},"Members":{"type":"object","properties":{"name":{"type":"string","description":"名称，去除首尾空白后1–50个字符。","minLength":1,"maxLength":50,"example":"团队日常"},"relation":{"type":"string","description":"关系标记，默认other，最多32字节；仅为记账信息，不分配登录权限。","default":"other","maxLength":32,"example":"other"},"color":{"type":"string","description":"十六进制颜色，默认#3c8dbc。","pattern":"^#[0-9a-fA-F]{6}$","default":"#3c8dbc","example":"#3c8dbc"},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"TransactionsCreate":{"type":"object","properties":{"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"category_id":{"type":"string","description":"同账本、与kind相同收支类型的分类ID。","pattern":"^[1-9][0-9]*$","example":"1"},"account_id":{"type":"string","description":"同账本、与kind相同收支类型的账户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"attachment_ids":{"type":"array","items":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"description":"已上传、属于当前用户和当前账本的临时附件ID。追加关联，不会删除未列出的旧附件。"}},"required":["kind","amount","date","category_id","account_id"]},"TransactionsUpdate":{"type":"object","properties":{"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"category_id":{"type":"string","description":"同账本、与kind相同收支类型的分类ID。","pattern":"^[1-9][0-9]*$","example":"1"},"account_id":{"type":"string","description":"同账本、与kind相同收支类型的账户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"attachment_ids":{"type":"array","items":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"description":"已上传、属于当前用户和当前账本的临时附件ID。追加关联，不会删除未列出的旧附件。"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["kind","amount","date","category_id","account_id","version"]},"Transactions":{"type":"object","properties":{"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"category_id":{"type":"string","description":"关联ID，未关联或关联资料已删除时为null。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"account_id":{"type":"string","description":"关联ID，未关联或关联资料已删除时为null。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"member_id":{"type":"string","description":"关联ID，未关联或关联资料已删除时为null。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"transfer_id":{"type":"string","description":"转账ID；普通收支为null。转账明细是其中一侧流水，kind为income或expense。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentLink"},"description":"详情GET返回关联附件；写入响应不带此字段。"}}},"TransfersCreate":{"type":"object","properties":{"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"from_account_id":{"type":"string","description":"转出账户ID；与转入账户不同，且同属当前账本。","pattern":"^[1-9][0-9]*$","example":"1"},"to_account_id":{"type":"string","description":"转入账户ID；账户收支类型不限制转账方向。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"attachment_ids":{"type":"array","items":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"description":"已上传、属于当前用户和当前账本的临时附件ID。追加关联，不会删除未列出的旧附件。"}},"required":["amount","date","from_account_id","to_account_id"]},"TransfersUpdate":{"type":"object","properties":{"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"from_account_id":{"type":"string","description":"转出账户ID；与转入账户不同，且同属当前账本。","pattern":"^[1-9][0-9]*$","example":"1"},"to_account_id":{"type":"string","description":"转入账户ID；账户收支类型不限制转账方向。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"attachment_ids":{"type":"array","items":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"description":"已上传、属于当前用户和当前账本的临时附件ID。追加关联，不会删除未列出的旧附件。"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["version"]},"Transfers":{"type":"object","properties":{"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"from_account_id":{"type":"string","description":"转出账户ID；与转入账户不同，且同属当前账本。","pattern":"^[1-9][0-9]*$","example":"1"},"to_account_id":{"type":"string","description":"转入账户ID；账户收支类型不限制转账方向。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"BudgetsCreate":{"type":"object","properties":{"category_id":{"type":"string","description":"当前账本的支出分类ID。同分类、年、月只有一项预算。","pattern":"^[1-9][0-9]*$","example":"1"},"year":{"type":"integer","description":"预算年份，1–9999。","minimum":1,"maximum":9999,"example":2026},"month":{"type":"integer","description":"预算月份，1–12。","minimum":1,"maximum":12,"example":11},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"}},"required":["category_id","year","month","amount"]},"BudgetsUpdate":{"type":"object","properties":{"category_id":{"type":"string","description":"当前账本的支出分类ID。同分类、年、月只有一项预算。","pattern":"^[1-9][0-9]*$","example":"1"},"year":{"type":"integer","description":"预算年份，1–9999。","minimum":1,"maximum":9999,"example":2026},"month":{"type":"integer","description":"预算月份，1–12。","minimum":1,"maximum":12,"example":11},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["category_id","year","month","amount","version"]},"Budgets":{"type":"object","properties":{"category_id":{"type":"string","description":"当前账本的支出分类ID。同分类、年、月只有一项预算。","pattern":"^[1-9][0-9]*$","example":"1"},"year":{"type":"integer","description":"预算年份，1–9999。","minimum":1,"maximum":9999,"example":2026},"month":{"type":"integer","description":"预算月份，1–12。","minimum":1,"maximum":12,"example":11},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"RecurringCreate":{"type":"object","properties":{"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"category_id":{"type":"string","description":"同账本、与kind相同收支类型的分类ID。","pattern":"^[1-9][0-9]*$","example":"1"},"account_id":{"type":"string","description":"同账本、与kind相同收支类型的账户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"frequency":{"type":"string","description":"重复单位：日、周、月、年。月/年遇到不存在的日期取当月最后一天。","enum":["daily","weekly","monthly","yearly"],"example":"monthly"},"interval":{"type":"integer","description":"间隔单位数量，1–365；例如frequency=weekly、interval=2为每两周。","minimum":1,"maximum":365,"example":1},"next_date":{"type":"string","description":"下次到期日。查询API不会触发生成流水。","format":"date","example":"2026-11-04"},"end_date":{"type":"string","description":"结束日期，YYYY-MM-DD；省略或空字符串表示不设结束日，非空时不得早于next_date。","example":""},"active":{"type":"boolean","description":"是否启用，创建时默认true。更新时省略同样按true处理。","default":true,"example":true}},"required":["kind","amount","category_id","account_id","frequency","interval","next_date"]},"RecurringUpdate":{"type":"object","properties":{"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"category_id":{"type":"string","description":"同账本、与kind相同收支类型的分类ID。","pattern":"^[1-9][0-9]*$","example":"1"},"account_id":{"type":"string","description":"同账本、与kind相同收支类型的账户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"member_id":{"type":"string","description":"记账成员ID。账本有记账成员时必填；没有成员时可省略或传空字符串。不是登录用户ID。","pattern":"^[1-9][0-9]*$","example":"1"},"frequency":{"type":"string","description":"重复单位：日、周、月、年。月/年遇到不存在的日期取当月最后一天。","enum":["daily","weekly","monthly","yearly"],"example":"monthly"},"interval":{"type":"integer","description":"间隔单位数量，1–365；例如frequency=weekly、interval=2为每两周。","minimum":1,"maximum":365,"example":1},"next_date":{"type":"string","description":"下次到期日。查询API不会触发生成流水。","format":"date","example":"2026-11-04"},"end_date":{"type":"string","description":"结束日期，YYYY-MM-DD；省略或空字符串表示不设结束日，非空时不得早于next_date。","example":""},"active":{"type":"boolean","description":"是否启用，创建时默认true。更新时省略同样按true处理。","default":true,"example":true},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["kind","amount","category_id","account_id","frequency","interval","next_date","version"]},"Recurring":{"type":"object","properties":{"kind":{"type":"string","description":"收支类型；分类和账户创建后不可改变此值。","enum":["expense","income"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"category_id":{"type":"string","description":"关联ID，未关联或关联资料已删除时为null。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"account_id":{"type":"string","description":"关联ID，未关联或关联资料已删除时为null。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"member_id":{"type":"string","description":"关联ID，未关联或关联资料已删除时为null。","pattern":"^[1-9][0-9]*$","example":"1","nullable":true},"frequency":{"type":"string","description":"重复单位：日、周、月、年。月/年遇到不存在的日期取当月最后一天。","enum":["daily","weekly","monthly","yearly"],"example":"monthly"},"interval":{"type":"integer","description":"间隔单位数量，1–365；例如frequency=weekly、interval=2为每两周。","minimum":1,"maximum":365,"example":1},"next_date":{"type":"string","description":"下次到期日。查询API不会触发生成流水。","format":"date","example":"2026-11-04"},"end_date":{"type":"string","description":"结束日期，YYYY-MM-DD；省略或空字符串表示不设结束日，非空时不得早于next_date。","example":""},"active":{"type":"boolean","description":"是否启用，创建时默认true。更新时省略同样按true处理。","default":true,"example":true},"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"created_by":{"type":"string","description":"创建人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"updated_by":{"type":"string","description":"最后修改人登录用户ID；系统初始化记录可能为字符串0。","pattern":"^[0-9]+$","example":"1"},"created_at":{"type":"string","description":"服务器创建时间；未设置时可能为空值或零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"updated_at":{"type":"string","description":"服务器修改时间；未设置时可能为零时间。","nullable":true,"example":"2026-11-04T10:00:00Z"},"ledger_id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"}}},"Attachment":{"type":"object","properties":{"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"name":{"type":"string","description":"文件名。","example":"receipt.pdf"},"size":{"type":"integer","description":"文件字节数，最大10485760。","example":1234},"transaction_id":{"type":"string","description":"已关联的流水ID；尚未关联时为空字符串。","example":"1"}}},"AttachmentUpload":{"type":"object","properties":{"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"name":{"type":"string","description":"文件名。","example":"receipt.pdf"},"size":{"type":"integer","description":"文件字节数，最大10485760。","example":1234}}},"AttachmentLink":{"type":"object","properties":{"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"name":{"type":"string","description":"文件名。","example":"receipt.pdf"},"size":{"type":"integer","description":"文件字节数，最大10485760。","example":1234},"download_url":{"type":"string","description":"同源API下载路径，下载时仍须Bearer认证。","example":"/api/v1/attachments/1/download"}}},"TransactionView":{"type":"object","properties":{"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"type":{"type":"string","description":"列表使用type而不是kind；转账被合并成一行。","enum":["expense","income","transfer"],"example":"expense"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"is_transfer":{"type":"boolean","description":"是否为合并转账。","example":false},"category_id":{"type":"string","description":"列表关联ID。未关联时可能为空字符串或null；转账的分类ID为空。","pattern":"^(|[1-9][0-9]*)$","example":"1","nullable":true},"account_id":{"type":"string","description":"列表关联ID。未关联时可能为空字符串或null；转账的分类ID为空。","pattern":"^(|[1-9][0-9]*)$","example":"1","nullable":true},"member_id":{"type":"string","description":"列表关联ID。未关联时可能为空字符串或null；转账的分类ID为空。","pattern":"^(|[1-9][0-9]*)$","example":"1","nullable":true},"category_name":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"category_color":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"category_icon":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"account_name":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"member_name":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"transfer_id":{"type":"string","description":"仅转账行出现。转账接口中的id为transfer_id；流水列表中的id为其中一侧流水ID。","pattern":"^[1-9][0-9]*$","example":"1"},"from_account_id":{"type":"string","description":"仅转账行出现。转账接口中的id为transfer_id；流水列表中的id为其中一侧流水ID。","pattern":"^[1-9][0-9]*$","example":"1"},"to_account_id":{"type":"string","description":"仅转账行出现。转账接口中的id为transfer_id；流水列表中的id为其中一侧流水ID。","pattern":"^[1-9][0-9]*$","example":"1"},"from_account_name":{"type":"string","description":"转账两侧账户名称，仅转账行出现。","example":"备用金"},"to_account_name":{"type":"string","description":"转账两侧账户名称，仅转账行出现。","example":"备用金"},"_merged":{"type":"boolean","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_from_account_id":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_to_account_id":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_from_account_name":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_to_account_name":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"}}},"TransferView":{"type":"object","properties":{"id":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1},"type":{"type":"string","description":"列表使用type而不是kind；转账被合并成一行。","enum":["transfer"],"example":"transfer"},"amount":{"type":"string","description":"十进制金额，最多两位小数，不含货币符号、千分位或负号；写入须大于0，最大999999999.00。货币由账本决定。","example":"12.34"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"},"description":{"type":"string","description":"备注，最多500个字符，省略默认为空。","maxLength":500,"default":"","example":"团队采购"},"is_transfer":{"type":"boolean","description":"是否为合并转账。","example":true},"category_id":{"type":"string","description":"列表关联ID。未关联时可能为空字符串或null；转账的分类ID为空。","pattern":"^(|[1-9][0-9]*)$","example":"1","nullable":true},"account_id":{"type":"string","description":"列表关联ID。未关联时可能为空字符串或null；转账的分类ID为空。","pattern":"^(|[1-9][0-9]*)$","example":"1","nullable":true},"member_id":{"type":"string","description":"列表关联ID。未关联时可能为空字符串或null；转账的分类ID为空。","pattern":"^(|[1-9][0-9]*)$","example":"1","nullable":true},"category_name":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"category_color":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"category_icon":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"account_name":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"member_name":{"type":"string","description":"用于展示的关联名称、颜色或图标；未关联时为空或未分类标记。","example":""},"transfer_id":{"type":"string","description":"仅转账行出现。转账接口中的id为transfer_id；流水列表中的id为其中一侧流水ID。","pattern":"^[1-9][0-9]*$","example":"1"},"from_account_id":{"type":"string","description":"仅转账行出现。转账接口中的id为transfer_id；流水列表中的id为其中一侧流水ID。","pattern":"^[1-9][0-9]*$","example":"1"},"to_account_id":{"type":"string","description":"仅转账行出现。转账接口中的id为transfer_id；流水列表中的id为其中一侧流水ID。","pattern":"^[1-9][0-9]*$","example":"1"},"from_account_name":{"type":"string","description":"转账两侧账户名称，仅转账行出现。","example":"备用金"},"to_account_name":{"type":"string","description":"转账两侧账户名称，仅转账行出现。","example":"备用金"},"_merged":{"type":"boolean","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_from_account_id":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_to_account_id":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_from_account_name":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"},"_to_account_name":{"type":"string","description":"内部展示辅助字段，客户端应忽略，使用无下划线的对应字段。"}}},"TransferCreated":{"type":"object","properties":{"id":{"type":"string","description":"转账ID，不是流水ID；后续使用/transfers/{id}。","pattern":"^[1-9][0-9]*$","example":"1"},"version":{"type":"integer","description":"当前记录版本号。修改、删除必须使用最近一次查询返回的值，成功修改后递增。","minimum":1,"example":1}},"required":["id","version"]},"Breakdown":{"type":"object","properties":{"income":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"expense":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"balance":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"name":{"type":"string","description":"月份/日序号或对应维度的展示名称。","example":"11"}}},"Report":{"type":"object","properties":{"income":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"expense":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"balance":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"savings_rate":{"type":"string","description":"结余率百分数，不含百分号；收入为0时为0.0。","example":"25.0"},"months":{"type":"array","items":{"$ref":"#/components/schemas/Breakdown"},"description":"按此维度汇总，不计转账；时间范围由year和month指定。"},"days":{"type":"array","items":{"$ref":"#/components/schemas/Breakdown"},"description":"按此维度汇总，不计转账；时间范围由year和month指定。"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Breakdown"},"description":"按此维度汇总，不计转账；时间范围由year和month指定。"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Breakdown"},"description":"按此维度汇总，不计转账；时间范围由year和month指定。"},"members":{"type":"array","items":{"$ref":"#/components/schemas/Breakdown"},"description":"按此维度汇总，不计转账；时间范围由year和month指定。"}}},"CalendarDay":{"type":"object","properties":{"income":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"expense":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"balance":{"type":"string","description":"按账本货币表示的金额，固定两位小数；balance为income减expense，可以为负。","example":"0.00"},"date":{"type":"string","description":"有效日历日期，YYYY-MM-DD。","format":"date","example":"2026-11-04"}}},"AttachmentAssociation":{"type":"object","properties":{"attachment_ids":{"type":"array","items":{"type":"string","description":"正整数ID；始终按字符串处理，不能使用其他账本的ID。","pattern":"^[1-9][0-9]*$","example":"1"},"description":"已上传、属于当前用户和当前账本的临时附件ID。追加关联，不会删除未列出的旧附件。"}},"required":["attachment_ids"]}}}}
